Lecture 17: Initial value problems

Similar documents
Partial differential equations

q t = F q x. (1) is a flux of q due to diffusion. Although very complex parameterizations for F q

Advection / Hyperbolic PDEs. PHY 604: Computational Methods in Physics and Astrophysics II

Numerical methods Revised March 2001

7 Hyperbolic Differential Equations

Chapter 3. Finite Difference Methods for Hyperbolic Equations Introduction Linear convection 1-D wave equation

3.3. Phase and Amplitude Errors of 1-D Advection Equation

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 13

MIT (Spring 2014)

PDEs, part 3: Hyperbolic PDEs

Finite difference methods for the diffusion equation

Numerical Solutions to PDE s

Chapter 10 Exercises

FUNDAMENTALS OF FINITE DIFFERENCE METHODS

Part 1. The diffusion equation

Fundamentals Physics

Numerical Hydraulics

Basics of Discretization Methods

Lecture Notes on Numerical Schemes for Flow and Transport Problems

3.4. Monotonicity of Advection Schemes

Lecture Notes on Numerical Schemes for Flow and Transport Problems

1D Wave PDE. Introduction to Partial Differential Equations part of EM, Scalar and Vector Fields module (PHY2064) Richard Sear.

Numerical Methods for PDEs

Dissipation and Dispersion

2 Multidimensional Hyperbolic Problemss where A(u) =f u (u) B(u) =g u (u): (7.1.1c) Multidimensional nite dierence schemes can be simple extensions of

2.2. Methods for Obtaining FD Expressions. There are several methods, and we will look at a few:

ME Computational Fluid Mechanics Lecture 5

arxiv: v1 [physics.comp-ph] 22 Feb 2013

Numerical Solutions for Hyperbolic Systems of Conservation Laws: from Godunov Method to Adaptive Mesh Refinement

Ordinary Differential Equations II

Ordinary Differential Equations II

Tutorial 2. Introduction to numerical schemes

The Finite Difference Method

MITOCW ocw feb k

Numerical Methods for Conservation Laws WPI, January 2006 C. Ringhofer C2 b 2

Numerical Integration of Linear and Nonlinear Wave Equations

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

Approximations of diffusions. Mathématiques appliquées (MATH0504-1) B. Dewals, Ch. Geuzaine

1 Upwind scheme for advection equation with variable. 2 Modified equations: numerical dissipation and dispersion

Numerical Solutions to Partial Differential Equations

A second look at waves

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

Math 46, Applied Math (Spring 2009): Final

Introduction LECTURE 1

Diffusion / Parabolic Equations. PHY 688: Numerical Methods for (Astro)Physics

Fraunhofer Institute for Computer Graphics Research Interactive Graphics Systems Group, TU Darmstadt Fraunhoferstrasse 5, Darmstadt, Germany

Design of optimal Runge-Kutta methods

Finite difference modelling, Fourier analysis, and stability

Second year master programme

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

Finite Differences: Consistency, Stability and Convergence

Deutscher Wetterdienst

Some observation on developments in lossy TLM

Conservation of Mass (Eulerian Framework)

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

1 Introduction to MATLAB

Homework 7 Solutions

A Taylor series method for numerical fluid mechanics

Math 7824 Spring 2010 Numerical solution of partial differential equations Classroom notes and homework

The Heat Equation John K. Hunter February 15, The heat equation on a circle

Chapter 1. Introduction

5. FVM discretization and Solution Procedure

Finite Difference Solution of the Heat Equation

The Finite Difference Method

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

Multi-Factor Finite Differences

Module 3: BASICS OF CFD. Part A: Finite Difference Methods

Acoustic Wave Equation

CS205B / CME306 Homework 3. R n+1 = R n + tω R n. (b) Show that the updated rotation matrix computed from this update is not orthogonal.

Chapter 4. Nonlinear Hyperbolic Problems

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic

NUMERICAL SOLUTION OF THE LINEARIZED EULER EQUATIONS USING HIGH ORDER FINITE DIFFERENCE OPERATORS WITH THE SUMMATION BY PARTS PROPERTY

DOING PHYSICS WITH MATLAB WAVE MOTION

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

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Ordinary Differential Equations

Numerical Hydraulics

CHAPTER 4 FOURIER SERIES S A B A R I N A I S M A I L

Finite difference method for heat equation

Salmon: Introduction to ocean waves

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations

FDTD for 1D wave equation. Equation: 2 H Notations: o o. discretization. ( t) ( x) i i i i i

Last time: Diffusion - Numerical scheme (FD) Heat equation is dissipative, so why not try Forward Euler:

Time stepping methods

Time Adaptivity Stable Finite Difference for Acoustic Wave Equation

The Advanced Research WRF (ARW) Dynamics Solver

Finite Difference Methods for

Advanced Partial Differential Equations with Applications

1 Separation of Variables

1.1 Motivation: Why study differential equations?

Numerical Methods for Partial Differential Equations CAAM 452. Spring 2005

Evolution equations with spectral methods: the case of the wave equation

Chaotic motion. Phys 750 Lecture 9

Krylov single-step implicit integration factor WENO methods for advection-diffusion-reaction equations

Elliptic Problems / Multigrid. PHY 604: Computational Methods for Physics and Astrophysics II

The Finite-Difference Time-Domain (FDTD) Algorithm

FOURIER TRANSFORM METHODS David Sandwell, January, 2013

Split explicit methods

The Finite-Difference Time-Domain (FDTD) Algorithm

Transcription:

Lecture 17: Initial value problems Let s start with initial value problems, and consider numerical solution to the simplest PDE we can think of u/ t + c u/ x = 0 (with u a scalar) for which the solution is a wave travelling in the +x direction, u = f(x ct) (The PDE satisfied for any function f) 380

Initial value problems Create a grid in space and time, where subscripted index j labels space and superscripted index n labels time Our grid then has x j = jδx and t n = nδt Given u n j, (i.e. the spatial dependence of U at the nth time step), we wish to step forward in time and determine u j (NB n and are superscripts, not powers) 381

Finite difference equations As usual, we use finite difference equations to represent derivatives Simplest choice for the time derivative: forward Euler differencing ( u/ t) j,n = (u j u jn ) / Δt allows us to compute u j in terms of only quantities known at timestep n. 382

Finite difference equations Simple choice for the spatial derivative: ( u/ x) j,n = (u j+1n u j 1n ) / 2Δx Finite difference equation becomes (u j u jn ) / Δt + (c/2δx) (u j un 1 j ) = 0 u j = u jn (cδt /2Δx) (u j+1n u j 1n ) 383

Forward Time Center Space (FTCS) This simplest possible scheme is called Forward Time Center Space (FTCS) The error is of order (Δt) 2 (Δx) 3 second-order accurate in space, because we take the difference between positions on either side to determine ( u/ x) j,n first order accurate in time, because we approximate the derivative ( u/ t) j,n by its mean value over the range n to. 384

Forward Time Center Space (FTCS) This simple scheme is explicit (u j can be written explicitly in terms of quantities already calculated) It is also a single-level scheme (in that it only involves values at time level n) Graphical representation: n,t for / t for / x already known new point j,x 385

Stability of PDEs Stability is always a key issue in PDEs (more so than for ODEs) Q: under what circumstances is the FTCS scheme stable? Address this with the von Neumann stability analysis 386

von Neumann stability analysis Suppose we start with a sine wave of wavelength 2π/k: u jn = ξ n e ikjδx At the next step, the FTCS scheme yields u j = u jn (cδt /2Δx) (u j+1n u j 1n ) = u jn (1 (cδt /2Δx) [e ikδx e ikδx ]) = ξ n (1 i (cδt /Δx) sin(kδx) ) 387

von Neumann stability analysis So at step, our sine wave has amplitude ξ =(1 i (cδt /Δx) sin(kδx)) ξ n Define R ξ /ξ n = {1+[cΔt sin(kδx)/δx] 2 } > 1 The magnitude is therefore growing exponentially for all k (i.e. for all Fourier components of u jn ) unconditional instability for any stepsize however small! FTCS never works except over very short time periods! 388

The Lax method Amazingly, a very minor change to this scheme (introduced by Lax) fixes this unconditional instability Instead of u j = u jn (cδt /2Δx) (u j+1n u j 1n ) we use u j = ½(u n j+1 + u n j 1 ) (cδt /2Δx)(u j+1n u j 1n ) 389

The Lax method Like FTCS, the Lax scheme is isexplicit (u can be written explicitly in terms of quantities already calculated) is a single-level scheme (in that it only involves values at time level n) accurate to order (Δt) 1 (Δx) 2 Graphical representation: n,t for / t for / x already known new point j,x 390

