Вы находитесь на странице: 1из 22

POISSONS EQUATION - DISCRETIZATION

The Dirichlet boundary value problem for Poissons equation is given by


u(x, y ) = g (x, y ), (x, y ) R
u(x, y ) = f (x, y ), (x, y )

(1)

where R is a planar region and is the boundary of


R. In the book in 8.8, we examine this problem for
R = {(x, y ) | 0 < x, y < 1}.
For an integer N > 1, we introduce a mesh size h =
1/N . With it, we dene a rectangular mesh on R =
R :
(xj , yk ) =

j k
N, N

j, k = 0, 1, ..., N

At mesh points (=grid points) inside of R, we approximate the equation u = g . To do so, we recall the
approximation
G(x + h) 2G(x) + G(x h) h2 (4)
G (x) =
G ( )
2
h
12
with some [x h, x + h]. This assumes G is four
times continuously dierentiable on [x h, x + h].


Since
2u(x, y ) 2u(x, y )
+
u(x, y ) =
x2
y 2
we obtain at each (xj , yk ) R that
u(xj+1, yk ) 2u(xj , yk ) + u(xj1, yk )
h2
u(xj , yk+1) 2u(xj , yk ) + u(xj , yk1)
+
h2
 4

4
2
h u(j , yk ) u(xj , k )

+
12
x4
y 4
= g (xj , yk )


(2)

with j xj1, xj+1 , k yk1, yk+1 . We can


delete the error terms involving the fourth derivatives
of u. This leads to a new set of equations for approximating unknown uh u:

uh(xj , yk ) | 1 < j, k < N

The values of uh at boundary mesh points on are


given by
uh(xj , yk ) = f (xj , yk ),

(xj , yk )

(3)

This leads to the linear system


uh(xj+1, yk ) 2uh(xj , yk ) + uh(xj1, yk )
h2
uh(xj , yk+1) 2uh(xj , yk ) + uh(xj , yk1)
+
h2
= g (xj , yk ),
(xj , yk ) R
uh(xj , yk ) = f (xj , yk ),

(xj , yk )

(4)

For interior mesh points, we can simplify this to


uh(xj , yk1) + uh(xj1, yk ) 4uh(xj , yk )

+uh(xj+1, yk ) + uh(xj , yk+1) = h2g (xj , yk )


(xj , yk ) R
(5)
Thus we have a system of (N + 1)2 linear equations
in the (N + 1)2 unknowns

uh(xj , yk ) | 1 j, k N

If u(x, y ) is four times continuously dierentiable over


R, it can be shown that for some c,




max u(xj , yk ) uh(xj , yk ) c h2
R

JACOBI ITERATION
For m = 0, 1, 2, ..., dene

1
(m+1)
(m)
(m)
uh
(xj , yk ) =
uh (xj , yk1) + uh (xj1, yk )
4

(m)

(m)

+ uh (xj+1, yk ) + uh (xj , yk+1) h2g (xj , yk )


(xj , yk ) R
(6)
(m)

For values of uh at boundary points, use the given


boundary conditions as in (3).
We can write the iteration in matrix-vector form as
(m+1)

uh

1
Q=
4

(m)

= Quh

+ Gh

T I 0 0 0
I T I
..
0 I T
I
..
...
0
I T I
0

I T

with I the identity of order N 1,

T =

0 1
0
1 0 1
..
..
...
1 0 1
0
1 0

(m)
uh =

(m)
uh (, y1)
(m)
uh (, y2)

..

(m)

uh (, yN 1)

(m)
uh (, yk ) =

(m)
uh (x1, yk )
(m)
uh (x2, yk )

..

(m)

uh (xN 1, yk )

Gh =

1 B(y ) h2 G (, y )
1
1
h
4

1 B(y ) h2 G (, y )
2
2
h
4

..
1 B(y
2
N 1) h Gh (, yN 1)
4

B(yk ) =

Gh(, yk ) =

f (x0, yk )
0
..
0
f (xN , yk )

g (x1, yk )
g (x2, yk )
..
g (xN 1, yk )

The original discretization of (4)-(5) can be rewritten


as

uh = Quh + Gh
with uh written in accordance with the above deni(m)
tion of uh .

uh = Quh + Gh
(m+1)

uh

(m)

= Quh

+ Gh

(7)
(8)

In this block matrix description of the system being


solved, each block uh(, yk ) corresponds to the horizontal row of interior grid points at y = yk , with the
entries in uh(, yk ) being ordered in correspondence
to the grid points being numbered from left to right in
the grid. Note that Q is a symmetric matrix of order
(N 1)2.
If we write our linear system (7) in the form Ax = b,
we have A = I Q, again a symmetric matrix. With
reference to the Gauss-Seidel iteration, note that the
diagonal elements of A are positive.

(m)

For the iteration error eh in the Jacobi iteration,


subtract (8) from (7), obtaining
(m+1)

eh

(m)

= Qeh ,

m = 0, 1, ...

(9)

The matrix Q is the earlier matrix M of our general


framework in the case of the Gauss-Jacobi iteration.
Thus we have convergence of the Jacobi iteration if
and only if
r (Q) < 1

Note in this case that


Q 1 = Q = 1

Thus we are driven to looking at r (Q), and in this


case Q 2 = r (Q).

GAUSS-SEIDEL ITERATION
For m = 0, 1, 2, ..., dene

1
(m+1)
(m+1)
uh
(xj , yk ) =
uh
(xj , yk1)
4
(m+1)

+ uh

(m)

(xj1, yk ) + uh (xj+1, yk )

(m)

+uh (xj , yk+1) h2g (xj , yk ),

(xj , yk ) R
(10)

(m)

For values of uh at boundary points, use the given


boundary conditions as in (3).
We can use the above matrices to also write this iteration in matrix-vector format. In the language of the
general framework given earlier, it amounts to letting
N be the lower triangular portion of A = I Q and
P = N A. Then write
(m+1)

N uh

(m)

= Gh + P uh

RATES OF CONVERGENCE

Introduce

= 1 2 sin2
2N

1 + sqrt 1 2

(11)


Then for the rates of convergence of the various iteration methods we have studied when applied to solving
(7), uh = Quh + Gh, we have
Rate of Convergence
Method
r (M )
Jacobi

Gauss-Seidel
2
SOR
1

THE RATE OF CONVERGENCE OF SOR

In the language of the general framework given earlier,


the error equation for the SOR method will be
(m+1)

eh

(m)

= M ( ) eh ,

m = 0, 1, ...

(12)

The eigenvalues of M ( ) can be computed explicitly


in this case, yielding



2

+
sqrt
+ 4 (1 ) ,

2
2

r (M ( )) =
0

1,

We give graphs for a few cases of the discretization


parameter N .

COSTS
Recall the notation from 8.7 regarding costs:
Cost(c, , n) = m (n)
with c the factor by which the error was decreasing
per iterate, n the order of the system, the error
tolerance in






(m) 
(0) 
x x
 x x 

(n) the number of arithmetic operations per iterate


calculation, and
log
m =
,
R(c)

R(c) = log c

For c = 1 with small, we have


.
R(c) =

c = 1 ,

Note that for Poisson example, (n) 5n, and thus


the total cost of attaining the desired accuracy is
Cost(c, , n) = 5nm

APPLICATION TO SOLVING
POISSONS EQUATION

Gauss-Jacobi :
c==

 
1
2
2
1 2 h + O h4
12 2h2

Gauss-Seidel :
c=

1 2h2

+ O h4

2h2

SOR :


c = 1 = 1 2h + O h2
2h

The improvement in the needed numbers of iterates


is as follows, along with total costs for a desired accuracy.
Gauss-Jacobi vs. Gauss-Seidel : Gauss-Seidel requires
approximately half the iterates required of Gauss-Jacobi.
For Gauss-Seidel iteration,
Cost(c, , n)

log
5n
2h2

5(N 1)2 log


2
(N 1)2

5N 4 log
2

Gauss-Seidel vs. SOR : The factor giving the decrease


in the number of iterates to be computed is
2h
2
=
2h2
h
Thus you are increasingly better o as h 0. For
the cost of SOR,
Cost(c, , n)

log
5n2h

5(N 1)2 log

2(N 1)1

5N 3 log
2

The costs increase rapidly with N .

Let KJ , KGS , KSOR denote the number of iterations


