247 views (last 30 days)
In my understanding,
RelTol = abs(X-Y)/min(abs(X), abs(Y))
AbsTol = abs(X-Y)
But what does it mean when applied to ode45? Specifically what does it mean when we say
odeset('RelTol', 1e-3, 'AbsTol', 1e-4)
? Why is it necessary to set both RelTol and AbsTol? How does this influence the solution?I presume the smaller the Rel and Abs Tols the better the solution. But in what sense? In terms of precision or what? Also I presume setting the Rel and Abs Tols as above does not mean that the final solution only has error 1e-4, say? So what are we really doing? Is it right that the final solution's accuracy then depends on the program ode45 too?
Jan on 2 Apr 2012
The absolute tolerance of 1e-3 is meaningless, when the values are very small, e.g. 1.234e-27. Then the relative tolerance is more useful.
The precision of the result is IEEE-64bit double in every case, but the accuracy is influenced by the tolerances. The tolerances are used to limit the local discretization error: If the difference between a high-accuracy and low-accuracy integration is higher than one of the tolerances, the step size is reduced.
If the tolerance is too low, the large number of steps will increase the accumulated rounding errors, while for a to high tolerance the local discretization errors dominate the accuracy of the result.