- 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?
4 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Sahas
2024 年 9 月 11 日
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 件のコメント
Yifeng Tang
2024 年 9 月 18 日
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.
参考
カテゴリ
Help Center および File Exchange で Physical Units についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!