MA/CS 615 Spring 2019 Homework #2

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.

FDM for parabolic equations

Multistage Methods I: Runge-Kutta Methods

MTH 452/552 Homework 3

Design of optimal Runge-Kutta methods

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

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

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

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

AIMS Exercise Set # 1

Ordinary Differential Equations II

Scientific Computing: An Introductory Survey

Lecture 42 Determining Internal Node Values

ODE Runge-Kutta methods

Strong Stability-Preserving (SSP) High-Order Time Discretization Methods

Ordinary Differential Equations II

Consistency and Convergence

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

Strong Stability Preserving Time Discretizations

Butcher tableau Can summarize an s + 1 stage Runge Kutta method using a triangular grid of coefficients

30 crete maximum principle, which all imply the bound-preserving property. But most

Applied Math for Engineers

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

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

Numerical Oscillations and how to avoid them

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

Surprising Computations

Opleiding Wiskunde & Informatica

ENO and WENO schemes. Further topics and time Integration

Multistep Methods for IVPs. t 0 < t < T

Selected HW Solutions

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

Advanced methods for ODEs and DAEs

Chapter 4. MAC Scheme. The MAC scheme is a numerical method used to solve the incompressible Navier-Stokes. u = 0

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)

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

Integration of Differential Equations

Parallel-in-time integrators for Hamiltonian systems

MecE 390 Final examination, Winter 2014

Optimal Implicit Strong Stability Preserving Runge Kutta Methods

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

Fourth Order RK-Method

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

Marching on the BL equations

The Initial Value Problem for Ordinary Differential Equations

Preliminary Examination in Numerical Analysis

CHAPTER 10: Numerical Methods for DAEs

Numerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Maths III - Numerical Methods

Numerical Marine Hydrodynamics Summary

Finite difference method for heat equation

Numerical Methods for Differential Equations

Introduction to numerical schemes

A numerical study of SSP time integration methods for hyperbolic conservation laws

Astrodynamics (AERO0024)

MATHEMATICAL METHODS INTERPOLATION

Ordinary Differential Equations (ODEs)

NUMERICAL ANALYSIS 2 - FINAL EXAM Summer Term 2006 Matrikelnummer:

ARTICLE IN PRESS Mathematical and Computer Modelling ( )

Numerical Methods for the Solution of Differential Equations

Linear Systems of Equations. ChEn 2450

CS520: numerical ODEs (Ch.2)

Strong Stability Preserving Properties of Runge Kutta Time Discretization Methods for Linear Constant Coefficient Operators

Initial value problems for ordinary differential equations

Tutorial 2. Introduction to numerical schemes

Mini project ODE, TANA22

Numerical Methods for Differential Equations

A Strong Stability Preserving Analysis for Explicit Multistage Two-Derivative Time-Stepping Schemes Based on Taylor Series Conditions.

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

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

Development and stability analysis of the inverse Lax-Wendroff boundary. treatment for central compact schemes 1

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

Ordinary differential equations - Initial value problems

Optimal Implicit Strong Stability Preserving Runge Kutta Methods

Differential Equations

MECH : a Primer for Matlab s ode suite of functions

Ordinary differential equations. Phys 420/580 Lecture 8

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

Solving scalar IVP s : Runge-Kutta Methods

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group

A Bound-Preserving Fourth Order Compact Finite Difference Scheme for Scalar Convection Diffusion Equations

Solutions Preliminary Examination in Numerical Analysis January, 2017

Initial Value Problems

Constructing High-Order Runge-Kutta Methods with Embedded Strong-Stability-Preserving Pairs

Exam in TMA4215 December 7th 2012

Chapter 6 - Ordinary Differential Equations

Euler s Method, cont d

Lecture IV: Time Discretization

Time stepping methods

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

Finite Difference and Finite Element Methods

Ordinary Differential Equations (ODEs)

Relevant self-assessment exercises: [LIST SELF-ASSESSMENT EXERCISES HERE]

Differential Equations

Homework Solution # 3

