Professional Documents
Culture Documents
05
On Solving Higher Order Equations
for Ordinary Differential Equations
d n 1 y dz n 1
(3.n)
=
= zn
dx
dx n 1
d n y dzn
=
dx n
dx
1
d n 1 y
dy
= an 1 n 1 a1
a0 y + f ( x )
an
dx
dx
1
(3.n+1)
( a n1 z n a1 z 2 a0 z1 + f (x ))
an
The above Equations from (3.1) to (3.n+1) represent n first order differential equations as
follows
08.05.1
08.05.2
Chapter 08.05
dz1
(4.1)
= z 2 = f 1 ( z1 , z 2 , , x )
dx
dz 2
(4.2)
= z 3 = f 2 ( z1 , z 2 , , x )
dx
dz n
1
( a n1 z n a1 z 2 a0 z1 + f (x ))
(4.n)
=
dx
an
Each of the n first order ordinary differential equations are accompanied by one initial
condition. These first order ordinary differential equations are simultaneous in nature but can
be solved by the methods used for solving first order ordinary differential equations that we
have already learned.
Example 1
Rewrite the following differential equation as a set of first order differential equations.
d2y
dy
3 2 + 2 + 5 y = e x , y (0) = 5, y (0) = 7
dx
dx
Solution
The ordinary differential equation would be rewritten as follows. Assume
dy
= z,
dx
Then
d 2 y dz
=
dx 2 dx
Substituting this in the given second order ordinary differential equation gives
dz
3 + 2z + 5 y = e x
dx
dz 1 x
= (e 2 z 5 y )
dx 3
The set of two simultaneous first order ordinary differential equations complete with the
initial conditions then is
dy
= z, y (0) = 5
dx
dz 1 x
= (e 2 z 5 y ), z (0) = 7 .
dx 3
Now one can apply any of the numerical methods used for solving first order ordinary
differential equations.
Example 2
Given
d2y
dy
dy
(0) = 2 , find by Eulers method
+ 2 + y = e t , y (0) = 1,
2
dt
dt
dt
a) y (0.75)
08.05.3
b) the absolute relative true error for part(a), if y (0.75) exact = 1.668
dy
(0.75)
dt
Use a step size of h = 0.25 .
Solution
c)
First, the second order differential equation is written as two simultaneous first-order
differential equations as follows. Assume
dy
=z
dt
then
dz
+ 2 z + y = e t
dt
dz
= e t 2 z y
dt
So the two simultaneous first order differential equations are
dy
(E2.1)
= z = f1 (t,y,z ), y (0) = 1
dt
dz
(E2.2)
= e t 2 z y = f 2 (t , y , z ), z (0) = 2
dt
Using Eulers method on Equations (E2.1) and (E2.2), we get
(E2.3)
y i +1 = y i + f1 (t i , y i , z i )h
(E2.4)
z i +1 = z i + f 2 (t i , yi , z i )h
a) To find the value of y (0.75) and since we are using a step size of 0.25 and starting at
t = 0 , we need to take three steps to find the value of y (0.75) .
For i = 0, t0 = 0, y0 = 1, z0 = 2 ,
From Equation (E2.3)
y1 = y 0 + f 1 (t 0 , y 0 , z 0 )h
= 1 + f1 (0,1,2 )(0.25)
= 1 + 2(0.25)
= 1.5
y1 is the approximate value of y at
t = t1 = t 0 + h = 0 + 0.25 = 0.25
y1 = y (0.25) 1.5
From Equation (E2.4)
z1 = z 0 + f 2 (t 0 , y 0 , z 0 )h
= 2 + f 2 (0,1,2 )(0.25)
= 2 + (e 0 2(2) 1)(0.25)
=1
dy
) at t = 0.25
dt
08.05.4
Chapter 08.05
z1 = z (0.25) 1
For i = 1, t1 = 0.25, y1 = 1.5, z1 = 1 ,
From Equation (E2.3)
y 2 = y1 + f 1 (t1 , y1 , z1 )h
= 1.5 + f 1 (0.25,1.5,1)(0.25)
= 1.5 + (1)(0.25)
= 1.75
y 2 is the approximate value of y at
t = t 2 = t1 + h = 0.25 + 0.25 = 0.50
y 2 = y (0.5) 1.75
From Equation (E2.4)
z 2 = z1 + f 2 (t1 , y1 , z1 )h
= 1 + f 2 (0.25,1.5,1)(0.25)
= 1 + (e 0.25 2(1) 1.5)(0.25)
= 1 + ( 2.7211)(0.25)
= 0.31970
z2 is the approximate value of z at
t = t 2 = 0.5
z2 = z (0.5) 0.3197 0
For i = 2, t2 = 0.5, y2 = 1.75, z2 = 0.31970 ,
From Equation (E2.3)
y 3 = y 2 + f1 (t 2 , y 2 , z 2 )h
= 1.75 + f1 (0.50,1.75,0.31970)(0.25)
= 1.75 + (0.31970)(0.25)
= 1.8299
y3 is the approximate value of y at
t = t 3 = t 2 + h = 0.5 + 0.25 = 0.75
y 3 = y (0.75) 1.8299
From Equation (E2.4)
z 3 = z 2 + f 2 (t 2 , y 2 , z 2 )h
= 0.31972 + f 2 (0.50,1.75,0.31970)(0.25)
= 0.31972 + (e 0.50 2(0.31970) 1.75)(0.25)
= 0.31972 + ( 1.7829 )(0.25)
= 0.1260
z 3 is the approximate value of z at
t = t 3 = 0.75
z 3 = z (0.75) 0.12601
y (0.75) y3 = 1.8299
08.05.5
k 2y = f 1 t i + h, y i + hk 1y , z i + hk 1z
1 z
z i +1 = z i +
k 1 + k 2z h
2
(E 3.4b)
(E3.5)
08.05.6
Chapter 08.05
k 1z = f 2 (t i , y i , z i )
z
2
y
1
k = f 2 t i + h, y i + hk , z i + hk
For i = 0, to = 0, yo = 1, zo = 2
From Equation (E3.4a)
k1y = f 1 (t o , y o , z o )
z
1
= f1 (0,1,2)
=2
From Equation (E3.6a)
k1z = f 2 (t 0 , y 0 , z 0 )
= f 2 (0,1,2)
= e 0 2(2) 1
= -4
From Equation (E3.4b)
k2y = f1 (t0 + h, y0 + hk1y , z0 + hk1z )
= f 1 (0 + 0.25,1 + (0.25)(2 ),2 + (0.25)( 4 ))
= f 1 (0.25,1.5,1)
=1
From Equation (E3.6b)
k 2z = f 2 (t 0 + h, y 0 + hk1y , z 0 + hk1z )
= f 2 (0 + 0.25,1 + (0.25)(2 ),2 + (0.25)( 4 ))
= f 2 (0.25,1.5,1)
= e 0.25 2(1) 1.5
= 2.7212
From Equation (E3.3)
1
y1 = y 0 + k1y + k 2y h
2
1
= 1 + (2 + 1)(0.25)
2
= 1.375
y1 is the approximate value of y at
t = t1 = t 0 + h = 0 + 0.25 = 0.25
y1 = y (0.25) 1.375
From Equation (E3.5)
1
z1 = z 0 + (k1z + k 2z )h
2
1
= 2 + ( 4 + ( 2.7212))(0.25)
2
= 1.1598
z1 is the approximate value of z at
t = t1 = 0.25
(E3.6a)
(E3.6b)
z1 = z (0.25) 1.1598
For i = 1, t1 = 0.25, y1 = 1.375, z1 = 1.1598
From Equation (E3.4a)
k1y = f1 (t1 , y1 , z1 )
= f1 (0.25,1.375,1.1598)
= 1.1598
From Equation (E3.6a)
k1z = f 2 (t1 , y1 , z1 )
= f 2 (0.25,1.375,1.1598)
= e 0.25 2(1.1598) 1.375
= 2.9158
From Equation (E3.4b)
k2y = f1 (t1 + h, y1 + hk1y , z1 + hk1z )
= f1 (0.25 + 0.25,1.375 + (0.25)(1.1598),1.1598 + (0.25)( 2.9158))
= f1 (0.50,1.6649,0.43087 )
= 0.43087
From Equation (E3.6b)
k 2z = f 2 (t1 + h, y1 + hk1y , z1 + hk1z )
= f 2 (0.25 + 0.25,1.375 + (0.25)(1.1598),1.1598 + (0.25)( 2.9158))
= f 2 (0.50,1.6649,0.43087 )
= e 0.50 2(0.43087 ) 1.6649
= 1.9201
From Equation (E3.3)
1
y 2 = y1 + (k1y + k 2y )h
2
1
= 1.375 + (1.1598 + 0.43087 )(0.25)
2
= 1.5738
y 2 is the approximate value of y at
t = t 2 = t1 + h = 0.25 + 0.25 = 0.50
y2 = y (0.50) 1.5738
From Equation (E3.5)
1
z 2 = z1 + (k1z + k 2z )h
2
1
= 1.1598 + (2.9158 + (1.9201))(0.25)
2
= 0.55533
z 2 is the approximate value of z at
t = t 2 = 0.50
z2 = z (0.50) 0.55533
08.05.7
08.05.8
Chapter 08.05
08.05.9
1.1598
0.55533
1.1598
0.55533
4
1
2.9158
2.0779
0.43087
0.035836
y
1
z
1
y
2
z
2
k
yi +1
2.7211
1.9201
1.3119
1.3750
1.5738
1.6477
zi +1
1.1598
0.55533
0.13158