MTH 452/552 Homework 3

Similar documents
Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

Applied Math for Engineers

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

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

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

Fourth Order RK-Method

Numerical Methods for the Solution of Differential Equations

2 Numerical Methods for Initial Value Problems

The Initial Value Problem for Ordinary Differential Equations

NUMERICAL SOLUTION OF ODE IVPs. Overview

Numerical Methods for Differential Equations

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Linear Multistep Methods I: Adams and BDF Methods

Jim Lambers MAT 772 Fall Semester Lecture 21 Notes

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

Multistage Methods I: Runge-Kutta Methods

Lecture IV: Time Discretization

Solving Ordinary Differential equations

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 2. Predictor-Corrector Methods

9.6 Predictor-Corrector Methods

Math 128A Spring 2003 Week 12 Solutions

Numerical Methods - Initial Value Problems for ODEs

You may not use your books, notes; calculators are highly recommended.

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take

multistep methods Last modified: November 28, 2017 Recall that we are interested in the numerical solution of the initial value problem (IVP):

Ordinary Differential Equations II

Ordinary differential equations - Initial value problems

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

Multistep Methods for IVPs. t 0 < t < T

Numerical Differential Equations: IVP

CHAPTER 5: Linear Multistep Methods

Math 128A Spring 2003 Week 11 Solutions Burden & Faires 5.6: 1b, 3b, 7, 9, 12 Burden & Faires 5.7: 1b, 3b, 5 Burden & Faires 5.

Numerical Methods for Differential Equations

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations

Module 4: Numerical Methods for ODE. Michael Bader. Winter 2007/2008

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

1 Error Analysis for Solving IVP

5.6 Multistep Methods

Lecture V: The game-engine loop & Time Integration

MATH 350: Introduction to Computational Mathematics

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

CS520: numerical ODEs (Ch.2)

Ordinary Differential Equations II

Initial value problems for ordinary differential equations

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

Differential Equations

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

Section 7.4 Runge-Kutta Methods

Part IB Numerical Analysis

Astrodynamics (AERO0024)

CHAPTER 10: Numerical Methods for DAEs

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

Scientific Computing: An Introductory Survey

1 Introduction to MATLAB

MA/CS 615 Spring 2019 Homework #2

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

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

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

Initial value problems for ordinary differential equations

Southern Methodist University.

COSC 3361 Numerical Analysis I Ordinary Differential Equations (II) - Multistep methods

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Consistency and Convergence

On interval predictor-corrector methods

Lecture 10: Linear Multistep Methods (LMMs)

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

Numerical solution of ODEs

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

Solving Ordinary Differential Equations

1 Ordinary Differential Equations

Ordinary differential equation II

Applied Numerical Analysis

Ordinary Differential Equations

Opleiding Wiskunde & Informatica

Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

24, B = 59 24, A = 55

Solution: (a) Before opening the parachute, the differential equation is given by: dv dt. = v. v(0) = 0

Solving scalar IVP s : Runge-Kutta Methods

Appendix C: Recapitulation of Numerical schemes

Lecture 17: Ordinary Differential Equation II. First Order (continued)

AM205: Assignment 3 (due 5 PM, October 20)

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

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo

Predictor Corrector Methods of High Order for Numerical Integration of Initial Value Problems

Introduction to the Numerical Solution of IVP for ODE

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

Dynamic Systems. Simulation of. with MATLAB and Simulink. Harold Klee. Randal Allen SECOND EDITION. CRC Press. Taylor & Francis Group

Numerical Solution of ODE IVPs

Name of the Student: Unit I (Solution of Equations and Eigenvalue Problems)

The family of Runge Kutta methods with two intermediate evaluations is defined by

Computational Methods CMSC/AMSC/MAPL 460. Ordinary differential equations

Euler s Method, cont d

Chap. 20: Initial-Value Problems

Modeling & Simulation 2018 Lecture 12. Simulations

Time stepping methods


Numerical Integration of Ordinary Differential Equations for Initial Value Problems

4.4 Computing π, ln 2 and e

Unit I (Testing of Hypothesis)

Transcription:

MTH 452/552 Homework 3 Do either 1 or 2. 1. (40 points) [Use of ode113 and ode45] This problem can be solved by a modifying the m-files odesample.m and odesampletest.m available from the author s webpage. Consider the third order initial value problem (a) Verify that the function v (t) + v (t) + 4v (t) + 4v(t) = 4t 2 + 8t 10, v(0) = 3, v (0) = 2, v (0) = 2. v(t) = sin(2t) + t 2 3 is a solution to this problem. How do you know it is the unique solution? (b) Rewrite this problem as a first order system of the form u (t) = f(u(t), t) where u(t) lr 3. Make sure you also specify the initial condition u(0) = η as a 3-vector. (c) Use the matlab function ode113 to solve this problem over the time interval 0 t 2. Plot the true and computed solutions to make sure you ve done this correctly. (d) Test the matlab solver by specifying different tolerances spanning several orders of magnitude. Create a table showing the maximum error in the computed solution for each tolerance and the number of function evaluations required to achieve this accuracy. (e) Repeat part (d) using the matlab function ode45, which uses an embedded pair of Runge-Kutta methods instead of Adams-Bashforth-Moulton methods. (f) Make as many useful observations on the results in your tables as possible. Attempt to provide explanations. At least discuss which method performs better and why. 2. (40 points) [Use of explicit RK1, RK2 and RK4] (a) (452:) Write a code in the form of a.m function file for each of the following methods: I Forward Euler II Explicit Midpoint III Classical RK4 (5.33 in the text)

