DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science

Similar documents
DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science

Lecture 5: Single Step Methods

Math 128A Spring 2003 Week 12 Solutions

Second Order ODEs. CSCC51H- Numerical Approx, Int and ODEs p.130/177

Differential Equations

Numerical Methods - Initial Value Problems for ODEs

TS Method Summary. T k (x,y j 1 ) f(x j 1,y j 1 )+ 2 f (x j 1,y j 1 ) + k 1

Do not turn over until you are told to do so by the Invigilator.

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

Fourth Order RK-Method

Numerical Methods for Ordinary Differential Equations

DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science

AN OVERVIEW. Numerical Methods for ODE Initial Value Problems. 1. One-step methods (Taylor series, Runge-Kutta)

4 Stability analysis of finite-difference methods for ODEs

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

Applied Math for Engineers

Do not turn over until you are told to do so by the Invigilator.

Ordinary Differential Equations

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Ordinary differential equation II

The Definition and Numerical Method of Final Value Problem and Arbitrary Value Problem Shixiong Wang 1*, Jianhua He 1, Chen Wang 2, Xitong Li 1

2.1 NUMERICAL SOLUTION OF SIMULTANEOUS FIRST ORDER ORDINARY DIFFERENTIAL EQUATIONS. differential equations with the initial values y(x 0. ; l.

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Numerical Solutions to Partial Differential Equations

What we ll do: Lecture 21. Ordinary Differential Equations (ODEs) Differential Equations. Ordinary Differential Equations

8.1 Introduction. Consider the initial value problem (IVP):

Numerical solution of ODEs

THE TRAPEZOIDAL QUADRATURE RULE

Initial value problems for ordinary differential equations

Scientific Computing: An Introductory Survey

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

Numerical Solution of Second Order Singularly Perturbed Differential Difference Equation with Negative Shift. 1 Introduction

Integration of Ordinary Differential Equations

Numerical Methods for Differential Equations

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Numerical Methods. King Saud University

Ordinary Differential Equations

Ordinary Differential Equations

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods

Numerical Methods in Physics and Astrophysics

HIGHER ORDER METHODS. There are two principal means to derive higher order methods. b j f(x n j,y n j )

1 Ordinary Differential Equations

Ordinary differential equations - Initial value problems

Ordinary Differential Equations

Notes on floating point number, numerical computations and pitfalls

x n+1 = x n f(x n) f (x n ), n 0.

Examination paper for TMA4215 Numerical Mathematics

Numerical Differential Equations: IVP

Continuous Block Hybrid-Predictor-Corrector method for the solution of y = f (x, y, y )

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

Solving PDEs with PGI CUDA Fortran Part 4: Initial value problems for ordinary differential equations

Solutions Preliminary Examination in Numerical Analysis January, 2017

Virtual University of Pakistan

Computation Fluid Dynamics

Differential Equations

Numerical Solutions to Partial Differential Equations

Lecture 6. Numerical Solution of Differential Equations B21/B1. Lecture 6. Lecture 6. Initial value problem. Initial value problem

Mini project ODE, TANA22

Initial Value Problems

Equations with regular-singular points (Sect. 5.5).

NAME: MA Sample Final Exam. Record all your answers on the answer sheet provided. The answer sheet is the only thing that will be graded.

Numerical Methods for Differential Equations

Solving Ordinary Differential Equations

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

A Survey of Numerical Methods in Fractional Calculus

Principles of Scientific Computing Local Analysis

Introduction to the Numerical Solution of IVP for ODE

FORTRAN 77 Lesson 7. Reese Haywood Ayan Paul

12 The Heat equation in one spatial dimension: Simple explicit method and Stability analysis

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

Euler s Method and Logistic Growth (BC Only)

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Ordinary Differential Equations: Initial Value problems (IVP)

Lecture 10: Finite Differences for ODEs & Nonlinear Equations

Euler s Method, cont d

Consistency and Convergence

Numerical Analysis Preliminary Exam 10.00am 1.00pm, January 19, 2018

Numerical Methods in Physics and Astrophysics

Department of Applied Mathematics Preliminary Examination in Numerical Analysis August, 2013

One-Step Hybrid Block Method with One Generalized Off-Step Points for Direct Solution of Second Order Ordinary Differential Equations

Exponential and. Logarithmic Functions. Exponential Functions. Logarithmic Functions

An Exponentially Fitted Non Symmetric Finite Difference Method for Singular Perturbation Problems

Chap. 20: Initial-Value Problems

Math 20B Supplement. Bill Helton. September 23, 2004

Notation Nodes are data points at which functional values are available or at which you wish to compute functional values At the nodes fx i

Math 20B Supplement. Bill Helton. August 3, 2003

MB4018 Differential equations

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

Explicit One-Step Methods

16.1 Runge-Kutta Method

M.SC. PHYSICS - II YEAR

Lecture 38. Almost Linear Systems

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

Linear Multistep Methods

Variational Methods & Optimal Control

Nonlinear Autonomous Systems of Differential

Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers

Transcription:

DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science ANSWERS OF THE TEST NUMERICAL METHODS FOR DIFFERENTIAL EQUATIONS ( WI3097 TU AESB0 ) Thursday April 6 05, 8:30-:30. [a] The test equation is given by y = λy, and we bear in mind that the amplification factor is defined by w n+ = Q(hλ)w n. () Then for the Trapezoidal Rule, we get w n+ = w n + h (λwn + λw n+ ) = w n + hλ (wn + w n+ ). () The above equation is rewritten as w n+ ( hλ ) = wn ( + hλ ). (3) Then, using the definition of the amplification factor, we immediately have Q T (hλ) = + hλ hλ The Modified Euler Method is treated analogously, to get. (4) ŵ n+ = w n + hλw n, w n+ = w n + h (λwn + λŵ n+ ), Combining the predictor and corrector, gives predictor corrector. (5) w n+ = w n + hλ (wn + w n + hλw n ) = w n ( + hλ + (hλ) ). (6) Finally, the definition of the amplification factor implies that [b] The local truncation error is defined by Q ME (hλ) = + hλ + (hλ). (7) τ n+ (h) = yn+ z n+, (8) h

where y n+ and z n+, respectively, denote the exact solution and the numerical approximation at time t n+ under using y n. Since, we use the test equation to estimate the local truncation error, we get z n+ = Q(hλ)y n. (9) The exact solution to the test equation at time t n+ is expressed in terms of y n by y n+ = y n e λh. (0) Substitution into the definition of the local truncation error, gives τ n+ (h) = yn h (ehλ Q(hλ)) = yn (hλ) ( + hλ + h + (hλ)3 3! + O(h 4 ) Q(hλ)), () where we used the Taylor expansion of the exponential around 0. For the Trapezoidal Rule, we have Q T (hλ) = + hλ hλ + hλ + (hλ) = ( + hλ )( + hλ + (hλ ) + ( hλ )3 + O(h 4 )) = + (hλ)3 4 + O(h 4 ). Using equation (), we get after some rearrangements () τ n+ (h) = yn λ 3 h + O(h 3 ) = O(h ). (3) The Modified Euler Method is treated similarly with to give via equation () Q ME (hλ) = + hλ + (hλ), (4) τ n+ (h) = yn λ 3 h + O(h 3 ) = O(h ). (5) 6 [c] Let y = y and let y = y, then y = y = y. Hence we have y = y, y = 4y + t. (6) The two equations are linear and therewith, one can rewrite this system using a matrix representation: ( ) ( ) ( ) ( ) y 0 y 0 = +, (7) 4 0 t y y

Further, we have y (0) = y(0) = and y (0) = y (0) = 0. [d] We use h =, and let A = ( ) ( ) 0 w, w = 4 0 w, w 0 = ( ), (8) 0 where the subscript stands for the component, whereas the superscript denotes the time index. The Trapezoidal Rule gives w = w 0 + h ( ) 0 (Aw0 + Aw + ). (9) This gives (I h A)w = (I + h A)w0 + h ( ) 0. (0) Substitution of h =, gives the following linear system ( ) ( ) 4 w = 3. () 4 This system is solved by w = ( ) 0.65.4 Next, we treat the Modified Euler Method. First, we carry out the prediction step ( ) ŵ = w 0 + haw 0 = + ( ) 0 =. (3) 0 4 Subsequently, we perform the corrector step Using h =, gives w = w = w 0 + h ( ) + (( ) 0 + 0 4 4 ( Aw 0 + Aŵ + ( ) + 4 () ( )) 0. (4) ( )) 0 = 3 4 [e] The local truncation errors for both methods are approximated by. (5) τn+(h) T = yn λ 3 h, τn+ EM (h) = yn λ 3 h. (6) 6 3

From these equations, it can be seen that the errors have the same order, although the error from the Trapezoidal Rule is about twice as small as the one from the Modified Euler Method in the limit for h 0. With regard to stability, the eigenvalues of A in the present initial value problem, are given by λ = ±i. Herewith, the following amplification factors are obtained: This gives the following moduli Q T (h) = + ±ih ±ih, Q ME(h) = ± ih h. (7) Q T (h) =, Q ME (h) = ( h ) + 4h = + 4h 4 >. (8) Hence the Trapezoidal Rule is neutrally stable, whereas the Modified Euler Method is unstable. The workload is smaller for the Modified Euler Method, since no linear system needs to be solved. Although the solution of the linear system may require considerable computation time if A is a very large matrix, the issue is not very important for the present case. Therefore, the Trapezoidal Rule is to be preferred for the present system since the system is just a two-by-two set of equations. Furthermore the Modified Euler Method is instable.. (a) Consider y(x) = x, then y (x) = x and y (x) =, substitution into the differential equation yields y (x) + xy = + xx = x 3, (9) hence y(x) = x satisfies the differential equation. Next, we check the boundary conditions: y (0) = 0 = 0 and y() = = which proves that the boundary conditions are also satisfied. Hence, y(x) = x is a solution of the boundary value problem. (b) Using central differences for the second order derivative at a node x j = jh, gives y (x j ) y j+ y j + y j h =: Q(h). (30) Here y j := y(x j ). Next, we will prove that this approximation is second order accurate, that is y (x j ) Q(h) = O(h ). Using Taylor s Theorem around x = x j, gives y j+ = y(x j + h) = y(x j ) + hy (x j ) + h y (x j ) + h3 3! y (x j ) + h4 4! y (η + ), y j = y(x j h) = y(x j ) hy (x j ) + h y (x j ) h3 3! y (x j ) + h4 4! y (η ). (3) 4

Here, η + and η are numbers within the intervals (x j, x j+ ) and (x j, x j ), respectively. Substitution of these expressions into Q(h) gives y (x j ) Q(h) = O(h ). This leads to the following discretization formula for internal grid nodes: w j + w j w j+ h + x j w j = x 3 j. (3) Here, w j represents the numerical approximation of the solution y j. To deal with the boundary x = 0, we use a virtual node at x = h, and we define y := y( h). Then, using central differences at x = 0 gives Using Taylor s Theorem, gives 0 = y (0) y y h =: Q b (h). (33) Q b (h) = y(0) + hy (0) + h y (0) + h3 3! y (η + ) (y(0) hy (0) + h y (0) h3 3! y (η )) h = y (0) + O(h ). Again, we get an error of O(h ). (c) With respect to the numerical approximation at the virtual node, we get (34) w w h The discretization at x = 0 is given by = 0 w = w. (35) w + w 0 w h =. (36) Substitution of equation (35) into the above equation, yields w 0 w h =. (37) Subsequently, we consider the boundary x =. To this extent, we consider its neighboring point x n, here substitution of the boundary condition w n = y() = y n = into equation (3), gives w n + w n h + x n w n = x 3 n + h = ( h)3 + h. (38) This concludes our discretization of the boundary conditions. In order to get a symmetric discretization matrix, one divides equation (37) by. 5

Next, we use h = /3, then, from equations (3, 37, 38), one obtains the following system 9w 0 9w = 9w 0 + 8 3 w 9w = 53 7 (39) 9w + 8 3 w = 97 7. (d) The truncation errors from the virtual grid point and internal points contain a third- and fourth order derivative, respectively (see part b). Since the exact solution is given by y(x) = x, the third and fourth order derivatives are zero. Hence, the error is zero at all grid points. Therefore, the numerical solution is given by w 0 = y 0 = 0, w = y = /9 and w = y = 4/9. Remark: This numerical solution can also be obtained from the solution of system (39). (e) Consider an interval of integration [x j, x j ], then the Rectangle Rule reads The composed integration rule is derived by I R j = hf(x j ), h = x j x j. (40) I R = h(i R + I R +... + I R n ) = h(f(x 0 ) +... + f(x n )), (4) which yields I R = 3 (0 + ( 3 ) + ( 3 ) ) = 5 7. (4) (f) For the interval of integration [x j, x j ] the Trapezoidal Rule is The composed integration rule is derived by I T = h(i T + I T +... + I T n ) = h( f(x 0) I T j = h (f(x j ) + f(x j )). (43) + f(x ) +... + f(x n ) + f(x n) ), (44) which leads to I T = 3 (0 + ( 3 ) + ( 3 ) + ) = 9 54. (45) (g) For a general number of subintervals, say n, the magnitude of the composed Rectangle- and Trapezoidal Rules, is bounded from above by ε R h max x [0,] y (x) h = n, ε T h max x [0,] y (x) h 6 = 6n. (46) 6

Here, the exact solution y(x) = x was used. Hence, the error from the Trapezoidal Rule is much smaller. Furthermore, from the composed Rules, it is easy to see that the number of function evaluations for the composed Rectangle- and Trapezoidal Rules is given by n and n +, respectively. Since n + lim n n =, (47) it follows that the amount of work for the Trapezoidal Rule is not significantly higher than it is for the Rectangle Rule. Hence, it is more attractive to use the Trapezoidal Rule. 7