NDSolve::berr NDSolveValue::berr ParametricNDSolve::berr ParametricNDSolveValue::berr
Examples
Basic Examples (2)
Consider the differential equation:

The solution at is not close to
as specified in the equation:
This is a boundary value problem. You can tell because the conditions and
are specified on both ends of the boundary. Since this is a boundary value problem, the solution is often to use the shooting method. This will solve the equation as an initial value problem using the specified
and
as initial conditions. To get the condition of
at the far end correct, one needs to use the correct initial value for
at
. However, the initial value of
at
is not known. The shooting method will figure out what this initial condition must be so that the boundary condition at the far end of the boundary is satisfied.
An initial guess on the value of must be provided to get the shooting method algorithm started. The solution may depend on this initial guess:
The solution at is now much closer to the requested value:
Consider the differential equation:

The solution at is close to 1/2, but not close enough, so the message is triggered:
This is a boundary value problem. You can tell because the conditions and
are specified on each end of the region. You can normally get a solution to a problem like this by using the shooting method. However, in this case, you will still get the error message:

The difficulty is that the function will never reach 1/2 no matter what the initial conditions are. It will get close, but never quite get there. For example, play around with the value of to see that 2.495 is probably the best that can be done:
In this particular case, you can see the problem by looking at the equation. When looking at an equation, it is a good habit to put it in "normal form"—that is, solve for the highest-order derivative. NDSolve will do this under the hood. In this case, the highest-order derivative in the equation is :
Look at the denominator. The boundary condition is going to cause problems when
because
when both
and
.