You are on page 1of 5

THE STUDY OF RUNGE

KUTTA METHODS OF
HIGHER ORDER
A PROPOSAL OF INNOVATIVE WORK FOR MTE
COMPONENT

SUBMITTED BY :- KHURSEED AQUEEB


(2K19/EE/135)
AIM

This is related to the study of Runge Kutta method of higher order . Our aim is to show the sixth order Runge
Kutta method and fourth order Runge Kutta method. This has been done with comparison of exact, fourth
order Runge Kutta and sixth order Runge Kutta in the graphical form on Matlab.

Runge Kutta 4th order

3. As in the midpoint rule, we compute a second slope at that midpoint we Just


estimated. We then rewind to the start and drive that slope half-way across the interval
again.
k2= f(ti+ h/2,yi+ h/2 k1)
y (ti+ti+1/2) ≈ yi+ h/2 k2

4. We use the second estimated midpoint to compute another slope and then drive that
slope all the way across the interval.
k3= f(ti+ h/2,yi+ h/2 k1)
y (ti+ti+1/2)= yi+ hk3
k4= f(ti+ h,yi+ h k3)
Substituting all of these estimates into the Simpson’s rule formula above gives
Runge Kutta 6th order
A set of Runge-Kutta formulas related thereto is given below. They can be
verified by substitution in the relations given by Butcher . Expressed in a
usual form they are
Matlab Output
program
For objective function

For objective function


Y=2*e^x-x-1

Y=2*e^x-x-1
fprintf('\n %s',"Range kutta 4th order");
clc;
A=zeros(N+1,1);
clear all;
A(1)=1;
t0 = 0;
Range kutta 4th order Range kutta 6th order for i=1:N Exact function
y0=1; 0.000000 1.000000 0.000000 1.000000 Value
k1=h*(f(X(i),A(i)));
tEnd = 1.1; 0.100000 1.110342 0.100000 1.122318 0.000000 1.000000
k2=h*(f((X(i)+h*0.5),(A(i)+k1*0.5)));
0.200000 1.242805 0.200000 1.270578 0.100000 1.110342
h= 0.1;
0.300000 1.399717 0.300000 1.447806 0.200000 1.242806
k3=h*(f((X(i)+h*0.5),(A(i)+k2*0.5)));
0.400000 1.583648
N = (tEnd-t0)/h; 0.400000 1.657384 0.300000 1.399718
k4=h*(f((X(i)+h),(A(i)+k3)));
O=[1:N+1];
0.500000 1.797441 0.500000 1.903085 0.400000 1.583649
0.600000 2.044236 0.600000 2.189125 A(i+1)=A(i)+(k1+2*k2+2*k3+k4)/6;
0.500000 1.797443
X=[t0:h:tEnd];0.700000 2.327503 0.700000 2.520211 0.600000 2.044238
fprintf(' \n %f %f',X(i),A(i));
fprintf("Range0.800000 2.651079
kutta 6th order"); 0.800000 2.901599 0.700000 2.327505
end
0.900000 3.019203 0.900000 3.339159 0.800000 2.651082
B= zeros(N+1,1);
1.000000 3.436559 1.000000 3.839446 figure (2) 0.900000 3.019206
for i = 1:N
plot(X,A) 1.000000 3.436564
B(1) = y0;
C=zeros(N+1,1);
k1= h*f(X(i),B(i));
fprintf('\n %s',"Objective function");
k2= h*f(X(i)+h,B(i)+k1);
for i=1:N
k3= h*f(X(i)+h/2,B(i)+(3*k1+k2)/8);
C(1)=1;
k4= h*f(X(i)+2*h/3,B(i)+(8*k1+2*k2+8*k3)/27);
C(i+1)=2*(e^X(i+1))-X(i+1)-1;
k5=h*f(X(i)+(7-(21)^1/2)*h/14,B(i)+(3*(3*(21)^1/2-7)*k1-8*(7-
fprintf(' \n %f %f',X(i),C(i));
(21)^1/2)*k2+48*(7-(21)^1/2)*k3-3*(21-(21)^1/2)*k4)/392);
end
k6=h*f(X(i)+(7+(21)^1/2)*h/14,B(i)+(-5*(123+51*(21)^1/2)*k1-
40*(7+(21)^1/2)*k2- figure (3)
320*((21)^1/2)*k3+3*(21+121*(21)^1/2)*k4+392*(6+(21)^1/2)*k5)/19
60); plot(X,C);

k7=h*f(X(i)+h,B(i)+(15*(22+7*(21)^1/2)*k1+120*k2+40*(7*((21)^1/2) figure(4)
-5)*k3+63*(3*((21)^1/2)-2)*k4-14*(49+9*((21)^1/2))*k5+70*(7-
(21)^1/2)*k6)/180); hold on

B(i+1)= B(i)+(9*k1+64*k3+49*k5+49*k6+9*k7)/180; plot(X,B,'-p');

fprintf(' \n %f %f',X(i),B(i)); plot(X,A,'-g');

end plot(X,C);

figure (1) hold off

plot(X,B) function z=f(x1,y1);

z = x1+y1;

end
Result
&
Comparison
As we can see clearly from the result and graphs that the Runge Kutta
6th order is neither nor accurate nor efficient.

Instead of that we should use 4th order which is less time taking and
more accurate

Conclusion

You might also like