Module for Runge-Kutta Method for O.D.E.'s
Check out the new Numerical Analysis Projects page.
Runge-Kutta
Method of Order
4. To approximate the solution of the initial
value problem
with
over
. Start
with the initial point
and
generate the sequence of approximations
by
using the formula
,
where
Animations (Runge-Kutta
Method of Order 4 Runge-Kutta
Method of Order
4). Internet
hyperlinks to animations.
Program
(Runge-Kutta Method) To
compute a numerical approximation for the solution of the initial
value problem
with
over
at a discrete set of points using the formula
,
where
,
,
,
and
.
Mathematica Subroutine (Runge-Kutta Method).
![[Graphics:Images/RungeKuttaMod_gr_16.gif]](Images/RungeKuttaMod_gr_16.gif)
Example
1. Solve the
I.V.P.
over
. Use
the Runge-Kutta method with 2 subintervals
of [0, 0.4] to get a numerical
approximation to the solution. Show the calculations
for
for
each step. Compare the Runge-Kutta solution with the known
analytic solution
.
Solution
1.
Example
2. Solve the
I.V.P.
over
. Use
the Runge-Kutta method with 10 subintervals
of [0, 10] to get a numerical
approximation to the solution. Plot the solution using the
11 points you just computed in the window
{{0,10},{0,1}}. Report the last point which is the
numerical approximation to (10, y(10)).
Solution
2.
Example
3. Solve the
I.V.P.
over
. Use
the Runge-Kutta method with 20 subintervals
of [0, 10] to get a numerical
approximation to the solution. Plot the solution using the
21 points you just computed in the window
{{0,10},{0,1}}. Report the last point which is the
numerical approximation to (10, y(10)).
Solution
3.
Example
4. Solve the
I.V.P.
over
. Use
the Runge-Kutta method with 50 subintervals
of [0, 10] to get a numerical
approximation to the solution. Plot the solution using the
51 points you just computed in the window
{{0,10},{0,1}}. Report the last point which is the
numerical approximation to (10, y(10)).
Solution
4.
Example
5. Solve the
I.V.P.
over
. Use
the Runge-Kutta method with 100 subintervals
of [0, 10] to get a numerical
approximation to the solution. Plot the solution using the
101 points you just computed in the window
{{0,10},{0,1}}. Report the last point which is the
numerical approximation to (10, y(10)).
Solution
5.
Example
6. Use Mathematica to find the
analytic solution to the D.E.
Solution
6.
Example
7. Experiment with
and
try to feel good about this new function.
Solution
7.
Example 8. Plot the solution in 6.
Example
9. Plot the error in exercise 5 using
the "true solution" function in exercise 8.
Remark. You must make sure that
the Runge Kutta solution in exercise 5 is the "last one" that was
computed, so that the values that are actually resident in the
variables T and Y are
the ones we need to use.
Solution
9.
Example
10. Error analysis. The
Runge-Kutta method of order N = 4 allegedly has a Final Global Error
(FGE) of order
. Hence,
the error at the right endpoint should appear to decrease by 1/16
when the number of sub-intervals is doubled. Use the D.E. in exercise
1 and investigate this behavior for m = 15, 30, 60, 120 and 240
sub-intervals of [0,3].
Notice. The subroutine
Runge stores the values in a list starting with
subscript 1 and ending with subscript m+1. We need only check this
last point with the value obtained from the analytic
solution. To explore the error we will need to execute
things in the following order.
Solution
10.
Old Lab Project (Runge-Kutta
Method of order 4 Runge-Kutta
Method of order
4).
Internet hyperlinks to an old lab project.
Research Experience for Undergraduates
The
Runge-Kutta Method The
Runge-Kutta Method
Internet hyperlinks to web sites and a bibliography of
articles.
Downloads (Runge-Kutta
Method of order 4 Runge-Kutta
Method of order
4).
Download this Mathematica notebook.
(c) John H. Mathews 2003