numerical solution of a set of 1st ODE's Watch

demonwolf
Badges: 0
#1
Report Thread starter 13 years ago
#1
Im trying to numerically solve a set of linear 1st order differential equations

like

d³f/dn³ + f*d²f/dn² = 0

making this into a set of three 1st order differential equations

let
y1 = f

let y2 = df/dn

y3 = d²f/dn²

this gives the following equations

dy1/dn = y2

dy2/dn = y3

dy3/dn = -y1*y2

I have to write a program to numerically solve these equations using the boundary conditions f(0) = 0, df(0)/dn = 0, d²f(0)/dn² = -0.6
i can do this for just one 1st ODE eg .. dy/dx = yx

therefore yi+1 = yi + f(xi, yi)*h

but im not sure how to apply this to a set of 1st ODEs .. can anyone help?
0
quote
reply
Mehh
Badges: 8
Rep:
?
#2
Report 13 years ago
#2
(Original post by demonwolf)
Im trying to numerically solve a set of linear 1st order differential equations

like

d³f/dn³ + f*d²f/dn² = 0

making this into a set of three 1st order differential equations

let
y1 = f

let y2 = df/dn

y3 = d²f/dn²

this gives the following equations

dy1/dn = y2

dy2/dn = y3

dy3/dn = -y1*y2

I have to write a program to numerically solve these equations using the boundary conditions f(0) = 0, df(0)/dn = 0, d²f(0)/dn² = -0.6
i can do this for just one 1st ODE eg .. dy/dx = yx

therefore yi+1 = yi + f(xi, yi)*h

but im not sure how to apply this to a set of 1st ODEs .. can anyone help?
Sounds like a linear algebra question.
Okay it seems easy to write this y = [y1,y2,y3].
Now you also have dy/dn = My
Where M is a matrix.
Still with me?

Now using the general result that for the above relationship we have
y(n) = exp(Mn) y(0).
Where y(0) = y where n = 0.

Iff M is diagonlisable ie can be writen as PAP-1
where A is nonzero only on the leading diagonal.
Then exp(Mn) = PBP-1
where B is each element on the leading diagonal is e raised to its corrisponding element in A multiplied by n.

For a better explaination of exp(Mn)
http://mathworld.wolfram.com/MatrixExponential.html
0
quote
reply
demonwolf
Badges: 0
#3
Report Thread starter 13 years ago
#3
The way you have worked out the question is the analytical way of finding the solution. I have to use numerical ways such as Eulers method to find the solution to the set of 1st ODE. numerical ways require i set a step and iteratively integrate over boundary conditions.
0
quote
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • University of Lincoln
    Mini Open Day at the Brayford Campus Undergraduate
    Wed, 19 Dec '18
  • University of East Anglia
    UEA Mini Open Day Undergraduate
    Fri, 4 Jan '19
  • Bournemouth University
    Undergraduate Mini Open Day Undergraduate
    Wed, 9 Jan '19

Were you ever put in isolation at school?

The results of this poll are hidden until the poll closes.

Watched Threads

View All