Information Technology Reference
In-Depth Information
The first-order derivative at x
can be approximated by a centered difference
iC 2
using the point x iC1
to the right and the point x i
to the left:
@ u
@x
`
u iC1
u i
x
:
iC 2
Similarly, the first-order derivative at x
can be approximated by a centered
i 2
difference using the point x i
to the right and the point x i1 to the left:
@ u
@x
`
u i
u i1
x
:
i 2
Combining the differences gives ( 7.89 ), a calculation that you should verify. The
derivation of ( 7.89 ) shows that we used only centered difference approximations.
Therefore, ( 7.89 ) is also a centered difference. Centered differences are known to
be more accurate than one-sided differences. You may thus wonder why we do not
use a centered difference for @ u =@t. The reason is because our one-sided difference
gives a computational algorithm that is much simpler to implement than if we use a
centered difference in time.
The Finite Difference Scheme
Inserting the difference approximations ( 7.88 )and( 7.89 )in(7.87) results in
u `C1
i
D u i1
2 u i
C u iC1
u i
t
C f `
i
:
(7.90)
x 2
This is our discrete version of the PDE (7.87). Alternative versions will be derived
later.
The computational algorithm consists of computing u along the t D t ` lines, one
line at a time. That is, we compute u i
values, for i D 0;:::;n,firstfort D 0,
which is trivial since u is known from the initial condition ( 7.85 )att D 0, then for
t D t 1 D t , then for t D t 2 D 2t , and so forth. Suppose that the u i
values at
time level t D t ` are known for all the spatial points (i D 0;:::;n). We can then use
(7.90) to find values at the next time level t D t `C1 .Wesolve(7.90) with respect to
u `C1
i
, yielding a simple formula for the solution at the new time level:
u i1
C tf `
i
C t
x 2
u `C1
i
D u i
2 u i
C u iC1
:
(7.91)
We refer to (7.90)or(7.91)asa finite difference scheme for the PDE (7.86). At a gen-
eral point .x i ;t `C1 / we can compute the function value u `C1
i
from the known values
u i1
, u i
,and u iC1
. This procedure is graphically illustrated in Fig. 7.12 . Many refer
Search WWH ::




Custom Search