NDSolve::ibcinc NDSolveValue::ibcinc ParametricNDSolve::ibcinc ParametricNDSolveValue::ibcinc


  • This message is generated when the boundary conditions and initial conditions in a partial differential equation give different values for the solution at a single point.
  • Difficulties with inconsistent boundary and initial conditions can sometimes be resolved by approximating the inconsistent conditions with consistent conditions.
  • Although inconsistent boundary and initial conditions are common in practical models, such conditions generally represent unphysical processes, such as an instantaneous change in temperature, and can lead to singular solutions that may be difficult to handle by numerical methods.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[NDSolve::ibcinc].


Basic Examples  (5)

A warning is generated because at and the initial conditions and boundary conditions give two different values for the value of . Specifically, and are inconsistent at and . This example corresponds to a heat equation in which the temperature at one endpoint changes instantly:

One way to avoid the inconsistent conditions on the solution is to replace the discontinuous condition with a similar condition that changes quickly but smoothly:

This shows a plot of the solution:

Clear the value of sol:

When the spatial discretization is too coarse, the message may be issued even though the conditions are actually consistent:

This behavior is expected and explained in "Inconsistent Boundary Conditions". Refining the spatial discretization sufficiently eliminates the message:

Consider this PDE:

This message typically indicates a problem at the the intersection of the initial and boundary conditions. Here, the problem occurs at and . and are inconsistent at this point since the first condition says , while the second says .

If the situation is too complicated and it is difficult to identify where the boundary conditions are inconsistent, you can use "DifferentiateBoundaryConditions"False. This will solve the underlying system of ODEs with a DAE solver, which can modify the initial conditions provided to find a consistent set of initial conditions:

This approach will, however, deviate from the specified initial and boundary conditions.

In this example, because of discretization error, NDSolve incorrectly warns about inconsistent boundary conditions:

Occasionally, NDSolve will issue the NDSolve::ibcinc message warning about inconsistent boundary conditions when they are actually consistent. This happens due to discretization error in approximating derivatives. With a finer temporal discretization, there is no message and the boundary condition is satisfied better:

Consider the PDE:

The inconsistent boundary conditions have to do with . , so the derivative in the direction at should be consistent with this boundary condition at . Therefore, it must be :

To avoid the NDSolve::eerr warning message, the precision is reduced: