
Section 2.4 Program realization and computational examples 37
2.4.2 Difference schemes
In consideration of one-dimensional convection-diffusion problems (2.64), (2.65), we
choose using difference schemes written at the internal nodes in the form (2.51), (2.52).
Consider the difference schemes (2.51), (2.52) in which
α
i
> 0,β
i
> 0,γ
i
> 0, i = 1, 2,...,N − 1. (2.68)
Let us formulate a criterion for monotonicity of the difference scheme or, in other
words, formulate conditions under which the difference scheme (2.51), (2.52) satisfies
the difference principle of maximum.
Theorem 2.5 (Maximum principle) Let in the difference scheme (2.51), (2.52),
(2.68) μ
1
≥ 0, μ
2
≥ 0 and ϕ
i
≥ 0 for all i = 1, 2,...,N − 1 (or, alternatively,
μ
1
≤ 0, μ
2
≤ 0 and ϕ
i
≤ 0 for i = 1, 2,...,N − 1). Then, provided that
γ
i
≥ α
i
+ β
i
, i = 1, 2,...,N − 1, (2.69)
we have: y
i
≥ 0,i = 1, 2,...,N − 1 (y
i
≤ 0,i = 1, 2,...,N − 1).
Proof. Let us follow the line of reasoning assuming the opposite. Let conditions (2.69)
be fulfilled, but the difference solution of problem (2.51) with non-negative right-hand
side and non-negative boundary conditions be not non-negative at all nodes of the grid.
We designate as k the grid node at which the solution assumes the least negative value.
If such a value is attained at several nodes, then we choose the node where y
k−1
> y
k
.
We write the difference equation at this node:
−α
k
y
k−1
+ γ
k
y
k
− β
k
y
k+1
= ϕ
k
.
The right-hand side is non-negative, and for the left-hand side, in view of (2.68) and
(2.69), we have:
− α
k
y
k−1
+ γ
k
y
k
− β
k
y
k+1
= α
k
(y
k
− y
k−1
) + (γ
k
− α
k
− β
k
)y
k
+ β
k
(y
k
− y
k+1
)>0.
The obtained contradiction shows that y
i
≥ 0 at all nodes i = 1, 2,...,N − 1.
To approximately solve the problem (2.64), (2.65), we use the simplest difference
scheme with central-difference approximation of the convective term. At the inter-
nal nodes of the computational grid, we approximate the differential equation (2.64),
accurate to the second order, with the difference equation
−(ay
¯x
)
x
+ by
◦
x
= ϕ, x ∈ ω, (2.70)
where, for instance, a(x) = k(x − 0.5h) and b(x) = v(x) in problems with smooth
coefficients.