Department of Mathematical Sciences Examination paper for TMA425 Numerical Mathematics Academic contact during examination: Trond Kvamsdal Phone: 93058702 Examination date: 6th of December 207 Examination time (from to): 09:00 3:00 Permitted examination support material: C: Endre Süli and David Mayers An Introduction to Numerical Analysis (a copy is accepted) TMA425 Numerical Mathematics: Collection of Lecture Notes (5/ 203, 62 pages) Interpolation summary (4. October 20, 9 pages) Lecture notes on splines (26. October 207, 8 pages) Rottmann: Matematisk formelsamling Approved calculator Other information: All answers should be justified and include enough details to make it clear which methods and/or results have been used. All the (sub-)problems are worth 5 points each. The total value is 70 points. Language: English Number of pages: 6 Number of pages enclosed: 0 Checked by: Date Signature
TMA425 Numerical Mathematics 6th of December 207 Page of 6 Problem a) The matrix is symmetric because A T = A, but it is not positive definite because the determinant is zero: A = 4 4 2 4 2 = 0 The eigenvalues are {0, 4, 5}, so the matrix is positive semidefinite. b) Since the matrix is singular, the conditioning number is infinite. c) An LU-factorization means that we have the representation Writing out the equations, we get 0 0 d e g 2 3 a 0 0 f h = 2 5 7 b c 0 0 i 3 7 d = ad = 2 bd = 3 e = 2 ae + f = 5 be + cf = 7 g = 3 ag + h = 7 bg + ch + i = Solving these equations, we get 0 0 2 3 L = 2 0, U = 0 3 0 0 Problem 2 a) Using Lagrange interpolation, we get (x 2)(x 3) L(x) = (0 2)(0 3) = (x + ) 2 x(x 3) x(x 2) + 9 + (2 0)(2 3) (3 0)(3 2) 6 b) The same polynomial above satisfies the new imposed criterion.
Page 2 of 6 TMA425 Numerical Mathematics 6th of December 207 c) We use Hermite interpolation for this task. The function values are 0.0.0 f(x) = sin π x 0.0.0 2 f (x) = π cos πx π 0.0 2 2 2 The required Lagrange monomials are L 0 (x) = x, L (x) = x Using the definition of the auxiliary polynomials, we get H (x) = x 2 ( 2(x )) K 0 (x) = x( x) 2 We do not need H 0 and K because they are multiplied by 0, so the Hermite interpolation polynomial becomes p(x) = x 2 (3 2x) + π x(x )2 2 Problem 3 a) We use Cox-de Boor recursion on the two first splines: φ (x) = B[0, 0, 0, /2] = /2 x B[0, 0, /2] /2 0 ( ) 2 /2 x = B[0, /2] /2 0 = (2x ) 2 χ [0,/2] φ 2 (x) = B[0, 0, /2, ] = x 0 x B[0, 0, /2] + /2 0 0 = 2x /2 x B[0, /2] + ( x) /2 0 B[0, /2, ] ( ) x 0 x B[0, /2] + B[/2, ] /2 0 /2 = 2x( 2x + x)b[0, /2] + 2( x)( x)b[/2, ] = ( 6x 2 + 4x)χ [0,/2] + 2(x ) 2 χ [/2,]
TMA425 Numerical Mathematics 6th of December 207 Page 3 of 6 Due to symmetry, we can reflect φ 2 and φ about the origin and move the new spline one unit to the right. This is done by replacing x with x. With this transformation, φ 2 and φ become respectively φ 3 (x) = (2x 2 )χ [0,/2] + ( 6x 2 + 8x 2)χ [/2,] φ 4 (x) = (2x ) 2 χ [/2,] b) The equations for the nodes and weights are φ (x ) φ (x 2 ) [ ] 0 φ 2 (x ) φ 2 (x 2 ) φ (x) dx w = 0 φ 2(x) dx φ 3 (x ) φ 3 (x 2 ) w 2 0 φ 3(x) dx φ 4 (x ) φ 4 (x 2 ) 0 φ 4(x) dx Because of symmetry, the two quadrature weights w and w 2 are equal, and their sum equals, so we get w = w 2 = 2 Since φ has support in [0, /2], we find x as follows: w φ (x ) + w 2 φ (x 2 ) = 0 φ (x) dx /2 2 (2x ) 2 + 0 = (2x ) 2 dx 0 (2x ) 2 = 3 x = 2 ± 3 6 The symmetry of the nodes implies that x = 2 3 6, x 2 = 2 + 3 6 c) The characteristic of orthogonal polynomials is that given and interval [a, b] and a weight function w(x) we have: φ i φ j w(x)dx = 0 i j See Definition 9.4 page 260 in the textbook of Süli and Mayers. Orthogonal polynomials play an important role in finding the best polynomial approximation of function measured in the 2-norm. The zeroes of a set of orthogonal polynomials may also be used to determine the optimal numerical sampling points in a numerical integration scheme.
Page 4 of 6 TMA425 Numerical Mathematics 6th of December 207 E.g. the Legendre polynomials are a set of orthogonal polynomials and on the interval [, ] they are: φ 0 (x) =, φ (x) = x, and φ 2 (x) = 3 2 x2 2. The orthogonality condition is φ i φ j dx = 0 i j We have that xdx = 2 x2 = 0 3 2 x2 2 dx = 2 x3 2 x = 0 x 3 2 x2 2 dx = 3 8 x4 4 x2 = 0 Problem 4 a) Our function is defined as f(x) = 2x sin(x) + 2 The corresponding iteration function g and its derivative become g(x) = x 2 f(x) = 2 sin(x) g (x) = 2 cos(x) The point x is a zero of f if and only if it is a fixed point of the mapping x g(x). We observe that In this way, we obtain sup x R g (x) = sup x R g(x) g(y) = x y 2 cos(x) = 2 g (z) dz x y 2 Thus, g is a contraction mapping on R with contraction factor /2, and it follows from Banach s fixed point theorem that the fixed point iteration x k+ = g(x k ) converges to x for any starting value x 0 R.
TMA425 Numerical Mathematics 6th of December 207 Page 5 of 6 b) Since the maximal value of g (x) is /2 on R, and x = when x 0 = 0, we get the estimate k = ln x x 0 ln(e( L)) ln(/l) = ln 0 ln(2 6 ( /2)) ln(2) = ln(2 7 ) ln(2) = 7 We need 7 iterations before reaching the desired precision. Problem 5 a) We recognize that Φ(x n, y n ; h) = f(x n +h/2, (y n +y n+ )/2). Since Φ(x, y; 0) = f(x, y), the method is consistent. Since x n+ = x n + h, we obtain x n + h/2 = (x n + x n+ )/2 = x n+/2 and (y n + y n+ )/2 = y n+/2. Taylor expansion yields: y n+ = y n + hy n + h2 2 y n + h3 6 y y n+/2 = f(x n + h/2, (y n + y n+ )/2) = y n + h 2 y n + h2 4 y n + O(h 3 ) With these formulas, we get the truncation error n + O(h 4 ) T n = y n+ y n hf(x n + h/2, (y n + y n+ )/2) ( ) ( = y n + hy n + h2 2 y n + h3 6 y n + O(h 4 ) y n h y n + h ) 2 y n + h2 4 y n + O(h 3 ) = h3 2 y n + O(h 4 ) Since T n = O(h 2+ ), the method is of second order. Alternatively, we can utilize that the Butcher tableau is /2 /2 The second order conditions are satisfied because b =, b c = 2
Page 6 of 6 TMA425 Numerical Mathematics 6th of December 207 b) We replace f(t, y) with λy and obtain y n+ = y n + λh y n + y n+ ( 2 λh ) ( y n+ = + λh ) y n n n y n+ = + z z y n This is the stability function for the implicit midpoint rule, which is A-stable. c) Implicit methods are appropriate to use when the time-step for an explicit method is governed by its stability, not the accuracy. This is typical for stiff problems.