100% found this document useful (1 vote)
637 views

Chapter-8 ODE PDF

The document discusses numerical methods for solving ordinary differential equations (ODEs). It covers Euler's method, a one-step numerical method where the slope at the beginning of each interval is used to approximate the solution over that interval. Errors in Euler's method come from truncating the Taylor series expansion used to derive it. The error can be reduced by decreasing the interval size h. The document also introduces multi-step methods like Runge-Kutta that can provide more accurate solutions than Euler's method.

Uploaded by

Vany Braun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
637 views

Chapter-8 ODE PDF

The document discusses numerical methods for solving ordinary differential equations (ODEs). It covers Euler's method, a one-step numerical method where the slope at the beginning of each interval is used to approximate the solution over that interval. Errors in Euler's method come from truncating the Taylor series expansion used to derive it. The error can be reduced by decreasing the interval size h. The document also introduces multi-step methods like Runge-Kutta that can provide more accurate solutions than Euler's method.

Uploaded by

Vany Braun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

CHAPTER 8

ORDINARY DIFFERENTIAL
EQUATIONS (ODE)
Chapter 8 : TOPIC COVERS
(ORDINARY DIFFERENTIAL EQUATIONS)

 Euler’s Method and Modifications

 Runge-Kutta Methods

 Systems Of Equation Problem Solving

 Heun’s Method

 Application in Chemical Engineering


LEARNING OUTCOMES
INTRODUCTION
It is expected that students will be able to:

 Indicate the visual representation of Euler’s, Heun’s and the midpoint methods
 Clarify the relationship of Euler’s method to the Taylor series expansion
 Define the basis of predictor-corrector methods and realize that the efficiency
of the corrector is highly dependent on the accuracy of the predictor
 Derive second-order RK method and how it relates to the Taylor series
expansion
• Apply any of the RK methods to systems of equation
• Application in Chemical Engineering
CHAPTER 8: ORDINARY DIFFERENTIAL EQUATIONS (ODE)
8.1 Introduction

In Chapter 1, we have Newton's Second Law of falling parachutist;

dv cV
g - - - - - - - - (1)
dt m
where; g = gravitational constant
m = mass
c = drag coefficient
dv/dt = unknown function/differential equation (rate equation)
We called as rate equation because express the rate of change of a variable.
From equation (1), V = dependent variable
t = independent variable
When function involves one independent variable, the equation is called Ordinary
Differential Equation (ODE).
Partial Differential Equation (PDE); involves two or more independent
variables.
The fundamental laws of physics, mechanics, electricity, and
thermodynamics are usually based on empirical (experimentally)
observations that explain variations in physical properties and states of
systems.
The laws are usually expressed in terms of spatial (space) and temporal
(time) changes.
As shown in Table 1: These laws define mechanisms of change. When
combined with continuity laws for energy, mass or momentum, resulting in
differentiation equation. Subsequent, by integration of these differential
equations results in mathematical functions.
For example: Recall Newton's second law of falling parachutist was used to
develop an ODE. By integrating this relationship, we obtained an equation
to predict fall velocity as a function of time (see Fig.7.1).
However, as described in previous chapter, many of differential equations of practical
significant cannot be solve using analytical methods of calculus.
Thus, in this chapters are important as Numerical approaches for solving engineering
application.
Table 1: Examples of fundamental laws in terms of rate of change of variables (t = time,
x = position)

Law Mathematical expression Variables & Parameters

dv F V=velocity
Newton’s 2nd
Law of motion
 F=force
m=mass
dt m
q=heat flux
dT
Fourier’s heat law q  k ' k’=thermal conductivity
T=temp.
dx
Fick’s law of dc J=mass flux
Diffusion J  D D=diffusion coefficient
dx c=concentration
di VL=voltage drop
Faraday’s law V L  L L=inductance
dt i=current
Fig. 8.1: Application of ODE’s for engineering problem solving.

F  ma (Physical Law)

dv c
 g  v (ODE)
 dt m

