Range Kota
Range Kota
dy
= f (t, y), y(t0 ) = y0
dt
where f (t, y) is a given function, and y0 is the initial condition at t = t0 . The
goal is to approximate y(t) at successive points.
The RK methods approximate the solution by taking weighted averages of
slopes calculated at different points within each step. Two commonly used RK
methods are the 2nd-order and 4th-order methods, which we will discuss in
detail.
k1 = f (tn , yn )
h h
k2 = f tn + , yn + k1
2 2
The RK2 method gives an approximation of y(t) with an error of O(h2 ) per
step.
1
3 4th-Order Runge-Kutta Method (RK4)
The 4th-order Runge-Kutta method (commonly referred to as RK4 ) is a widely
used method due to its accuracy and efficiency. The RK4 method is given by:
h
yn+1 = yn + (k1 + 2k2 + 2k3 + k4 )
6
where k1 , k2 , k3 , and k4 are computed as follows:
k1 = f (tn , yn )
h h
k2 = f tn + , yn + k1
2 2
h h
k3 = f tn + , yn + k2
2 2
k4 = f (tn + h, yn + h k3 )
The RK4 method has an error of O(h4 ) per step, which makes it more
accurate than RK2 for the same step size.
5 Example Application
Consider the ODE:
dy
= −2y + 3, y(0) = 1
dt
Using either RK2 or RK4, we can approximate the solution for y(t) over a range
of t values. Choose a step size h, apply the chosen RK method, and iterate to
obtain yn+1 at each step.