2
$\begingroup$
s = NDSolve[{f'''[eta] + 0.5*f[eta]*f''[eta] == 0.0, f[0] == 0.0, 
f'[0] == 0.0, f'[Infinity] = 1.0}, f, {eta, 0, 1}];
Plot[Evaluate[f[eta] /. s], {eta, 0, 1}, PlotRange -> All]

I don't understand why this doesn't work. I followed exactly the instructions from the site. I get the following error (among others)

NDSolve::deqn: Equation or list of equations expected instead of 1.` in the first argument
$\endgroup$
4
  • $\begingroup$ You need f'[Infinity] == 1.0 but still error will occur with this Infinity I guess! $\endgroup$ May 1, 2013 at 6:29
  • $\begingroup$ It does not matter. I changed infinity to 10 and the same error comes up $\endgroup$
    – l3win
    May 1, 2013 at 6:31
  • $\begingroup$ At the moment in the above code you have a single = for your boundary condition at infinity. Changing it to a double equal (==) will help (as long as you quit the kernel). However, you need to define the boundary conditions within the region of integration, ie. between eta=0 and 1. Otherwise the algorithm doesn't know what value of f'[eta] to start iterating with. $\endgroup$ May 1, 2013 at 6:51
  • 1
    $\begingroup$ A related question. $\endgroup$ May 1, 2013 at 11:54

2 Answers 2

1
$\begingroup$

It seems to work if you replace Infinity with a smaller number :

s = NDSolve[{Derivative[3][f][x] + 1/2 f[x] Derivative[2][f][x] == 0, 
      f[0] == 0, f'[0] == 0, f'[#] == 1}, f, {x, 0, 1}] & /@ Range[1, 50, 5];

Plot[Evaluate[f[eta] /. s], {eta, 0, 1}, PlotRange -> All, 
     PlotLegends -> (ToString[#] & /@ Range[1, 50, 5])]

plot

$\endgroup$
1
$\begingroup$

As late as this answer may be:

sol = NDSolve[{f'''[η] + 0.5 f[η] f''[η] == 0, 
   f[0] == f'[0] == 0, f'[10] == 1}, f, η]
Plot[f[η] /. First[sol], {η, 0, 10}]
Plot[f'[η] /. First[sol], {η, 0, 10}]
Plot[f''[η] /. First[sol], {η, 0, 10}]

Plot of f vs eta

Plot of f vs eta

Plot of f' vs eta (velocity profile)

Plot of f' vs eta (velocity profile)

Plot of f'' vs eta (shear stress distribution)

Plot of f'' vs eta (shear stress distribution)

$\endgroup$

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.