NDSolve::ivone NDSolveValue::ivone ParametricNDSolve::ivone ParametricNDSolveValue::ivone
Details
-
- This message is generated when the initial values and boundary conditions for a partial differential equation specify values on all sides of the solution region.
- If an equation cannot be solved as an initial value problem, NDSolve will try to solve the equation as a boundary value problem instead.
- The method of lines partial differential equation solver used by NDSolve is only able to solve initial value problems.
- Initial value equations of temporal order n need n-1 derivatives of initial values specified.
- Off[message] switches off the message; On[message] switches it on. For example: Off[NDSolve::ivone].
Examples
Basic Examples (7)
This input generates a message because the equations specify values for the solution on all sides of the solution region:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t],
f[1, t] == 0, f[x, 0] == 0, f[0, t] == 0, f[x, 4] == 0}, f, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"];For a second-order time-dependent system, fix this by specifying values for the initial condition and the derivative of the initial condition at one side:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t],
f[1, t] == 0, f[x, 0] == 0, f[0, t] == 0, Derivative[0, 1][f][x, 0] == 0}, f, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"];Alternatively, specify values for the initial condition and the derivative of the initial condition at another side:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t],
f[1, t] == 0, Derivative[0, 1][f][x, 4] == 0, f[0, t] == 0, f[x, 4] == 0}, f, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"];An error is generated because too many initial conditions have been specified for this first-order time-dependent equation:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t],
f[1, t] == 0, f[x, 0] == 0, f[0, t] == 0, Derivative[0, 1][f][x, 0] == 0}, f, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"];Change the input to only have a single initial condition:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t],
f[1, t] == 0, f[x, 0] == 0, f[0, t] == 0}, f, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"];An error is generated because there is no specification for the initial value of the solution:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t],
f[0, t] == 0, f[1, t] == 0}, f, {x, 0, 1}, {t, 0, 1}, Method -> "MethodOfLines"]Specify an initial value for this first-order time-dependent equation:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t],
f[0, t] == 0, f[1, t] == 0, f[x, 0] == 0}, f, {x, 0, 1}, {t, 0, 1}, Method -> "MethodOfLines"];An error is generated because there is no specification for the initial values of the solution:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t],
f[0, t] == 0, f[1, t] == 0}, f, {x, 0, 1}, {t, 0, 1}, Method -> "MethodOfLines"]Specify values for the initial conditions:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t],
f[0, t] == 0, f[1, t] == 0, f[x, 0] == 0, Derivative[0, 1][f][x, 0] == 0}, f, {x, 0, 1}, {t, 0, 1}, Method -> "MethodOfLines"];An error is generated because an initial condition is specified as DirichletCondition:
NDSolve[{Derivative[2, 0][f][x, t] == 0.1Derivative[0, 1][f][x, t], DirichletCondition[f[x, t] == 0, t == 0], DirichletCondition[f[x, t] == 0, x == -1]}, f, {x, -1, 1}, {t, 0, 1}, Method -> {"MethodOfLines"}]Correct the specification of the initial condition:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t], f[x, 0] == 0, DirichletCondition[f[x, t] == 0, x == -1]}, f, {x, -1, 1}, {t, 0, 1}, Method -> {"MethodOfLines"}]In some cases, NDSolve will try to find a solution by interpreting the equations as purely spatial:
NDSolveValue[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t], DirichletCondition[f[x, t] == 0, t == 0], DirichletCondition[f[x, t] == 0, x == -1]}, f, {x, -1, 1}, {t, 0, 1}]In the preceding case, NDSolve cannot solve the equation as a time-dependent equation because no initial conditions were specified. NDSolve will assume a zero NeumannValue for the unspecified boundaries and solve the equation as a stationary equation.
Inspect that the InterpolatingFunction contains a 2D mesh:
%["ElementMesh"]To treat the equation as a time-dependent equation, specify the "MethodOfLines" option and correct the specification for the initial condition and its derivative:
NDSolveValue[{Derivative[2, 0][f][x, t] == Derivative[0, 2][f][x, t], f[x, 0] == 0, Derivative[0, 1][f][x, 0] == 0, DirichletCondition[f[x, t] == 0, x == -1]}, f, {x, -1, 1}, {t, 0, 1}, Method -> {"MethodOfLines"}]Inspect that the InterpolatingFunction contains a 1D mesh:
%["ElementMesh"]An error is generated because there is no specification for the initial value for the solution of f:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t],
f[1, t] == 0, f[x, 0] == 0, f[0, t] == 0, Derivative[0, 1][f][x, 0] == 0}, f, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"];Specify initial conditions for all dependent variables:
NDSolve[{Derivative[2, 0][f][x, t] == Derivative[0, 1][f][x, t] + g[x, t], Derivative[2, 0][g][x, t] == Derivative[0, 1][g][x, t],
f[1, t] == 0, f[0, t] == 0, f[x, 0] == 0, g[1, t] == 0, g[0, t] == 0, g[x, 0] == 0}, {f, g}, {x, 0, 1}, {t, 0, 4}, Method -> "MethodOfLines"]