| SimPowerSystems | ![]() |
Increasing 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
The Simulink Accelerator mode is explained in the Simulink user's guide.
The Simulink Accelerator 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 Simulink Accelerator uses portions of Real-Time Workshop (RTW) to generate this code on the fly. Although the Simulink Accelerator uses RTW technology, Real-Time Workshop is not required to run it. Also, if you do not have your own C compiler installed, you can use the lcc C compiler provided with MATLAB.
To activate the Simulink Accelerator, select Accelerator instead of Normal in the Simulation menu of your model window. Alternatively, select Accelerator in the pull-down menu to the right and below the Simulation menu.
The following table shows typical performance gains obtained with discretization and Simulink Accelerator 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 times obtained on a Pentium II 500 MHz processor, with 128MB of RAM
The table shows how discretizing your circuit boosts the simulation speed by a factor of 7.6 for the DC drive. Using the Accelerator mode, an additional factor of 2.3 performance gain is obtained. For complex power electronic converter models, the Accelerator provides performance gains up to factors of 10.
To take full advantage of the performance enhancements made possible by converting your models to code, you must use Real-Time Workshop to generate stand-alone C code. You can then compile and run this code and, with xPC Target, also run it on a target PC operating the xPC Target real-time kernel.
| Simulating Discretized Electrical Systems | The Nonlinear Model Library | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2010 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |