What are the differences between the maximum step size and relative tolerance settings in a variable-step solver?

Problem description: 

Both settings appear to reduce the time between simulation steps and provide more accurate output, but is there a reason for using one over the other?

Solution: 

The maximum step size simply limits the solver to a specified largest possible time step. It can be used if you suspect that the solver is missing events, however this setting does not influence the accuracy of the output.

The relative and absolute tolerances specify the acceptable local integration errors for the individual state variables and therefore can be used to control the accuracy of the solution directly. Each new time step using a variable step solver is calculated based on the previous time step as well as the relative error and tolerance.

The absolute tolerance is best set to "auto" as this causes the solver to update the absolute tolerance for each state variable individually, based on the maximum absolute value encountered so far.

Categories: