Does using the simulink-ps converter slow down the simulation speed?

4 vues (au cours des 30 derniers jours)
Hamza
Hamza le 9 Sep 2024
Commenté : Yifeng Tang le 18 Sep 2024
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?

Réponses (1)

Sahas
Sahas le 11 Sep 2024
Dear @Hamza,
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 commentaire
Yifeng Tang
Yifeng Tang le 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Physical Units dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by