Ways to Speed Up Design Optimization Tasks
You can use the following ways to speed up parameter estimation, response optimization, and sensitivity analysis tasks:
Parallel computing
Fast restart mode
Accelerator mode
You can use a combination of these, but depending on the limitations associated with each, you may or may not see an increase in speed. For example, you can use parallel computing and fast restart together to speed up optimization. However, you do not see an increase in speed compared to using only parallel computing if the compilation phase of your model is short.
Speed Up Using Parallel Computing
You can use Parallel Computing Toolbox™ software to speed up parameter estimation, response optimization, and sensitivity analysis. When you use parallel computing, the software distributes the independent simulations on multiple MATLAB® sessions. Thus, the simulations run in parallel, which reduces the optimization time.
Using parallel computing may reduce the optimization time in the following cases:
The model contains many parameters to optimize, and you use the
Gradient descent
orNonlinear least squares
method.The
Pattern search
method is selected as the optimization method.The model contains many uncertain parameters and uncertain parameter values.
The model is complex and takes a long time to simulate.
You can use parallel computing in the Parameter Estimator, Response Optimizer, and Sensitivity Analyzer apps, or at the command line. For more information, see Use Parallel Computing for Parameter Estimation, Use Parallel Computing for Response Optimization, and Use Parallel Computing for Sensitivity Analysis.
Speed Up Using Fast Restart Mode
You can use the fast restart feature of Simulink® to speed up design optimization of tunable parameters of a model.
Fast restart enables you to perform iterative simulations without compiling a model or terminating the simulation each time. Using fast restart, you compile a model only once. You can then tune parameters and simulate the model again without spending time on compiling. Fast restart associates multiple simulation phases with a single compile phase to make iterative simulations more efficient. You see a speedup of design optimization tasks using fast restart in models that have a long compilation phase. See How Fast Restart Improves Iterative Simulations.
When you enable fast restart, you can only change tunable properties of the model during simulation. For more information about the limitations, see Limitations.
You can configure fast restart in the Parameter Estimator, Response Optimizer, and Sensitivity Analyzer apps, or at the command line. For more information see, Improving Optimization Performance Using Fast Restart (GUI), Improving Optimization Performance Using Fast Restart (Code), Use Fast Restart Mode During Response Optimization, or Use Fast Restart Mode During Sensitivity Analysis.
Speed Up Using Accelerator Mode
Simulink
Design Optimization™ software supports Normal
and Accelerator
simulation modes. You can accelerate the design optimization computations by changing the
simulation mode of your Simulink model to Accelerator
. For information about these modes,
see How Acceleration Modes Work.
The default simulation mode is Normal
. In
this mode, Simulink uses interpreted code, rather than compiled
C code during simulations.
In the Accelerator
mode, Simulink
Design Optimization software
runs simulations during optimization with compiled C code. Using compiled
C code speeds up the simulations and reduces the time to optimize
the model response signals.
For information about the limitations, and how to use the
Accelerator
mode, see Use Accelerator Mode During Simulations.