MATLAB: ODE problem : Unable to meet integration tolerances

odetolerance

Hello,
I'm trying to solve a differential non linear equation with very high values (each constant is like 10^-20 or 10^20 or even more). And i got problems of tolerances. I've tried that :
options=odeset('RelTol',1e-30,'AbsTol',1e-30)
xvalues=30:200;
[x,y]=ode45('fun',xvalues,1, options)
Where the function is, as i told you, with very big values (for example, a term with exp(x)…)
""Warning: RelTol has been increased to
2.22045e-14.
Warning: Failure at t=3.000000e+01. Unable
to meet integration tolerances without
reducing the step size below the smallest
value allowed (1.136868e-13) at time t. ""
If you have any idea, help me !!!
Thank you
Fred

Best Answer

I would increase the tolerance (to perhaps 1E-8 or more) rather than decrease it, but that may not solve your problem.
The warning is that at t=30, your ODE is most likely encountering a singularity. First, plot it to see what it is doing, then start it again at some value greater than t=30 (perhaps t=35) and see what it does, then experiment further to get the result you want. You may have to do a piecewise integration. That may not work in the end (you may not be able to integrate it beyond t=30 regardless), but unless you experiment with it, you will never know.