UNIVERSITY OF EAST ANGLIA School of Mathematics Main Series UG Examination 216 17 INTRODUCTION TO NUMERICAL ANALYSIS MTHE712B Time allowed: 3 Hours Attempt QUESTIONS 1 and 2, and THREE other questions. Notes are not permitted in this examination. Do not turn over until you are told to do so by the Invigilator. MTHE712B Module Contact: Dr. Jennifer Ryan, MTH Copyright of the University of East Anglia Version: 2
- 2-1. Consider the linear hyperbolic equation where α is a given constant. u t + α u =, x (x, t) [, 2π (, T, (1) u(x, ) =u (x), (i) Consider the discretised equation using the Lax-Wendroff finite difference method, u n+1 j = ν 2 (1 + ν)un j 1 + (1 ν 2 )u n j ν 2 (1 ν)un j+1. Assume that the approximation at (x j, t) is given by u n j = û(t)e ikx. (a) Derive the amplification factor for the Lax-Wendroff method. (b) Use the relation that (1 ν 2 ) iν sin(kh) + ν 2 cos(kh) 1 to obtain the stability condition for ν for the Lax-Wendroff approximation. [11 marks (ii) (a) Give an interpretation for what it means for a numerical method to be conservative. (b) Let ū n j = 1 x xj+1/2 x j 1/2 Finite Volume formulation, be the cell average over I j = (x j 1/2, x j+1/2 ). Derive the ū n+1 j = ū n j t x (F n j+1/2 F n j 1/2), that is used to approximate solutions to the Equation u t + f(u) =. x [9 marks MTHE712B Version: 2
- 3-2. Consider the two point Gauss Quadrature rule 1 1 f(x) dx = w 1 f(x 1 ) + w 2 f(x 2 ) such that the nodes x 1, x 2 and weights w 1, w 2 are given by w 1 (x 1 ) m + w 2 (x 2 ) m = 1 m + 1 [1 ( 1)m+1, m =,..., 3. (2) (i) Use Equation (2) and the fact that w 1 = w 2 and x 1 = x 2 to determine the nodes and weights in the Gauss Quadrature formula. [8 marks (ii) Notice the above formula is for integrating a function over ( 1, 1). Transform this formula to apply to integrating a function over the general interval (a, b). That is, determine the formula that applies to b a f(x) dx. (iii) Consider the integral 1 x m dx. (a) For which values of m is the two-point Gauss Quadrature rule is exact? (b) Evaluate the exact integral. For the values of m = 3, 4, approximate the integral using the Gauss quadrature rule and determine the error. [7 marks MTHE712B PLEASE TURN OVER Version: 2
- 4-3. We seek a difference formula for the first derivative of a function f(x) at x = of the form such that Q(h) = 1 h ( ( α f h ) ) + α 1 f() + α 2 f(h) 2 f () Q(h) = O(h 2 ). (3) (i) Give the first four terms for the Taylor expansions of f( h ), f(), f(h) around 2 zero. (ii) Use the results from (i) and Equation (3) to show that the coefficients α, α 1 and α 2 satisfy the system 1 1 1 1/2 1 1/8 1/2 α α 1 α 2 = 1 and that the solution is therefore α = 4 3, α 1 = 1, α 2 = 1 3. [6 marks (iii) Use the information in Table 1 along with Richardson s method which assumes that the form of the error is f () Q(h) = Kh 2 to give an estimate of the error f () Q(1/5) and determine the constant, K. [9 marks x -.4 -.3 -.2 -.1.1.2.3.4 f(x) -.9511 -.89 -.5878 -.39.32.5878.89.9511 Table 1: The values of a function, f(x), for a given x. MTHE712B Version: 2
- 5-4. Suppose that we are given the nonlinear equation f(x) =. (i) Let p be a fixed point of a function f(x) such that f has a continuous derivative. Consider the fixed point iteration p k+1 = g(p k ) = p k f(p k) α, α R. Show that this always converges to a fixed point of f(x) if < f (p) < α and p sufficiently close to p by first stating the Convergence theorem. [15 marks (ii) Consider the Newton-Raphson method p n+1 = p n f(p n) f (p n ). (a) Determine p 1 using the Newton-Raphson method for f(x) = x 2 2x 2 with p = 1. (b) Can p = 1 be used as the beginning value? Why or why not? MTHE712B PLEASE TURN OVER Version: 2
- 6-5. For the numerical integration of the first order differential equation y = f(t, y), y() = y, we use the modified Euler method w n+1 =w n + hf(t n, w n ), w n+1 =w n + h 2 (f(t n, w n ) + f(t n+1, w n+1)), (4) where h denotes the timestep and w n represents the numerical solution at time t n. (i) By using the general form of the equation, y = f(t, y), show that the local truncation error is of order O(h 2 ). [1 marks (ii) Consider the initial value problem d dt [ x1 x 2 [ x1 x 2 [ 1 = 3 4 = [ 1 2. [ x1 x 2 [ + cos(t), Calculate one step with the modified Euler method, in which h = 1 1 and t = using the given initial conditions. (iii) Determine the amplification factor. MTHE712B Version: 2
- 7-6. For the numerical solution of the differential equation y = f(t, y) with y() = y, we use the fourth order Runge-Kutta method (RK4): k 1 = hf(t n, w n ), k 3 = hf(t n +.5h, w n +.5k 2 ), k 2 = hf(t n +.5h, w n +.5k 1 ), k 4 = hf(t n + h, w n + k 3 ), w n+1 = w n + 1 6 (k 1 + 2(k 2 + k 3 ) + k 4 ). and consider the equation [ [ d x1 = dt x 2 1 251 1 [ x1 x 2 [ + cos(t). (5) Figure 1: The stability region for RK4. (i) Find the eigenvalues of the matrix in Equation (5). (ii) Use the illustration in Figure 1 to give an approximate stability condition. (iii) Derive the amplification factor for RK4. (iv) Use the fact that y(t n+1 ) = e hλ y(t n ) holds for the exact solution of y = λy to show that the RK4 method solves the homogeneous test equation with a local truncation error of O(h 4 ). MTHE712B PLEASE TURN OVER Version: 2
- 8 - END OF PAPER MTHE712B Version: 2
MTHE612B/MTHE712B Exam Feedback Overall students did well on the exams, especially students that performed all coursework and laboratory exercises during the semester. Q1: This question was overall done well. The difficulties were: MTHE712B: The definition of conservative scheme and why a finite volume approximation is needed appeared to be lacking. MTHE612B: Overall students did well on this problem, but some had difficulty obtaining an error bound. Q2: The majority of the students did well. The only difficulty seemed to be in evaluating the integral and determining for which values of m the quadrature rule is exact. Q3: The majority of the students did well. However, some had difficulty in deriving the equations that determine the coefficients. Q4: Those that chose to do this problem did well. Q5: The difficulties encountered on this question were: (i) not performing the correct expansion for the modified Euler method; and (ii) neglecting to apply the method to the system of equations. Q5: The main difficulty of this question was not identifying the stability region of the 4th order Runge-Kutta method to be 2.8 λ. 1