0% found this document useful (0 votes)
15 views7 pages

Lecture 10

Uploaded by

crfpfyfynj
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
0% found this document useful (0 votes)
15 views7 pages

Lecture 10

Uploaded by

crfpfyfynj
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/ 7

Numerical and Engineering Analysis – 3rd Stage M. Sc.

Dina Sami

3. Runge – Kutta Method (4th order)

Runge-Kutta 4th order method is a numerical technique used to solve ordinary differential
equation of the form

𝑑𝑦
= (𝑥, 𝑦) , y (xo) = yo
𝑑𝑥

So only first order ordinary differential equations can be solved by using the Runge-Kutta
4th order method.

.‫تعتبر هذه الطريقة أكثر تطورا ً بالدقة من الطرق السابقة وتعود هذه الطريقة للعالمان االلمانيان رونج وكوتا‬

Algorithm of solution:
1- Identify 𝑥𝑜, 𝑦𝑜, 𝑎𝑛𝑑 ℎ , Where 𝒉 = 𝒙 − 𝒙𝟎 (‫ القيمة االبتدائية‬- ‫)القيمة المطلوب عندها الحل‬

2- Evaluate 𝒌𝟏 = 𝑓 (𝑥𝑛 , 𝑦𝑛 )

x ‫ باعتبار هي حاصل للتغير في‬h ‫ عندما تتقدم بمقدار‬Y ‫ يعرف بصورة عامة على انه مقدار تقريبي للتغير في‬:𝒌

𝑑𝑦
. ‫و‬
𝑑𝑥

ℎ ℎ
3- Evaluate 𝒌𝟐 = 𝑓 (𝑥𝑛 + , 𝑦𝑛 + 𝑘1 )
2 2

ℎ ℎ
4- Evaluate 𝒌𝟑 = 𝑓 (𝑥𝑛 + , 𝑦𝑛 + 𝑘2 )
2 2

5- Evaluate 𝒌𝟒 = 𝑓 (𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3 ℎ )

𝒉
6- Evaluate 𝒚𝒏+𝟏 = 𝒚𝒏 + (𝒌𝟏 + 𝟐 𝒌𝟐 + 𝟐 𝒌𝟑 + 𝒌𝟒 )
𝟔

7- Repeated steps 2 – 6 for 𝑛 = 1, 2, 3, …

114
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami

Example 1: Solve 𝑦´ = 4 e 0.8 x – 0.5 y, y (0) = 2 by using Runge–Kutta Method (4th


order) at x = 0.5
Sol:
y0 = 2 , x0 = 0 , h = x - xo = 0.5 – 0 = 0.5
k1 = f (xo, yo) = f (0, 2) = 4 𝑒 0.8 ×0 – (0.5× 2) = 3
ℎ ℎ 0.5 0.5
k2 = f (xo + , yo + k1 ) = f (0 + , 2 + [3 × ])
2 2 2 2

= f (0.25, 2.75) = 4 𝑒 0.8 ×0.25 – (0.5× 2.75) = 3.510611

ℎ ℎ 0.5 0.5
k3 = f (xo + , yo + k2 ) = f (0 + , 2 + [3.510611 × ])
2 2 2 2

= f (0.25, 2.87765) = 4 𝑒 0.8 ×0.25 – (0.5× 2.87765) = 3.446785

k4 = f (xo +ℎ, yo + k3 ℎ ) = f (0 + 0.5,

115
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami

Ex. 3: A liquid phase reaction A→ B is carried out in a stirred vessel reactor. Feed enters
the reactor at a rate of F = 1 L/s and exits out also at the same flow rate. Both the reactant
and product have the same density. The concentration of reactant in the feed is C A0 = 1
mol/m3. The volume of the tank is V = 10 L and the concentration of A of the solution in
the tank is 1 mol/m3. The vessel may be considered perfectly mixed, so that the
concentration of A in the product stream equals that inside the tank. The rate of
consumption of A equals k CA, where k = 1 s-1. Determine the concentration of A at various
time periods from 0 to 0.2 s.

Sol:

116
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami

117
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami

h.w1: solve the following differential equation numerically using Runge–Kutta Method
(4th order). Find y (0.5) when 𝑦´ = 2 x + y, y (0) = 1. Take h = 0.5

H.w 2: The open loop response, that is, the speed of the motor to a voltage input of 20V, assuming a
system without damping is
dw
20 = (0.02) + (0.06) w .
dt
If the initial speed is zero (w(0) = 0) ,and using the Runge-Kutta 4th order method, what is the speed at
t = 0.8 s ? Assume a step size of h = 0.4 s .

Sol:
y0 = y (0) = 100 , t0 = 0
The number of gallons of gasoline and additive in solution in the tank at any time t is
𝑔𝑎𝑙 𝑔𝑎𝑙
𝑉(𝑡) = 2000 𝑔𝑎𝑙 + (40 − 45 ) 𝑡 (min )
𝑚𝑖𝑛 𝑚𝑖𝑛

𝑉(𝑡) = 2000 − 5𝑡

118
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami

The differential equation modeling the mixture process is


𝑑𝑦 𝑦(𝑡)
= (40 × 2) − (45 × )
𝑑𝑡 𝑣(𝑡)
𝑑𝑦 45 𝑦(𝑡)
= 80 − ( )
𝑑𝑡 2000 − 5𝑡

Apply Euler’s methods to find y(20) = ? Ib


Stirred tank with coil heater

119
Numerical and Engineering Analysis – 3rd Stage M. Sc. Dina Sami

120

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