74
4. Finite DitTerence Methods
(i-l.i, k)
(i,j,k)
(i+l,j,k)
FIGURE 4.1. Three adjacent no des along the x direction.
and from Eq. (4.1.2), we have
ac _ C(x, y, z, t) - C(x - Llx, y, z, t)
)
ax -
Llx
+ O(Llx .
Subtraction ofEq. (4.1.2) from Eq. (4.1.1) results in
ac _ C(x + Llx, y, z, t) - C(x - Llx, y, z, t)
(Ll )2]
ax -
2Llx
+ O[ x .
(4.1.4)
(4.1.5)
By neglecting the se co nd term on the right-hand side of Eqs. (4.1.3), (4.1.4),
and (4.1.5), three approximate equations are obtained. These equations are
called the forward, backward, and central difJerence formulas, respectively.
The second term on the right-hand side is called the truncation error, which
denotes the possible order of error when the derivative on the left-hand side
is expressed by the first term on the right-hand side.
The summation of Eq. (4.1.1) and Eq. (4.1.2) generates the finite difTerence
approximation of the second order derivative:
a 2 C C(x + Llx, y, z, t) - 2C(x, y, z, t) + C(x - Llx, y, z, t)
ax 2 -
(Llx)2
(4.1.6)
The truncation error of this approximation is O[(Llx)2].
numbers, this equation can be rewritten as
U sing the node
a2cI
ax 2 (i,j.k)
Ci+l.j.k - 2Ci.j.k + Ci-1,j,k
(Llx)2
For the mixed partial derivative, we have
a 2 c I
Ci+1,k - Ci- 1.j +1,k - Ci+l,j-l.k + Ci-1,j-l.k
axay (i.j.k)
4LlxLly
and its truncation error is o [(Llx)2 + (Lly)2].
(4.1. 7)
(4.1.8)
In the same way, we can obtain the finite difTerence approximations of
other partial derivatives, such as aC/at, aC/ay, a 2 C/ay2, ... , a 2 C/az 2 , and so
4. Finite DitTerence Methods
(i-l.i, k)
(i,j,k)
(i+l,j,k)
FIGURE 4.1. Three adjacent no des along the x direction.
and from Eq. (4.1.2), we have
ac _ C(x, y, z, t) - C(x - Llx, y, z, t)
)
ax -
Llx
+ O(Llx .
Subtraction ofEq. (4.1.2) from Eq. (4.1.1) results in
ac _ C(x + Llx, y, z, t) - C(x - Llx, y, z, t)
(Ll )2]
ax -
2Llx
+ O[ x .
(4.1.4)
(4.1.5)
By neglecting the se co nd term on the right-hand side of Eqs. (4.1.3), (4.1.4),
and (4.1.5), three approximate equations are obtained. These equations are
called the forward, backward, and central difJerence formulas, respectively.
The second term on the right-hand side is called the truncation error, which
denotes the possible order of error when the derivative on the left-hand side
is expressed by the first term on the right-hand side.
The summation of Eq. (4.1.1) and Eq. (4.1.2) generates the finite difTerence
approximation of the second order derivative:
a 2 C C(x + Llx, y, z, t) - 2C(x, y, z, t) + C(x - Llx, y, z, t)
ax 2 -
(Llx)2
(4.1.6)
The truncation error of this approximation is O[(Llx)2].
numbers, this equation can be rewritten as
U sing the node
a2cI
ax 2 (i,j.k)
Ci+l.j.k - 2Ci.j.k + Ci-1,j,k
(Llx)2
For the mixed partial derivative, we have
a 2 c I
Ci+1,k - Ci- 1.j +1,k - Ci+l,j-l.k + Ci-1,j-l.k
axay (i.j.k)
4LlxLly
and its truncation error is o [(Llx)2 + (Lly)2].
(4.1. 7)
(4.1.8)
In the same way, we can obtain the finite difTerence approximations of
other partial derivatives, such as aC/at, aC/ay, a 2 C/ay2, ... , a 2 C/az 2 , and so
