Lecture 4: Numerical Stability

Slides:



Advertisements
Similar presentations
Stable Fluids A paper by Jos Stam.
Advertisements

Finite Difference Discretization of Hyperbolic Equations: Linear Problems Lectures 8, 9 and 10.
An Introduction to Numerical Methods
2ª aula Evolution Equation. The Finite Volume Method.
Reduction of Temporal Discretization Error in an Atmospheric General Circulation Model (AGCM) Daisuke Hotta Advisor: Prof. Eugenia Kalnay.
Chapter 8 Elliptic Equation.
Numerical Integration of Partial Differential Equations (PDEs)
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
Atms 4320 Lab 2 Anthony R. Lupo. Lab 2 -Methodologies for evaluating the total derviatives in the fundamental equations of hydrodynamics  Recall that.
Introduction to Numerical Methods I
PETE 603 Lecture Session #30 Thursday, 7/29/ Accuracy of Solutions Material Balance Error Nonlinear Error Instability Error Truncation Error Roundoff.
Chapter 16 Waves (I) What determines the tones of strings on a guitar?
Finite Difference Methods to Solve the Wave Equation To develop the governing equation, Sum the Forces The Wave Equation Equations of Motion.
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 9 Instructor: Tim Warburton.
Numerical Solutions to ODEs Nancy Griffeth January 14, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis.
1 The Spectral Method. 2 Definition where (e m,e n )=δ m,n e n = basis of a Hilbert space (.,.): scalar product in this space In L 2 space where f * :
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Integrals 5.
Tutorial 5: Numerical methods - buildings Q1. Identify three principal differences between a response function method and a numerical method when both.
Finite Differences Finite Difference Approximations  Simple geophysical partial differential equations  Finite differences - definitions  Finite-difference.
Simulating Electron Dynamics in 1D
FCI. Faculty of Computers and Information Fayoum University 2014/ FCI.
Lecture 3.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Model Task 0A: Programming the 1D upstream scheme ATM 562 Fall 2015 Fovell 1.
3.3.3: Semi-Lagrangian schemes AOSC614 class Hong Li.
7. Introduction to the numerical integration of PDE. As an example, we consider the following PDE with one variable; Finite difference method is one of.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
1 Three views on Landau damping A. Burov AD Talk, July 27, 2010.
CIS888.11V/EE894R/ME894V A Case Study in Computational Science & Engineering We will apply several numerical methods to find a steady state solution of.
Lecture 6: Open Boundaries Solid wall Open boundary Let us first consider the ocean is incompressible, which satisfies (6.1) H  Integrating (6.1) from.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
Chapter 11 Vibrations and Waves.
1 Linear Wave Equation The maximum values of the transverse speed and transverse acceleration are v y, max =  A a y, max =  2 A The transverse speed.
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
The Rayleigh-Taylor Instability By: Paul Canepa and Mike Cromer Team Leftovers.
The story so far… ATM 562 Fovell Fall, Convergence We will deploy finite difference (FD) approximations to our model partial differential equations.
Time Integration Schemes Bill Skamarock NCAR/MMM 1.Canonical equations for scheme analyses. 2.Time-integration schemes used in NWP models.
1 EEE 431 Computational Methods in Electrodynamics Lecture 13 By Dr. Rasime Uyguroglu
The Finite-Difference Method Taylor Series Expansion Suppose we have a continuous function f(x), its value in the vicinity of can be approximately expressed.
Copyright © Cengage Learning. All rights reserved.
Numerical Solutions to the Diffusion Equation
Copyright © Cengage Learning. All rights reserved.
The heat equation Fourier and Crank-Nicolsen
EEE 431 Computational Methods in Electrodynamics
Reporter: Prudence Chien
Finite Difference Methods
Introduction to Numerical Methods I
Convection-Dominated Problems
Academic Training Lecture 2 : Beam Dynamics
ECE 576 – Power System Dynamics and Stability
Lecture 30 Wave Equation and solution (Chap.47)
Quantum One.
Quantum One.
Finite Volume Method for Unsteady Flows
Quantum Two.
بسم الله الرحمن الرحيم FCI.
Introduction to Fluid Dynamics & Applications
Electromagnetic waves
Thermal Energy & Heat Capacity:
topic4: Implicit method, Stability, ADI method
Slope Fields and Euler’s Method
High Accuracy Schemes for Inviscid Traffic Models
7-5 Relative Stability.
Comparison of CFEM and DG methods
topic4: Implicit method, Stability, ADI method
6th Lecture : Numerical Methods
An optimized implicit finite-difference scheme for the two-dimensional Helmholtz equation Zhaolun Liu Next, I will give u an report about the “”
Presentation transcript:

Lecture 4: Numerical Stability Stability: Will the numerical solution remains finite at all times and all locations? Example: The diffusion equation (3.1) Forward time scheme for time and central difference scheme for space, we have (3.2) Let us rewrite (3.3) , then (3.4)

Assume that an error  appears at a point io at initial, let us examine if this error would grow up with time. If does, the numerical scheme is unstable. If doesn’t, the numerical scheme is stable or at least neutral stable. Case 1: (3.5) When the error appears at the initial, the approximate solution is (3.6) (3.6)-(3.5) producing an error equation (3.7)

Errors decreases with time integration, so the method is stable! Table of the errors n=5 0.16525 0.3125 0.15625 n=4 0.0625 0.25 0.375 n=3 0.125 n=2 0.5 n=1 n=0  ko-4 ko-3 ko-2 ko-1 ko ko+1 ko+2 ko+3 ko+4 n i Errors decreases with time integration, so the method is stable!

Error increases with time integration, so the method is unstable! Case 2: (3.8) Error equation is n=4  -4 10 -16 19 n=3 -3 6 -7 n=2 -2 3 n=1 - n=0 ko-4 ko-3 ko-2 ko-1 ko ko+1 ko+2 ko+3 ko+4 Error increases with time integration, so the method is unstable!

QS 1: Do we have to make a table every time to determine the stability of a numerical scheme? QS 2: What is the definition of the numerical stability? Numerical stability is generally built on an assumption that the boundary values are accurate and errors appear at the initial integration. Stability analysis is to determine if this error would grow up. For a linear t-x equation, the error always could be expressed by a wave function such as (3.9) where A is the amplitude factor, To is the initial value, n is the number of the tine integration, k is the node point (3.10)

Example: Substituting (3.9) into the above equation, we have After removing the common factors, we get Then To make the method stable, we must have

That is equivalent to So, the stability condition is: (3.11) For case 1: r = 1/(2Ah) For case 2: r = 1/Ah

Now, let us use this method to analyze all the advection schemes described in the last class: 1. Leapfrog scheme Central difference for both time and space. Assume that Then, we have Solution is

If  ≤ 1, because |A| > 1 If  > 1, Let’s define that , then the solution can be expressed as For stability, |A±| ≤ 1 If  ≤ 1, Stable ! because |A| > 1 If  > 1, Therefore, the leapfrog scheme is only stable if  ≤ 1 , i. e.

2) Forward Time/Central Space Scheme (Euler Scheme) Assume that Then, we have Therefore, no matter what the ratio of time step to space grid size is chosen, the Euler scheme is an absolutely unstable scheme!

3). Forward Time/Backward Space Scheme Assume that Then, we have For |A|2 ≤ 1, then which can only be assured if So, if we use the upstream information (backward) for space gradient and forward time stepping, the method is conditionally stable! Since |A| < 1, the scheme is artificial numerical damping!

4). Forward Time/Implicit Central Space Scheme Assume that Then, we have Unconditionally stable! No matter what ∆t and ∆x are chosen, this scheme is always stable. However, the accuracy of the scheme still depend on ∆t and ∆x because it only O(∆t) and O(∆x2) . So, you can get serious phase errors for both long and short waves if C(∆t/∆x) is too large. In fact, the implicit schemes essentially have C =  in that the information can be spread throughout the grids over one time step. damping scheme!

5. Crank-Nicolson Scheme—Semi-implicit Scheme Assume that Crank-Nicolson scheme is unconditionally stable! This scheme helps reducing the artificial numerical damping.