Analytical Numerical


gm c
v (1  e ( c / m )t ) vi 1  vi  ( g  vi )t
c m

SOLUTION SOLUTION
8.2 One-Step Method

To solve ODE's in the form of;


dy/dx = f(x,y) ------ (2)
In previous chapter, we used a numerical method to solve such an equation for the
velocity of the falling parachutist.
Let equation (2) in general form;
New value = old value + slope x (step size)
or, in mathematical terms,
yi+1 = yi + h ------ (3)
where, yi+1 = new value
yi = old value
h = step size
 = slope; extrapolation from yi to yi+1 over a distance h (Fig. 8.2)
This formula can be applied step by step to compute the final results.
Fig. 8.2: One-step method
8.3 Euler's Method
This method is follow the approximation of Taylor’s expansion.
The slope at the beginning of the interval is taken as an approximation
of the average slope over the whole interval. The first derivative
provides a direct estimate of the slope at xi.
Slope at xi ;

  f ( xi , yi ) ------- (4)
where ;
f ( xi , yi ) = differential equation evaluated at xi and yi

Then, equation (4) substituted into equation (3);

yi 1  yi  f ( xi , yi )h ------- (5)

We called equation (5) as Euler’s Method or point-slope method.


A new value of y is predicted using the slope (equal to the derivative at
the original value of x) to extrapolate linearly over the step size h as
shown in Fig. 8.3.

Fig. 8.3: Euler’s Method


Example 1: Euler’s Method (Point-slope method)
Use Euler’s method to numerically integrate;
dy
 2 x 3  12 x 2  20 x  8.5
dx
from x = 0 to x = 4 with a step size of 0.5. Initial condition at x = 0 is
y = 1. Exact solution is given as;
y = -0.5x4 + 4x3 – 10x2 + 8.5x + 1

Solution:
From Euler’s method equation; yi 1  yi  f ( xi , yi )h
Substituted all the data given;
y(0.5) = y(0) + f(0,1)0.5 equation of Euler’s method
where; y(0) = 1,
and the slope at x = 0 is,
f(0,1) = -2(0)3 + 12 (0)2 + 20(0) + 8.5 = 8.5
Thus; y(0.5) = 1.0 + 8.5(0.5) = 5.25
True solution at x = 0.5 ;
y = -0.5(0.5)4 + 4(0.5)3 – 10(0.5)2 + 8.5(0.5) + 1
= 3.21875

Thus, true error is ;


Et = true – approximate
= 3.21875 – 5.25 = -2.03125
or expressed as percentage relative error,
t = -63.1%

For the second step;


y(1) = y(0.5) + f(0.5, 5.25)0.5
= 5.25 + [-2(0.5)3 + 12(0.5)2 – 12(0.5) + 8.5]0.5
= 5.875

The true solution at x = 1.0 is 3.0, and therefore, the percentage relative
error is –95.8%.
The computation is repeated, and the results are complied in Table 2 and Fig. 8.4
Although the computation captures the general trend of the true solution, the
error is considerable.
As discussed in the next section, this error can be reduced by using a smaller step
size.
Table 2: Comparison true and approximation values
x ytrue yEuler t %Global t %Local

0.0 1.000 1.000


0.5 3.21875 5.250 -63.1 -63.1
1.0 3.000 5.875 -95.8 -128.0
1.5 2.21875 5.125 131.0 -1.41
2.0 2.000 4.500 -125.0 20.5
2.5 2.71875 4.7500 -74.7 17.3
3.0 4.000 5.8750 46.9 4.0
3.5 4.71875 7.1250 -51.0 -11.3
4.0 3.000 7.000 -133.3 -53.0

Note: Global error is the total differences between past and present steps.
Local error is calculated with a Taylor series expansion (shows by Example 25.2 in
the Text book)
Fig. 8.4a: Comparison of curve true
solution with numerical
solution using Euler’s Method (with
step size h = 0.5)
Fig. 8.4b: Comparison of curve
true solution with numerical
solution using Euler’s Method
with different step size (h)
0.25 and 0.5
8.4 Error Analysis for Euler’s Method

