MATLAB: Absolute and Relative Tolerances

errortolerance

Hi,
I'd like to know what are the maximum and minimum significative values of RelTol and AbsTol ? I couldn't find the solution on Google or in the previous subjects in MathWork.
Thanks.

Best Answer

These are tolerance metrics used by variable-step solvers in Simulink. They are used to answer the question: "should the solver take a smaller time-step because the errors are too high?"
For example, let's take the variable-step solver ode45. According to the documentation, "This Runge-Kutta (4,5) solver is a fifth-order method that performs a fourth-order estimate of the error."
If this error estimate is above your specified tolerances, your solver will take a step back and reduce the time-step with hopes of reducing that error to an acceptable level.
Now, here's where AbsTol and RelTol come in. Simulink combines both of these tolerances so your solver doesn't get "stuck" in situations that have very small or very large integrator state values.
tolerance = max( AbsTol, RelTol*|state| )
If the state is very small, the relative tolerance multiplied by the state value will also be very small... so in this situation, the absolute tolerance dictates a hard lower bound on the error tolerance.
If the state is very large, on the other hand, the absolute tolerance would be too small and restrictive... so the relative tolerance dominates here.
For more information, check out this documentation page . Go to "Choosing a Variable-Step Solver" and look for the "Specifying Error Tolerances for Variable-Step Solvers" sub-heading.
- Sebastian
Related Question