Tutorial Numerical

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

–1– MA 311

Indian Institute of Space Science and Technology


Thiruvananthapuram
MA 311- Numerical Methods
Tutorial

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

Classify the convergence rate as linear or superlinear.

2. Determine the roots of f (x) = x2 − e−x by Newton’s Method with x1 = 0. Carry


out three iterations each. Round the numbers to 5 digits.

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

7. Consider the following initial value problem on 0 ≤ t ≤ 2:

y ′ (t) = et (sin(t) + cos(t)) + 2t, y(0) = 1

The true solution is


y(t) = et sin(t) + t2 + 1.
Calculate solutions to this problem using Euler method and trapezoidal method
with varying discretizations ∆t = 1/10, 1/20, 1/40, 1/80, 1/160. Create a table
of error and convergence rates. Do your estimated convergence rates match the
theory for each method?

8. Consider the initial value problem

y ′ (t) = −1.2y + 7e−0.3t , y(0) = 3, 0 ≤ t ≤ 2.5 = T

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy