SlideShare a Scribd company logo
6
Most read
11
Most read
15
Most read
Runge-Kutta methods with examples
Academic Description
Presenter Details:
Md. Sajjad Hossain
Id: 18010101
Md. Shoheal Hossan
Id: 18010125
Tasmia Kamal
Id: 18010126
5th semester ,31st batch, CSE
Course title: Numerical Analysis
Course Code: CSE 311
Course Teacher: Wahidul Alam
Sr. Lecturer, CSE, FSET, USTC.
University of Science and Technology Chittagong
Department of Computer Science and Engineering
2
Definition of Runge-Kutta methods:
In numerical analysis, the Runge-kutta methods are a family
of implicit and explicit interactive methods which include the
well-known routine called the Euler Method, used in temporal
discretization for the approximate solutions of ordinary
differential equation. These methods were developed around
1900 by the German mathematician Carl Runge and Wilhelm
Kutta.
3
The most widely known member of the Runge-Kutta
family is generally referred to as “RK4”, “Classic Runge-
Kutta method or simply as “the Runge-Kutta method.
Application:
The application of Runge-Kutta methods
as a means of solving non-linear partial
differential equations is demonstrated
with the help of a specific fluid flow
problem. The numerical results obtained
are compared with the analytical solution
and the solution obtained by implicit,
explicit and Crank-Nicholson finite
difference methods. The error analysis
and computational efficiency analysis are
performed to test each method.
5
Explanation of the Runge-Kutta Methods:
Let an initial value problem be specified as follows:
𝜕𝑦
𝜕𝑡
= f(t, y), y(to) = yo
Here, y is an unknown function (scalar or vector) of time t, which we
would like to approximate; we told that
𝜕𝑦
𝜕𝑡
, the rate at which y
changes, is a function from t and t0 to y itself. At the initial time is t0
and the corresponding y value is yo. The function f and the initial
conditions to, yo are given.
6
Now pick a step-size h>0 and define
yn+1 = yn +
1
6
(k1+2k2+2k3+k4);
tn+1= tn + h
for n=0, 1, 2, 3,…. Using
k1= hf(tn,yn)
k2= hf(tn+
ℎ
2
, yn+
k1
2
)
k3= hf(tn+
ℎ
2
, yn+
k2
2
)
k4= hf(tn+h, yn + k3)
Here, yn+1 is the RK4 approximation of y(tn+1), and
the next value (yn+1) is determined by the present
value (yn) plus the weighted average of four
increments, where each increment is the product of
the size of the interval h and an estimated slope
specified by function f on the right-hand side of the
differential equation
• k1 is the slope at the beginning of the interval using y (Euler’s
method);
• k2 is the slope at the midpoint of the interval using y and k1;
• k3 is again the slope at the midpoint, but now using y and k2;
• k4 is the slope at the end of the interval, using y and k3.
In averaging the four slopes , greater weight is given to the slopes
at the midpoint. If f is the independent of y, so that the differential
equation is equivalent to a simple integral.
Graphical Representation:
10
Example:
Example 1: Using Runge-Kutta method Solve y’ = xy for x= 1.4. Initially x =
1, y=2 (take h= 0.2)
Solution: The given differential equation is,
𝜕𝑦
𝜕𝑡
= f(x, y)
= x y
Given that x0 = 1, y0 = 2, and h= 0.2
First interval: K1 = h f(x0, y0)
= 0.2 f(1,2)
= 0.2 (1 x 2)
= 0.4
11
k2 = h f(x0 +
ℎ
2
, y0 +
k1
2
)
= 0.2 f(1.1 , 2.2)
= 0.2 (1.1 x 2.2)
= 0.484
k3 = h f(x0 +
ℎ
2
, y0 +
k2
2
)
= 0.2 f(1.1 , 2.242)
= 0.2 (1.1 x 2.242)
= 0.49324
k4 = h f(x0 + ℎ , y0 + k3)
= 0.2 f(1.1 , 2.49324)
= 0.2 (1.1 x 2.49324 )
= 0.5983776
x0 +
ℎ
2
= 1+
0.2
2
= 1.1
y0 +
k1
2
= 2+
0.4
2
= 2.2
y0 +
k2
2
= 2 +
0.484
2
= 2.242
x0 + h =1+ 0.2
= 1.2
y0 + k3= 2 + 0.49324
= 2.49324
Here, x1 = x0 + h
= 1+ 0.2
= 1.2
y1 = y0 +
1
6
(k1+2k2+2k3+k4)
= 2+
1
6
(0.4 + 2 x 0.484 +2 x 0.49324 + 0.5983776)
= 2+
1
6
(0.4 + 0.968+0.98648 + 0.5983776)
= 2.4921429
Second Interval,
k1 = h f(x1 , y1)
= 0.2 f(1.2, 2.4921429)
= 0.2 ( 1.2 x 2.4921429)
= 0.5981143
k2 = h f(x1 +
ℎ
2
, y1 +
k1
2
)
= 0.2 f(1.3 , 2.7911999)
= 0.2 (1.3 x 2.7911999)
= 0.725712
k3 = h f(x1 +
ℎ
2
, y1 +
k2
2
)
= 0.2 f(1.3 , 2.8549989)
= 0.2 (1.3 x 2.8549989)
= 0.7422997
k4 = h f(x1 + ℎ , y1 + k3)
= 0.2 f(1.1 , 3.2344426)
= 0.2 (1.1 x 3.2344426)
= 0.9056439
x1 +
ℎ
2
= 1.2+
0.2
2
= 1.3
y1 +
k1
2
= 2.4921429+
0.5981143
2
= 2.7911999
y1 +
k2
2
= 2.4921429 +
0.725712
2
= 2.8549989
x1 + h =1.2+ 0.2
= 1.4
y1 + k3= 2.4921429 + 0.7422997
= 3.2344426
Since, x2 = x1 + h
= 1.2 +.2
= 1.4
and, y2 = y1 +
1
6
(k1+2k2+2k3+k4)
= 2.4921429 +
1
6
( 0.5981143 +1.451424 + 1.4845994 + 0.9056439)
= 3.2321065
The value of x and y can be tabularized by:
x 1 1.2 1.4
y 2 2.4921429 3.2321065
Example:
Example 2: Use Runge-Kutta quadratic method to calculate three
additional points on thesolution curve of the problem
𝜕𝑦
𝜕𝑥
= 1-2xy, y(0)
= 0, h= 0.1
Solution: The given differential equation is,
𝜕𝑦
𝜕𝑥
= 1- 2xy; given initial condition y(0) = 0, x0 = 0 and h= 0.1
K1 = h f(x0, y0)
= 0.1f(0, 0)
= 0.1(1-2 x 0x0)
= 0.1
16
k2 = h f(x0 +
ℎ
2
, y0 +
k1
2
)
= 0.1f(0+
0.1
2
, 0+
0.1
2
)
= 0.1 f(0.05 , 0.05)
= 0.1 (1- 2 x0.05 x0.05)
= 0.0995
k3 = h f(x0 +
ℎ
2
, y0 +
k2
2
)
= 0.1f(0.05, 0+
0.0995
2
)
= 0.1 f(0.5 , 0.04975)
= 0.1 (1- 2 x0.05 x 0.04975)
= 0.0995025
k4 = h f(x0 + ℎ , y0 + k3)
= 0.1 f(0.1 , 0.0995025)
= 0.2 (1-2x 0.1 x 0.0995025)
= 0.09801
X1 = x0 + h
= 0 + 0.1
= 0.1
Since, y1 = y0 +
1
6
(k1+2k2+2k3+k4)
= 0 +
1
6
( 0.1 +2x 0.0995 + 2 x 0.0995025 + 0.09801)
=
1
6
( 0.1 + 0.199 + 0.199005 + 0.09801)
= 0.0993358
= 0.099336
The value of x and y can be tabularized by:
x 0 0.1
y 0 0.99336
Algorithm (Runge-Kutta) Method of order 4
20
References:
▫ Text book: Numerical Analysis by A.R. Vasishtha and Vipin Vasishtha
▫ https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods
▫ https://www.quora.com/What-are-the-applications-of-the-Runge-
Kutta-method-in-real-life-based
21
Ask frequently, if you have any
QUESTION???

