Unable to meet integration tolerances without reducing the step size below the smallest value allowed
387 次查看(过去 30 天)
显示 更早的评论
Hello,
I am integrating a series of ODEs and I run into the following warning that stops the integration:
Warning: Failure at t=3.252486e+02. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (9.094947e-13) at time t.
I googled the problem and from what I read I see it could be do to a singularity or discontinuity and it was advised to plot the solution, which I did (see Figure, plotted from 290 to the end of the integration for visibility). I still can't pinpoint what the problem is exactly and how to solve it. I'm guessing it's related to the fact that at time 300 there is a significant change in the values of the variables, as for example the variable in blue here goes from 0 to 0.9 in 3s. However the warning occurs 25s later where the values seem to have stabilized.
Any help is appreciated, thank you
0 个评论
回答(1 个)
Chidvi Modala
2021-5-31
It is useful to set the absolute and relative tolerances to a higher value to avoid this warning. In case of sharp discontinuities in the reference input such as when tracking a reference signal, it is possible that this warning is generated at intermediate time steps. MATLAB is trying to reduce the time step to a really small amount in order to counter the abrupt change due to the discontinuity in the reference signal.
For sharp discontinuities,it might not be possible to avoid this warning. However for non discontinous inputs we can set relative and absolute tolerance to a higher number than the default setting.
We can set the tolerances to a higher value for example by using the following commands:
options = odeset('Mass',M,'RelTol',1e-4,'AbsTol',1e-6);
[t,y] = ode15s(@objectivefunction,tspan,y0,options);
For more information on relative and absolute tolerance you can look at the link below:
2 个评论
Walter Roberson
2022-3-13
M is a mass matrix https://stackoverflow.com/questions/38035238/what-is-the-mass-matrix-in-ode-solvers-in-matlab
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!