f n,jÀ2 ¼ f n,j À 2Δx
∂f
∂x
n,j
þ
2Δx
ð
Þ
2
2
∂
2 f
∂x 2
n,j
þ . . . . . . . . .
Therefore, it follows that
af n,j þ bf n,jÀ1 þ cf n,jÀ2 ¼ a þ b þ c
ð
Þf n,j À Δx b þ 2c
ð
Þ
∂f
∂x
n,j
þ
Δx
2
2
b þ 4c
ð
Þ
∂
2 f
∂x 2
n,j
þ O Δx
3
À Á
However, the left-hand side of the latter equation is just equal to Δx
∂f
∂x
n,j
and, as
a result, the terms on the right-hand side becomes,
a þ b þ c ¼ 0
b þ 2c ¼ À1
b þ 4c ¼ 0:
The solution of these equations involving the coefficients; a, b and c, yields the
following results; a ¼ 3/2, b ¼ À 2 and c ¼ 1/2. Hence,
∂f
∂x
n,j
¼
3 f n,j À 4 f n,jÀ1 þ f n,jÀ2
2Δx
ð4:43Þ
and this difference quotient is accurate to second order in Δx. By using forward grid
points rather than backward grid points one can show that an alternative form of the
derivative appearing in the latter equation can be written as,
∂f
∂x
n,j
¼
À3 f n,j þ 4 f n,jþ1 À f n,jþ2
2Δx
:
ð4:44Þ
Up to now we have concentrated on determining some finite difference formulae
in the spatial domain and it is clear that similar formulae pertain to the time domain.
For example, the forward difference, backward difference and central difference
equations in the time domain are
∂f
∂t
n,j
¼
f nþ1,j À f n,j
Δt
,
∂f
∂t
n,j
¼
f n,j À f nÀ1,j
Δt
and
4.5 The Numerical Procedure
149
∂f
∂x
n,j
þ
2Δx
ð
Þ
2
2
∂
2 f
∂x 2
n,j
þ . . . . . . . . .
Therefore, it follows that
af n,j þ bf n,jÀ1 þ cf n,jÀ2 ¼ a þ b þ c
ð
Þf n,j À Δx b þ 2c
ð
Þ
∂f
∂x
n,j
þ
Δx
2
2
b þ 4c
ð
Þ
∂
2 f
∂x 2
n,j
þ O Δx
3
À Á
However, the left-hand side of the latter equation is just equal to Δx
∂f
∂x
n,j
and, as
a result, the terms on the right-hand side becomes,
a þ b þ c ¼ 0
b þ 2c ¼ À1
b þ 4c ¼ 0:
The solution of these equations involving the coefficients; a, b and c, yields the
following results; a ¼ 3/2, b ¼ À 2 and c ¼ 1/2. Hence,
∂f
∂x
n,j
¼
3 f n,j À 4 f n,jÀ1 þ f n,jÀ2
2Δx
ð4:43Þ
and this difference quotient is accurate to second order in Δx. By using forward grid
points rather than backward grid points one can show that an alternative form of the
derivative appearing in the latter equation can be written as,
∂f
∂x
n,j
¼
À3 f n,j þ 4 f n,jþ1 À f n,jþ2
2Δx
:
ð4:44Þ
Up to now we have concentrated on determining some finite difference formulae
in the spatial domain and it is clear that similar formulae pertain to the time domain.
For example, the forward difference, backward difference and central difference
equations in the time domain are
∂f
∂t
n,j
¼
f nþ1,j À f n,j
Δt
,
∂f
∂t
n,j
¼
f n,j À f nÀ1,j
Δt
and
4.5 The Numerical Procedure
149
