I want to be able to compare the duration of multiple simulations.
To determine the actual (wall clock) time taken for a simulation run to complete in PLECS Standalone, only a few lines of code are required in a Simulation Script. The resulting value can then be viewed in the PLECS Console window. This could be useful, for example, when determining how different simulation setups or changes to a model affect simulation speed.
The required code for this is as follows:
tic
plecs('simulate')
toc
To run the scripted simulation demonstration in the attached PLECS Standalone example model, select “Simulation scripts…” from the Simulation menu and run the script. The Octave console can be accessed by selecting “Show Console” from the Window menu.
Note that the same time calculation commands apply for PLECS Blockset in Simulink and can be executed in a MATLAB script:
tic
sim(‘model_name’, Parameters)
toc
tic_toc.plecs (5.07 KB)