Numerical solution of ODEs’ involves 2 type of error:


a. Truncation error: caused by the nature of the techniques employed to
approximate values of y.
b. Round-off error: caused by the limited numbers of significant digits that can
be retained by a computer.

Truncation errors composed of 2 parts;


i. Local truncation error: result from a single step method.
ii. Propagated truncation error: results from a previous steps.

Sum of the two truncation errors is called as Global or Total Truncation Error.

Magnitude and properties of truncation error can be gained by deriving Euler's


method, i.e Taylor series expansion.
To calculate error in Euler’s Method:
From the differential equation being integrated in general form;
y' = f (x, y) ------- (1)
where; y' = dy/dx ; x = independent variable
y = dependent variable
From Taylor series expansion;
yi" 2 yi( n ) n
yi 1  yi  y h  h  ...... 
'
i h  Rn    (2)
2! n!
where;
h  xi 1  xi
y ( n1)
Rn  ( )h n1    (3)
(n  1)!
where;  Lies somewhere in the
interval from xi to x i+1
Then substituting equation (1) into equation (2) and (3) to yield;

f ' ( xi , yi ) 2 f ( n1) ( xi , yi )h n
yi 1  yi  f ( xi , yi )h  h  .......   0(h n1 )    (4)
2! n!
where; 0(hn+1) = local truncation error which is proportional to step size raised to the
(n+1)’th power
Equation (4) substituted into Euler’s Method equation (to calculate true local
truncation error for Euler Method);

