You are on page 1of 30

AML 811 Lecture 6

Elliptic Equations Solving a Linear System of Equations

Recap of Lecture 5 : Stability of discretizations



1. 2. 3.

If the PDE is stable, i.e. its solution remains bounded, then we need that the finite differnce solution should also be stable Some methods for analyzing stability Discrete perturbation method Von-Neumann analysis Matrix method Stability analysis can normally only be done for linear equations. For non-linear equations, we linearize locally before analysis and hence, only linear stability can be judged. Experience indicates that linear stability normally means nonlinear stability as well.

Recap: Explicit FTCS for the diffusion equation x = 0.2; t = 0.004; =1 FTCS
2u u = 2 x t

=1

Explicit FTCS for the diffusion equation Finer grid : x = 0.1; t = 0.004
2u u = 2 x t
FTCS

Explicit FTCS for the diffusion equation Finer grid : x = 0.05; t = 0.004
2u u = 2 x t
FTCS

Solution quickly unstable. Why?

Recap: Summary of Von-Neumann Analysis

Step 1 : Fourier Decomposition: Assume that solution is composed of a sum of waves of Amplitude of the form Fourier wave
Soln at grid point i, at time step n at n

Wave number

Step 2: Obtain evolution equation for the amplitude Substitute Fourier decomposition in the original Finite Difference equation and write it in the form

U n +1 = GU n
Gain or amplification factor

Ref Computational Fluid Dynamics 1 : Hoffmann and Chiang: pgs 124-25

Recap: Summary of Von-Neumann Analysis

Step 3 : Find region of stability Find the conditions on x, t under which the amplitude of the wave will be stable, i.e. not grow. This will happen if

Stability analysis shows that FTCS for the wave equation is stable only if t =0 i.e. FTCS is never stable for the wave equation: Unconditionally unstable FTCS for the diffusion equation G = 1 4d sin 2 t 1 2 Stable only for d = 2 2 x
Ref: Computational Fluid Dynamics -1 : Hoffmann and Chiang, pgs 124-25

Recap: The Explicit Approach


Solution at each point in the next time step computed from known values at previous time step(s)
Stencil

Example:

Recap: The Implicit Approach


Solution at a certain grid point for a time step depends on values at other grid points in the same time step A system of equations has to be solved to simultaneously obtain the solution at all grid points This is computationally more expensive than the explicit method as we have to solve a system of equations at each time step. So, are there are any advantages?

Example:

Recap: Implicit FTCS for the diffusion equation

Von-Neumann analysis shows


G= 1 1 + 4d cos 2

G 1 for all

Since there is no restriction on time step, unlike the explicit scheme, unconditional stability allows us to take much larger time steps

Recap: FTCS for diffusion equation


These terms are computed at time level n : known

Explicit FTCS

These terms are computed at time level n + 1 : unknown

Implicit FTCS

Recap: Other Schemes for the diffusion Explicit equation


DuFort-Frankel

Implicit

Crank-Nicholson

Recap: Summary of Lecture 5


Even if a numerical scheme is consistent, it might not be stable for all choices of the grid spacing and time step. Von Neumann stability analysis can be used to analyze the linear stability of a numerical scheme Implicit schemes are more stable (many times unconditionally stable) than explicit schemes and hence, allow larger time steps. However, they involve greater computational expense per computational time step Beta formulation for the 1D diffusion equation

Elliptic Equations

Recall

Have no real characteristics Equilibrium problems. Often represent steady state of some parabolic problem. Example: Steady state heat-conduction Boundary value problems (BVP) : Value of function on the interior of the domain is completely determined by values on the boundary. Also known as jury problems for the same reason.

Examples of Elliptic Equations

Steady state heat conduction with isotropic material

2T = 0

Streamfunction for 2D, incompressible, inviscid, irrotational flow

=0
2

Laplaces Equation

2 = 0

Creeping flow (very low speed flow) driven purely by gravity or other body forces Poisson Equation

r r u = f
2

2 = f ( x, y , z )

A simple elliptic problem 1D steadystate heat conduction Dirichlet


d 2T =0 2 dx

BCs

T = Ta @ x = 0 T = Tb @ x = L

BCs

To numerically solve this, first discretize the 1D domain into N points. Greater N => greater accuracy

x=0 i=1

x=L i=N

Dirichlet (value of function) and Neumann (derivative of function) BCs


T = Ta @ x = 0 T = Tb @ x = L
Dirichlet BC

Tx = 0 @ x = 0 T = Tb @ x = L
Neumann BC

1 0 0 0 0 0 T1 Ta 1 2 1 0 0 0 T 0 2 0 1 2 1 0 0 T3 0 = 0 0 1 2 1 0 T4 0 0 0 0 1 2 1 T5 0 1 0 0 0 0 0 T6 Tb

1 1 0 0 0 0 T1 0 1 2 1 0 0 0 T 0 2 0 1 2 1 0 0 T3 0 = 0 0 1 2 1 0 T4 0 0 0 0 1 2 1 T5 0 0 0 0 0 0 1 T6 Tb

How can we solve such equations?

Direct vs Iterative Methods

Direct Methods Solution found at one shot Give exact solution (to precision of machine) Example: Cramers rule, Gauss elimination Extremely expensive

O(N!) for Cramerrule O(N3) for Gauss elimination

Iterative methods Solution found by iteration. Gives approximate solution Example: Jacobi iteration, Gauss-Seidel, SOR, ConjugateGradient Work well for sparse linear systems: Systems which have lots of zeros. These systems arise naturally for PDE approximations Often, paradoxically, simpler to implement than direct methods

A 2D Diffusion problem

BCs No of unknowns = ?

A 2D Diffusion problem

BCs No of unknowns = 16

A 2D Diffusion problem Five Point Stencil

Five Point stencil

Second order accurate

A 2D Diffusion problem Nine Point Stencil

Nine Point stencil

Fourth order accurate

System of equations for the second order method

Note that the corner points never enter into the equation

System of equations for the second order method

Sparse, band pentadiagonal system of equations.

Iterative method for solving system of equations: Jacobi method

Note that no matrix entries are really stored anywhere

Iterative method for solving system of equations: Jacobi method


Start with initial assumed guess for solution (except at the Dirichlet boundaries) u0 Update the values at all unknown points using the equation for the diagonal term. For Laplaces equation this comes to

Repeat iterations till successive iterations are close enough

Jacobi vs FTCS
FTCS

Jacobi

Jacobi solves the equilibrium problem as if it is the steady-state solution to the corresponding parabolic problem This generally results in slower convergence of the iteration and since we are not interested in the actual parabolic problem, we can get faster solutions by modifying the Jacobi method

Point Gauss-Seidel method

Start with initial assumed guess for solution (except at the Dirichlet boundaries) u0 Update using the newest values available at each grid point

Gauss-Seidel iteration

Un-updated values

Updated values

Summary of Lecture 6

Discretization of elliptic equations results in a system of sparse linear equations Direct methods are often more expensive than iterative methods for sparse linear systems Jacobi for Laplace behaves similarly to the FTCS method for the corresponding parabolic problem Gauss-Seidel is a method that generally converges faster than Jacobi

You might also like