Quiz 08ode Euler Solution
Quiz 08ode Euler Solution
Euler’s Method
Ordinary Differential Equations
COMPLETE SOLUTION SET
1. To solve the ordinary differential equation
dy
3 + 5 y 2 = sin x, y (0) = 5
dx
by Euler’s method, you need to rewrite the equation as
dy
(A) = sin x − 5 y 2 , y (0) = 5
dx
(B)
dy 1
( )
= sin x − 5 y 2 , y (0) = 5
dx 3
dy 1 ⎛ 5 y3 ⎞
(C) = ⎜⎜ − cos x − ⎟, y (0 ) = 5
dx 3 ⎝ 3 ⎟⎠
dy 1
(D) = sin x, y (0) = 5
dx 3
Solution
The correct answer is (B).
To solve ordinary differential equations by Euler’s method, you need to rewrite the equation in
the following form
dy
= f ( x, y ), y (0) = y0
dx
Thus,
dy
3 + 5 y 2 = sin x, y (0) = 5
dx
dy
3 = sin x − 5 y 2 , y (0) = 5
dx
dy 1
( )
= sin x − 5 y 2 , y (0) = 5
dx 3
2. Given
dy
3 + 5 y 2 = sin x, y (0.3) = 5
dx
and using a step size of h = 0.3 , the value of y (0.9 ) using Euler’s method is most nearly
(A) − 35.318
(B) − 36.458
(C) − 658.91
(D) − 669.05
Solution
The correct answer is (A).
= −7.4704 − 27.847
= −35.318
y2 is the approximate value of y at
x = x2 = x1 + h = 0.6 + 0.3 = 0.9
y (0.9) ≈ −35.318
3. Given
dy
3 + y = e 0.1x , y (0.3) = 5
dx
dy
and using a step size of h = 0.3 , the best estimate of (0.9) using Euler’s method is most
dx
nearly
(A) − 0.37319
(B) − 0.36288
(C) − 0.35381
(D) − 0.34341
Solution
The correct answer is (B).
Thus
(
dy 1 0.1x
dx 3
= e − y )
dy
dx
(
(0.9) ≈ 1 e0.1×0.9 − 4.7647
3
)
= −0.36288
4. The velocity (m/s) of a body is given as a function of time (seconds) by
v(t ) = 200 ln(1 + t ) − t , t ≥ 0
Using Euler’s method with a step size of 5 seconds, the distance traveled in meters by the body
from t = 2 to t = 12 seconds is most nearly
(A) 3133.1
(B) 3939.7
(C) 5638.0
(D) 39397
Solution
The correct answer is (A).
v(t ) = 200 ln (1 + t ) − t
dS
= 200 ln (1 + t ) − t
dt
f (t , S ) = 200 ln (1 + t ) − t
Euler’s method is given by
Si +1 = Si + f (ti , Si )h
where
h = 0.5
For i = 0 , t0 = 2 s , S0 = 0 m (assuming S 0 = 0 m would make S 2 the value of the distance
covered, as the distance covered is S 2 − S 0 )
S1 = S 0 + f (t0 , S 0 )× h
= 0 + f (2,0)× 5
= 0 + (200 ln (1 + 2) − 2 )× 5
= 1088.6 m
t1 = t0 + h
= 2+5
=7
For i = 1 , t1 = 7 s , S1 = 1088.61 m
S 2 = S1 + f (t1 , S1 )× h
= 1088.6 + f (7,1088.6) × 5
= 1088.6 + (200 ln (1 + 7 ) − 7 )× 5
= 1088.6 + 2044.4
= 3133.1 m
S (12) − S (2) ≈ S 2 − S 0
= 3133.1 m
5. Euler’s method can be derived by using the first two terms of the Taylor series of writing the
value of yi +1 , that is the value of y at xi +1 , in terms of yi and all the derivatives of y at xi . If
h = x i +1 − x i , the explicit expression for yi +1 if the first three terms of the Taylor series are
chosen for the ordinary differential equation
dy
2 + 3 y = e −5 x , y (0) = 7
dx
would be
1
(
(A) yi +1 = yi + e − 5 xi − 3 yi h
2
)
1
( 1⎛5
) ⎞
(B) yi+1 = yi + e −5 xi − 3 yi h − ⎜ e −5 xi ⎟h 2
2 2⎝2 ⎠
1
( )
1 ⎛ 13 9 ⎞
(C) yi+1 = yi + e −5 xi − 3 yi h + ⎜ − e −5 xi + yi ⎟h 2
2 2⎝ 4 4 ⎠
1
2
( 3
)
(D) yi+1 = yi + e −5 xi − 3 yi h − yi h 2
2
Solution
The correct answer is (C).
1
(
f ( x, y ) = e −5 x − 3 y
2
)
The Taylor series is given by
2 3
y i +1 = y i +
dy
(xi +1 − xi ) + 1 d 2y (xi +1 − xi )2 + 1 d y
3
(xi +1 − xi )3 + ...
dx xi , yi 2! dx xi , y i
3! dx xi , yi
1 1
y i +1 = y i + f ( xi , yi )( xi +1 − xi ) +
f ' ( xi , yi )( xi +1 − xi ) + f ' ' ( xi , y i )( xi +1 − xi ) + ...
2 3
2! 3!
If we look at the first three terms of the Taylor series
1
yi+1 = yi + f ( xi , yi )( xi+1 − xi ) + f ' ( xi , yi )( xi+1 − xi )
2
2!
1
= yi + f ( xi , yi )h + f ' ( xi , yi )h 2
2!
where
h = xi+1 − xi
∂f ∂f dy
f ′( x, y ) = +
∂x ∂y dx
1
2
= ( )
⎛ 3 ⎞⎛ 1
( )
⎞
− 5e −5 x + ⎜ − ⎟⎜ e −5 x − 3 y ⎟
⎝ 2 ⎠⎝ 2 ⎠
13 9
= − e −5 x + y
4 4
then the value of yi+1 is given by
yi+1 = yi +
2
(
1 −5 xi
)1 ⎛ 13 9 ⎞
e − 3 yi h + ⎜ − e −5 xi + yi ⎟h 2
2⎝ 4 4 ⎠
6. A homicide victim is found at 6:00 PM in an office building that is maintained at 72 °F.
When the victim was found, his body temperature was at 85 °F. Three hours later at 9:00 PM,
his body temperature was recorded at 78 °F. Assume the temperature of the body at the time
of death is the normal human body temperature of 98.6 °F.
The governing equation for the temperature θ of the body is
dθ
= −k (θ − θ a )
dt
where
θ = temperature of the body, °F
θa = ambient temperature, °F
t = time, hours
k = constant based on thermal properties of the body and air
The estimated time of death most nearly is
(A) 2:11 PM
(B) 3:13 PM
(C) 4:34 PM
(D) 5:12 PM
Solution
The correct answer is (B).
dθ
= −k (θ − θ a )
dt
dθ
+ kθ = kθ a
dt
The characteristic equation of the above ordinary differential equations is
r+k = 0
The solution to this equation is
r = −k
θ H = Ae −kt
(D + k )θ = kθ a
The particular solution is of the form
θP = B
Substituting this solution in the ordinary differential equation,
0 + kB = kθ a
B = θa
The complete solution is
θ = θH + θP
= Ae −kt + θ a
Given
θ a = 72
and using 12 noon as the reference time of t = 0 ,
θ (6 ) = 85
θ (9) = 78
θ (B ) = 98.6
where
B = time of death
we get
85 = Ae −k×6 + 72 (1)
78 = Ae −k×9 + 72 (2)
98.6 = Ae − k ×B + 72 (3)
Use Equations (1) and (2) to find A and k.
85 = Ae − k×6 + 72
(4)
Ae −k×6 = 13
78 = Ae − k×9 + 72
(5)
Ae −k×9 = 6
Dividing Equation (4) by Equation (5) gives
Ae − k 6 13
=
Ae −k 9 6
e = 2.1667
3k
1
k = (ln (2.1667 ))
3
1
= 0.25773
hours
Knowing the value of k, from Equation (5)
A = 61.028 °F
Substitute k and A into Equation (3) to find B.
98.6 = Ae − k×B + 72
98.6 = 61.028e −0.25773×B + 72
26.6 = 61.028e −0.25773×B
ln 26.6 = ln 61.028 + (− 0.25773B )
0.25773B = 0.83042
B = 3.2220 hours
Note to the student:
You can also do the problem by assuming that the initial time reference is zero, and that the
temperature then is θ (0) = 98.6 . Then the temperature is given at the time the body was found
as θ (C ) = 85 °F, and that θ (C + 3) = 78 °F. You can now find k, A and C just like as given
above. The value of C in fact is the time between the body was found and the time of death.
You will get C = 2.7780 hrs.
The time of death is 3.2220 hrs from 12 noon, that is 3 : (0.2220 × 60) PM = 3:13 PM.