Numerical Methods Exam 2015 PDF

Title Numerical Methods Exam 2015
Course Numerical Methods II
Institution The University of Adelaide
Pages 7
File Size 184.8 KB
File Type PDF
Total Downloads 28
Total Views 150

Summary

2015 examination for Numerical Methods. Good luck...


Description

Examination in School of Mathematical Sciences Semester 2, 2015

104838 MATHS 2104 Numerical Methods II 104839 MATHS 7104 Numerical Methods

Official Reading Time: 10 mins Writing Time: 120 mins Total Duration: 130 mins NUMBER OF QUESTIONS: 5

TOTAL MARKS: 63

Instructions • Attempt all questions. • Begin each answer on a new page. • Examination materials must not be removed from the examination room. Materials • 1 Blue book is provided. • A calculator is required. Only calculators without remote communications or CAS capability are allowed. The memory must be cleared before entering the examination room. • A formula sheet is attached.

DO NOT COMMENCE WRITING UNTIL INSTRUCTED TO DO SO. Page 1 of 7

Numerical Methods II

Page 2 of 7

1. Consider the equispaced data (0, f 0 ), (h, f1 ), (2h, f2 ), where fj = f (jh) for j = 0, 1, 2. (a) Write down the Lagrange form of the quadratic interpolating polynomial that passes through these points. [2 marks] (b) Use the interpolant found in part (a) to obtain estimates of (i) f1/2 = f (h/2) and 0 = f 0 (h/2) (ii) the derivative f1/2 in terms of h, f0 , f1 and f2 .

[3 marks]

(c) Use the polynomial interpolation error theorem to find bounds for the absolute value of the error of the estimate of f1/2 obtained from part (b)(i). [4 marks] (d) Figure 1 shows the actual error of the approximation derived in part (b)(i) for two different functions. Are these results consistent with the error bound you developed in part (c)? Explain your answer. [2 marks] 0 -2

log10 |error|

-4 -6 -8 -10 -12 -14 -4

f (x) = sin x f (x) = x3/2

-3.5

-3

-2.5

-2

-1.5

-1

log10 h

Figure 1: Actual error obtained when interpolating functions f (x) using the estimate of f1/2 obtained in (b)(i). (e) An estimate of the derivative f00 = f 0 (0) is f 0 (0) ⇡

3f0 + 4f1  f2 . 2h

Use Taylor’s theorem to show that the error of this approximation is O(h2 ). [4 marks] [TOTAL 15 marks] Please turn over for page 3

Numerical Methods II

Page 3 of 7

2. Simpson’s rule for approximating the definite integral of a function f (x) is Z xj+1 h f (x) dx ⇡ (fj1 + 4fj + fj+1). 3 xj−1

(1)

where xj1 , xj and xj+1 are equispaced points with spacing h = xj+1  xj = xj  xj1 and fj = f (xj ). (a) Use an appropriate extension of Simpson’s rule (1) to estimate Z

0.8

f (x) dx 0

given the discrete data listed in Table 1 below. Show your working. Use all values in the table. [3 marks] j xj fj

1 2 3 4 5 0 0.2 0.4 0.6 0.8 0.2 0.5 0.8 1.0 1.2

Table 1: Discrete samples of f (x). (b) Consider the integral I=

Z

b

f (x) dx.

(2)

a

Suppose that fj = f (xj ), where xj = a + (j  1)h, j = 1, . . . , n, h = (b  a)/(n  1), and n is odd. Use Simpson’s rule (1) to show that ✓ ◆ n1 n2 X X h f1 + 4 I⇡ fj + fn fj + 2 3 j=2 j=3 j even

(3)

j odd

[3 marks] (c) The error in the approximation (1) is Z xj+1 h h5 "j = f (x) dx  (fj1 + 4fj + fj+1) =  f (iv) (t) 90 3 xj−1

(4)

for some t in the interval [xj1 , xj+1]. Hence show that the error of the approximation (3) is bounded by 1 |error|  (b  a)Mh4 , (5) 180 where |f (iv) (t)|  M for a  t  b. [4 marks] [TOTAL 10 marks] Please turn over for page 4

Numerical Methods II

Page 4 of 7

3. The position of a comet or planet in orbit about the sun is given by r=

p , 1 + e cos ✓

(6)

where p and e are parameters that determine the shape and size of the orbit and r and ✓ are polar coordinates. Depending on the value of e, the orbit may be elliptic (0 < e < 1), parabolic (e = 1) or hyperbolic (e > 1). Consider the problem of finding p and e such that (6) best fits the following observations of a newly-discovered object: ✓j rj