More Related Content

PPTX
Runge Kutta Method
PDF
Numerical Solution of Ordinary Differential Equations
PPTX
Euler and runge kutta method
PPTX
Runge kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
PPTX
Runge kutta
PPTX
Runge Kutta Method
PPTX
Numerical solution of ordinary differential equation
PPTX
Euler and improved euler method
Runge Kutta Method
Numerical Solution of Ordinary Differential Equations
Euler and runge kutta method
Runge kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
Runge kutta
Runge Kutta Method
Numerical solution of ordinary differential equation
Euler and improved euler method

What's hot (20)

PPTX
presentation on Euler and Modified Euler method ,and Fitting of curve
PPTX
Applications of differential equations
PPTX
Interpolation
PPTX
Interpolation In Numerical Methods.
PPTX
weddle's rule
PPTX
Ordinary differential equations
PPTX
simpion's 3/8 rule
PPTX
HERMITE SERIES
PDF
Numerical Methods - Oridnary Differential Equations - 3
PPTX
application of differential equations
PPTX
Homogeneous Linear Differential Equations
PPTX
Methods of variation of parameters- advance engineering mathe mathematics
PPT
Fourier series
PDF
Integration in the complex plane
PPTX
newton raphson method
PDF
Runge kutta 2nd Order
PDF
Newton's Forward/Backward Difference Interpolation
PDF
Interpolation with Finite differences
PPTX
Application of-differential-equation-in-real-life
PPTX
Ordinary differential equation
presentation on Euler and Modified Euler method ,and Fitting of curve
Applications of differential equations
Interpolation
Interpolation In Numerical Methods.
weddle's rule
Ordinary differential equations
simpion's 3/8 rule
HERMITE SERIES
Numerical Methods - Oridnary Differential Equations - 3
application of differential equations
Homogeneous Linear Differential Equations
Methods of variation of parameters- advance engineering mathe mathematics
Fourier series
Integration in the complex plane
newton raphson method
Runge kutta 2nd Order
Newton's Forward/Backward Difference Interpolation
Interpolation with Finite differences
Application of-differential-equation-in-real-life
Ordinary differential equation
Ad

