Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Blasius Eqn help

Subject: Blasius Eqn help

From: Abstract_A

Date: 24 Oct, 2010 06:30:09

Message: 1 of 8

How can I solve a third order nonlinear ODE?

f''' + f * f''=0
f(0)=0
f'(0)=0
f'(infinity)=1

Subject: Blasius Eqn help

From: Nasser M. Abbasi

Date: 24 Oct, 2010 07:34:57

Message: 2 of 8

On 10/23/2010 11:30 PM, Abstract_A wrote:
> How can I solve a third order nonlinear ODE?
>
> f''' + f * f''=0
> f(0)=0
> f'(0)=0
> f'(infinity)=1


If you want to do the numerically, need to do something with the
infinity value. But aside from that, you can to convery to x'=f(x) form
and use ode45, something like this (using state variables)

let

x1 = f
x2 = f'
x3 = f''

take derivatives

x1' = f' = x2
x2' = f'' = x3
x3' = f''' = -x1*x3

So, now system is in form X'=F(X).

Which you can run ode45 on them as one system. (vectors). the RHS which
you have to update in your ode45 function will be {x2,x3,-x2*x3}.

May be you can try that and see what you get.

--Nasser

Subject: Blasius Eqn help

From: Abstract_A

Date: 24 Oct, 2010 19:40:06

Message: 3 of 8

"Nasser M. Abbasi" <nma@12000.org> wrote in message <ia0nji$g4h$1@speranza.aioe.org>...
> On 10/23/2010 11:30 PM, Abstract_A wrote:
> > How can I solve a third order nonlinear ODE?
> >
> > f''' + f * f''=0
> > f(0)=0
> > f'(0)=0
> > f'(infinity)=1
>
>
> If you want to do the numerically, need to do something with the
> infinity value. But aside from that, you can to convery to x'=f(x) form
> and use ode45, something like this (using state variables)
>
> let
>
> x1 = f
> x2 = f'
> x3 = f''
>
> take derivatives
>
> x1' = f' = x2
> x2' = f'' = x3
> x3' = f''' = -x1*x3
>
> So, now system is in form X'=F(X).
>
> Which you can run ode45 on them as one system. (vectors). the RHS which
> you have to update in your ode45 function will be {x2,x3,-x2*x3}.
>
> May be you can try that and see what you get.
>
> --Nasser


Thanks, I figured it out last night. I have to make the f'(infinity)= 1 to f''(0)='my guess' and keep intergrating till the f'(x) goes to infintiy at 1.

Subject: Blasius Eqn help

From: Nasser M. Abbasi

Date: 24 Oct, 2010 19:49:17

Message: 4 of 8

On 10/24/2010 12:40 PM, Abstract_A wrote:
> "Nasser M. Abbasi"<nma@12000.org> wrote in message<ia0nji$g4h$1@speranza.aioe.org>...
>> On 10/23/2010 11:30 PM, Abstract_A wrote:
>>> How can I solve a third order nonlinear ODE?
>>>
>>> f''' + f * f''=0
>>> f(0)=0
>>> f'(0)=0
>>> f'(infinity)=1
>>
>>
>> If you want to do the numerically, need to do something with the
>> infinity value. But aside from that, you can to convery to x'=f(x) form
>> and use ode45, something like this (using state variables)
>>
>> let
>>
>> x1 = f
>> x2 = f'
>> x3 = f''
>>
>> take derivatives
>>
>> x1' = f' = x2
>> x2' = f'' = x3
>> x3' = f''' = -x1*x3
>>
>> So, now system is in form X'=F(X).
>>
>> Which you can run ode45 on them as one system. (vectors). the RHS which
>> you have to update in your ode45 function will be {x2,x3,-x2*x3}.
>>
>> May be you can try that and see what you get.
>>
>> --Nasser
>
>


> Thanks, I figured it out last night. I have to make the f'(infinity)= 1 to f''(0)='my guess' and keep
 > intergrating till the f'(x) goes to infintiy at 1.

Yes, this is called the shooting method, since you had BVP on one of
those first derivatives ode's there.

glad things are working for you now.

--Nasser

Subject: Blasius Eqn help

From: Roger Stafford

Date: 24 Oct, 2010 21:01:04

Message: 5 of 8

