Professional Documents
Culture Documents
SEAT NO PP-20048
BATCH 2020
DISCIPLINE POLYMER & PETROCHEMICAL ENGINEERING
SEMESTER FALL - 2022
COURSE TEACHER DR FAHEEM RAEES
COURSE CODE & TITLE APPLIED NUMERICAL METHOD (MT-471)
Problem definition
Four stage R.K. methods are defined in the following way in terms of
general coefficients.
, Such that .
Where, ℎ And
ℎ ℎ , . ‘h’ is width of
interval.
Test Problem
The Runge-Kutta Method is used to calculate the solution of ordinary differential equations
numerically
Mathematically Runge-Kutta Method can be expressed as
𝑑𝑦
𝐿𝑒𝑡 = 𝑓(𝑡, 𝑦) ; 𝑦 ( 𝑡0 ) = 𝑦0
𝑑𝑡
So, the Runge-Kutta Method of order four is given as
𝑘1 = ℎ 𝑓( 𝑡𝑛 , 𝑦𝑛 ) ,
𝑘2 = ℎ 𝑓( 𝑡𝑛 + ℎ⁄2 , 𝑦𝑛 + 𝑘1 ⁄2)
𝑘3 = ℎ 𝑓( 𝑡𝑛 + ℎ⁄2 , 𝑦𝑛 + 𝑘2 ⁄2)
𝑘4 = ℎ 𝑓( 𝑡𝑛 + ℎ, 𝑦𝑛 + 𝑘3 )
1
𝑦𝑖+1 = 𝑦𝑖 + (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ) 𝑓𝑜𝑟 𝑖 = 0, 1, 2, 3, ... 𝑛
6
The above given scheme is for standard RK method of order IV, for the modified RK method we are
selecting some parameters and on these parameters the method will be modified
Four stages R.K. methods are defined in the following way in terms of general coefficients.
, Such that .
Where, ℎ And
ℎ ℎ , . ‘h’ is width of interval
C1 0.1 W1 0 theta 1 0
C2 0.3 W2 0.4 theta 2 0.4
C3 0.4 W3 0.6 theta 3 0.6
C4 0.2 W4 1 theta 4 1
Now according to given conditions in the problem we have a (roll no) = 48 and b=1.23 and for our
step size (h) we are taking it as h=12, h/2=6, h/4=3, h/8=1.5, h/16=0.75
So, our differential equation would become
𝒅𝒚 𝟒𝟖𝒙 + 𝟏. 𝟐𝟑 𝒚
=
𝒅𝒙 𝟏. 𝟐𝟑𝒙 + 𝟒𝟖𝒚
We will be obtaining the result between the domain of (0 ≤ X ≤ 48).
STEP:3 COMPARISON OF STANDARD VS MODIFIED
RK RK MODIFIED
STANDARD FOR h
x Y Y' (Y-Y')2
0 39.0244 39.0244 0
12 41.1166 41.2906 0.030276
24 46.308 46.5964 0.08317456
36 53.6997 54.0389 0.11505664
48 62.5165 62.8669 0.12278016
RMSE 0.26506126
RK RK MODIFIED
STANDARD FOR h/2
x Y Y' (Y-Y')2
0 39.0244 39.0244 0
6 39.634 39.6793 0.002052
12 41.1163 41.2017 0.007293
18 43.3793 43.4968 0.013806
24 46.3073 46.4482 0.019853
30 49.7826 49.9388 0.024398
36 53.699 53.864 0.027225
42 57.9672 58.1365 0.028662
48 62.5158 62.6859 0.028934
RMSE 0.130053
60 60
VALUES OF Y & Y'
50
50
VALUES OF Y & Y'
40
40
30
30
20
20
10
10 0
0 0 10 20 30 40 50 60
0 10 20 30 40 50 60 VALUES OF X
VALUES OF X
Series1 Series2 Series1 Series2
RK
RK
MODIFIED
STANDARD FOR h/4
x Y Y' (Y-Y')2
0 39.0244 39.0244 0
3 39.216 39.2275 0.000132
6 39.634 39.6566 0.000511
9 40.2709 40.3039 0.001089
12 41.1162 41.1587 0.001806
15 42.1571 42.208 0.002591
18 43.3793 43.4375 0.003387
21 44.7677 44.8322 0.00416
24 46.3073 46.377 0.004858
27 47.9836 48.0574 0.005446
30 49.7826 49.8597 0.005944
33 51.6916 51.7713 0.006352
36 53.6989 53.7804 0.006642
39 55.7939 55.8767 0.006856
42 57.9672 58.0507 0.006972
45 60.2103 60.2941 0.007022
48 62.5157 62.5996 0.007039
RMSE 0.064539
60
VALUES OF Y & Y'
50
40
30
20
10
0
0 10 20 30 40 50 60
VALUES OF X
Series1 Series2
RK
RK
MODIFIED
STANDARD FOR h/8
x Y Y' (Y-Y')2
0 39.0244 39.0244 0
1.5 39.0916 39.0945 8.41E-06
3 39.216 39.2217 3.249E-05
4.5 39.3971 39.4056 7.225E-05
6 39.634 39.6453 0.00012769
7.5 39.9257 39.9396 0.00019321 X VS Y & Y' FOR h/8
9 40.2709 40.2874 0.00027225
70
10.5 40.6683 40.6871 0.00035344
60
12 41.1162 41.1374 0.00044944
50
40
30
20
10
0
0 10 20 30 40 50 60
VALUES OF X
Series1 Series2
From the above calculations and graphs we can clearly see that the RSME error starts
decreasing as soon as we decrease our step size and increase our intervals.
As we reduced the step size, selected coefficient and parameters starts giving better result
Step
RMSE
Size(h) RMSE VS Stepsize(h)
0.265061 12
0.3
0.130053 6
0.064539 3 0.25
0.15
0.1
0.05
0
12 6 3 1.5 0.75
Step size(h)
MATLAB CODES