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

Exam in Numerical Analysis FMNF10/FMN050

2020–08–22
Exam duration 8:00–13:00. In order to pass, a minimum of 15 points is
required on the exam. The (preliminary) grade requirements are
grade 3 ≥ 15 p, grade 4 ≥ 21 p and grade 5 ≥ 26 p.

In case something seems suspicious from the online hand-in or the


Zoom monitoring, a follow-up oral exam will be schedule with you.

You are allowed to use a pocket calculator, but no other material of any
kind. Please answer the problems in Swedish or English.

Problems
1. Consider the linear system Ax = b, where the matrix A has the LU
factorization
  
1 0 0 1 1 1
A = LU =  2 1 0  0 1 3 .
−1 1 1 0 0 2

Solve Ax = b, with b = [1, 1, 0]T , by performing one forward and one back
substitution. (2p)

2. Let B be an invertible n × n matrix and p a fixed positive integer.


a) Write down the definitions of the matrix norm kBkp and the corre-
sponding condition number κp (B). (1p)

b) Prove that κp (B) ≥ 1. (1p)

c) We want to solve the linear system Bx = b on a computer. Assume


that the matrix B has a very large condition number κp (B). Explain
how this can influence the accuracy of the computed solution x (a
mathematical motivation is required). (2p)

3. We would like to approximate the intersection of the curves x = cos(y)+1


and cos(x) = y, by employing Newton’s method.
a) Formulate the problem as a system of nonlinear equations of the form
f (x, y) = 0. (1p)

b) Construct the Jacobian matrix at a point (x, y). (1p)

c) Introduce a suitable notation and perform one Newton iteration from


the starting point (x0 , y0 ) = (0, 0) and compute the approximation
(x1 , y1 ). (2p)

1
4.a) Construct the Lagrange interpolating polynomial that interpolates the
data below. (2p)

x -1 0 2
y 1 0 1

b) Your friend has sampled a time dependent function f (t) every two
seconds during an hour. Hence, 1801 data points ti , f (ti ) have been
collected, where ti = 2i and i = 0, 1, . . . , 1800.
However, you would like to have the function f (t) evaluated at every
second during the hour. One approach could be to interpolate the
data by a polynomial p(t) of degree 1800. The missing function values
are then approximated by evaluating the interpolating polynomial, i.e.,
f (ti ) ≈ p(ti ) for ti = 2i + 1 and i = 0, 1, . . . , 1799.
Explain why this is a terrible approach in terms of the expected accu-
racy of the missing function values. Suggest a better approach. (2p)

5. Fit a straight line y(x) = c0 + c1 x to the data given in Problem 4.a), by


using the least squares method. (2p)

6. We want to solve the two-point boundary value problem


y 00 (x) + x3 y 0 (x) + y(x) = 0,
with boundary values y(0) = 1 and y(1) = 2. Introduce a suitable notation
and discretize the problem by a standard second-order method, i.e., the
derivatives should be discretized as in Project 2. Construct the linear system
(in matrix-vector form) that has to be solved, and make sure to include the
boundary conditions. All details, such as matrix dimensions, vector lengths,
grid, step size ∆x, etc., must be clearly stated. (4p)

7. Consider the Matlab code below.


N = 70 ;
a = 0 ; b = 2 ;
dx = (b-a)/N ;
x = linspace(a+dx/2,b-dx/2,N)’ ;
fx = exp(-x.^2) ;
weights = dx * ones(1,N) ;
I = weights * fx ;
a) Which numerical method is implemented in the code? What does the
value I approximate? (2p)
b) How does the error of the implemented method decrease as the value
of N tends to infinity? (1p)

2
8. Consider the “real valued” test equation

y 0 (t) = λy(t), t > 0, λ < 0,

with some given initial value y(0) = α.

a) Set α = 2 and λ = −2. Approximate y(0.2) by using a second-order


method of your choice with the time step ∆t = 0.1. (2p)

b) Prove that the implicit Euler method is stable for all time steps ∆t
when applied to the “real valued” test equation. (2p)

9. We want to approximate the solution to the linear system Ax = b, with


b = [1, 2]T and  
9 2
A = ,
0 9
by employing the Gauss–Seidel method.

a) Write out the formula for the Gauss–Seidel iterates xi for the problem
at hand. (1p)

b) Prove that for any starting vector x0 the Gauss–Seidel approximation


xi converges to the exact solution x of the linear system Ax = b in the
∞-norm, i.e., kxi − xk∞ → 0 as i → ∞. (2p)

Lycka till!

You might also like