Mathematical Physics - Volume II - Numerical Methods

1.1 Finite difference method

23

is satisfied by an exact solution u with an error of O ( h 2 + k 2 ) ; in other words, if the expression (1.49) determines U n 1 , we obtain an error whose order is higher than O ( k 2 + h 2 ) . 1.1.8 Application of the finite difference method to elliptical differential equations For a linear elliptical contour problem, if all derivatives are replaced by their finite differences, we obtain a system of linear algebraic equations, as is the case with the Dirichlet problem over a domain Ω ( 0 < x < l ; 0 < y < l ) : u xx + u yy = f ( x , y ) (1.53) with the following boundary conditions:

u = g ( x , y )

on the boundary S .

(1.54)

If we chose a mesh step of h = l / 4, we obtain the following mesh:

( x m , y m ) = ( mh , nh ) ( m , n = 0 , 1 , 2 , 3 , 4 ) .

(1.55)

By using the central differences, we obtain: U m + 1 , n − 2 U mn + U m − 1 , n h 2 +

U m , n + 1 − 2 U mn + U m , n − 1 h 2

= f mn ,

(1.56)

where f mn = f ( x m , y n ) , a U mn = g mn za m , n = 0 or 4. In this case, the following is obtained:

     4 − 1 0 − 1 0 0 0 0 0 − 1 4 − 1 0 − 1 0 0 0 0 0 − 1 4 0 0 − 1 0 0 0 − 1 0 0 4 − 1 0 − 1 0 0 0 − 1 0 − 1 4 − 1 0 − 1 0 0 0 − 1 0 − 1 4 0 0 − 1 0 0 0 − 1 0 0 4 − 1 0 0 0 0 0 − 1 0 − 1 4 − 1 0 0 0 0 0 − 1 0 − 1 4

    

     U 1 U 2 U 3 U 4 U 5 U 6 U 7 U 8 U 9

     =

     B 1 B 2 B 3 B 4 B 5 B 6 B 7 B 8 B 9

    

(1.57)

where for g = 0, B j = − h 2 f

j . Based on this example, it can be seen that for a general 2 D linear

elliptical contour problem, we can obtain a system of linear algebraic equations: AU = B

(1.58)

wherein the following holds: (1) Dimensions of vectors U and B correspond to the number of nodes for which the solution is sought. (2) Vector B is defined by its contour conditions and terms in the partial differential equation that are not dependent from u . (3) Matrix A is square and contains no more than 5 terms per row or column which are not 0. With a fixed Ω , the order of matrix A is a decreasing function of the number of mesh steps, h (higher step – coarser mesh, lower order of A ). Hence the eigenvalues of matrix A (necessary for the iterative solving of a system of linear algebraic equations) are dependent of h .

Made with FlippingBook flipbook maker