Similar to Runge-Kutta methods with examples (20)

PPTX
SNM seminar.pptx differential calculus explanation of history theorem formula...
PPTX
Runge Kutta Method Matlab Software Overview PPT
PPTX
Runge - Kutta Method of fourth order.pptx
PDF
Ma2002 1.7 rm
PDF
Ma2002 1.9 rm
PDF
numericalmethods.pdf
PPT
Ch08 3
PPTX
RUNGE KUTTA METhbhbhbhbb bhbbhbhbhbhHOD.pptx
PPTX
Runge Kurta method of order Four and Six
PDF
Ma2002 1.10 rm
PPTX
Runge kurta method of order Four and Six
PPTX
U3BEKoM7mQ4JSO26ggggggfgyrghhfgjhfghh739.pptx
PPTX
Runge-Kutta-Methods.pptx
PPTX
jake.pptx
PDF
Ma2002 1.6 rm
PDF
Runge–Kutta methods for ordinary differential equations
PPTX
4th order RK ---------------------method.pptx
PDF
PPT
Numerical solution of ordinary differential equations GTU CVNM PPT
PPT
Computational techniques
SNM seminar.pptx differential calculus explanation of history theorem formula...
Runge Kutta Method Matlab Software Overview PPT
Runge - Kutta Method of fourth order.pptx
Ma2002 1.7 rm
Ma2002 1.9 rm
numericalmethods.pdf
Ch08 3
RUNGE KUTTA METhbhbhbhbb bhbbhbhbhbhHOD.pptx
Runge Kurta method of order Four and Six
Ma2002 1.10 rm
Runge kurta method of order Four and Six
U3BEKoM7mQ4JSO26ggggggfgyrghhfgjhfghh739.pptx
Runge-Kutta-Methods.pptx
jake.pptx
Ma2002 1.6 rm
Runge–Kutta methods for ordinary differential equations
4th order RK ---------------------method.pptx
Numerical solution of ordinary differential equations GTU CVNM PPT
Computational techniques
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Pharma ospi slides which help in ospi learning
PDF
Business Ethics Teaching Materials for college
PDF
Classroom Observation Tools for Teachers
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Complications of Minimal Access Surgery at WLH
PDF
RMMM.pdf make it easy to upload and study
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Basic Mud Logging Guide for educational purpose
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
01-Introduction-to-Information-Management.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Supply Chain Operations Speaking Notes -ICLT Program
Module 4: Burden of Disease Tutorial Slides S2 2025
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
O7-L3 Supply Chain Operations - ICLT Program
Week 4 Term 3 Study Techniques revisited.pptx
Pharma ospi slides which help in ospi learning
Business Ethics Teaching Materials for college
Classroom Observation Tools for Teachers
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
TR - Agricultural Crops Production NC III.pdf
PPH.pptx obstetrics and gynecology in nursing
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Basic Mud Logging Guide for educational purpose

