Y' F (T, Y), a:St:Sb, y (A) A,: (T K4 (T K I :K1 - ) K4)
Y' F (T, Y), a:St:Sb, y (A) A,: (T K4 (T K I :K1 - ) K4)
INPUT endpoints a, b; initial condition a; tolerance TOL; maximum step size hma.x;
minimum step size hmin.
OUTPUT t, w, h where w approximates y(t) and the step size h was used, or a message
that the minimum step size was exceeded.
Step 1 Set t = a;
w=a;
h = hma.x;
FLAG= 1;
OUTPUT (t, w).
Step 2 While (FLAG= 1) do Steps 3-11.
Step 3 Set K 1 = hf (t, w);
= hf (t + ¼h, w + ¼K1);
K2
K3 = hf (t + }h, w + -b_K1 + iK2);
K4 = hf (t + Hh, W + ~i~~K1 - ;i~K2 + ;i~~K3);
K5 = hf (t + h, w + i~:K1 - 8K2 + 356183°K3 - ]~K4);
K6 = hf (t + ½h, w - iK1 + 2K2 - ~;~K3 + !~~K4 - !diKs).
Step 4 Set R = iil I 360 2197 K4 + soI Ks + ss
1 K1 - 128 K3 - 75240 2 K6 I·
4275
5
Example 1 Use the Runge-Kutta-Fehlberg method with a tolerance TOL == 1~- , a maximu~ step size
hmax = 0.25, and a minimum step size hmin == 0.01 to approximate the solution to the
initial-value problem