필터 지우기
필터 지우기

Simulink does messes up step sizes (and doesn't do what I tell it)

조회 수: 1 (최근 30일)
Daniel H
Daniel H 2014년 11월 19일
편집: Joachim Kahr 2019년 4월 5일
Hi all,
I want to simulate a variable-step size system. The model includes a coupler to a circuit simulator and hence transmits the current step size to the other simulator on each step.
When I run the simulation, I get errors like these on the other side:
ERROR (SIMLNK-57): [Internal] An invalid message was received from the AMS simulator: NextTimeHit must be in future, NextTimeHit=3.875e-07, lastTime=3.875e-07, now=3.875e-07
It seems that simulink makes too small time steps, probably below numerical precision so they arrive as identical numbers on the other side. Alright, so I set:
Min step size: 1000e-12
This should prevent Simulink from making too small steps. But the problem persists!
Now I just remove the coupler and observe the difference in time steps (I export "Clock" to workspace):
plot(diff(simout_time));
This is the result:
Clearly, there are steps which are below the numerical precision (3.388e-21) although I told Simulink that the minimum step should be 1e-9 !!
How can this be fixed?
PS: Taking a fixed-step solvers works as expected but this is not what I want.
  댓글 수: 1
Joachim Kahr
Joachim Kahr 2019년 4월 5일
편집: Joachim Kahr 2019년 4월 5일
Has anyone found a solution to this problem?
I face the same problem and are not sure if this problem is only simulink related or if the communication over the socket leads to this problems.
KR,
Joachim
edit: setting the sample time of the coupler to a fixed step size is kind of a workaround as the min step size of the simulator does not affect the step size inherited from the coupler. anyway, this is a tradeoff between simulation time and accuracy....

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Configure Simulation Conditions에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by