0

I am trying to solve a ODE related to its boundary value with NDSolve

NDSolve[
  {f'''[x] + 1/2*f[x]*f''[x] + f''[0] == 0, 
   f'[0] == 0, f[0] == 0, f'[1000] == 1}, 
  f, {x, 0, 10}]

The error message is:

NDSolve::litarg: To avoid possible ambiguity, the arguments of the dependent variable in {(f^′′)[0]+1/2 f[η] (f^′′)[η]+(f^(3))[η]==0} should literally match the independent variables.

I guess the issue is that I cannot define the boundary value within the equation in this way. How could I add this term into equation and solve it?

bbgodfrey
  • 61,439
  • 17
  • 89
  • 156
  • 1
    Your ode do not make too much sense. What is f''[0] doing in the ODE itself? This is a constant. So you could just as well write NDSolve[{f'''[x]+1/2*f[x]*f''[x]+c==0..... or may be you meant to have it in the B.C. but then you have too many boundary conditions – Nasser Dec 17 '17 at 23:11
  • f''[0] is unknown. The ODE is still with three boundary conditions – silentdragon Dec 17 '17 at 23:18
  • You have 3rd order ODE, and you have given 3 boundary conditions already. – Nasser Dec 17 '17 at 23:21
  • Yes. BCs are enough to solve the ODE. However, f''[0] is also involved into the equation. – silentdragon Dec 17 '17 at 23:25
  • 1
    Your ODE is equivalent to $f'''(x)+f(x)f''(x)/2+c=0$ with the boundary conditions $f'(0)=f(0)=0$, $f'(1000)=1$ and $f''(0)=0$. So it is equivalent to a third ODE with four BCs. I don't think there is a solution for an arbitrary $c$. Even if there were, you cannot solve numerically a problem with an unspecified BC (and thus not your equivalent problem either). – anderstood Dec 17 '17 at 23:54
  • If you want to be convinced, solve e.g. NDSolve[{f'''[x] + 1/2*f[x]*f''[x] + c == 0, f'[0] == 0, f[0] == 0, f'[3] == 1}, f, {x, 0, 3}] for different values of c: you see that you have no additional degree of freedom for f''[0]. – anderstood Dec 18 '17 at 00:00
  • It appears that f[x] must approach x asymptotically as x approaches infinity to satisfy the outer boundary condition. If so, then f'''[x] and f''[x] must approach 0 faster than 1/x, and f''[0] them must be identically 0. So, there appears to be no solution satisfying the boundary conditions. Incidentally, the ODE here bears some similarity to 100659, which can be solved. See also 104170. – bbgodfrey Dec 18 '17 at 03:03
  • Thank you all for the help. In fact, my issue is about how to code a term in the ODE that depends on a boundary value F(f''(0)), I am pretty sure there is a solution for the original equation. – silentdragon Dec 18 '17 at 17:20

1 Answers1

1

You get a solution when searching for f''[0]==c

g[y_?NumericQ, c_?NumericQ] := f[y] /. First@
     NDSolve[{f'''[x] + 1/2*f[x]*f''[x] + c == 0, f'[0] == 0, f[0] == 0,
              f''[0] == c}, f, {x, 0, 1000}]

h[y_?NumericQ, c_?NumericQ] := f'[y] /. First@
     NDSolve[{f'''[x] + 1/2*f[x]*f''[x] + c == 0, f'[0] == 0, f[0] == 0,
              f''[0] == c}, f, {x, 0, 1000}]

cfr = c /. First@FindRoot[h[1000, c] == 1, {c, -.03}, WorkingPrecision -> 20, 
                     AccuracyGoal -> 8, PrecisionGoal -> 8]

(*    -0.025783801817875997941    *)

h[1000, cfr]

(*    1.    *)

Plot[g[y, cfr], {y, 0, 10}, GridLines -> Automatic, PlotStyle -> Red]

enter image description here

Akku14
  • 17,287
  • 14
  • 32