MATLAB Examples

Improving Optimization Performance Using Fast Restart (GUI)

This example shows how to use the Fast Restart feature of Simulink® to speed up optimization of a model. You use Fast Restart to estimate the parameters of an engine throttle model.


How Fast Restart Speeds up the Optimization

Simulation of Simulink models requires that the model be compiled before it is simulated. In this context compilation of a model means analyzing and formatting the model so that it can be simulated. The idea of Fast Restart is to perform the model compilation once and reuse the compiled information for subsequent simulations, see "How Fast Restart Improves Iterative Simulations" in the Simulink documentation for a description of Fast Restart.

During optimization the model is repeatedly simulated (often tens or hundreds of times) Fast Restart means that the model is only compiled once for these simulation in comparison to non-fast restart where the model is recompiled each time.

Models where compilation is a significant portion of overall simulation time benefit the most from Fast Restart. Further once a model is compiled not all model parameters can be changed, specifically only tunable parameters can be changed, see "Factors Affecting Fast Restart" in the Simulink documentation for more information.

Open Model and Estimation Tool

Load the model and click the "Parameter Estimation with preloaded data" block to load a preconfigured parameter estimation problem. The goal is to tune the parameters of an engine throttle model to match measured data. For details on the problem setup see the "Estimate Model Parameter Values (GUI)" example.


Estimate Without Using Fast Restart

To compare the estimation with and without fast restart, change the estimation options in the tool to not update the model with estimated values.

Click Model Options... in the Parameter Estimation tool and clear Update model at end of estimation, and select Save estimated values as new estimation result.

Click Estimate in the tool to estimate the model parameter values. The estimation progress report shows the estimation start and end time.

Estimate Using Fast Restart

To configure the model to use Fast Restart during simulation, click Enable Fast Restart in the Simulink model.

Click Estimate in the Parameter Estimation tool. The estimation progress report shows the estimation start and end time. Note the reduction in total estimation time compared to the estimation without using fast restart, in this case around 28 seconds or 45% of the original estimation time.

Related Examples

The Generate MATLAB Code feature of the Parameter Estimation and Response Optimization tool will generate the MATLAB code to configure the model for fast restart if the tool is configured to use fast restart.

To learn how to use Fast Restart at the command line see "Improving Optimization Performance using Fast Restart (Code)".

Close the model.