Biomedical Engineering Reference
In-Depth Information
We now demonstrate the idea of FDM by the following examples.
Example 3. As an example, we consider using FDM to solve the linear shape
from shading problem (5.3) on a square domain:
={ ( x , y ) ,
0 < x < 1 ,
0 < y < 1 }
with the boundary condition given by (5.4). Using forward difference formula
(5.23), we have
1
h ( Z i + 1 , j Z i , j ) and q
1
k ( Z i , j + 1 Z i , j ) .
p
(5.27)
We rewrite Eq. (5.3) as
I ( x , y ) = p 0 p + q 0 q ,
(5.28)
1 + p 0 + q 0 ρ. Substituting (5.27) and (5.28), we have
where =
p 0
h ( Z i + 1 , j Z i , j ) +
q 0
k ( Z i , j + 1 Z i , j ) .
I i , j =
Solving for Z i , j + 1 , we have
Z i , j + 1 =− α Z i + 1 , j + ( α + 1) Z i , j + β I i , j ,
k q 0 , i = 0 ,..., n 2 , Z i , 0 = g 1 ( x i ) and Z n 1 , j = g 2 ( y j ) ,j =
0 ,..., n 2 . Written in matrix format, we have
p 0 k
where α =
q 0 h =
Z 0 , j + 1
Z 1 , j + 1
....
Z n 2 , j + 1
α + 1
α
0
...
0
Z 0 , j
Z 1 , j
....
Z n 2 , j
α + 1
0
α
...
=
...
...
...
...
...
0
0
...
...
α + 1
(5.29)
I 0 , j
I 1 , j
....
I n 2 , j
0
0
....
α Z n 1 , j
+ β
+
,
j = 0 , 1 ,..., n 2 .
Figure 5.1 shows the discretization we are using.
The finite difference scheme (5.29) is called the explicit method since it
is given by an iterative formula. If instead, the central (5.25) and forward
difference formulas (5.23) are used to approximate the partial derivatives,
an implicit finite difference scheme can be derived. The approximate solution
is then derived iteratively by using the iteration formula (5.29). Numerical
 
Search WWH ::




Custom Search