10 Numerical Solutions of PDEs

Lecture 4: Numerical solution of ordinary differential equations

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

The Milne error estimator for stiff problems

Transcription:

MA/CS 615 Spring 019 Homework # Due before class starts on Feb 1. Late homework will not be given any credit. Collaboration is OK but not encouraged. Indicate on your report whether you have collaborated with others and whom you have collaborated with. 1. (0 points) Analyze the wellposedness of the initial value problem u t = αu xx + βu xxxx, u(x, 0) = f(x) for four different cases: α 0, β 0. α 0, β < 0. α < 0, β 0. α < 0, β < 0.. (30 pts) The explicit third order strong stability preserving (SSP) Runge-Kutta method can be written as U (1) = U n + tf(u n ), U () = 3U n + 1(U (1) + tf(u (1) )), (0.1) 4 4 U n+1 = 1U n + (U () + tf(u () )). 3 3 in which U (1) and U () are obviously different from those in a standard form. The strong stability here (different from what we defined for LMM) refers to the feature that U n+1 can be written as a convex combination of several formal forward Euler steps, which is useful in enforcing nonlinear stability for high order Runge-Kutta methods. (a) (10 pts) Rewrite it in the standard form and find its Butcher tableau (c can be found as the sum of each row in A). c A b (b) (10 pts) Show that its local truncation error is third order for solving u (t) = f(u) (here we consider a simpler case in which f is a function of u only). (c) (10 pts) After eliminating inner stages, any explicit 3-stage Runge-Kutta method can be written as U n+1 = R(z)U n where R(z) = 1+zb T (I +za+z A )e with z = tλ and e = [1,, 1] T. Verify that R(z) = 1+z +z /+z 3 /6 for this third order Runge-Kutta by plugging in A and b. So this scheme has the same region of absolute stability as any other explicit 3-stage Runge-Kutta of order 3. 3. (0 pts) The explicit 4-stage fourth order Runge-Kutta for solving u = f(u, t) can also be written/implemented as F (1) = f(u n, t n ) 1