needed to reduce the iteration error by a factor of
10, for the Jacobi, Gauss-Seidel, and SOR methods,
respectively. The following table shows the results for
several values of N .

2
1
KJ
KGS
KSOR

N = 10
.9510565
.9045085
.5278640
46
23
4

N = 20
N = 40
.9876883 .9969173
.9755283 .9938442
.7294538 .8544978
186
746
93
373
8
15

N = 80
.99922904
.99845867
.92444658
2985
1493
31

AN INITIAL GUESS
(0)

How to generate an initial guess uh ? Since we know


the solution on the boundary,
uh(xj , yk ) = f (xj , yk ),

(xj , yk )

We use an interpolant of this data to extend the


boundary values to all of R. Dene
(0)

uh (x, y ) = (1 x)f (0, y ) + xf (1, y )


+(1 y )f (x, 0) + yf (x, 1)
[(1 y )(1 x)f (0, 0) + xyf (1, 1)
+ (1 y )xf (1, 0) + y (1 x)f (0, 1)]
(13)

LINE ITERATION

Recall the discretization of (8.8.5):


uh(xj , yk ) =


1 u (x
h j+1, yk ) + uh(xj , yk+1)
4

+uh(xj1, yk ) + uh(xj , yk1)


2
h
4 g (xj , yk ),

1 j, k N 1

Previously we solved individually for a new value of


uh(xj , yk ). Consider solving simultaneously for all the
values in a row of the grid, say in row #k.
The line Jacobi method is dened by

(m+1)
(m+1)
uh
(xj , yk ) = 14 uh
(xj+1, yk )
(m+1)
(m)
+ uh
(xj1, yk ) + uh (xj , yk+1)

2
(m)
h
+uh (xj , yk1) 4 g (xj , yk ), 1 j N 1

for k = 1, ..., N 1. This is a tridiagonal system of


order N 1; and it can be solved in approximately
5N arithmetic operations.

MULTIGRID ITERATION

I just give the general philosophy, as the details are


quite complicated.
Imagine having a sequence of linear systems
AN uN = bN ,

N = N0, N1, N2, ..., Nq

In our case with the Poisson equation, we would generally have Nj+1 = 4Nj , approximately. We want
to solve for the most accurate discretization, that for
N = Nq .
The general philosophy is to use information from
each of the systems AN uN = bN to solve all the
systems with a ner mesh. There are a number of
ways is which this may be carried out.

Step 1. Use the Jacobi method to iterate in ANq uNq =


bNq , calculating a certain number of iterates (say K ),
(K)

to get v = uNq . Then calculate the residual




R = bNq ANq v =ANq uNq v

Step 2. Find an approximate solution by performing


the multigrid iteration on the system
ANq1 = Rq,q1R

calling the approximate solution .


Step 3. Prolong the solution  to a vector  be of
length Nq and then dene the new iterate for ANq uNq =
bNq to be

uNq v + 
This converges extremely rapidly; and there are public domain packages available which implement it for
common classes of partial dierential equations. In
general these are the fastest means of solving discretizations of PDEs.

DIRECT METHODS
With the systems for some special PDEs, including the
Poisson equation on a rectangle, it is possible to give
an exact method of solution which is also extremely
ecient. It depends on knowing the eigenvalues and
eigenvectors for the matrix AN . Since the matrix is
symmetric and positive denite, there is a basis of
orthogonal eigenvectors; and it can be found explicitly.
Suppose it is written as

v(1), v(2), ..., v(N )


with eigenvalues 1, ..., N . Then write

b=

N 

j=1

b, v

(j)

v(j)

The solution of AuN = b is given by

uN =

N

1 
j=1 j

b, v

(j)

v(j)

In the particular case of the Poisson equation over a


rectangle, this can be computed in O(N log N ) operations.

0.95

0.9

0.85

0.2

0.4

0.6

0.8

1.2

1.4

1.6

1.8

Figure 1: Convergence rate r (M ( )) with N = 40


and = 1.85450

0.99

0.98

0.97

0.96

0.95

0.94

0.93

0.92

0.2

0.4

0.6

0.8

1.2

1.4

1.6

1.8

Figure 2: Convergence rate r (M ( )) with N = 80


and = 1.92445

Вам также может понравиться