Finite Difference Method
Kush Bhatia Dept. of Computer Science & Engg. IIT Delhi
Tutors: Prof. U. Rde, Prof. G. Biswas
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Differential Equations
Newton Cooling Model
1 Dimensional Wave Equation
Solving Differential Equations
Analytical Methods: Finding Closed form Solution
Numerical Methods: Approximating Numerical
Solutions to Differential Equations
Finite Difference Method
Finite Elements Method
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Finite Difference Method: Overview
A finite difference method for solving differential
equations involves the following steps:
Grid Generation Derivative Substitution Solving System Of Algebraic Equation
Grid Generation
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Finite Difference Approximations
Consider the following differential Equation:
Numerical Approximation requires replacing the
derivatives with Numerical approximations
Use Taylor Series Expansion for the approximation
Finite Difference Approximations
The Taylor Series:
On replacing by + and by
Combining higher order terms
Finite Difference Approximations
P Q
P1
P2
Forward/Backward Difference Approximation
Central Difference Approximation
Finite Difference Approximations
Forward Difference Approximation
Backward Difference Approximation
Central Difference Approximation
Finite Difference Approximations
Taylor Series Expansion for Function of 2 independent
variables
The Partial Derivative Approximations:
Forward :
Backward : Central
Finite Difference Approximations
As we approximated the first derivative, similarly by
considering higher order terms in the Taylor Series, we can approximate the higher order derivatives as well
Second Order Derivative:
Second Order Partial Derivative:
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Explicit & Implicit Methods
On Substituting the approximations to the derivatives
in the differential equation, the following two cases may arrive:
Explicit Method
Implicit method
Where denotes the spacial dimension and denotes the temporal dimension
Explicit & Implicit Method : Example
Consider the Differential Equation:
Constructing the Grid: Consider a rectangular Mesh
( , ) with uniform time step size = +1 and uniform space step = +1 .
To denote the solution (, ) at the required point on
the grid, use , .
Explicit & Implicit Method : Example
Substituting the forward difference approximations in
the differential equation
Given that we know value of at all for time from
initial condition, can determine at for time +1 . Solutions takes the form of a marching in steps of time, also the Explicit Euler Method of Finite Difference
Explicit & Implicit Method : Example
Substituting the spatial difference on RHS by time
average of n and n+1 (Crank-Nicolson Method)
The unknown value at time + 1 is expressed in
terms of known values at time and unknown values at time + 1.
To solve this equation, we formulate it at all points
for time +1 to obtain a system of algebraic equations
Explicit & Implicit Method : Example
The equation can be rearranged as
With =
. 2
On applying equation at all points from = 1 + 1
and applying the boundary conditions, representation of the form B = can be obtained.
B is the coefficient Matrix and X is the Solution Vector
Explicit Vs Implicit Methods
Explicit Method
Solution Algorithm is
Implicit Method
Setting up Solution
simple to set up. Stability Constraint puts a restriction on time step given a spatial step. Computing time per time step is small.
Algorithm requires more involved process Stability can be maintained over larger values of . Computing time per step is larger.
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Errors in Discretization
Numerical Solution of a differential Equation is
influenced by the following sources of errors:
Discretization Error = Truncation Error + Error due to
treatment of Boundary Conditions Round Off Error = Numerical Error induced due to finite precision of decimals in computer memory For implicit methods, there is an additional Algebraic Error induced by introducing an iterative method for the Linear System.
The errors can be controlled by controlling the grid
spacing in the chosen mesh.
Errors in Discretization
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Consistency
A Finite Difference Scheme is said to be consistent if
the limit of the truncation error is zero as approaches zero. Example : Consider the Newton Cooling Law:
The Truncation Error is given by
And we observe that Thus, the finite difference scheme as employed on the
Newton Cooling Law is a consistent one.
Convergence
A Finite Difference scheme is said to be Convergent if
the approx. solution approaches the exact solution of the differential equation for each value of the independent variable as grid spacing approaches zero
Numerical approximation to the differential equation = , 0 = 1. The red line denotes the exact solution. For the blue line, value of grid spacing has been set to 1, while for the green line, the grid spacing is 0.25.
Stability Analysis
Unstable Finite Difference Scheme (Grid Size = 0.01)
Stable Finite Difference Scheme (Grid Size = 0.005)
Stability Analysis
Let be the error which occurs at time step . Amplification of this error at time step + 1 is
+1 = , where g = amplification factor. For the stability of the finite difference scheme, it is required that +1 or 1. To find the stability criteria, one can use Von Neumann technique to determine error explicitly. A Finite Difference Method Scheme Converges if it is stable and consistent and the discrete problem is uniquely solvable.
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Application: Fluid Flow Modeling
Burgers presented a simple non-linear equation to
model fluid flow
2 2 .
In the equation above refers to the velocity, refers
to the coefficient of viscosity and refers to any property which can be transported or diffused.
If we neglect the viscous term, Burgers Equation
reduces to an analog of Eulers equation
=0
Contents
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
Conservative Property
Consider the following system with a property being
verified for conservation. We say that a property is conserved in the system if the net rate of accumulation of property in the system equals the net inflow net outflow.
Inflow of property
System Under Consideration
Outflow of property
Conservative Property
Consider the inviscid Burger Equation
().
Its Finite Difference analog is given by
+1
+1 +1 1 1
Consider a region running from = 1 = 2 .
On evaluating the integral 1 2 2 +1 n =1 = = 1 i
1 2 =1
1 2 +2
1 1 2
Thus the conservative property has been preserved.
Overview
Introduction to Differential Equations Finite Difference Method : Overview Finite Difference Approximations Explicit and Implicit Methods Errors In Discretization Consistency, Convergence and Stability Analysis Fluid-Flow Modeling
Conservative Property
References
High Performance Computing, K. Dowd & C.Severence Finite Difference Method Basics, Zhilin Li Numerical Methods: Finite Differences, Peter Olver 2-D Finite Difference Methods, Chris Johnson Numerical Methods for Elliptic and Parabolic Partial
Differential Equations, P. Knabner & L. Angermann Lecture Notes, Simulation and Scientific Computing, Christoph Pflaum Numerical Simulation in Fluid Dynamics, Michael Griebel, Thomas Dornseifer, Tilman Neunhoeffer
Thank You