Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Design Optimization   

Estimating and Validating Parameters in the GUI

Performing Estimation

Before you begin estimating the parameters, you must have configured the estimation data and parameters, and specified estimation and simulation options, as described in Configuring Parameter Estimation in the GUI.

To start the estimation, select the New Estimation node in the Control and Estimation Tools Manager and select the Estimation tab.

Click Start to begin the estimation process. At the end of the iterations, the window should resemble the following:

Usually, a lower cost function value indicates a successful estimation, meaning that the experimental data matches the model simulation with the estimated parameters.

The Estimation pane displays each iteration of the optimization methods. To see the final values for the parameters, click the Parameters tab.

The values of these parameters are also updated in the MATLAB workspace. If you specify the variable name in the Initial Guess column, you can restart the estimation from where you left off at the end of a previous estimation.

After the estimation process completes, the cost function minimization plot appears as shown in the following figure.

If the optimization went well, you should see your cost function converge on a minimum value. The lower the cost, the more successful is the estimation.

You can also examine the measured versus simulated data plot to see how closely the simulated data matches the measured estimation data. The next figure shows the measured versus simulated data plot generated by running the estimation of the engine_idle_speed model.

Basic Steps for Model Validation

After you complete estimating the parameters, as described in Performing Estimation, you must validate the results against another set of data.

These are the basic steps to validate a model using the Control and Estimation Tools Manager:

  1. Import the validation data set to the Transient Data node.

  2. Add a new validation task in the Validation node in the workspace directory tree.

  3. Configure the validation settings by selecting the plot types and the validation data set from the Validation Setup pane.

  4. Click Show Plots in the Validation Setup pane and view the results in the plot window.

  5. Compare the validation plots to the corresponding view plots to see if they match.

The basic difference between the validation and views features is that you can run validation after the estimation is complete. All views should be set up before an estimation, and you can watch the views update in real time. Validations can use other validation data sets for comparison with the model response. Also, validations appear after you have completed an estimation and do not update.

You can validate your data by comparing measured vs. simulated data for your estimation data and validation data sets. Also, it is often useful to compare residuals in the same way.

Loading and Importing the Validation Data

To validate the estimated parameters computed in Performing Estimation, you must first import the data into the Control and Estimation Tools Manager GUI.

To load the validation data, type

load iodataval

at the MATLAB prompt. This loads the data into the MATLAB workspace. The next step is to import this data into the Control and Estimation Tools Manager. See Importing Data into the GUI for information on importing data, but the quickest way is to follow these steps:

  1. Right-click the Transient Data node in the workspace directory tree in the Control and Estimation Tools Manager and select New.

  2. Select New Data (2) from the Transient Data pane.

  3. Right-click the New Data (2) node in the workspace directory tree and select Rename. Change the name of the data to Validation Data.

  4. In the Input Data pane, select the Data cell associated with Channel - 1 and click Import. In the Data Import dialog box, select iodataval and assign column 1 to the selected channel by entering 1 in the Assign columns field. Click Import to import the input data.

  5. Select the Time/Ts cell and import time using the Data Import dialog box.

  6. Similarly, in the Output Data pane, select Time/Ts and import time.

  7. In the Output Data pane, select the Data cell associated with Channel - 1 and click Import. Import the second column of data in iodataval by selecting it from the list in the Import Data dialog box and entering 2 in the Assign columns field. Click Import to import the output data.

    The Control and Estimation Tools Manager should resemble the next figure.

Performing Validation

After you import the validation data, as described in Loading and Importing the Validation Data, right-click the Validation node and select New. This creates a New Validation node in the Control and Estimation Tools Manager.

To perform the validation:

  1. Select the New Validation node in the workspace directory tree to open the Validation Setup pane.

  2. Click the Plot Type cell for Plot 1 and select Measured and simulated from the drop-down menu.

  3. In the Options area, select Validation Data in the Validation data set drop-down list.

  4. Click Show Plots to open a plot figure window as shown next.

    Measured Versus Simulated Data Plot for Validation Data

  5. Compare this plot with the plot of Measured and simulated data for the validation data. For more information on how to create this plot, see Selecting Views for Plotting.

    Measured and Simulated Data Views Plot

Comparing Residuals

To look at the residuals, select Residuals as the Plot Type for Plot 2 in the New Validation pane. In the Options area, select the Plot 2 check box and click Show Plots. The following figure shows the resulting residuals plot.

Plot of Residuals Using the Validation Data

Compare the validation data residuals with the original data set residuals from the Views node in the workspace directory tree. To create the plot of residuals for the original data set, select the New View node and choose Residuals as the Plot Type.

Plot of Residuals Using the Test Data

The plot on the left agrees with the plot of the residuals for the validation data. The right side has no plot because residuals were not calculated for the validation data during the original estimation process.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS