This example shows how to use experiment data to estimate model parameters. You estimate the parameters of an engine throttle system.
The Simulink® model for the engine throttle system,
spe_engine_throttle, is shown below.
The throttle controls the air mass flow into the intake manifold of an engine. The throttle body contains a butterfly valve that opens when the driver presses down on the accelerator pedal. This lets more air enter the cylinders and causes the engine to produce more torque.
A DC motor controls the opening angle of the butterfly valve. There is also a spring attached to the valve to return it to its closed position when the DC motor is de-energized. The amount of rotation of the valve is limited to approximately 90 degrees. Therefore, if a large command input is applied to the motor, the valve hits the hard stops preventing it from rotating further.
The motor is modeled as a torque gain and a time-delay input with parameters Kt and input_delay. The butterfly valve is modeled as a mass-spring-damper system with parameters J, c and k. This system is augmented with hard stops to limit the valve opening to 90 degrees. We know the model components, however, the parameter values of the system are not known accurately.
Parameter Estimation GUI with preloaded data block in the model to open a pre-configured estimation GUI session.
The saved estimation project defines three experiments; the
EstimationData experiment will be used for parameter estimation, while
ValidationData2 are used for validating the estimated parameters. The
EstimateData experiment is plotted.
The signal data for the experiments can be imported from various sources including MATLAB® variables, MAT files, Excel® files, or comma-separated-value files.See Importing and Preprocessing Experiment Data (GUI) for more information.
The experiment plot is also used to see how well the measured data matches the current model. Click Plot Model Response to display simulated signal data on the experiment plots.
The simulation results show that the model does not match the measured data and that model parameters need to be estimated.
The next step is to define the parameter to estimate. Click Select Parameters to open a dialog to select model parameters to estimate. In this example we have preselected the four unknown parameters; the butterfly valve inertia,
J; the damping coefficient,
c; the return spring constant,
k; and the time lag in motor response,
Since we know from physical insight that all of these parameters have positive values, we set their lower limits to zero. We also put an upper bound of 0.1 sec on the
input_delay parameter. We can also select an initial value for the parameters. These may come from some quick calculations of some formulas that determine the parameters.
Click the right arrow toggle button to modify the parameter minimum and maximum bounds.
With the parameters for estimation selected we select experiments to use for estimation. Click Select Experiments and select
EstimationData for estimation.
We are now almost ready to start our estimation but first create plots to monitor the estimation progress. Click Add Plot and select Parameter Trajectory. This creates a plot that shows how the estimated parameter values change during estimation. Click the View tab to layout the plots so that the
Experiment plot:EstimationData and
EstimatedParams are both visible.
Click the Estimate button to start the estimation. You can modify estimation options by setting the Cost Function combobox and clicking More Options....
While the estimation is running the plots update and a dialog showing estimation progress appears. The progress dialog shows the estimation iterations, the number of times the model has been evaluated (F-count), and the estimation cost at each iteration.
After a number of iterations the estimation converges and terminates. The model is updated with the estimated parameters and the estimation results are saved in the data browser. Right click
EstimatedParams and select Open... to see details of the estimation result.
It is important to validate the estimation results against other experiments. A successful estimation will not only match the experimental data that was used for estimation but also other independent measured data that were collected in experiments.
Click the Validation tab and click Select Experiments to select experiments for validation. Select both
ValidationData2 for validation.
Click Select Results to select the estimation result(s) to use for validation. Select
EstimatedParams and deselect
Use current parameter values.
Click Validate to validate the estimation result against the validation experiments. Validation simulates the model using the estimated parameters and selected experiments and creates plots showing the measured and simulation data. Use the View tab to layout the plots so that the
Experiment plot:ValidationData1 and
Experiment plot:ValidationData2 are both visible.
The validation plots confirm that our estimation was successful, showing that the estimated parameters are robust enough to handle a variety of inputs.
To learn how to estimate model parameters using the
sdo.optimize command, see Estimate Model Parameter Values (Code).
Close the model.