Finite difference method - National University of …bao/teach/ma5233/lect10.pdf · Finite...

Post on 30-Aug-2018

256 views 2 download

Transcript of Finite difference method - National University of …bao/teach/ma5233/lect10.pdf · Finite...

Finite difference method

Poisson equation in 2D with Dirichelt BC Well-posedness – Existence – Uniqueness

Finite difference method

Finite difference method

Finite difference approximation: Dimension-by-dimension

Computation & error analysis – Solve the linear system efficiently – Error bound???

Local truncation error

Finite difference method

Order of accuracy: second order Error analysis -- maximum principle – Proof: Exercise!!

Efficient solver – Iterative solvers: CG, PCG, Gauss-Seidel, SOR, ….. – Direct Poisson solver

Linear system

Linear system

Matrix form

Matrix form

Matrix form

Linear system: Iterative solvers – Rewrite the difference equations as

SOR method – An example

Fast Poisson solver via DST

For Poisson equation in 1D with Dirichlet BC Finite difference discretization Linear system:

Fast Poisson solver

Homogeneous BC: In PDE level – sine transform

Fast Poisson solver

Exact solution

Fast Poisson solver

In discrtization level – Discrete since transform (DST)

Fast Poisson solver

Algorithm for fast Poisson solver via DST

Fast Poisson solver

Inhomogeneous BC --- Homogenizing the BC

Introducing Plugging into the difference equations: – With

Algorithm for fast Poisson solver via DST

Fast Poisson solver in 2D

The equation: The finite difference discretization

Fast Poisson solver in 2D

Discrete sine transform in 2D Plugging into the finite difference equations

Algorithm for Fast Poisson solver in 2D

Algorithm for Fast Poisson solver in 2D

Comments on fast Poisson solver

Advantages – Direct solver & give exact solution to the linear system – Memory cost: O(M) & no extra memory is needed!! – Computational cost: O(M ln M) – Very efficient in 2D & 3D due to FST!!! – Can be extended to Neumann BC or periodic BC

Disadvantages: – The domain should be a rectangle in 2D & box in 3D – Uniform mesh in each direction is needed!! – The coefficients of the PDE must be constant!! – BC much be the same type in opposite edges!!!

Extension to Neumann BC

The problem:

Extension to Neumann BC

Discretization – at shifted grids points by half grid Direct Poisson solver via discrete cosine transform (DCT) – Exercise!!

Extension to periodic BC – discrete Fourier transform (DFT)

Poisson equation in 2D on a disk or shell

The problem The ideas: Domain mapping or variable transform

The discretization

The discretization for a shell

The discretization for a disk

The discretization

Local truncation error: Order of accuracy: second order Error estimate –-- maximum principle

Solution of the linear system – Fast Poisson solver

• Discrete Fourier transform in transverse direction • Solve a linear system with tri-diagonal coefficient matrix in r-direction

Extension

3D Poisson equation – In a box, sphere, shell, cylindrical cylinder, etc.

General linear elliptic equation Elliptic system – Navier system, ……

More topics

Compact scheme --- high order methods with less grid points • 4th (6th ,…) order methods need 5 (7, …) grid points in 1D • Need use ``ghost’’ points near boundary

– Question: Can we design high order methods using less grid points??? – An example in 1D:

– Extension to 2D & 3D: Exercise!!!!

2 21 12 4 4

2

12 22 4 2 4

122 2

( ) 2 ( ) ( )( ) ( ) ( ) ( ) ( ) ( )

12 12

( ) ( ) ( ) ( ) ( )12 12

( ) ( ) (12

j j jx j xx j xxxx j xx xx j

xx j xx x j xx x j

xx j x x j

u x u x u x h hu x u x u x O h I u x O hh

h hu x I u x O h I u x O h

hu x I u x O

δ

δ δ

δ δ

+ −

− + = = ∂ + ∂ + = ∂ + ∂ +

∂ = + ∂ + = − ∂ +

∂ = + +

24 2 2 4

1 1 1 102

) ( ) ( ) ( )12

2 10, 1,2,..., 1, ,

12

x j x j

j j j j j jM

hh u x I f x O h

u u u f f fj M u u

h

δ δ

α β+ − + −

⇒ − = + +

− + + +

− = = − = =

More topics

General geometry in 2D & 3D – FEM or FVM or Boundary integral method

Adaptive mesh refinement (AMR) – Solution has sharp change locally – Refine the mesh adaptively based on the approximation

Nonlinear problem – Discretization, solve nonlinear system

…..