|On this page…|
In general, you must trade off simulation speed against flexibility when choosing either Accelerator mode or Rapid Accelerator mode instead of Normal mode.
Normal mode offers the greatest flexibility for making model adjustments and displaying results, but it runs the slowest.
Accelerator mode lies between Normal and Rapid Accelerator modes in performance and in interaction with your model. If your model has 3-D signals, use Normal or Accelerator mode. Accelerator mode does not support runtime diagnostics.
Rapid Accelerator mode runs the fastest, but this mode does not support the debugger or profiler, and works only with those models for which C code is available for all of the blocks in the model. In addition, Rapid Accelerator mode does not support 3-D parameters and sinks.
Note: An exception to this rule occurs when you run multiple simulations, each of which executes in less than one second in Normal mode. For example:
for i=1:100 sim(model); % executes in less than one second in Normal mode end
For this set of conditions, you will typically obtain the best performance by simulating the model in Normal mode.
Tip To gain additional flexibility, consider using model referencing to componentize your model. If the top-level model uses Normal mode, then you can simulate a referenced model in a different simulation mode than you use for other portions of a model. During the model development process, you can choose different simulation modes for different portions of a model. For details, see Referenced Model Simulation Modes.
The following table compares the characteristics of Normal mode, Accelerator mode, and Rapid Accelerator mode.
|If you want to...||Then use this mode...|
|Run your model in a separate address space|
|Efficiently run batch and Monte Carlo simulations|
|Change model parameters such as solver, stop time without rebuilding|
|Change block tunable parameters such as gain|
|For more information on configuration set parameters which can be modified without requiring rebuild, see Code Regeneration in Accelerated Models|
|Accelerate your model even if C code is not used for all blocks|
|Support Interpreted MATLAB Function blocks|
|Support Non-Inlined MATLAB language or Fortran S-Functions|
|Permit algebraic loops in your model|
|Have your model work with the debugger or profiler|
|Have your model include C++ code|
|Use scopes and signal viewers||See Behavior of Scopes and Viewers with Rapid Accelerator Mode|
|Use scopes and signal viewers when running your model from the command line|
The following decision tree can help you select between Normal mode, Accelerator mode, or Rapid Accelerator mode.
See Comparing Performance to understand how effective the accelerator modes will be in improving the performance of your model.