0% found this document useful (0 votes)
52 views2 pages

Runge-Kutta (Order Four) : To Approximate The Solution of The Initial-Value Problem

This document describes the Runge-Kutta (Order four) method for approximating the solution to an initial value problem at equally spaced points between two endpoints. It takes as input the endpoints a and b, the initial condition a, and the number of intervals N. It then calculates the solution approximation w at the (N+1) points using a four-step Runge-Kutta method, outputting the results.

Uploaded by

baba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

Runge-Kutta (Order Four) : To Approximate The Solution of The Initial-Value Problem

This document describes the Runge-Kutta (Order four) method for approximating the solution to an initial value problem at equally spaced points between two endpoints. It takes as input the endpoints a and b, the initial condition a, and the number of intervals N. It then calculates the solution approximation w at the (N+1) points using a four-step Runge-Kutta method, outputting the results.

Uploaded by

baba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Runge-Kutta (Order four)

To approximate the solution of the initial-value problem


y' = f (t, y), a < t < b, y (a) =a,
at (N + 1) equally spaced numbers in the interval (a, b]:
IN PUT endpoints a, b; integer N initial condition a.
OUTPUT approximation w toy at the (N + 1) values oft .
5.4 Runge-Kutta Methods 289

Step 1 Seth= (b - a)/N;


t = a;
w =a;
OUTPUT (t, w).
Step 2 For i = l, 2, ... , N do Steps 3-5.
Step 3 Set K1 = hf (t, w);
K2 = hf (t + h/2, w + Ki/2);
K3 = hf (t + h/2, w + K2/2);
K4 = hf (t + h, w + K3).
Step 4 Set w = w + (K1 + 2K2 + 2K3 + K4)/6; (Compute wi.)
t =a+ ih. (Compute ti.)

Step 5 OUTPUT (t, w).


I
Step 6 STOP.

You might also like