Stability of the Lax method von Neumann stability analysis: starting again with a sine wave of wavelength 2π/k: u jn = ξ n e ikjδx At the next step, the Lax scheme yields u j = ½(u j+1 n + u j 1n ) (cδt/2δx) (u j+1n u j 1n ) = u jn (½[e ikδx + e ikδx ]) (cδt/2δx) [e ikδx e ikδx ]) = ξ n (cos(kδx) i(cδt/δx)sin(kδx) ) 391

von Neumann stability analysis Now, the amplitude growth is governed by R, where R ξ /ξ n = {cos 2 (kδx)+[cδt/δx] 2 sin 2 (kδx)} = 1 + ([cδt/δx] 2 1) sin 2 (kδx) The stability criterion is then R < 1 cδt < Δx (for any k) 392

Courant-(Friedrichs-Lewy) stability criterion This stability criterion cδt < Δx tells us that Δt must be sufficiently small that we don t require information from points beyond those sampled at step n (step too large) okay for Step ct Step n x 393

Relation of Lax to FTCS Note also that the Lax scheme applied to u/ t + c u/ x = 0 u j = ½(u j+1n +u n j 1 ) (cδt /2Δx)(u j+1n u j 1n ) can be written u j = u jn (cδt /2Δx)(u j+1n u j 1n ) + ½(u n j+1 2u jn +u j 1n ) Additional term added to FTCS recipe 394

Relation of Lax to FTCS This additional term is the finite difference expression for 2 u/ x 2 In fact, we would use just this recipe if used FTCS to solve u/ t + c u/ x [(Δx) 2 /2Δt] 2 u/ x 2 = 0 Diffusion term damps out amplitude growth 395

Upwind differencing For simple problems, an asymmetric expression for the spatial derivative can remove instability: we can force information to flow in the physical wave direction u j = u jn (cδt /Δx)(u n j+1 u jn ) c < 0 u j = u jn (cδt /Δx)(u jn u j 1n ) c > 0 396

Errors in the integration of PDEs Exponential decay is clearly preferable Short wavelength perturbations decay fastest because decay rate 1 R sin 2 (kδx) Not surprisingly, our integration does best for Fourier components that are well sampled (with kδx << 1) 397

Errors in the integration of PDEs Clearly, for this simple case, we know that the true solution is R = 1 (our wave propagates at constant amplitude along the x-axis) The FTCS method always yields R > 1 exponential growth for all k and Δt The Lax method yields R < 1 if the Courant criterion is satisfied exponential decay 398

Errors in the integration of PDEs So far, we have considered only amplitude errors For the Lax method, we had ξ = ξ n (cos(kδx) i(cδt/δx) sin(kδx) ) ξ n e i(ckδt) in the limit kδx 0 But for finite kδx, arg(ξ /ξ n ) i(ckδt) Phase errors can cause problems because they artificially introduce dispersion (wave propagation rate depends on k) 399

Staggered leapfrog We can achieve 2 nd order accuracy in time if we use ( u/ t) j,n = (u j un 1 j ) / 2Δt instead of ( u/ t) j,n = (u j u jn ) / Δt This is called staggered leapfrog 400

Staggered leapfrog This is no longer a single-level scheme (in that it now involves values at time level n and n 1) but it is still explicit Graphical representation: n,t j,x 401

Staggered leapfrog For u/ t + c u/ x = 0, staggered leapfrog yields (u j u j n 1 ) = (cδt /Δx) (u j+1 n u j 1n ) The von Neumann stability analysis gives us ξ ξ n 1 = ξ n ( 2i (cδt/δx) sin(kδx) ) R 2 1 = 2i (cδt/δx) sin(kδx) R R = i (cδt/δx) sin(kδx) ± {1 (cδt/δx) 2 sin 2 (kδx)} 402

Staggered leapfrog For any (cδt/δx) 2 sin 2 (kδx) < 1, R = 1 Thus, if the Courant condition applies, this 2 nd order method works perfectly for our simple wave equation: the amplitude neither grows nor dissipates 403

Staggered leapfrog For more complex equations, staggered leapfrog can become unstable because the odd and even gridpoints are completely uncoupled; this can lead to mesh instability (see figure 19.1.16 from Recipes) 404

Staggered leapfrog Solution: couple the two meshes by introducing a weak diffusive coupling term a(u n j+1 2un j + un j 1 ) with a << 1. This keeps them in phase. 405