Finite Diference Method

Embed Size (px)

Citation preview

  • 8/6/2019 Finite Diference Method

    1/10

    IMA Journal of Numerical Analysis (1991) 11, 261-270

    High-Order Finite-Differences Schemes to Solve Poisson's Equation inPolar CoordinatesR. C. MTTTAL AND S. G A H L A U T

    Department of Mathematics, University of Roorkee, Roorkee-247 667[Received 21 June 1985 and in revised form 28 January 1987]

    In the present work finite difference schemes of second and fourth order arederived for the solution of Poisson's equation in polar coordinates. To solve theresulting system of linear equations, a direct method similar to Hockney's methodis developed. The schemes are tested on six test problems whose exact solutionsare known. The numerical results obtained by these finite-difference schemesshow that they produce very accurate results.1. IntroductionPOISSON'S equation in polar coordinates is given by

    d*u 1 du 1 3?u , , . ,+ + e ) ( 1 1

    defined in the domain

    orAJ = {(r, d): R

    The boundary conditions for the domain Dx are of the formu(r, 0,) =/,(r), u(r,

  • 8/6/2019 Finite Diference Method

    2/10

    262 R. C. MTTTAL AN D S . GA HL AU Tderived a sixth-order scheme while Collate (1960) has given an eighth-orderscheme derived by what he calls 'Hermitian methods'. Albasiny (1960), Eisen(1966), MacMillan (1964) and Iyengar & Mittal (1978) have derived somefinite difference schemes to solve the cylindrical heat-conduction problem.Evans & Gane (1978) have given an ADI scheme to solve the two-dimensionalheat-conduction problem in r-8 geometry. In the present paper, we have derivedsecond-order and fourth-order finite-difference schemes to solve Poisson's equa-tion (1.1). These schemes are tested on six examples of different kinds whoseexact solutions are known to u s. The resulting system of linear equ ations obtainedwith the h elp of the se finite-difference schemes is solved by a direct me thodsimilar to that of Hockney. The results are reported in Section 5. The results ofthe finite-difference especially the fourth-order schem es, when com pared w ith theexact solutions, have been found very accurate.2. Derivation offinite-differenceschemes

    T he finite-difference approximation of equa tion (1.1) is derived on a cellwith circular boundaries and centre at (r, 8). Let hx be the step-length alongthe r-direction and h2 be the step-length along the 0-direction. The centralpoint (r, 6) is taken to be the origin and denoted by 'O'. The neighbouringpoints (*!,y

    F I G . l .

    atPontif?cia

    UniversidadeCat?licadoRioGrandedoSulonJanuary21,2011

    imajn

    a.oxfordjournals.org

    Downloadedfrom

    http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/
  • 8/6/2019 Finite Diference Method

    3/10

    HIGH-ORDER FINITE DIFFERENCE SCHEMES FOR POISSON'S EQUATION 2 6 3

    we obtain the following finite-difference scheme:(1 + a,)u i+lJ - 2(1 + a,)u,j + (1 - a t)u,_ij + aiUiJ+1 + a tu i4_x = hi\f,,,, (2.1)

    where a, = hx/2r, an d or, = (hjh 2 r, ) 2 .2.2 Fourth Order Finite-Difference Scheme

    According to Fig. 1, the elliptic expression^w 1

    can be replaced by the following nine-point approximation at point O:

    where 5^ = us + u6 + u7 + u8, S3 = ux + u3, S4 = u2 + u 4 , and a) = (h1/h 2) 2 .Replacing duo/dr by the approximationdr 2hx 6 3r3 i r " z 3r 30 2 ' " v ' * + h**' ( 2 3 )

    where 6 ^ is the central difference ope rator along the r-direction and 0 ^ 1.With the help of (2.2) and (2.3), we have{cPu 1 du

    (2.4)Choosing

  • 8/6/2019 Finite Diference Method

    4/10

    (2.6)

    2 6 4 R. C. MTTTAL AND S. GAHLAUTFinally, we obtain the following finite-difference scheme

    a,u, = Uhlfo + h\{d2 + 62)f0+ -6.t-o " owhere the coefficients a, are defined as follows:

    a0 = - 2 0 ( 1 + a) + 2 p2 - Sp2aax = 2(5 - a) + 5p + $p3 - p2 + 3paa3 = 2(5 -a)-5p-hp3-p 2~ ^poc05 = 8 = (1 + 2, taking th e ^-direction first and then the r-direction, we have the followingsystem of linear equations:

    C 2 A ,CL-i

    cL

    u2

    "L

    (4.1)

    where L = N or L = N + 1 depending on whether the Dirichlet or Neumannboundary condition is given on the outer boundary. Also A,, B,, and C t areMx At matrices.

    atPontif?cia

    UniversidadeCat?licadoRioGrandedoSulonJanuary21,2011

    imajn

    a.oxfordjournals.org

    Downloadedfrom

    http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/
  • 8/6/2019 Finite Diference Method

    5/10

    H I G H - O R D E R F I N I T E D I F F E R E N C E S C H E M E S FOR POIS S OITS EQUATION 265For domain Du when we apply the second-order scheme (2.1), A lr..,AL aresymmetric tridiagonal matrices and B lr..,BL-u C2r-,CL are diagonal matrices,while, for the fourth-order scheme (2.6), B and C are also tridiagonal matrices. In

    the present case the usual Hockney method can be applied. The details of themethod can be found in Smith (1978).In the case of domain I\, for the second-order finite-difference scheme (2.1),A lr.nAL are symmetric circulant matrices and B lr..,BL_ t and C2r..,CL arediagonal matrices, while, for the fourth-order finite-difference scheme (2.6),B lr..,BL^ and C2r-,CL are also symmetric circulant matrices.In the present case, to apply a method similar to that of Hockney, we need toknow the eigenvalues of a symmetric circulant matrix and its correspondingorthogonal matrix of eigenvectors. We have developed formulae to obtaineigenvalues and corresponding eigenvectors of a circulant matrix of the followingform

    A =

    ab

    0b

    ba

    00

    0

    b

    0 0

    00

    b0

    00

    ab

    b0

    ba

    e R " (4.2)

    The eigenvalues of matrix A can be computed by the formulaA, = a + 2 b co s (2ni/M) (J = 1,...,M). (4.3)

    Let Q be the matrix of eigenvectors of matrix A, known as the model matrix,where

    qi = [qnr-,?/M]T (i = l,...,M)are eigenvectors of A . The components q,j can be obained by the formulaq tJ = (cos 6 + sin 6)1 JM (i = 1,..., M,j = l,..., M ), (4.4)where 6 = (2x/M)(i - 1)(; - 1).5. Numerical results

    We have tested the finite-difference schem es (2.1) and (2.6) on the followingsix examples representing different classes of problems that may arise in practice.EXAMPLE 1

    Id u

    atPontif?cia

    UniversidadeCat?licadoRioGrandedoSulonJanuary21,2011

    imajn

    a.oxfordjournals.org

    Downloadedfrom

    http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/
  • 8/6/2019 Finite Diference Method

    6/10

    266 R. C. MTITAL AND S. GAHLAUTT A B L E 1Numerical results for Example 1

    s.n o .123456

    Point(0-2,n/6)(0-3.K/3)( 0 - 4 , n/2)(0-6,2n/3)(0-7,5n/6)(0-8,n/2)

    Second-order f.d.s.(2.1) A , = 0 - 1 , h = n/12

    0-18680670-39530760-53931630-70386220-71767720-8782691

    Fourth-order f.d.s.(2.6) A , = 0 - 1 , h2 = n/120-18701370-39618510-54036390-70504300-71969470-8787360

    Exactsolution0-187020-396290-540410-705160-719780-87874

    Note: The 'exact' solution of this problem is given by taking the first 20 terms of the infinite series.

    with boundary condition

    The exact solution of the problem is given by^ -lor2"1*1^r 0 n(2m - l)(2m + l)(2m + 3)

    The results of this example are given in Table 1.EXAMPLE 2

    1 du 1 a2!/ .

    sin (2m+ 1)0.

    , 1< r < 2,with boundary conditions

    w(l ,0)=O, U ( 2 , 0) = sin 20.The exact solution is given by

    - ^ ) sin 20.(r, 0) =

    The results of this example are given in Table 2.T A B L E 2Absolute errors in Example 2

    S.n o . Point

    Second-orderf.d.s. (2.1), = 0 - 1 , h2 = n/Fourth-orderf.d.s. (2.6)A, = 0-1, /i2 = n / Exactsolution

    123456

    (1-2.B/3)( l -3 ,2n/3)( 1 - 4 , n)( l -6 ,4n/3)( 1 - 7 , 5 J I / 3 )( 1 - 8 , 2n )

    0-38707(-2)-0 -52515(-2)O - O O O O O O O0-63966(-2)0-56815(-2)O - O O O O O O O

    0-54150(-3)002991(-3)00000000018863(-2)0-232O4(-2)00000000

    01721787-0-2536378000000000-5009957-0-5875069O - O O O O O O O

    atPontif?cia

    UniversidadeCat?licadoRioGr

    andedoSulonJanuary21,2011

    imajn

    a.oxfordjournals.org

    Downloadedfrom

    http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/http://imajna.oxfordjournals.org/
  • 8/6/2019 Finite Diference Method

    7/10

    HIGH-ORDER FINITE DIFFERENCE SCHEMES FOR POISSON*S EQUATION 2 6 7EX AMPLE 3

    a u 1 du 1 d^u- - j + - + -55 = 0 forO

  • 8/6/2019 Finite Diference Method

    8/10

    268 R. C. MTITAL AND S. OAHLAUTTABLE 4Absolute errors in Example 4

    s.no.123456

    S.no.123456

    EXAMPLE

    Point

    (0-5'5n/12)(0-6, 5JI/12)(0-8, JI/4)(I-O.B/12)

    Point(0-2, JI /3)(0-3, 2JI/3)(0-4, K)(0-7, 4JI/3)(0-8, 5n/3)(0-9, 2JI)

    6c?u 1 dudr2 r dr

    Second-orderf.d.s. (2.1)A, =0-1, H2 = n/12

    0-93301(-4)0-18754(-2)0-20722(-2)0-28154(-2)0-50439(-2)0-62601(-3)

    TABLEAbsolute errors inSecond-orderf.d.s. (2.1)

    0-23478(-l)-0-21803(-l)-0-17937(-l)-0-25945(-l)0-47683(-l)0-21486

    1 cPu}"r1~ddi=~3cose

    Fourth-orderf.d.s. (2.6)A, = 0-1, h2 = n/l2

    011571(-3)0-83990(-3)0-47181(-5)0-61190(-3)0-27278(-2)014166(-l)

    5Example 5Fourth-orderf.d.s. (2.6)

    0-50405(-2)-0-65019(-2)-0-52795(-2)-0-82577(-2)0-86927(-2)0-60872(-1)

    f o r O < 0 = e 2 j t , O < r