Sie sind auf Seite 1von 5

Lecture 14: The Art of Discretization

KXGM 6104 Computational Mathematics


14.1 Explicit and Implicit schemes
i)

Explicit and implicit methods are approaches used in numerical analysis for obtaining numerical
solutions of time-dependent ordinary and partial differential equations, as is required in computer
simulations of physical processes.

ii)

Explicit methods calculate the state of a system at a later time from the state of the system at the
current time, while implicit methods find a solution by solving an equation involving both the current
state of the system and the later one.

iii)

It is clear that implicit methods require an extra computation, and they can be much harder to
implement. Implicit methods are used because many problems arising in practice are stiff, for which
the use of an explicit method requires impractically small time steps t to keep the error in the result
bounded (see numerical stability).

iv)

For such problems, to achieve given accuracy, it takes much less computational time to use an implicit
method with larger time steps. That said, whether one should use an explicit or implicit method
depends upon the problem to be solved.

v)

Equation of motion in fluid mechanics is frequently reduced to parabolic formulation. Boundary layer
equations and Parabolised Navier-Stoke (PNS) equations are examples of such formulations. In
addition, the unsteady heat conduction equation is also parabolic.

14.2 Explicit Finite Difference


Unsteady heat conduction equation,
T
2T
2
t
x
Descretize by using First Order Forward for time and Second Order Difference for space,
T Ti n 1 Ti n

t
t
n
2
T Ti 1 2Ti n Ti n1

x 2
(x)2
The equation can be approximated as follows,
Ti n1 Ti n
Ti n1 2Ti n Ti n1

t
(x)2
In this equation, only uin1 is unknown and therefore it can be computed from the following,

Ti n1 Ti n

(t )
(x)

(Ti n1 2Ti n Ti n1 )

This method of solving is called explicit method. Note that the value of the dependent variable at time level n
is known from the previous solution or given as initial data. The computed values at n+1 depend on the past
history. To start the solution, an initial condition and two boundary conditions must be specified.
Other example of heat transfer equations (one dimensional):
i)

ii)

iii)

iv)

Pure steady conduction:


2T
0 2
x
Unsteady conduction:
T
2T
2
t
x
Unsteady conduction/convection:
T
2T
2 h '(T T )
t
x
Unsteady conduction/convection/radiation :

T
2T
2 h '(T T ) '(T4 T 4 )
t
x

14.3 Discretization of Explicit Finite Difference


i)

The Forward Time Central Space (FTCS) method

uin1 uin

(uin1 2uin uin1 )


2
t
(x)
t n
u in1 u in
(ui 1 2uin u in1 )
2
(x)

It is of the order (t ), (x) 2 . It can be proven that the solution is stable for
ii)

The Richardson method (CTCS)

uin1 uin1

(uin1 2uin uin1 )


2t
(x) 2

t
(x)

1
.
2

uin 1 uin 1

2t n
(ui 1 2uin uin1 )
2
(x)

It is of the order (t ) 2 , (x) 2 . It turns out that the scheme is unconditionally unstable and therefore has no
practical value.
iii)

The DuFort-Frankel method

uin1 uin1
uin1 uin1

(
u

2
uin1 )
i 1
2t
2
(x) 2
For which,

uin1 uin1

2t n
(ui 1 uin1 uin1 uin1 )
(x) 2

Rearranging,

2t n1 2t n1 2t n
n
1 (x) 2 ui 1 (x) 2 ui (x) 2 (ui 1 ui 1 )

This method is of the order of (t ) 2 , (x) 2 . Interestingly enough, it is unconditionally stable. The values of ui
at time levels n and n 1 are required to start the computation. Therefore, either 2 sets of data must be
specified, or from a practical point of view, a one-step method can be used as a starter.
Of course, for one-step method starter solution, only one set of data is required to generate the solution of at
n . With the values of ui at time levels n and n 1 specified, DuFort Frankel method can thus be used. 2
disadvantages of the method,
a) The accuracy of the whole solution is affected by the accuracy of the starter solution.
b) Since the solution at the unknown station requires data from 2 previous stations, computer storage
requirements will increase.

14.4 Courant-Friedrichs and Lewy (CFL)


One restriction in solving the PDE using explicit method is the condition that the time step has to be smaller
than the time it takes information to propagate across one step in space. This condition is called CFL. Applying
to the diffusion problem in one-dimension,
2t
1
(x) 2
The time to propagate through a distance x is proportional to (x)2 . Any explicit FD scheme that violates the
CFL condition is necessarily unstable, but satisfying the CFL condition does not necessarily guarantee stability.

14.5 Implicit Finite Difference


In the explicit formulation, the boundary condition lags behind computation by one step. Use a forward
difference approximation for the time derivative and a second order central difference approximation for the
spatial derivative,

uin1 uin
u n1 2uin1 uin11
i1
t
(x) 2
In the above equation, there are 3 unknowns against 1 known value.

This finite difference equation is written for all grid points at the advanced time level, resulting in a set of
algebraic equations. When these equations are put in a matrix form, the coefficient matrix is diagonal.
The computation of the unknowns would require a set of coupled finite difference equations, which are found
by writing FDE for all the grid points,
t n1
t n1 t n1
u 1 2
u
u uin
2 i 1
2 i 1
2 i 1
(x)
(x)
(x)

Let

and rearranging,
(x) 2
uin11 1 2 uin11 uin11 uin

Say there are 5 nodes on the rod where node 1 and 5 are the boundaries and abiding the prescribed boundary
condition, expanding equation (3) at each of the internal nodes,
1

u1n1 1 2 u2n1 u3n1 u2n


u2n1 1 2 u3n1 u4n1 u3n
u3n1 1 2 u4n1 u5n1 u4n

The system is a set of linear system of equations which can be solved simultaneously. u1 and u5 are known
values at the boundaries. Rearranging the equation again,

1 2 u2n1 u3n1 u2n u1n1


u2n1 1 2 u3n1 u4n1 u3n
u3n1 1 2 u4n1 u4nu5n1
Forming a matrix,

0 u2 u2n u1n1
1 2

u3 u3n
1 2

n
n 1
0

1 2 u4 u4 u5

The matrix can be solved by using many methods that solve for simultaneous equations. The best option is to
adopt tridag subroutine that can be found in Numerical Recipes. It can be widely found in the internet.

14.6 Discretization of Implicit Finite Difference


i)

The Laasonen method

The simple formulation of implicit as derived before is known as the Laasonen method. Applying the
formulation to all grid points as in Section 2 would lead to a set of linear algebraic equations.
uin1 uin
u n1 2uin1 uin11
i 1
t
(x) 2
ii)

The Crank-Nicolson method

This formulation averages the diffusion term using central differencing at time levels n and n 1 .
discretized equation is as follows,

The

uin1 uin
1 u n1 2uin1uin11 uin1 2uin uin1
i1

t
2
(x) 2
(x) 2

Note that on the left side of the equation is a central difference of step

t
,
2

u uin1 uin

t
t
2
2

It is of the order (t ) 2 . In terms of the grid points, the left side can be interpreted as the central difference
u
representation of
at the point considered, while at the right hand side, is the average of the diffusion term
t
at the same point. The method can be thought of as the addition of the two time step computations.
Using the explicit method,
n 1

uin
u n 2uin uin1
i1
t
(x) 2
2
While using the implicit method,
ui

n 1

uin1 ui 2
u n1 2uin1 uin11
i1
t
(x) 2
2
Addition of the 2 equations will result in equation (5) above. This method is unconditionally stable and is of
order of (t ) 2 , (x) 2 , second order scheme.

Das könnte Ihnen auch gefallen