Runge-Kutta methods with examples

  • 2. Academic Description Presenter Details: Md. Sajjad Hossain Id: 18010101 Md. Shoheal Hossan Id: 18010125 Tasmia Kamal Id: 18010126 5th semester ,31st batch, CSE Course title: Numerical Analysis Course Code: CSE 311 Course Teacher: Wahidul Alam Sr. Lecturer, CSE, FSET, USTC. University of Science and Technology Chittagong Department of Computer Science and Engineering 2
  • 3. Definition of Runge-Kutta methods: In numerical analysis, the Runge-kutta methods are a family of implicit and explicit interactive methods which include the well-known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equation. These methods were developed around 1900 by the German mathematician Carl Runge and Wilhelm Kutta. 3
  • 4. The most widely known member of the Runge-Kutta family is generally referred to as “RK4”, “Classic Runge- Kutta method or simply as “the Runge-Kutta method.
  • 5. Application: The application of Runge-Kutta methods as a means of solving non-linear partial differential equations is demonstrated with the help of a specific fluid flow problem. The numerical results obtained are compared with the analytical solution and the solution obtained by implicit, explicit and Crank-Nicholson finite difference methods. The error analysis and computational efficiency analysis are performed to test each method. 5
  • 6. Explanation of the Runge-Kutta Methods: Let an initial value problem be specified as follows: 𝜕𝑦 𝜕𝑡 = f(t, y), y(to) = yo Here, y is an unknown function (scalar or vector) of time t, which we would like to approximate; we told that 𝜕𝑦 𝜕𝑡 , the rate at which y changes, is a function from t and t0 to y itself. At the initial time is t0 and the corresponding y value is yo. The function f and the initial conditions to, yo are given. 6
  • 7. Now pick a step-size h>0 and define yn+1 = yn + 1 6 (k1+2k2+2k3+k4); tn+1= tn + h for n=0, 1, 2, 3,…. Using k1= hf(tn,yn) k2= hf(tn+ ℎ 2 , yn+ k1 2 ) k3= hf(tn+ ℎ 2 , yn+ k2 2 ) k4= hf(tn+h, yn + k3)
  • 8. Here, yn+1 is the RK4 approximation of y(tn+1), and the next value (yn+1) is determined by the present value (yn) plus the weighted average of four increments, where each increment is the product of the size of the interval h and an estimated slope specified by function f on the right-hand side of the differential equation
  • 9. • k1 is the slope at the beginning of the interval using y (Euler’s method); • k2 is the slope at the midpoint of the interval using y and k1; • k3 is again the slope at the midpoint, but now using y and k2; • k4 is the slope at the end of the interval, using y and k3. In averaging the four slopes , greater weight is given to the slopes at the midpoint. If f is the independent of y, so that the differential equation is equivalent to a simple integral.
  • 11. Example: Example 1: Using Runge-Kutta method Solve y’ = xy for x= 1.4. Initially x = 1, y=2 (take h= 0.2) Solution: The given differential equation is, 𝜕𝑦 𝜕𝑡 = f(x, y) = x y Given that x0 = 1, y0 = 2, and h= 0.2 First interval: K1 = h f(x0, y0) = 0.2 f(1,2) = 0.2 (1 x 2) = 0.4 11
  • 12. k2 = h f(x0 + ℎ 2 , y0 + k1 2 ) = 0.2 f(1.1 , 2.2) = 0.2 (1.1 x 2.2) = 0.484 k3 = h f(x0 + ℎ 2 , y0 + k2 2 ) = 0.2 f(1.1 , 2.242) = 0.2 (1.1 x 2.242) = 0.49324 k4 = h f(x0 + ℎ , y0 + k3) = 0.2 f(1.1 , 2.49324) = 0.2 (1.1 x 2.49324 ) = 0.5983776 x0 + ℎ 2 = 1+ 0.2 2 = 1.1 y0 + k1 2 = 2+ 0.4 2 = 2.2 y0 + k2 2 = 2 + 0.484 2 = 2.242 x0 + h =1+ 0.2 = 1.2 y0 + k3= 2 + 0.49324 = 2.49324
  • 13. Here, x1 = x0 + h = 1+ 0.2 = 1.2 y1 = y0 + 1 6 (k1+2k2+2k3+k4) = 2+ 1 6 (0.4 + 2 x 0.484 +2 x 0.49324 + 0.5983776) = 2+ 1 6 (0.4 + 0.968+0.98648 + 0.5983776) = 2.4921429 Second Interval, k1 = h f(x1 , y1) = 0.2 f(1.2, 2.4921429) = 0.2 ( 1.2 x 2.4921429) = 0.5981143
  • 14. k2 = h f(x1 + ℎ 2 , y1 + k1 2 ) = 0.2 f(1.3 , 2.7911999) = 0.2 (1.3 x 2.7911999) = 0.725712 k3 = h f(x1 + ℎ 2 , y1 + k2 2 ) = 0.2 f(1.3 , 2.8549989) = 0.2 (1.3 x 2.8549989) = 0.7422997 k4 = h f(x1 + ℎ , y1 + k3) = 0.2 f(1.1 , 3.2344426) = 0.2 (1.1 x 3.2344426) = 0.9056439 x1 + ℎ 2 = 1.2+ 0.2 2 = 1.3 y1 + k1 2 = 2.4921429+ 0.5981143 2 = 2.7911999 y1 + k2 2 = 2.4921429 + 0.725712 2 = 2.8549989 x1 + h =1.2+ 0.2 = 1.4 y1 + k3= 2.4921429 + 0.7422997 = 3.2344426
  • 15. Since, x2 = x1 + h = 1.2 +.2 = 1.4 and, y2 = y1 + 1 6 (k1+2k2+2k3+k4) = 2.4921429 + 1 6 ( 0.5981143 +1.451424 + 1.4845994 + 0.9056439) = 3.2321065 The value of x and y can be tabularized by: x 1 1.2 1.4 y 2 2.4921429 3.2321065
  • 16. Example: Example 2: Use Runge-Kutta quadratic method to calculate three additional points on thesolution curve of the problem 𝜕𝑦 𝜕𝑥 = 1-2xy, y(0) = 0, h= 0.1 Solution: The given differential equation is, 𝜕𝑦 𝜕𝑥 = 1- 2xy; given initial condition y(0) = 0, x0 = 0 and h= 0.1 K1 = h f(x0, y0) = 0.1f(0, 0) = 0.1(1-2 x 0x0) = 0.1 16
  • 17. k2 = h f(x0 + ℎ 2 , y0 + k1 2 ) = 0.1f(0+ 0.1 2 , 0+ 0.1 2 ) = 0.1 f(0.05 , 0.05) = 0.1 (1- 2 x0.05 x0.05) = 0.0995 k3 = h f(x0 + ℎ 2 , y0 + k2 2 ) = 0.1f(0.05, 0+ 0.0995 2 ) = 0.1 f(0.5 , 0.04975) = 0.1 (1- 2 x0.05 x 0.04975) = 0.0995025
  • 18. k4 = h f(x0 + ℎ , y0 + k3) = 0.1 f(0.1 , 0.0995025) = 0.2 (1-2x 0.1 x 0.0995025) = 0.09801 X1 = x0 + h = 0 + 0.1 = 0.1 Since, y1 = y0 + 1 6 (k1+2k2+2k3+k4) = 0 + 1 6 ( 0.1 +2x 0.0995 + 2 x 0.0995025 + 0.09801) = 1 6 ( 0.1 + 0.199 + 0.199005 + 0.09801) = 0.0993358 = 0.099336
  • 19. The value of x and y can be tabularized by: x 0 0.1 y 0 0.99336
  • 21. References: ▫ Text book: Numerical Analysis by A.R. Vasishtha and Vipin Vasishtha ▫ https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods ▫ https://www.quora.com/What-are-the-applications-of-the-Runge- Kutta-method-in-real-life-based 21
  • 22. Ask frequently, if you have any QUESTION???