f ' ( xi , yi ) 2
Et  h  ......  0(h h 1 )    (5)
2!
where; Et = true local truncation error
For small of h ; (eliminated term 0(hh+1)
f ' ( xi , yi ) 2
Ea  h    (6)
2!
or
Ea  0(h 2 )    (7)
where; Ea = approximate local truncation error
Example 2: Taylor Series Estimate for Error of Euler's Method.
Use the true local truncation error to estimate the error of the 1st step of
Example 1. Also use it to determine the error due to each higher-order
term of the Taylor Series expansion.

Solution:
Since we have polynomial equation, we use Taylor Series to obtain exact
estimate of the errors in Euler’s Method;
From equation (5)
f ' ( xi , yi ) 2 f " ( xi , yi ) 3 f (3) ( xi , yi ) 4
Et  h  h  h
2! 3! 4!
where; f’ (xi , yi ) = first derivative of the differential
equation (2nd derivative of the solution)
From Example 1; dy/dx = -2x3 + 12x2 –20x + 8.5
Thus; f’ (xi , yi ) = -6x2 + 24x - 20
f’’ (xi , yi ) = -12x + 24
f3 (xi , yi ) = -12
We ignore 4th and higher derivative because in this case they equal to zero.
Thus; Error due to truncation :
i. For second-order term; 1st derivative

f ' ( xi , yi ) 2
Et , 2  h
2!
 6(0) 2  24(0)  20
Et , 2  (0.5) 2  2.5
2
ii. For third-order term;
f " ( xi , yi ) 3
Et ,3  h
3!
 12(0)  24
Et ,3  (0.5)3  0.5
6
iii. For fourth-order term;

f (3) ( xi , yi ) 4
Et , 4  h
4!
 12
Et , 4  (0.5) 4  0.03125
24

Added all local truncation error to yield total truncation error;

Et  Et , 2  Et ,3  Et , 4
 2.5  0.5  0.03125
 2.03125

The value of Et = -2.03125 is exactly the error in the initial step of Example 1.
8.5 Improvements of Euler's Method
Can be divided into 2 types;
a. Huen's Method
b. Mid-point Method (Improve Polygon Method)

8.5.1 Huen's Method


To improve the estimate of the slope.
Involves the determination of two derivatives (slopes) for the interval (h) at;
i. Initial Point
ii. End Point
Then the two derivatives are averaged to obtain an improved estimate of
the slope for the entire interval, h.
Recall Euler's Method; slop at beginning an interval;
y'i = f (xi , yi ) -------- (8)
Used to extrapolate linearly to yi+1 ;
yio1  yi  f ( xi , yi )h    (9) Predictor equation

Note: for Euler's method we would stop at this point;


However in Huen's Method yoi+1 is an intermediate prediction.
Thus, equation (9) is called as Predictor equation.
From equation (9); provide to calculate slope at the end of interval:
y’ i+1= f (xi+1 , yoi+1 ) ------- (10)

An average slope for interval (equation 8 and 10)

 yi'  y 'i 1
y' 
2
f ( xi , yi )  f ( xi 1 , y o i 1 )
    (11)
2
From an average slope of equation (11), extrapolate linearly from yi to
yi+1 using Euler’s Method: yi 1  yi  f ( xi , yi )h

f ( xi , yi )  f ( xi 1 , y o i 1 )
yi 1  yi  h    (12)
2

Equation (12) is called as Corrector Equation


where the Huen Method is a predictor-corrector approach.
Fig. 7.5a shows the predictor approach (equation 9), and Fig. 7.5b shows
the corrector equation (equation 12).
Fig. 8.5: (a) Predictor of Huen’s Method
(b) Corrector of Huen’s Method
Termination Criterion:

j 1
y j
y
a  i 1 i 1
 100%
yij1

where; yij1  Result from present iteration of corrector

yij11  Result from previous iteration of corrector


Example 3 :
Use Huen’s method to integrate y’=4e 0.8x–0.5y ;from x = 0 to x = 4 with a
step size of 1.0. The initial condition at x = 0 is y = 2.

Solution: Analytical solution for integral equation;


y’=4e 0.8x–0.5y is;

4 0.8 x 0.5 x
y (e  e )  2e 0.5 x
1.3

This formula can be used to calculate true value/solution as shown in


table below;
(1 iteration each step) (15 iteration each step)
x ytrue yHeun t% yHeun  t%
0 2.000 2.000 0.00 2.000 0.00
1 6.1946314 6.7010819 8.18 6.3608655 2.68
2 14.8439219 16.3197819 9.94 15.3022367 3.09
3 33.6771718 37.1992489 10.46 34.7432761 3.17
4 75.3389626 83.3377674 10.62 77.7350962 3.18
To calculate yHeun ; as Numerical Approach;
Given initial value; xi = 0, yi = 2
Predictor (equation 9): yoi+1 = yi + f(xi , yi )h
= 2 + (1)

Step 1: f(xi , yi ) = f(0 , 2) = slope at point (xi , yi )


y’=4e 0.8x–0.5y
= 4e 0.8(0) – 0.5(2)
= 4-1 = 3

Step 2: predictor equation (9);


yoi+1 = yi + f(xi , yi )h
= 2 + (1)
yo1 = 2 + 3(1) = 5
Thus, next point: xi+1 = 1 (step size 1.0), yi+1 = 5
Step 3 : f(xi+1 , yoi+1 )= f(1 , 5) = slope at point (xi+1 ,yoi+1)
y’=4e 0.8x–0.5y
y’=4e 0.8(1)–0.5(5) = 6.402164
Step 4 : average slope

 f ( xi , yi )  f ( xi 1 , y o i 1 )
y' 
2
 (3)  (6.402164)
y'   4.701082
2
Step 5 : Corrector (equation 12);
f ( xi , yi )  f ( xi 1 , y o i 1 ) or
yi 1  yi  h    (12)
2 y1  yo  h
 2  4.701082(1)
 6.701082
Thus; 6.1946314  6.701082
t %  100%
6.1946314
True value
 8.18%
Step 6 : repeat step 3 through step 5
Step 3: f(xi+1 , yi+1) = f(1 , 6.701082)
= 4e 0.8(1) - 0.5 (6.701082)
= 5.551622714
Step 4 : slope average;

 3  5.551622714
y'   4.275811357
2
Step 5: corrector equation;
y1 = yo + h
= 2 + 4.275811357(1)
= 6.275811357
Thus; 6.1946314  6.275811
t %  100%
6.1946314
 1.31%

Again, repeat step 3 to step 5:

 3  4e 0.8(1)  0.5(6.2758(1) 
y1  2    (1)
 2 
 6.382129
thus;
 t %  3.03

t% increasing when iteration increase. It happen especially for large step
size. For small step size, the iteration coverage (directing) on a single value.
For our case, if step 3 to 5 are repeated at iteration 15;
We get y1 = 6.3608655 and εt% = 2.68
Fig. 8.7: Comparison of true
solution with numerical solution
using Euler's and Heun's method for
y' = -2x3+12x2 -20x +8.5
8.5.2 Midpoint Method (Improved Polygon Method)

Fig. 8.8(a) show the Midpoint Method as modification of Euler's method.


This technique uses Euler's method to predict a value of y at midpoint of
interval as shown in Fig. 7.8(b).
Thus the new value of y;
h
y 1  yi  f ( xi , yi ) - - - - - (13)
i 2
2

Then, this predicted value is used to calculate a slope at the midpoint:

y   f (x ,y )
1 1 1
i i i
2 2 2

which is assumed to represent a valid approximation of the average slope


for the entire interval. This slope is then used to extrapolate linearly from
xi to xi+1 (Fig. 8.8b)

yi 1  yi  f ( x 1 ,y 1 )h    (14)
i i
2 2
Fig. 8.8: Mid-point method for
equation (13&14)

Note: because yi+1 is not both sides,


the corrector (equation 12) cannot
be applied iteratively to improve
the solution
Example 4: Use Midpoint method to solve this equation;

y  y x 2 1.2y
for range x = 0 to 2 and h = 0.5 where y(0) = 1 (initial values).

Solution:
At, x = 0, y = 1

x = 0.5 (step size, h = 0.5)
h
(a) y 1  y i f (x i , y i )
i
2
2
0.5
y 1  1 f (0,1)
i
2
2
f (0,1)  (1)(0) 2 1.2(1)  1.2
0.5
y 1  1 (1.2)  0.7
i
2
2
(b) slope:

y   f (x ,y )  f (0.25,0.7)
1 1 1
i i i
2 2 2

f (0.25,0.7)  (0.7)(0.25) 2 1.2(0.7)  0.79625

(c) y i+1

y i1  y i  f (x 1 ,y 1 )h
i i
2 2

y i1  1 (0.79625)(0.5)  0.601875

. . . . Repeat steps (a) through (c) for a range x = 0 to 2 with step size, h = 0.5
8.6 Runge-Kutta Method (RK method)

RK methods achieve the accuracy of a Taylor series approach without requiring


the calculation of higher derivatives.
General equation for RK method;
yi+1 = yi + (xi , yi , h)h ------- (15)
where; (xi , yi , h) = increment function
= slope over the interval
The increment function can be written as;
 = a1k1 + a2k2 + ........ +ankn ----- (16)
where; a = constant
k's are ; k1 = f (xi , yi) --------- (17)
k2 = f (xi + p1h , yi + qIIkIh) ---- (18)
k3 = f (xi + p2h , yi + q21k1h + q22k2h) ---- (19)
:
:
kn = f (xi + pn-1h , yi + qn-1,1k1h + qn-1,2k2h +.......+qn-1,n-1 kn-1h) ------ (20)
p’s and q’s are constants
Note : k's are recurrence relationship;
i.e k1 appears in equation for k2
k2 appears in equation for k3 and so forth.
This recurrence makes RK methods efficient for computer calculations.
Various types of RK methods depends on the increment function of "n"
For example (in next section), 2nd order RK method use an increment
function with two terms; n = 2
8.6.1 Second order RK method

The 2nd order version extracted from equation (15)


yi+1 = yi + (a1k1 + a2k2)h ------ (21)
where;
k1 = f (xi , yi) ------ (21a)
k2 = f (xi + p1h , yi + q11kIh) ------- (21b)
Values for a1, a2, p1 and q11 are evaluated by setting equation (21) equal to Taylor
series expansion to the 2nd order term.
By doing this, we derive 3 equations to evaluate 4 unknown constants;
The 3 equations are set as;
a1 + a2 = 1 ----- (22)
a1p1= 1/2 ------ (23)
a2q11 = 1/2 ----- (24)
Because we have 3 equations with 4 unknowns, we must assume a value of one
of the unknown to determine the other three.
Suppose, we assume a value for a2.
Then equation (22) through (24) can be solved simultaneously.
a1 = 1 - a2 ------- (25)
p1 = q11 = 1/2a2 -------- (26)
Because we can choose an infinite number of values for a2, there are an
infinite number of 2nd order RK methods.
Would yield exact results if the solution to the ODE were quadratic, linear or
constant.
However, these results varies when the solution is more complicated.
Thus, 3 different methods were introduced for solution;
a. Heun method with a single corrector (assume a2 = 1/2 )
b. Midpoint / Improve Polygon method (assume a2 = 1 )
c. Ralston's method (assume a2 = 2/3 )
a. Heun method with a single corrector
(assume a2 = 1/2)
If a2 is assumed to be 1/2 ,Equations (25) and (26) can be solved;
a1 = 1/2 ----- (27)
p1 = q11 = 1 -------- (28)
Substituted into equation (15) to yield;
yi+1 = yi + (1/2k1 + 1/2k2)h ----- (29)
where; k1 = f (xi , yi) ------- (29a)
k2 = f (xi + h , yi + k1h) ------ (29b)
Note : k1 = slope at beginning of the interval
k2 = slope at the end of the interval

This 2nd order RK method actually is the Heun's technique without iteration.
b. Midpoint / Improve Polygon method
(assume a2 = 1)
If a2 is assumed to be 1.0 from equation (25) and (26) can be solved;
a1 = 0 ----- (30)
p1 = q11 = 1/2 -------- (31)
Substituted into equation (15) to yield;
yi+1 = yi + k2h ----- (32)
where; k1 = f (xi , yi) ------- (32a)
k2 = f (xi + 1/2h , yi + 1/2k1h) ------ (32b)
c. Ralston's method (assume a2 = 2/3)
If a2 is assumed to be 1/2 from equation (25) and (26) can be solved;
a1 = 1/3 ----- (33)
p1 = q11 = 3/4 -------- (34)

Substituted into equation (15) to yield;


yi+1 = yi + (1/3k1 + 2/3k2)h ----- (35)
where; k1 = f (xi , yi) ------- (35a)
k2 = f (xi + 3/4h , yi + 3/4k1h) ------ (35b)
Example 5: Comparison of various 2nd order of RK method
Use 2nd order RK method of Heun's, Midpoint, and Ralston's methods for integrate:
y' = -2x3+12x2 -20x +8.5
from x = 0 to x = 4 using a step size of 0.5. Initial condition at x = 0 is y = 1.0
Solution:
a. Heun method (a2 = 1/2)
To calculate k's values:
k1 = f (xi , yi) ------- (29a)
= f (0 , 1)
= -2(0)3 + 12(0)2 - 20(0) + 8.5 = 8.5
k2 = f (xi + h , yi + k1h) ------- (29b)
= (0.5 , 5.25)
= -2(0.5)3 + 12(0.5)2 - 20(0.5) + 8.5
= 1.25
Substituted into Heun's method equation for 2nd order RK
yi+1 = yi + (1/2k1 + 1/2k2)h ----- (29)
= 1.0 + [1/2 (8.5) + 1/2 (1.25)] (0.5)
= 1 + [4.25 + 0.625] (0.5)
= 3.4375 ;
where; εt% = 6.8% (compare with true values in Table 25.3)

b. Midpoint method (a2 = 1)


To calculate k's values:
k1 = f (xi , yi) ------- (32a)
= f (0 ,1) = 8.5
k2 = f (xi + 1/2h , yi + 1/2k1h) ------ (32b)
= f (0.25, 3.125)
= -2(0.25)3 + 12(0.25)2 - 20(0.25) + 8.5
= 4.21875
Substituted into Midpoint method equation for 2nd order RK
yi+1 = yi + k2h ----- (32)
= 1 + (4.21875)(0.5)
= 3.109375
where; εt% = 3.4% (compare with true values in Table 25.3)

c. Do it yourself for Ralston’s Method !!!


8.6.2 Third-order Runge-Kutta Method
For n=3, the result of derivation is six equations with eight unknowns.
Therefore, two unknowns must be specified.
yi+1 = yi + 1/6(k1 + 4k2 + k3)h

k's are ; k1 = f (xi , yi)


k2 = f (xi + 1/2h , yi + 1/2kIh)
k3 = f (xi + h , yi - k1h + 2k2h)
8.6.3 Fourth-order Runge-Kutta Method
The most popular RK methods and known as the classical fourth-order
RK method.
yi+1 = yi + 1/6(k1 + 2k2 + 2k3 + k4)h

k's are ; k1 = f (xi , yi)


k2 = f (xi + 1/2h , yi + 1/2kIh)
k3 = f (xi + 1/2h , yi +1/2k2h)
k4 = f (xi + h , yi + k3h)

8.6.4 Higher-order Runge-Kutta Method


Where more accurate results are required, Butcher’s (1964) fifth-order RK
method is recommended.
yi+1 = yi + 1/90(7k1 + 32k3 + 12k4 + 32k5 + 7k6)h
8.7 Systems of Equations
Many practical problems in engineering and science require the solution of a system
of simultaneously ordinary differential equations rather than a single equation. Such
systems may be represented generally as:

dy1
 f1 (x, y1, y 2 ,....., y n )
dx
dy 2
 f 2 (x, y1, y 2 ,....., y n )
dx

dy n
 f n (x, y1, y 2 ,....., y n )
dx
The solution of such a system requires that n initial conditions be known at the
starting value of x.


Example of the ODE:
Solve the following set of ODEs using Euler’s method, assuming at x = 0,
y1 = 4 and y2 = 6. Integrate to x = 2 with a step size of 0.5.

dy1
 0.5 y1 Euler’s method
dx
yi 1  yi  f ( xi , yi )h
dy2
 4  0.3 y2  0.1 y1
dx

Solution:
Euler’s method is implemented for each variable:
Thus;
y1 (0.5)  4  [0.5(4)]0.5  3
y2 (0.5)  6  [4  0.3(6)  0.1(4)]0.5  6.9
Note that y1(0) = 4 is used in the second equation rather than the
y1(0.5) = 3 computed with the first equation. Proceeding in a like
manner gives:

x y1 y2
0 4 6
0.5 3 6.9
1.0 2.25 7.715
1.5 1.6875 8.44525
2.0 1.265625 9.094087
CASE STUDIES: Application in Chemical Engineering
Ordinary Differential Equations (ODE) : Case Study

The rate of heat flow between two points on a cylinder heated at one end is
given by:
dQ B( L  x)(20  t )
 A
dt 100  xt

where, Q is the heat flow, t is time,  is a constant, B is the volume coefficient,


A is the cylinder’s cross sectional area, L is the length of the cylinder and x is
the distance from the heated end. Use the fourth-order Runge-Kutta method
with step size 0.1 min to compute the heat flow for t = 0 to 0.3 min. The initial
condition is Q(0) = 0 and the parameters are  = 0.4 cal.cm/min, L = 20 cm, B
= 100 cm-3, A = 10 cm2 and x = 2.5 cm.
END
OF
CHAPTER 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy