Download (direct link):
(a) Use the Euler method.
(b) Use the backward Euler method.
(c) Use the Runge-Kutta method.
4. Consider the initial value problem
/ = -10y + 2.5t2 + 0.5t, y(0) = 4.
(a) Find the solution y = ô(´) and draw its graph for 0 < t < 5.
(b) The stability analysis in the text suggests that for this problem the Euler method is stable only for h < 0.2. Confirm that this is true by applying the Euler method to this problem for 0 < t < 5 with step sizes near 0.2.
8.6 Systems of First Order Equations
(c) Apply the Runge-Kutta method to this problem for 0 < t < 5 with various step sizes. What can you conclude about the stability of this method?
(d) Apply the backward Euler method to this problem for 0 < t < 5 with various step sizes. What step size is needed in order that the error at t = 5 is less than 0.01?
In each of Problems 5 and 6
(a) Find a formula for the solution of the initial value problem, and note that it is independent of k.
(b) Use the Runge-Kutta method with h = 0. 01 to compute approximate values of the solution for 0 < t < 1 for various values of k such as k = 1,10, 20, and 50.
(c) Explain the differences, if any, between the exact solution and the numerical approximations.
> 5. Ó — ky = 1 — kt, y(0) = 0 > 6. Ó — ky = 2t — kt2, y(0) = 0
8.6 Systems of First Order Equations
In the preceding sections we discussed numerical methods for solving initial value problems associated with a first order differential equation. These methods can also be applied to a system of first order equations. Since a higher order equation can always be reduced to a system of first order equations, it is sufficient to deal with systems of first order equations alone. For simplicity we consider a system of two first order equations
Ó = f(t, x, y), y = g(t, x, y), (1)
with the initial conditions
x (t0) = x0> y(t0) = y0 ¦ (2)
The functions f and g are assumed to satisfy the conditions of Theorem 7.1.1 so that The initial value problem (1), (2) has a unique solution in some interval of the t-axis containing the point t0. We wish to determine approximate values x1, x2,, xn,... and y1, y2,..., yn,... of the solution x = ô(³), y = ty(t) at the points tn = t0 + nh with n = 1, 2,....
In vector notation the initial value problem (1), (2) can be written as
X = f(t, x), x(t0) = x0, (3)
where x is the vector with components x and y, f is the vector function with components f and g, and x0 is the vector with components x0 and y0. The methods of the previous sections can be readily generalized to handle systems of two (or more) equations. All that is needed (formally) is to replace the scalar variable x by the vector x and the scalar function f by the vector function f in the appropriate equations. For example, the Euler formula becomes
xn+1 = xn + hfn,
Chapter 8. Numerical Methods
or, in component form,
xn+1 \ = ³ X ) + h ³ f('n• xn¦ yn) ) . (5)
Óï+1 / V Óï ) V S< Ï, x„, Ó„) )
The initial conditions are used to determine f0, which is the vector tangent to the graph
of the solution x = ) in the xy-plane. We move in the direction of this tangent
vector for a time step h in order to find the next point x1. Then we calculate a new tangent vector f1, move along it for a time step h to find x2, and so forth.
In a similar way the Runge-Kutta method can be extended to a system. For the step from tn to tn+1 we have
xn+1 = xn + (h/6)(kn1 + 2kn2 + 2kn3 + kn4), (6)
kn1 = f(tn, xn),
kn2 = f [tn + W), xn + (h/2)knl], (7)
kn3 = f [tn + (h/2), xn + (h/2)kn2],
kn4 = f(tn + h, xn + hkn3).
The formulas for the Adams-Moulton predictor-corrector method as it applies to the initial value problem (1), (2) are given in Problem 9.
The vector equations (3), (4), (6), and (7) are, in fact, valid in any number of
dimensions. All that is needed is to interpret the vectors as having n components rather
Determine approximate values of the solution x = ô (t), y = ô (t) of the initial value problem
X = x — 4y, j = — x + y, (8)
x (0) = 1, y(0) = 0, (9)
at the point t = 0.2. Use the Euler method with h = 0.1 and the Runge-Kutta method with h = 0.2. Compare the results with the values of the exact solution: