Why do I receive a warning about integration tolerance when using the ODE solver functions?
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 22 Jan. 2010
Bearbeitet: MathWorks Support Team
am 19 Feb. 2021
The following code:
ode23(@(t,y)1/(t-2),[0 2],5)
produces this warning:
ERROR: Warning: Failure at t=2.000000e+000.
Unable to meet integration tolerances without reducing the
step size below the smallest value allowed (7.105427e-015) at time t.
Akzeptierte Antwort
MathWorks Support Team
am 19 Feb. 2021
Bearbeitet: MathWorks Support Team
am 19 Feb. 2021
This error message indicates that the problem you are trying to solve is too stiff for the ODE solver you are trying to use, or that it includes a singularity.
In the first case, you will need to find a solver which can handle stiffer problems than the solver you are currently using. The stiff ODE solvers that are available in MATLAB are ODE15s, ODE23s, and ODE23tb.
For more information about the differences between the non-stiff and the stiff ODE solvers, please see Section 7.9 of "Numerical Computing with MATLAB". by Cleve Moler, at the following URL:
In the second case, eliminating the singularity from the region over which you are attempting to integrate should eliminate the problem. The following code produces a warning:
ode15s(@(t,y)1/(t-2),[0 2],5)
Changing the above code to:
ode15s(@(t,y)1/(t-2),[0 1.999],5)
%
avoids the singularity at t = 2.
If you are using a version of MATLAB prior to MATLAB 7.0 (R14), you will need to define the function to be integrated as an inline function or in a function file. Here an inline function is used:
O=inline('1/(t-2)','t','y')
ode15s(O,[0 1.999],5)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!