You are on page 1of 1

King Fahd University of Petroleum & Minerals

Chemical Engineering Department


CHE 560 –Numerical Methods in Chemical Engineering
2018 - 2019 (182)

HW#5
Due: Tue. 19-Feb-2019

For the problem you have solved in the previous assignment:

𝑑𝑦1
= −𝑦2 𝑦10.5 − ∅ 𝑦3 𝑦10.5
𝑑𝑥

𝑑𝑦2
= −𝑦2 𝑦10.5
𝑑𝑥

𝑑𝑦3
= 𝑦2 𝑦10.5 − ∅ 𝑦3 𝑦10.5
𝑑𝑥

𝑥 = 0, 𝑦1 = 1, 𝑦2 = 0.5 𝑎𝑛𝑑 𝑦3 = 0

Using  = 0.55 and h = 0.1, modify the MATLAB code IVP.m to solve this problem for the
following three methods:

a) (20 points) 2nd-order explicit Adams-Bashford method, (send this code as


lastname_HW5_a.m):
𝑦𝑛+1 − 𝑦𝑛 3 1
= 𝑓𝑛 − 𝑓𝑛−1
ℎ 2 2

b) (20 points) 4th-oder Rung-Kutta method, (send this code as lastname_HW5_b.m):

yn 1  yn 
1
k1  k4   1 b k2  d k3 
6 3
k1  h f t n , yn 
 h 1 
k 2  h f  t n  , yn  k1 
 2 2 
 h 
k3  h f  t n  , yn  a k1  b k 2 
 2 
 h 
k 4  h f  t n  , yn  c k 2  d k3 
 2 
2 1 2 2  2 2
a , b , c , d  1
2 2 2 2

c) (10 points) Ode45 built-in solver, (send this code as lastname_HW5_c.m).

You might also like