F () = f(u n + 1 tf (1), t n + 1 t) F (3) = f(u n + 1 tf (), t n + 1 t) F (4) = f(u n + tf (3), t n + t) U n+1 = U n + 1 6 t(f (1) + F () + F (3) + F (4) ) thus it requires four extra storage F (i), i = 1,, 3, 4 (or U (1), i = 1,, 3, 4 if implemented in the standard form). In the context of solving time-dependent PDEs by an explicit ODE solver, each F (i) or U (i) could be huge (think about solving the 3D Maxwell s equation). As an alternative, a low storage explicit 5-stage fourth order Runge-Kutta (LSERK) method is given by U (0) = U n, V (0) = U n V (i) = a i V (i 1) + tf(u (i 1), t n + c i t), i = 1,, 5 U (i) = U (i 1) + b i V (i), i = 1,, 5 U n+1 = U (5). with the coefficients given by rk4a = [ 0.0... 567301805773.0/1357537059087.0... 40467990393.0/01674669538.0... 3550918686646.0/091501179385.0... 17580637668.0/84570457699.0]; rk4b = [ 143997174477.0/9575080441755.0... 5161836677717.0/13610689357.0... 17014631549.0/09006949498.0... 3134564353537.0/4481467310338.0... 7781191437.0/1488151754819.0]; rk4c = [ 0.0... 143997174477.0/9575080441755.0... 566934149.0/68036396896.0... 006345519317.0/34310063776.0... 8031613138.0/943179651.0]; In each time step, it requires to evaluate the function f five times whereraz the explicit 4-stage fourth order Runge-Kutta only needs four times. In general, evaluating a nonlinear function f (or nonlinear/linear operator f in solving PDEs) is the most computationally expensive part. However, this does not necessarily mean that LSERK is more expensive than the 4-stage fourth order RK. For instance, if LSERK has a larger stability region then it may allow larger time steps to offset extra cost in one time step. (a) (10 pts) The LSERK solving u = λu can be written as U n+1 = R(z)U n. Find what R(z) is in terms of a, b and c. (Hint: The first five terms in R(z) are very easy to find

(why?). Once you know the first five terms, it becomes much simpler to find other higher order terms because you can ignore lower order terms of z when finding the coefficients for higher ones. There is no need to plug in the values of a, b and c. But we need to use the fact that a 1 = 0.) (b) (10 pts) Plot the stability regions of LSERK and the 4-stage fourth order RK. Which one is larger? Suppose we want solve the semidiscrete scheme U (t) = 1 KU (K is x the tridiagonal 1,, 1 matrix) for the heat equation using these two Runge-Kutta methods (with the largest possible stable time step), then for a given final time T = 1 which Runge-Kutta is more efficient (less number of matrix-vector multiplications KU)? 4. (30-35 pts) Consider the Kepler problem: where p = ( p1 p ), q = ( q1 q q = H p, p = H q, ) and the Hamiltonian is given by H(q, p) = p 1 + p 1 r 0.01 r 3 and r = q 1 + q. The initial conditions are q 1 (0) = 1 β, q (0) = 0, p 1 (0) = 0, p (0) = (1 + β)/(1 β), β = 0.6. Clearly, H = H q q + H p p = 0, so H(q(t), p(t)) = H(q(0), p(0)). Thus H(q(t), p(t)) H(q(0), p(0)) could be a simple error indicator, which underestimates the true error. The solution can be visualized by plotting q (t) vs. q 1 (t) in the q -q 1 plane (phase plane portrait), which looks like curves on a torus. Download Kepler reference q.m and run the following script in MATLAB to plot a reference solution in Figure 0.1 load('kepler reference q.mat');plot(q(1,:),q(,:)); axis equal;xlabel('q1');ylabel('q'); (a) Use the fourth-order Runge-Kutta to solve this ODE system with t = 0.0005 to the final time T = 500 as a reference solution. (b) Consider the second-order accurate A-stable implicit midpoint method ( ) u n+1 u n u n+1 + u n = f, t n+ 1 t for the ODE u = f(u, t). Implement the midpoint method for the ODE system. Use Newton s iteration to solve the nonlinear equations. 3

Figure 0.1: phase plane portrait (c) (30 points) Run the fourth-order Runge-Kutta and the midpoint method with t = 0.1 and t = 0.01 to the final time T = 500 (four runs in total). Plot the phase plane portraits (four figures with the same scale). Monitor the maximum of H(q(t), p(t)) H(q(0), p(0)). Let ū(t) denote the reference solution (u = (q, p) and you need to generate this reference using 4th order RK). Define the true error as e(t) = u(t) ū(t). Plot log e(t) vs. t (four curves in total). (d) (Bonus 5 points) What are your observations and conclusions for this particular problem? For instance, a forward Euler method to solve it can be implemented as (it will not generate an accurate solution with t = 0.001): function Kepler forwardeuler T=500; dt=0.001; Nt=T/dt; % u(:,i) is a vector of size 4 at time (i 1)*dt % u(1)=q1, u()=q, u(3)=p1, u(4)=p u=zeros(4,nt+1); % The initial condition beta=0.6; u(1,1)=1 beta; u(4,1)=sqrt((1+beta)/(1 beta)); % forward Euler for i=1:nt u(:,i+1)=u(:,i)+dt*rhs Kepler(u(:,i)); end % Phase Portrait of q1 q plot(u(1,:),u(,:));axis equal 4

xlabel('q1');ylabel('q') set(0,'defaulttextfontsize',18,'defaultaxesfontsize', 18) function f = RHS Kepler(u) % The right hand side functiosn % H p and H q for the modified Kepler problem % u(1)=q1, u()=q, u(3)=p1, u(4)=p r = sqrt(u(1)ˆ+u()ˆ); f=zeros(size(u)); f(1)=u(3); f()=u(4); f(3)= u(1)/rˆ3 0.015*u(1)/rˆ5; f(4)= u()/rˆ3 0.015*u()/rˆ5; 5