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

조회 수: 4 (최근 30일)
Hamza
Hamza 2024년 9월 9일
댓글: Yifeng Tang 2024년 9월 18일
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?

답변 (1개)

Sahas
Sahas 2024년 9월 11일
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
Yifeng Tang
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 CenterFile Exchange에서 Physical Units에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by