Products & Services Solutions Academia Support User Community Company

Learn more about SimPowerSystems   

Increasing Simulation Speed

Ways to Increase Simulation Speed

Once the proper method (continuous, discrete, or phasor), solver type, and parameters have been selected, there are additional steps you can take to optimize your simulation speed:

Using Accelerator Mode and Real-Time Workshop Software

The Simulink Accelerator mode is explained in the Accelerating Models documentation.

The Accelerator mode speeds up the execution of Simulink models by replacing the interpreted M code running beneath the Simulink blocks with compiled code as your model executes. The Accelerator mode uses portions of Real-Time Workshop® software to generate this code on the fly. Although the Accelerator mode uses this technology, Real-Time Workshop license is not required to run it. Also, if you do not have your own C compiler installed, you can use the LCC compiler provided with your MATLAB installation.

To activate the Accelerator mode, select Accelerator from the Simulation menu of your model window. Alternatively, you can select Accelerator from the pull-down menu in the model window toolbar.

The following table shows typical performance gains obtained with discretization and Accelerator mode applied on the following two demos: a DC drive using a chopper and the AC-DC converter using a three-phase, three-level voltage-sourced converter. Two versions of the DC drive model are provided in the Demos library: a continuous version, power_dcdrive, and a discrete version, power_dcdrive_disc. The AC-DC converter is available as the power_3levelVSC demo.

 

Simulation Time in Seconds*

Simulation Method

DC drive

(Stop time = 2 s)

AC-DC converter

(Stop time = 0.2 s)

Continuous: ode23tb default parameters

12

Discrete

9.0 (Ts = 10 µs)

14.5 (Ts = 5 µs)

Discrete + Accelerator

5.2 (Ts = 10 µs)

3.3 (Ts = 5 µs)

* Simulation times obtained on a Pentium IV 2.6 GHz processor, with 512 MB of RAM

The table shows how discretizing your circuit speeds up the simulation by a factor of 1.33 for the DC drive. Using the Accelerator mode, an additional factor of 1.7 performance gain is obtained. For the AC-DC converter the Accelerator mode provides a gain of 4.4 times. For complex power electronic converter models, the Accelerator mode provides performance gains up to factors of 15.

To take full advantage of the performance enhancements made possible by converting your models to code, you must use Real-Time Workshop software to generate stand-alone C code. You can then compile and run this code and, with xPC Target™ software, also run it on a target PC operating the xPC Target real-time kernel.

  


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