4
$\begingroup$

The following boundary value problem has a unique solution:

$$ \begin{cases} x''-x=0\\ x''(0)=0\\ x(1)=1 \end{cases}\\ \text{General solution: } x=c_1 \sinh{t}+c_2\cosh{t}\\ \text{Solution for BVP: } x=\frac{\sinh{t}}{\sinh{1}} $$

Yet my simple attempt at solving this numerically in MMA failed:

NDSolve[{x''[t] - x[t] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 1}]

which gives the error

NDSolve::icord: The differential order of the functions in the initial or boundary conditions should be strictly less than in the differential equations.

Does MMA solve this kind of BVPs? I am aware that I could solve this example analytically, but I am working on a different problem that can't be solved analytically.

$\endgroup$
2
  • 2
    $\begingroup$ BVP as opposed to IVP is not relevant to what is going wrong. NDSolve wants initial/boundary conditions to have order strictly less than that of the differential equation. You could work around this by taking another derivative and also giving another condition say by evaluating the original DE at a point. (That verbiage is not easy to understand. In actual code: NDSolve[{x'''[t] - x'[t] == 0, x''[0] - x[0] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 1}]) $\endgroup$ Commented Jan 25, 2015 at 22:49
  • $\begingroup$ @DanielLichtblau I don't know how I didn't think of this. This approach also has much better agreement with the analytic solution than FiniteElement method. Do you mind posting an answer? $\endgroup$
    – Minethlos
    Commented Jan 25, 2015 at 23:03

2 Answers 2

7
$\begingroup$

BVP as opposed to IVP is not relevant to what is going wrong. NDSolve wants initial/boundary conditions to have order strictly less than that of the differential equation.

You could work around this by taking another derivative of the DE and also giving another condition say by evaluating the original DE at some point. The given example could be done as follows.

NDSolve[{x'''[t] - x'[t] == 0, x''[0] - x[0] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 1}])

enter image description here

I think you had intended hyperbolics rather than trigs though, for the analytic solution.

$\endgroup$
1
  • $\begingroup$ Corrected the hyperbolics. $\endgroup$
    – Minethlos
    Commented Jan 25, 2015 at 23:46
4
$\begingroup$

Curious, but under Mathematica 10, using FiniteElement spatial discretization we get this result

NDSolveValue[{x''[t] - x[t] == 0, x''[0] == 0, x[1] == 1}, x, {t, 0, 
  1}, Method -> "FiniteElement"]
Plot[%[x], {x, 0, 1}]

Mathematica graphics

$\endgroup$
1
  • 3
    $\begingroup$ Unfortunately, the result is not correct. The Finite Element Method as currently implemented can not solve this problem. In effect is ignores the x''[0] boundary and that means it uses a zero NeumannValue in place. NDSolve should give a warning in this case though. $\endgroup$
    – user21
    Commented Jan 26, 2015 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.