Each code should accept as input: the function defining the right-hand side of an ode (may be a vector valued function of a vector) f(t, u), an interval of time on which to find a numerical solution, the initial condition u 0, and the time-step k. Each code should output the solution and the times on which the solutions were approximated, i.e., {t n } N n=0 and { U n } N n=0. If we define f=@(t,u) t^2*sin(u) (see Example 5.10 in the text), an example of a calling sequence might be [t,u]=rk4(f,[0 1], 2,.001). (b) (552:) Write one code in the form of a.m function file which accepts each of the inputs in (a) plus a matrix A, and vectors b and c where A, b and c define the RK method to be used to compute the numerical solution. An example calling sequence might be [t,u]=rk(f,[0 1], 2,.001, A, b, c). (c) Use your code(s) from either (a) or (b) to answer the following questions. Consider the initial value problem Note that the exact solution is 1/t. u (t) = 5tu 2 + 5 t 1 t2, 1 t 25 u(1) = 1. i. Solve the IVP over the time interval 1 t 25 with Forward Euler using time-steps ranging from 2 2 to 2 9 halving the time-step for each subsequent case (i.e., j=[-2:-1:-9] and k=2^j). ii. Repeat (i) for Explicit Midpoint method. iii. Repeat (i) for classical RK4. iv. Make a table of the maximum absolute value of the error for each method above using each time-step. Also include the ratio of errors (see HW1 for an example of making a table in matlab ). The header of your table may look like k RK1 error RK1 ratio RK2 error RK2 ratio RK4 error RK4 ratio You may instead simply make one table for each method. v. Make as many useful observations on the results in your table(s) as possible. Attempt to provide explanations. At least discuss any rates of convergence that do not agree with theoretical expectations. Plotting solutions may help (e.g., Forward Euler using k =.25 and k =.125 in the same figure). vi. (552:) Comparing errors for methods with different numbers of stages is not fair. For each case above, compute the number of function evaluations required to find the solution (alternatively, you may use tic and toc to find the actual runtime). The ratio of error to cost gives a measure of the efficiency of a method for a given time-step k. Plot this efficiency ratio as a function of k for each method in the same figure. Discuss which method is most efficient (for this IVP). 2

3. (10 points) [Order conditions] Find a family of explicit third order accurate three-stage methods by filling in the Butcher array below 0??????? 2/3??? 1/4? α 4. (10 points) [Order of accuracy of Runge-Kutta methods] Consider the Runge-Kutta methods defined by the tableaux below. In each case show that the method is third order accurate in two different ways: (optional) First by checking that the order conditions (5.35), (5.37), and (5.38) are satisfied, and (required) then by applying one step of the method to u = λu and verifying that the Taylor series expansion of e kλ is recovered to the expected order. (a) Runge s 3rd order method: (b) Heun s 3rd order method: 0 1/2 1/2 1 0 1 1 0 0 1 1/6 2/3 0 1/6 0 1/3 1/3 2/3 0 2/3 1/4 0 3/4 5. (10 points) [Row-sum condition] The row-sum condition is actually not necessary for consistency. The one-stage Radau IA method defined as 0 1 1 is first order accurate (the proof involves Taylor expansions in two dimensions). Sketch one step of the method using k = 1 applied the sample problem u = t + 1/u, u(0) = 1. Include in your sketch the point where the direction field is sampled. Comment on whether this method seems like a good idea in general. 3

6. (15 points) [θ-method] For a given ODE u (t) = f(u), consider the θ-method for some value of θ, 0 θ 1. U n+1 = U n + k (θf(u n+1 ) + (1 θ)f(u n )) (a) What are the common names of the methods obtained by value i. θ = 0 ii. θ = 1 iii. θ = 1/2 (b) Write the θ-method as a general Runge-Kutta method using a Butcher array. (c) What is the order of the method (based on order conditions as given in the text)? 7. (5 points) [Use of implicit RK for linear systems] Write the explicit update step (in terms of the inverse of a matrix, do not invert the matrix), for the Backward Euler method applied to the linearized pendulum model (converted to a system of first order ODEs). 8. (5 points) [Use of implicit RK for non-linear equations] Write the explicit update step for the Backward Euler method applied to the non-dimensionalized logistic population model u (t) = r(1 u)u 9. (10 points) [Derivation of Adams-Moulton] Determine the coefficients β 0, β 1, β 2 for the third order, 2-step Adams-Moulton method using the expression for the local truncation error (from Section 5.9.1) ( r ) τ(t n+r ) = 1 r α j u(t n+j ) k β j u (t n+j ) k and taking a Taylor expansion of each function around t n. 10. (15 points) [Characteristic polynomials and LTE for LMM] Determine the characteristic polynomials ρ(ζ) and σ(ζ) for any three the following linear multistep methods. Also, verify that r ( ) 1 1 q! jq α j (q 1)! jq 1 β j = 0 for q = 1..p, and is not zero for q = p + 1, where p is the order of the method. 4

(a) The 2-step Adams-Bashforth method U n+2 = U n+1 + k 2 ( f(u n) + 3f(U n+1 )) (b) The 2-step Adams-Moulton method U n+2 = U n+1 + k 12 ( f(u n) + 8f(U n+1 ) + 5f(U n+2 )) (c) The 2-step Nyström method (explicit midpoint) U n+2 = U n + 2kf(U n+1 ) (d) The 2-step Milne-Simpson method (implicit Nyström) U n+2 = U n + k 3 (f(u n) + 4f(U n+1 ) + f(u n+2 )) (e) The 2-step Backward Differentiation Formula method (BDF) U n+2 = 4 3 U n+1 1 3 U n + 2k 3 f(u n+2) 11. (10 points) [Predictor-corrector methods] Show that the one-step Adams-Bashforth-Moulton method is actually an RK method (which one?). What is the order of this method? Is this consistent with expected order for a predictor-corrector method? 5