Tutorial Numerical
Tutorial Numerical
Tutorial Numerical
1. Suppose you ran a nonlinear solver algorithm and calculated errors at each step
to be
9.0579e − 03
3.4483e − 03
8.0996e − 04
9.2205e − 05
3.5416e − 06
2.6659e − 08
3. Prove that if x∗ is a fixed point of g, g ′ (x∗ ) = 0, g ′′ (x∗ ) = 0 and g ∈ C 3 (Bϵ (x∗ )),
then for x0 chosen close enough to x∗ , the fixed point algorithm xk+1 = g(xk )
converges cubically to x∗ .
4. Derive Simpson’s 3/8 rule by hand. For simplicity, let x0 = −1, xZ1 = −1/3,
1
x2 = 1/3, and x3 = 1 and we need to evaluate the weights, wk = Lk (x)dx
−1
where Lk (x) is the Lagrange basis function associated with node xk . Due to
symmetry we only need to evaluate w0 and w1 , and let w2 = w1 and w3 = w0 .
b−a a+b b−a
Finally obtain the general nodes xk = xk + and weights wk = .
2 2 2
5. Verify that the degree of accuracy of Simpson’s Rule is exactly 3.
–2– MA 311
a+b
6. Find the second-order Taylor expansion of f (x) at , and show that the error
2
of
Z bthe midpoint rule is
(b − a)3 ′′
f (x)dx − Q(f ) = f (c) for some c ∈ (a, b). Similarly let p1 (x) be the
a 24
linear interpolant of f (x) at x0 = a and x1 = b. Find the error f (x) − p1 (x) and
Z b
−(b − a)3 ′′
show that the error of trapezoidal rule is f (x)dx − Q(f ) = f (c).
a 12
70 −0.3t 43 −1.2t
has true solution y(t) = e − e . For each of the 3 methods: Euler,
9 9
Trapezoidal, Heun’s method, using ∆t = T /10, T /20, T /40 and T /80, calculate
the error
err = max |ytrue (ti ) − yi |
i=1,2,...,n
for each test. From these errors, calculate the convergence rates.