ODE problem : Unable to meet integration tolerances
Show older comments
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
2 Comments
Walter Roberson
on 15 May 2015
Could I ask you to show your ODE in symbolic form? I have not done much work with transforming back from ode45 calls into formulae and I suspect I got it wrong when I did.
Could you confirm your boundary condition is that the derivative evaluated at the initial coordinate, xvalues(1), 35, should be 1? The documentation is not explicit about the fact that the initial (t,y) will have t be the first time and y be the initial condition, but my tests confirm it in practice. (An alternative reading would be that the initial values should be for an implicit time of 0, which would seem less practical, but I wanted to be sure I got the theory right.)
Fred Dugli
on 15 May 2015
Accepted Answer
More Answers (2)
Fred Dugli
on 15 May 2015
Edited: Fred Dugli
on 15 May 2015
Walter Roberson
on 15 May 2015
0 votes
You can never get a relative tolerance of 1E-30 with double precision floating point numbers. The absolute least relative tolerance that could make sense is eps(1) = 2.22044604925031e-16 as that represents the relative difference between adjacent double precision floating point numbers.
An absolute tolerance of 1E-30 might make sense in some situations, but only when the values being computed are in the range of roughly 1E-18 to 1E-24.
If you have large values such as 1E+20 in your calculation, to get down below 1E+4 (eps(1) times the large value) you need to be dividing by large values or you need to be hoping for extreme cancellation of values.
I think you need to be re-thinking your tolerances.
1 Comment
Fred Dugli
on 15 May 2015
Edited: Fred Dugli
on 15 May 2015
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!