Error occurred while running the simulation

조회 수: 19 (최근 30일)
Marco Pellegrino
Marco Pellegrino 2022년 12월 30일
댓글: Sam Chak 2022년 12월 30일
Hi,
I keep getting this error:
An error occurred while running the simulation and the simulation was terminated
Caused by:
Solver encountered an error while simulating model at time 6.6282282635683543e-17 and cannot continue. Please check the model for errors.
Nonlinear iteration is not converging with step size reduced to hmin (2.35482E-31) at time 6.62823E-17. Try reducing the minimum step size and/or relax the relative error tolerance.
I tried changing the solver from 'auto' to 'ode45' as someone suggested in other answers but the simulation now takes "infinite" time.
How could I try to figure out this issue?

답변 (1개)

Sam Chak
Sam Chak 2022년 12월 30일
Hi Marco,
In most cases, the problem is likely caused by the singularity event, something like approaching the division-by-zero, or tan(90°). Also check if the system is "stiff" at the beginning of the simulation.
  댓글 수: 2
Marco Pellegrino
Marco Pellegrino 2022년 12월 30일
Thank you so much for your reply. How can I check it through the simulation? (I'm sorry but I'm not yet an experienced user).
Sam Chak
Sam Chak 2022년 12월 30일
If your Simulink model consists of only fundamental blocks (no mask), then it should be rather easy to detect if there are any division block and trigonometric function block. Sometimes, then problem can be due to the system response is rapidly diverging to . Take a look at this example in MATLAB (not Simulink).
fun = @(t, x) (1e4)*x;
tspan = linspace(0, 10, 1001);
x0 = 1;
[t, x] = ode45(fun, tspan, x0)
t = 1001×1
0 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 0.0800 0.0900
x = 1001×1
1.0e+260 * 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 3.7851 NaN NaN NaN
Also check if your system has discontinuities. Best is to post a clear screenshot of the Simulink model. Let the experienced users of Simulink help you to identify the root cause.

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

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by