Professional Documents
Culture Documents
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
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
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
Example:
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:
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
Explicit FTCS
Implicit FTCS
Implicit
Crank-Nicholson
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.
2T = 0
=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 )
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
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
Direct Methods Solution found at one shot Give exact solution (to precision of machine) Example: Cramers rule, Gauss elimination Extremely expensive
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
Note that the corner points never enter into the equation
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
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
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