🔧

Runge-Kutta Method

Jun 22, 2024

Runge-Kutta Method for Solving Ordinary Differential Equations

Introduction

  • Better approximation method than the Euler Method
  • Fourth order approximation

Initial Conditions

  • Starting point: a specific value of x, corresponding y value
  • Differential equation defines how y changes with x (function of x and y)

Recurrence Formula

  • Small step increment: x_(n+1) = x_n + h
  • Calculate new y value for x_(n+1)
  • Smaller h steps = more accurate calculations
  • Easily implemented in computer programs

T4 Formula

  • T4 = 1/6 * (sum of 6 terms)
  • k_1 = function evaluated at (x_n, y_n)
  • k_2 = function evaluated at (x + 1/2 step size, y + 1/2 step size * function)
  • k_3 = similar to k_2, using k_2
  • k_4 = evaluated at full step size, using k_3

Comparison to Euler Method

  • More accurate as it uses information around the midpoint and endpoints
  • Reduces error significantly when step size is halved

Example Calculation

  • Simple differential equation
  • Initial condition: x_0 = 1, y_0 = 2
  • Step size: h = 0.1

k Calculations

  • k_1: function evaluated at x_0 and y_0
  • k_2: function at x_0 + 0.1/2 and y_0 + 0.1/2 * k_1
  • k_3: similar calculation using k_2
  • k_4: evaluated at x_0 + full step size, using k_3*

y Calculation

  • y_1 = y_0 + h/6 * (k_1 + 2*k_2 + 2*k_3 + k_4)
  • Substituting calculated values for k_1, k_2, k_3, k_4
  • Continue process to find subsequent y values (y_2, y_3, etc.)*

Application in Numerical Programs

  • Technique used in numerical software like POLYMATH
  • Allows solving multiple ordinary differential equations simultaneously