0.12 1.87 2.75 3.03 0.52 1.38 5.90 9.45

(a) Show that the vector of differences between the model (6) and the observations can be written in the form e = Ax  b, where x = [p, e]T . Make sure you clearly def ine the elements of the matrix A and the vector b. [3 marks] (b) Let A = QR, where Q is an orthogonal matrix. Show that kek = kRx  QT bk, stating any properties of orthogonal matrices that you use. [3 marks] (c) Find the vector x that minimises kek. You are given the following Matlab transcript: >> [Q, R] = qr(A) Q = -0.5000 -0.5247 -0.4921 -0.4823 -0.5000 -0.4094 0.2319 0.7271 -0.5000 0.2211 0.7090 -0.4455 -0.5000 0.7130 -0.4488 0.2007 R = 2.0000 7.3676 0 -8.0053 0 0 0 0 >> Q’*b 8.6250 -7.2039 -0.0060 -0.0207 Here, A is the matrix A and b is the vector b from part (a). Make sure that you explain your answer and show all your working. [3 marks] [TOTAL 9 marks]

Please turn over for page 5

Numerical Methods II

Page 5 of 7

4. (a) Consider the nonlinear equation 2

x = ex .

(7)

(i) Use Taylor’s theorem to derive the Newton iteration formula xk+1 = xk 

f (xk ) f 0 (xk )

for solving f (x) = 0.

[2 marks]

(ii) Write down the formula for the Newton iteration to solve (7) in the form xk+1 = xk  · · · [2 marks] (iii) Using an initial guess x0 = 0.6, find a solution of (7) to three decimal places. Show your working and make sure you do enough iterations that it is clear that the required accuracy has been obtained. [2 marks] (b) Consider the linear system Ax = b. (i) Starting from the linear system Ax = b, derive the Jacobi iteration formula x(k) = x(k1)  D 1 r (k1). Make sure you explain what D and r (k1) are.

[3 marks]

(ii) Let A be the matrix A and b be the vector b. Write a short script that implements Jacobi iteration. [5 marks] (iii) Suppose that 3 4 1 2 A = 42 2 55 , 2 4 1 2

2 3 3 b = 44 5 . 2

Can Jacobi iteration be used to solve the above system? Explain your answer, making sure that you explain any terms you use. [4 marks] [TOTAL 18 marks]

Please turn over for page 6

Numerical Methods II

Page 6 of 7

5. Consider the initial value problem, dy = f (t, y), dt

y(t0 ) = y0 .

(8)

The improved Euler method is yk+1 = yk +

⇤ 1⇥ F1 + F2 , 2

(9)

where F1 = hf (tk , yk ), F2 = hf (tk + h, yk + F1 ) and h is the step size. (a) Suppose that f (t, y) = t  y 2 and y(0) = 1. Find an approximate value of y(0.2) using a single step of the improved Euler method. Show your working. [4 marks] (b) Consider the following Matlab implementation of the modified Euler method. function y = meuler(func, t, y0) % Modified Euler integration n = length(t); y = zeros(length(y0), n); y(:,1) = y0(:); for k = 1:n-1 h = t(k+1) - t(k); y12 = y(:,k) + 0.5*h*func(t(k), y(:,k)); y(:,k+1) = y(:,k) + h*func(t(k) + 0.5*h, y12); end Write a Matlab script that uses meuler to solve the second-order initial-value problem y 00 + 4y 0 + y 3 = cos t, y(0) = 1, y0 (0) = 2, using 100 points on the interval 0  t  20. Show your working.

[7 marks] [TOTAL 11 marks]

Please turn over for page 7

Numerical Methods II

Page 7 of 7

Useful Formulae The Lagrange form of the interpolation polynomial is pn (x) =

n X

fk Lk (x),

n Y x  xi , Lk (x) = xk  xi i=0 i6=k

k=0

where n is the degree of the polynomial. If f (x) has n + 1 continuous derivatives on the smallest interval I that contains {x, x0 , . . . , xn }, then the error of the polynomial interpolant is n f n+1(t) Y ✏n (x) = f (x)  pn (x) = (x  xk ) (n + 1)! k=0

where the unknown t 2 I depends on x. If a function f (x) has (n + 1) derivatives in the neighbourhood of a point x = a, then f (x) = f (a) + f 0 (a)(x  a) +

f (n+1)(t) f (n) (a) f 00 (a) (x  a)n + ( x  a) 2 + · · · + (x  a)n+1 , n! 2! (n + 1)!

for some t between a and x.

Final page...


Similar Free PDFs