UNIVERSITY OF HONG KONG
DEPARTMENT OF MATHEMATICS
MATH 3601 Numerical Analysis (2020–2021)
Tutorial 10
1. (Richardson extrapolation) By using the repeated Richardson extrapolation, find f 0 (1) from the
following values:
x 0.6 0.8 0.9 1.0 1.1 1.2 1.4
f (x) 0.707178 0.859892 0.925863 0.984007 1.033743 1.074575 1.127986
f (x+h) f (x h)
Apply the approximate formula f 0 (x) = 2h
with h = 0.4, h = 0.2, h = 0.1.
2. (Numerical method for ODE) The f 0 (x) can be approximated by the following finite di↵erence scheme
f 0 (x)
af (x) + bf (x h) + cf (x 2h)
gh (x) =
2h
(a) Determine the values of a, b, and c so that the finite di↵erent scheme gh (x) approximates f 0 (x)?
(b) What is the local truncation error of the above finite di↵erence scheme?
(c) Calculate f 0 (2.0) as accurately as possible by the Richardson extrapolation with the given data
(some data may be useless)
x 1.2 1.4 1.6 1.7 1.8 1.9 2.0
f (x) 0.550630 0.604826 0.665766 0.699730 0.736559 0.776685 0.820576
3. (Numerical method for ODE) Consider the IVP
x0 = f (t, x) := tx2 , x(0) = 2.
(a) Let h = 0.1. Use the second order Taylor series method to compute x(0.1).
(b) The tableau of a second order RK method is given below
1/3 0
2/3 3/4 3/4
Verify that the approximated value of x(0.1) agrees with the one in (a) if the same step size is
used.
dy
4. (Error analysis) Consider the initial value problem, dt
= f (t, y), y(t0 ) = y0 , t0 t T .
(a) The second-order two-stage Runge-Kutta method is of the form
8
< K1 = f (tk , yk ),
K2 = f (tk + ↵h, yk + hK1 )
:
yk+1 = yk + h(aK1 + bK2 ),
where a + b = 1, ↵b = 1/2, b = 1/2, and tk = t0 + kh. Do one step of the second-order Runge-
Kutta method with b = 1 to approximate y(1.2), where y(t) is the solution of dy dt
= t y3,
y(1) = 1.
(b) Assume the solution y(t) is exact at time t = tk , the Taylor expansion of y(t) at t = tk is
y(tk+1 ) = y(tk ) + hy 0 (tk ) + 12 h2 y 00 (tk ) + 16 h3 y 000 (⇠k ), where ⇠k lies between t = tk and t = tk+1 .
What is the local truncation error of the approximation method given in part (a)?
5. (Boundary value problem) Use a second order method for the solution y = y(x) of the boundary
value problem
y 00 = xy + 1, x 2 [0, 1],
with the boundary condition y 0 (0) + y(0) = 1 and y(1) = 1. The mesh size h = 0.25.
1
Suggested Solutions
1. Please see the figure 1.
Figure 1: For problem 1
2. (a)
3f (x) 4f (x
h) + f (x 2h)
gh (x) =
2h
(b) Expand each term in Tayler series about x in the given formula, we obtain
h2 000
gh (x) f 0 (x) = f (x) + O(h3 )
3
3. In both parts, x(0.1) = x(h) ⇡ x1 .
2
(a) Implicit di↵erentiate the ODE
x0 = tx2
x00 = x2 2txx0 .
It follows that
1
x1 = x0 + x0 (0)h + x00 (0)h2 + O(h3 )
2
1
= x0 (0)x20 h + x20 2(0)x0 x00 (t0 ) h2
2
1 2
= 2 · 2 · (0.1)2 = 1.98.
2
(b) Apply the order 2 RK method,
K1 = f (t0 , x0 ) = f (0, 2) = 0
K2 = f (0 + (3/4)(0.1), 2 + (3/4)(0.1)(0)) = f (3/40, 2) = 3/10.
It follows that ✓ ◆
1 2 1 2 3
x1 = x0 + h K 1 + K2 =2 · · = 1.98.
3 3 10 3 10
4. (a) b = 1, implies that a = 0, ↵ = = 12 . We get
8
< K1 = f (ti , yi ),
K2 = f (ti + 12 h, xi + 12 hK1 )
:
yi+1 = yi + hK2 ,
Since f (t, y) = t y 3 , t0 = 1, y0 = 1, and h = 0.2, we get K1 = f (1, 1) = 0, K2 f (1 + 12 ⇤ 0.2, 1 + 12 ⇤
0.2 ⇤ 0) = 0.1. y1 = y0 + 0.2 ⇤ 0.1 = 1.02.
(b) From the di↵erential equation (DE), dy |
dt t=tk
= yk0 = f (tk , yk ). Di↵erentiate the DE, we get
2
d y
|
dt2 t=tk
= yk00 = ft (tk , yk ) + fy (tk , yk )f (tk , yk ). So the Taylor series becomes
1
y(tk+1 ) = y(tk ) + hf (tk , yk ) + h2 (ft (tk , yk ) + fy (tk , yk )f (tk , yk )) + O(h3 )
2
Expand K2 using Taylor’s theorem for functions of two variables,
1
K2 = f (tk , yk ) + h(ft (tk , yk ) + fy (tk , yk )f (tk , yk )) + O(h2 )
2
Since y(tk ) = yk , the two-stage RK method gives
1
yk+1 = yk + hK2 = yk + hf (tk , yk ) + h2 (ft (tk , yk ) + fy (tk , yk )f (tk , yk )) + O(h3 )
2
Thus, the local truncation error is O(h3 ).
5. Please see the figure 2.
3
Figure 2: For problem 5