Initial Value Problem Set

The Runge-Kutta algorithm program source code was named rk1.c and was compiled on nova.npac.syr.edu, with the following line:

 

gcc -O rk1.c -o rk1 -lm

The executable "rk1" was then used to solve the homework problem set for the initial value problem given.


Problem 1a

Use the Runge-Kutta (Order Four) algorithm to solve the initial value problem:

y' = y - (t^2) +1
0 <= t < = 2
y(0) = 0.5
Solutions should be generated for the time points t = 0.0, 0.2, 0.4, ..., 2.0
SOLUTION:
please enter a, b, and alpha>0 2 0.5
t = 0.000000, w = 0.500000
t = 0.200000, w = 0.810700
t = 0.400000, w = 1.148146
t = 0.600000, w = 1.515002
t = 0.800000, w = 1.914519
t = 1.000000, w = 2.350671
t = 1.200000, w = 2.828310
t = 1.400000, w = 3.353362
t = 1.600000, w = 3.933065
t = 1.800000, w = 4.576262
t = 2.000000, w = 5.293750


Problem 1b

Provide empirical evidence that the Runge-Kutta (order four) algorithm exhibits fourth-order convergence.

SOLUTION:
To examine the convergence of the algorithm. The initial value above was solved using the 0.001, 0.005, 0.010, 0.020, and 0.040 time steps. The finest resolution time series (0.001) was used as a standard and the values of the coarser time step series were compared relative to the 0.001 series.

The cumulative and average errors of the time series relative to the standard were calculated by an error calculation program and the results are shown here. As the step size becomes smaller and the resolution increases both the cumulative and the average global error decreases. As the stepsize decreases by 50% the global error decreases by approximately 45%.


This problem set was prepared by Stefan Joe Yen, using the references provided and class notes. Please send all comments to the address below.

Stefan Joe-Yen, SUNY Health Science Center at Syracuse