NDSolve::mxst NDSolveValue::mxst ParametricNDSolve::mxst ParametricNDSolveValue::mxst
Details
-
- This message is generated when the number of steps used in solving a differential equation exceeds the value specified by the MaxSteps option.
- This message can be generated if the solution has many features or oscillations that must be resolved, or if the solution has a sharp or singular feature that can be represented only with very fine resolution.
- Difficulties associated with this error can usually be resolved by increasing the value of the MaxSteps option, or by lowering the values of the AccuracyGoal or PrecisionGoal options.
- Off[message] switches off the message; On[message] switches it on. For example: Off[NDSolve::mxst].
Examples
Basic Examples (4)
A large number of steps is needed to construct a solution through all of the oscillations in this example:

This error can be avoided by increasing the number of steps:
This shows a plot of the solution:
This error can also be avoided by lowering the error tolerances. With this change, the solution will be computed in fewer steps, but the solution will not be as accurate:
A plot of the solution shows the effect of using low error tolerances:
Sometimes the max steps are reached because the differential equation is an algebraic differential equation:

While one could go ahead and increase the number of allowed steps, an index reduction is a much better option in this case:
Solve an ODE that reaches the maximum number of steps:

Sometimes it is not possible to increase the MaxSteps option to resolve this message. This is because the system might be stiff, so an extremely large number of steps need to be taken. As an alternative, Method"StiffnessSwitching" can be used in such a case: