Environmental Engineering Reference
In-Depth Information
Fig. 21.2 Examples of 2D regular (equidistant) and irregular FD meshes of a square model region
For each position ( x , y )( 21.16 ) and ( 21.19 ) state a relation between the
(unknown) function value u ( x , y ) and the (also unknown) function values at the
neighboring four nodes. Boundary conditions can be considered as described for
the ode-case above.
Altogether, one obtains an equation for each of the unknown nodes. I.e. there are
as many equations as there are unknown values - a classical situation for utilizing a
mathematical solver for such a problem. Thus the problem of solving a differential
equation, ode or pde, is reduced to the problem of solving a system of equations.
The latter is a feasible task (in principle), using help offered by mathematical
toolboxes, such as MATLAB
.
For the given examples with constant coefficients the described procedure leads
to linear systems of equations. For example using canonical numbering of the nodes
( x -direction first, then y -direction) the stencil ( 21.19 ) leads to the linear system:
®
0
1
410
:::
10
:::
@
A
1
410
:::
:::
0
:::
1
41
:::
:::
1
0
:::
:::
:::
:::
:::
0
u
¼
b
(21.20)
10
:::
:::
:::
1
:::
0
:::
:::
01
41
:::
01
:::
01
4
where u denotes the vector of unknown values u ( x , y ) at the nodes and b the right
hand side vector. The matrix has entries
4 along the main diagonal, and entries 1
in 4 side-diagonals. Two of the side diagonals are just aside the main diagonal; both
others are further away depending on the size of the mesh in x -direction. Due to the
boundary condition several of the 1-entries in the side-diagonals will be missing,
and instead of that there will appear non-zero entries in the right hand side vector b.
In all cases, independent of the dimension, and of the special discretization
method, one obtains matrices, in which the number of non-zero entries is very quite
small in relation to the space available in the matrix. Such matrices are called
sparse , in contrast to dense matrices, in which the majority of elements is non-zero.
Search WWH ::




Custom Search