"Abstract_A " <chase1083@hotmail.com> wrote in message <ia222m$han$1@fred.mathworks.com>...
> Thanks, I figured it out last night. I have to make the f'(infinity)= 1 to f''(0)='my guess' and keep intergrating till the f'(x) goes to infintiy at 1.
- - - - - - - - - -
  I think you can make your problem easier than having to do repetitive calls on 'ode'. Suppose we rescale f and t using an as yet undetermined constant scale factor k according to the equations f = k*F and t = 1/k*T. Then we have

 0 = d3f/dt3 + f*d2f/dt2 = k^4*d3F/dT3 + (k*F)*(k^3*d2F/dT2)

so that dividing by k^4 we have the rescaled equation

 d3F/dT3 + F*d2F/dT2 = 0

(where d2F/dT2 and d3F/dT3 represent the second and third derivatives of F with respect to T, and similarly for f and t.)

  You can use initial conditions F(0) = 0, dF/dT(0) = 0 and d2F/dT2(0) = 1, and then run the problem through, say 'ode45', continuing T out to a sufficiently large amount that you can approximate the asymptotic value of dF/dT as T approaches infinity. At that point you can then determine what the factor k must be so that df/dt = k^2*dF/dT would equal 1 at this asymptote. Then use this factor k to rescale all your results in F and T from 'ode45' over to f and t. This way you need only one call on 'ode45'.

Roger Stafford

Subject: Blasius Eqn help

From: Torsten Hennig

Date: 25 Oct, 2010 06:46:33

Message: 6 of 8

> How can I solve a third order nonlinear ODE?
>
> f''' + f * f''=0
> f(0)=0
> f'(0)=0
> f'(infinity)=1

This is a boundary value problem - use bvp4c to solve.

Best wishes
Torsten.

Subject: Blasius Eqn help

From: Roger Stafford

Date: 25 Oct, 2010 12:01:05

Message: 7 of 8

Torsten Hennig <Torsten.Hennig@umsicht.fhg.de> wrote in message <185267398.170772.1287989223431.JavaMail.root@gallium.mathforum.org>...
> > How can I solve a third order nonlinear ODE?
> >
> > f''' + f * f''=0
> > f(0)=0
> > f'(0)=0
> > f'(infinity)=1
>
> This is a boundary value problem - use bvp4c to solve.
>
> Best wishes
> Torsten.
- - - - - - - - - -
  Other than perhaps a tutorial purpose, what is the point in doing that, Torsten, given the nature of the differential equation and two of its initial conditions? If the initial conditions had been other than f(0) = 0 and f'(0) = 0, then, yes, 'bvp4c' or some such would be called for, but as they are, a simple rescaling of both variables makes only one pass through an 'ode' function necessary - no prior estimating solutions necessary. I claim that properly performed rescaling can be an important part of anyone's techniques in solving problems in numerical analysis.

Roger Stafford

Subject: Blasius Eqn help

From: Torsten Hennig

Date: 25 Oct, 2010 14:34:50

Message: 8 of 8

> Torsten Hennig <Torsten.Hennig@umsicht.fhg.de> wrote
> in message
> <185267398.170772.1287989223431.JavaMail.root@gallium.
> mathforum.org>...
> > > How can I solve a third order nonlinear ODE?
> > >
> > > f''' + f * f''=0
> > > f(0)=0
> > > f'(0)=0
> > > f'(infinity)=1
> >
> > This is a boundary value problem - use bvp4c to
> solve.
> >
> > Best wishes
> > Torsten.
> - - - - - - - - - -
> Other than perhaps a tutorial purpose, what is the
> he point in doing that, Torsten, given the nature of
> the differential equation and two of its initial
> conditions? If the initial conditions had been other
> than f(0) = 0 and f'(0) = 0, then, yes, 'bvp4c' or
> some such would be called for, but as they are, a
> simple rescaling of both variables makes only one
> pass through an 'ode' function necessary - no prior
> estimating solutions necessary. I claim that
> properly performed rescaling can be an important part
> of anyone's techniques in solving problems in
> numerical analysis.
>
> Roger Stafford

Now that I took a closer into your solution,
I see that your method is a very elegant way to deal
with this specific BVP.
I simply made the diagnosis: BVP and suggested
BVP4C without taking into account the
problem-specific characteristics.

Best wishes
Torsten.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us