Example: Leapfrog Scheme: Central difference scheme for the time integration produces two numerical solutions, even though it provides a second-order numerical accuracy. This can produces additional numerical errors! Example: Leapfrog Scheme: there are two numerical solutions: A± For advection equation, the analytical solution is But now, the central difference scheme produces two solutions: Physical mode Computational mode Computational mode has also a finite amplitude bounded by |A| ≤ 1, but its amplitude goes like (-1)n. It changes sign with each time step and causes significantly artificial numerical error waves. Therefore, when a central difference scheme is used for the time integration, we must try to choose the initial conditions so that the computational mode is zero. However, it will grow due to numerical errors like truncation roundoff, so the computational mode can not be ignored.

Computational dispersion (3.12) This advection equation has an analytical solution in the form of a single harmonic component (3.13) Substituting (3.13) into (3.12), we have (3.14) This is an oscillation equation where kC is the frequency (called ). Therefore, (3.15) Since C is constant, so that waves with different wave lengths propagate with the same phase speed. The function u(x,t) is advected with no change in shape at a constant velocity C along the x axis: There are no dispersion!

(3.17) (3.18) Now, let us consider the difference equation like (3.16) Assume that (3.17) Substituting (3.17) into (3.16), we have (3.18) Therefore, Numerical phase speed is a function of the wave number k, so that the finite differencing in space cause a dispersion of the waves! It is also called “ computational dispersion”! As ∆x increases from zero, the phase speed monotonically decreases from C, and becomes zero for the shortest resolvable wave length 2∆x (k∆x =)-stationary. Thus, all waves propagates at a speed that is less than the true phase speed C.

uj 0 1 2 3 4 5 j

Using the finite-difference method to solve the advection equation, we have encountered two difficulties: The advection speed is less than the true advection speed The advection speed changes with wave number: this false dispersion is particularly serious for the shortest waves If the pattern that is being advected represents a superposition of more than one wave, this false dispersion will result in a deformation of that pattern. Examples: 1) Fronts (both ocean and atmosphere): the initial fields could be deformed quickly! If the patterns are advected with a wave-number dependent phase speed, the nature of the energy propagation will be affected! Therefore, the difference scheme might also destroy the true energy balance due to the difference approach.

(3.20) o The group velocity (3.19) So, in the advection equation with a constant C, its group velocity is also constant and equals to its phase speed. After the equation is discretized, its group velocity becomes (3.20) As k∆x increase from zero, the group velocity decreases monotonically from cg, and becomes –cg for the shortest resolvable wave length of 2∆x (k∆x= ). C=cg C This implies that the central difference scheme in space could cause the energy propagate in the opposite direction! o  /2 -C

(3.22) j Nonlinear Instability (3.21) This is usually called “advective equation for momentum and sometimes is also called “shock equation”. The general solution of (3.21) is (3.22) where f is an arbitrary function. Minimum length of a wave is 2∆x, therefore, the maximum wave number j 0 1 2 3 When preformed in finite differences, nonlinear terms could result in an error related to the inability of the discrete grids to resolve the wave lengths shorter than 2∆x,

x For example, (3.23) Then, (3.24) If the wave number in (3.23) Then, the nonlinear term will produce a wave number (2k > kmax) that can not resolved by the grid! This can not be properly reproduced in a finite-difference calculation! A nonlinear wave with a wave length of 4∆x/3 2∆x x

This misrepresentation error is called “aliasing arror” In a more general case, suppose that a function consists of a number of harmonic components (3.25) Then, the nonlinear term will produce a products of harmonics of different wave lengths such as Then, even if a finite difference calculation is started with waves which all have k ≤ kmax, very soon through this process of nonlinear interaction waves will be formed with k > kmax, and a misrepresentation of waves will occur! This misrepresentation error is called “aliasing arror” Energy spectrum For example, the combination of two waves: k1+k2 > kmax,, because this larger wave number combination wave energy can not resolved in the finite-difference scheme, so this higher wave number energy will be misplaced into the energy pool with k < kmax.

The best way to control the nonlinear instability: Comments: Aliasing errors: misrepresents the wave shapes and energy and it can cause the nonlinear instability of the numerical calculation. Such an error is not be able to control by the horizontal resolution, even it is related to it. Nonlinear instability can be determined using the harmonic analysis method shown in the linear equation. This instability does not depend on the ratio of the time step to space resolution. The best way to control the nonlinear instability: Develop a numerical scheme to conserve the momentum and mass in the individual cells and entire computational domain.