Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

How to define plecs circuit (blockset) simulation params separately from the main model?

0 votes
As I understand, to get the best performance I need to simulate the plecs circuit in variable-step mode. However, it seems that I can only make global changes to the simulation setting via the Simulink Simulation Settings dialog. I want to be able to do this because I have some models that run in plain simulink that would work much faster with (and are designed for) fixed-step simulation. Is it possible / desirable to  have plex solve the circuit with a variable time "within" the fixed time of the simulink circuit?

This may sound like a convoluted question, but I am relatively new to plecs - although I have worked on models made by others in the past. I am using Plecs blockset (4.5.4) with Matlab 2019b on Windows 10.
asked Jul 26, 2021 by kabhijit (12 points)

1 Answer

0 votes

For most applications we recommend a variable step solver, but PLECS Blockset works with both variable step and fixed step Simulink solvers. Note that you can have fixed-rate periodic tasks and a variable step solver. Variable-step solvers still accurately take simulation steps at the discrete control time steps in addition to the adaptive time-steps due to the power electronics system dynamics.


Also, if you are using a variable step solver and the simulation is running slow, evaluate different solvers and check if you should be using a stiff or non-stiff solver. 

Simulink also has a "local solver" configuration which you may be able to use,  but you should refer to Mathworks support for documentation on that feature.  I am not sure if it will be applicable here.

answered Jul 27, 2021 by Bryan Lieblick (1,995 points)
edited Aug 9, 2021 by Bryan Lieblick