—

— 6 ' — 0 '

¦ ¦

V

3

¦

7 3

Because of the boundary condition , it is necessary that . Likewise, the

&V

0 ‘

4

boundary condition yields

V

!— with

4

0 X

X3 3

‘ Y

Thus, the solution is

3

0 4X

V

X3

‘ 5

(

When the factor becomes negative and the above approximations will oscillate

X

1p 17

3

around zero. In contrast, the exact solution is positive and monotone in the range . In

this situation the solution is very inaccurate regardless of the arithmetic. In other words,

the scheme itself creates the oscillations. To avoid this, a small enough mesh can be

taken to ensure that . The resulting approximation is in much better agreement with

the exact solution. Unfortunately, this condition can limit the mesh size too drastically for

large values of .

7

Note that when , the oscillations disappear since . In fact, a linear algebra X

interpretation of the oscillations comes from comparing the tridiagonal matrices obtained

˜ £

from the discretization. Again, for the case , the tridiagonal matrix resulting from

discretizing the equation (2.7) takes the form

— 3444

99 8 3

— ! 44

99 3 3 3

—

9 3 3 3

6

— 3 3 3

5

!

A — 3 3 3

3 3

The above matrix is no longer a diagonally dominant M-matrix. Observe that if the back-

ward difference formula for the ¬rst order derivative is used, we obtain

z 0 4 — 6 0 ! 0

V3 3

‚

V V V V

3 a

7

& &

”’©§ d¥ u„£

un u n

¢ ¢ £ § © ¥ ©¨¤© £ £

¡ U£

©¢¥ ¡

©

7

Then (weak) diagonal dominance is preserved if . This is because the new matrix

obtained for the above backward scheme is

— 3444

99@8

9

3

! —

3 3 3

44

99

— 3 3 3

6

— 3 3 3

5

A

— ! — 3 3 3

3 3

V ‚

5 (

where is now de¬ned by . Each diagonal term gets reinforced by the positive

0 ‚ #

"

term while each subdiagonal term increases by the same amount in absolute value.

&

7

In the case where , the forward difference formula

0 4 — 6 0 0 4

V3 3

‚ V V V V

3 a

7

&

can be used to achieve the same effect. Generally speaking, if depends on the space

¦

variable , the effect of weak-diagonal dominance can be achieved by simply adopting the

following discretization known as an “upwind scheme”:

— 6 0 2

0 4 V 3

‚

V V V

3 a

7

&

where

£

z

2 &4 7

if

7

if

C B

0 %

(

The above difference scheme can be rewritten by introducing the sign function

( ¦