NDSolve::nderr NDSolveValue::nderr ParametricNDSolve::nderr ParametricNDSolveValue::nderr
更多信息
-
- This message is generated by a specific type of failure within the algorithm that is used for solving initial value problems.
- This error can occur if the differential equation has singular or oscillatory solutions.
- If you see this message in an example where it is not expected, please contact Technical Support for more information.
- If you see this message in an example with WorkingPrecision greater than MachinePrecision try using the option Method->"StiffnessSwitching" in NDSolve.
- Off[message] switches off the message; On[message] switches it on. For example: Off[NDSolve::nderr].
范例
基本范例 (2)
Usually this message is generated when the starting step size is too big, and sometimes it is generated when the DAE is too high an index to solve:
Starting with a very small step size helps:
The following differential equation cannot be solved:
It appears that the equation is becoming stiff, and NDSolve is having a hard time detecting this and modifying the methods it chooses accordingly. You can get a solution by explicitly using Method"StiffnessSwitching". While this does work, it increases the computation time substantially:
Alternatively, since this is a boundary value problem, you can use the "Shooting" method to solve it faster. However, this is very sensitive to the choice for "StartingInitialConditions". Since there are two variables, obtaining a set of "StartingInitialConditions" that solves the problem may require substantial guessing and checking: