Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
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
share|improve this question
    
You need f'[Infinity] == 1.0 but still error will occur with this Infinity I guess! –  PlatoManiac May 1 '13 at 6:29
    
It does not matter. I changed infinity to 10 and the same error comes up –  l3win May 1 '13 at 6:31
    
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. –  Jonathan Shock May 1 '13 at 6:51
1  
A related question. –  J. M. May 1 '13 at 11:54
add comment

2 Answers

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

share|improve this answer
add comment

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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