- https://www.mathworks.com/help/simscape/ug/making-optimal-solver-choices-for-physical-simulation.html
- https://www.mathworks.com/help/simscape/ug/setting-up-solvers-for-physical-models.html
Does using the simulink-ps converter slow down the simulation speed?
3 views (last 30 days)
Show older comments
Hello,
I am building a clutch model for a drivetrain. The clutch pressure will be computed sperately. I noticed that using the simulink-ps converter is slowing down simulation excessively.
I made a simple model for comparison (please find it in attachments). If i use ps-constant, the simulation runs very fast. But upon using the simulink-constant along with simulink-ps converter, the simulation becomes heaps slower. I could not find why it is happening. Can someone help me what I am missing here?
0 Comments
Answers (1)
Sahas
on 11 Sep 2024
As per my understanding, when the model uses “PS Constant” block as one of the inputs of a physical system block in place of “Simulink-PS Converter” block, the execution time is significantly lower.
I was able to reproduce the issue and found that the model uses “ode23t moderately stiff Trapezoidal” solver. For physical systems, it is recommended to use “stiff” solvers such as “ode15s” and “daessc”. “daessc” solver is optimized for solving systems with differential-algebraic equations (DAEs) which are common in physical systems. Alternatively, you can select the “auto (Automatic Solver Selection)” solver option for the most optimized solver selection for the given model.
To choose a solver, press the “Ctrl+E” keyboard shortcut to open the “Configuration Parameters” window. Then, select the solver from the “Solver” pane as shown in the image below.
I utilized the "daessc" solver and observed that the execution time was significantly lower and comparable whether we use the "PS Constant" block or the "Simulink-PS Converter" block.
Refer to the following MathWorks documentation links for more information on selecting the right solver for your Simulink model:
I hope is beneficial and reduces the execution time!
1 Comment
Yifeng Tang
on 18 Sep 2024
In addition to the solver setting pointed out by @Sahas, I also wonder if removing the du/dt block would help. I understand you put it there to provide a derivative to the Simulink-PS converter. Without the derivative, for some solvers (in your case ode23t I suppose), there isn't enough information for solving the system of equations. A common way to provide that derivative, instead of using du/dt block, is to use the filtering inside the converter block. I've found that to work well.
See Also
Categories
Find more on Physical Units in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!