A Numerical Technique of Initial and Boundary Value Problems by Galerkin’s Weighted Method and Comparison of the Other Approximate Numerical Methods

DOI : 10.17577/IJERTV3IS20565

Download Full-Text PDF Cite this Publication

Text Only Version

A Numerical Technique of Initial and Boundary Value Problems by Galerkin’s Weighted Method and Comparison of the Other Approximate Numerical Methods

Dipankar Kumar1, Gour Chandra Paul2, Ashabul Hoque3

1Department of Mathematics, Bangabandhu Sheikh Mujibur Rahman Science & Technology University, Gopalganj-8100, Bangladesh

2Department of Mathematics, University of Rajshahi, Rajshahi-6205, Bangladesh

3Department of Mathematics, University of Rajshahi, Rajshahi-6205, Bangladesh

Abstract In this paper, the initial and boundary value problems are solved by Galerkin weighted residual method. In the case of initial value problem, accuracy of Galerkin method is shown over exact solution. Accuracy is also continued to improve over the solutions by some standard numerical methods. It is shown that there is an astonishing accuracy of the Galerkins approximation method with even two terms in the case of initial value problem. Again In the cases of boundary value problem, some aspects of boundary problem are shown in solving them by Galerkin weighted residual approximation method. In this situation, the result of our calculation shows that basis functions are very dense in a space containing the actual solution. Galerkin finite element method is also introduced in solving boundary value problem. Resulting accuracy is also tested. Galerkin finite element method is found to be so effective that in this method an extraordinary accuracy is achieved with modest effort.

Keywords Galerkin weighted residual, Galerkin finite element method, initial value problem, boundary value problem.

  1. INTRODUCTION

    In Mathematics, Engineering and other branches of science, differential equations are used to model problems. Most of the problems require the solution to an initial value problem that is the solution to a differential equation that that satisfies a given condition. But in some cases arise in real life situations; the differential equation that models the problem is so complicated that, there is rarely a solution. In such cases, where an analytic solution is not possible, one must have to adopt one of the two ways, namely ( i) to simplify the differential equation to one that that can be solved exactly and

    (ii) to use methods for approximating the solution of the original problem. There are various procedures for obtaining a numerical solution to a differential equation. These methods can be separated into three basic groupings, namely (i) the finite difference method, (ii) the variational method and iii) the method that weight a residual. Our aim is to solve an initial value problem by Galerkin weighted residual approximation method.

    Several problems arising in science and engineering are modeled by differential equations that involve conditions

    that are specified at more than one point. Such types of problems are called boundary-value problems. The crucial distinction between initial value problems and boundary value problems is that in the former case we are able to start an acceptable solution at its beginning (initial values) and just march it along by numerical integration to its end (final values), while in the case of boundary value problem, boundary conditions at the starting point do not determine a unique solution to start with a random choice among the solutions that satisfy these incomplete starting boundary conditions is almost certain not to satisfy the boundary conditions at the other specified points. There are three standard methods for solving two point boundary value problems, namely shooting method, finite difference method and projection method. Among these, finite difference method is popular one. Our assumption is that the differential equation is linear.

    The finite difference method approximates the derivatives in the governing differential equation using difference equation. The variational approach involves the integral of a function that produces a number. Each function produces a new number. The function that produces the lowest number has the additional property of satisfying a specific differential equation. The weighted residual methods also involve an integral. In these methods, an approximate solution is substituted into the differential equation. Since the approximate solution does not satisfy the differential equation, therefore an error term or a residual results. Weighted residual method requires that the inner product of the residual and each of the weighted functions must be zero. There are several processes to choice weighted functions. Galerkins method is one of them. In order to solve to solve ordinary differential equations by Galerkin method the following terms are very essential to describe.

    The finite element method is another numerical technique that gives approximate solutions to differential equations that model problems arising in physics and engineering. As in simple finite difference schemes, the finite element method requires a problem defined in geometrical space (or domain), to be subdivided into a finite number of smaller regions. The early work on numerical solution of

    boundary-valued problems can be traced to the use of finite difference schemes. The beginnings of the finite element method actually stem from these early numerical methods and the frustration associated with attempting to use finite difference methods on more difficult, geometrically irregular problems [17]. The first publications in finite element method appeared in 1950´s with the works written by [1, 6, and 20]. These were used to solve problems in structural analysis. Some decades later, Zienkiewicz and Cheung, Oden and Wellford, Chung and Baker among other publications, treated the heat transfer and fluid flow problems solutions involving solution of Laplace and Poisson equations [21, 12, 5 and 2].

    A vigorous mathematical discussion is given by Johnson [10], and programming the finite element method is described by

    III. METHODS

    1. Galerkins weighted Method

      In this method, an approximating function called the trial function is substituted in the given differential equation and the result is called the residual. It is mentioned that the result will not be zero since an approximation function is substituted. The residual is then weighted and the integral of the product, taken over the domain, is set to zero. An advantage of this method is that it works with the governing equations of the problem and does not require a functional.

      • Galerkins Requirements

    Let us solve the linear differential equation L(u) f

    by choosing basis function . Then approximating the

    Smith [18]. The mathematical basis of the finite element method first lies with the classical Rayleigh-Ritz and

    actual solution u~

    j

    by a linear combination of these

    variational calculus procedures introduced by Rayleigh [14] ~ N

    and Ritz [16]. Recent descriptions of the method are discussed in [4, 11, 8, 9, 15, 19, 3 and 7]. Most practitioners of the finite

    functions

    u c j j j1

    for all values of c j

    the

    element method now employ Galerkin's method to establish the approximations to the governing equations. Instead of going into rigorous treatment about this Galerkin finite

    approximate u~ satisfies.

    The residual R L(u~) f

    must be orthogonal to the

    element, we only intend to show in this article is that why this method is so effective.

    basis element approximation.

    1 ,2 ,3 ,……….N

    used in the

  2. GOVERNING EQUATIONS

    1. Initial ValueProblems

      i.e.,

      N

      N

      R c f

      i , 0 , where L j j

      We consider the general equation of initial value problems of the first ordered as

      i ,

      c j

      j1

      i , j

      i , f 0

      dy f (x, y)

      dx

      subject to the initial condition y(x0

      ) y0 ,

      Hence

      j1 .

      where

      x0 x xn .

    2. Galerkin finite element method

    The finite element method is a numerical technique that gives

    To keep the discussion simple while meaningful a general formulation, we consider the following initial value problems of the first ordered as

    dy

    approximate solutions to differential equations that model problems arising in physics and engineering. As in simple finite difference schemes, the finite element method requires a problem defined in geometrical space (or domain), to be

    y 1

    dx

    subject to the initial condition y(0) 0

    where 0 x 1 .

    1. Boundary value problems

      (1)

      (2)

      subdivided into a finite number of smaller regions (a mesh).This method is based on the idea of building a complicated object with simple blocks, or dividing a complicated object into small and manageable pieces. Its provides a greater flexibility to model complex geometries than finite difference and finite volume methods do. It has

      We consider the general equation of boundary value problems of the first ordered as

      d 2 y

      been widely used in solving structural, mechanical, heat transfer, and fluid dynamics problems as well as problems of other disciplines. The finite element method has grown out of

      dx2

      f (x, y, y)

      subject to the boundary condition

      Galerkins method, emerging as a universal method for the solution of differential equations. Much of the success of the

      y(x0 ) y0 y(xn ) , where x0 x xn .

      Again to keep the discussion simple while meaningful a general formulation, we again consider the following initial value problems of the first ordered as

      d 2 y

      finite element method can be contributed to its generality and simplicity, allowing a wide range of differential equations from all areas of science to be analyzed and solved within a common framework. Another contributing factor to the success of the finite element method is the flexibility of

      formulation, allowing the properties of the discretization to be

      dx 2

      y 1 0

      (3)

      controlled by the choice of finite element approximating

      subject to the boundary condition

      y(0) 0 y(1)

      (4)

      spaces. Historically, all major practical advances of the finite element method have taken place since the early 1950s in conjunction with the development of digital computers. However, interest in approximate solutions of field equations

      dates as far back in time as the development of the classical field theories themselves. The work of Rayleigh [14] and Ritz

      [16] on vibrational methods and the weighted-residual

      where, i 1, 2, 3,…………….., N .

      We have solved the equations Ac b

      for the unknown c j

      approach taken by B. G. Galerkin and others form the theoretical framework to the finite element method.

    2. Finite difference method

      The finite difference method for the solution of a two point boundary value problem consists in replacing the derivatives occurring in the differential equation by means of their finite difference approximations and then solving the resulting linear system of equations by a standard procedure.

    3. Discontinuous Galerkin weighted method

    The Discontinuous Galerkin weighted method is somewhere between a finite element and a finite volume method and has many good features of both. It provides a practical framework for the development of high-order accurate methods using unstructured grids. The method is well suited for large-scale time-dependent computations in which high accuracy is required [13]. An important distinction between the Discontinuous Galerkin weighted (DGW) method and the usual finite-element method is that in the Discontinuous weighted Galerkin (DGW) method the resulting equations are local to the generating element. The solution within each element is not reconstructed by looking to neighboring elements. Its compact formulation can be applied near boundaries without special treatment, which greatly increases the robustness and accuracy of any boundary condition implementation.

    with the help of the MATLAB routine.

    Accuracy will continue to improve over the solutions of the differential equation by two standard numerical methods, namely Eulers method and Range-Kutta method.

    Fig.1. Solution curves by Galerkins, Euler and Range- Kutta method for N=1.

    1. SOLUTIONS

      1. Analytical solution of initial value problem

        The analytic solution of the Eq. (1) subject to the condition (2) is given by

        y(x) 1 e x

        (5)

      2. Solution of initial value problem by Galerkin weighted method

        Let us use the basic functions

        x, x2 , x3 , x4 ,…………………….

        Each of which satisfies the condition Let the trial solution be

        y(0) 0.

        Fig.2. Solution curves by Galerkins, Euler and Range-Kutta method for N=2.

        ~y N

        j 1

        c j x j

        (6)

        The residual for this trial solution is

        N

        R 1 c j

        j 1

        ( jx j 1 x j )

        (7)

        Imposing Galerkins requirement, we have

        N

        xi ,1

        • c j j 1

          (xi , jx j 1 x j ) 0

          This equation yields N equations k

          N

          c j j 1

          ( j

          i j

          1 )

          1 i j

          1

          , (8)

          i 1

          Fig.3. Solution curves by Galerkins, Euler and Range-Kutta method for N=3.

          N

          y c j j j 1

          The residual for this trial solution is given by

          (10)

          N N

          R c j j c j j 1

          (11)

          j 1 j 1

          N

          Imposing Galerkins requirement, we have

          N

          • c j j 1

          i , j

        • c j j 1

          i , j

          i 1

          As Sobolev matrix

          S ,

          ,

          i j

          i j

          Fig.4. Solution curves by Galerkins, Euler and Range-

          Eq. (11) then can be written as

          Kutta method for N=50.

          c 1 dx N c

          1 dx

          1 dx

          N

          j 1

          j 0 i j

          j 1

          j 0 i j

          0 i

          ij 2ij i j

          i j 1 i j

          or, N c

          (i 1)( j 1)

          1 1 1

          j 1

          j i j 1

          i j 1 i 1 i 2

          2

          i j 2

          1

          i j 3

          where, i 1, 2,

          3……………., N.

          To obtain Galerkin approximate solution of the given

          boundary value problem, the unknown c j

          must have to be

          Fig.5. Solution curves by Galerkins, Euler and Range- Kutta method for N=100.

          determined. The values of c j are yields MATLAB routine.

          If we set

          N 1, then the value of the unknown with the help

          of the above MATLAB routine is obtained as c1 .2778

          Since our aim is estimate a comparison and to show accuracy of our problem by Galerkin weighted residual method with the exact solution and those obtained by the two standard methods mentioned above, so instead of going into giving detail description about these methods, only MATLAB routine in the respective cases are given.

      3. Analytical solution of boundary value problem

        Analytic solution of boundary value problem of Eq. (3) imposing the condition eq. (4), we get

        and then the Galerkin approximate solution is obtained as

        ~y .2778(x x2 ) .

        For x 0.5 , we have first approximate solution as

        y

        1/p>

        ~ .06945 , whereas the exact solution given by Eq. (28)

        of the given boundary value problem for that point yields

        y0.5 0.139493927

        Comparison with the exact solution the error in the computed solution by Galerkin method is 0.07004.

        Again if we set N 2 , then the values of the unknowns with

        sin x

        the help of the above MATLAB routine are obtained as

        y(x) 1 cos x (1 cos1)

        sin1

        (9)

        c1 .1924 and c2 .1707 , and then the Galerkin

        approximate solution is obtained as

        ~y .1924(x x2 ) .1707(x2 x3 ) .

      4. Solution of boundary value problem by Galerkin weighted method

        We employ as usual the basis functions

        For

        y

        ~

        2

        x 0.5 , the second approximate solution is given by

        .1054375 .

        j

        x j x j 1 , where

        j 1, 2, 3,…….., N .

        In this case the error is 0.034.

        Similarly the other approximate solutions are obtained some

        Each of the basis function satisfies both the boundary conditions given by Eq. (3).

        We assume the trial solution of the problem prescribed by Eq.

        (3) as

        of them are given in Table 1.

        Table 1: Comparison of our calculated value with exact value.

        x

        Exact value of

        Computed value of y by Galerkin

        weighted method.

        1st approx.

        Error

        2nd approx.

        Error

        3rd approx.

        Error

        0.5

        0.1395

        0.1389

        -0.0074

        0.1389

        -0.0074

        0.1395

        -0.0080

      5. Solution of boundary value problem by finite difference method

        With h 0.5 , use the finite-difference method to determine

        y

        the value of y0.5. It is shown that its exact solution of Eq.

        (3) is given by

        yx 1 cos x

        1 cos1 sin1

        sin x ,

        from which, we obtain

        y0.5 0.139493927 .

        Here

        nh 1. Then the given boundary value problem

        discretized as finite difference method can be written as

        yi1 2 yi yi1 y

        p i

        1 0

        Table 2: Comparison of our calculated value with exact value.

        x

        Exact value of y

        Computed value of y by Finite difference

        method.

        n 4

        Error

        n 4

        Error

        n 6

        Error

        0.5

        0.1395

        0.1428

        -0.0033

        0.1403

        -0.0008

        0.1399

        -0.0004

        (12)

        i

        and the Eq. (12) after simplification gives

        yi1

        2 p y

        yi1

        p ,

        (13)

        where

        i 1, 2,3, …, n 1

        which together with the boundary conditions y0 0 and

        yn 0 , comprises a system of n 1 equations for the

        n 1 unknowns y0 , y1 , y2 , , yn .

        Choosing becomes

        h 1

        2

        (i.e. n 2 ), the above system

        1

        4

        0 1 2

        y 2 1 y y .

        4

        With y0 y2 0 , this gives

      6. Solution of boundary value problem by Galerkin finite element method

      Divide the interval [0, 1] into equal subintervals, each of

      y y0.5 1 0.142857142…

      length x 1 N .

      1 7 For j 1, 2,

      3,………, N 1, we take the piecewise linear

      Comparison with the exact solution given above shows that

      the error in the computed solution is 0.00336 .

      basis function

      j that is zero off the open interval

      On the other hand, if we choose obtain the three equations:

      h 1

      4

      (i.e.

      n 4 ), we

      (( j 1)x, ( j 1)x) but has value 1 at the Fig. 6.

      jx as shown in

      y 31 y y 1

      0 16 1 2

      y 31 y y

      16

      1

      Fig.6. Basis functions with small support.

      1 16 2 3 16

      y 31 y

      2 16 3

      y4

      1 ,

      16

      Fig.6. Basis functions with small support.

      where

      y0 y4 0 . Solving the system we obtain

      y2 y0.5

      63

      449

      0.140311804,

      Let us assume the piecewise linear trial solution

      N 1

      the error in which is 0.00082 . Since the ratio of the two

      y c j j

      j 1

      (14)

      errors is about 4 , it follows that the order of convergence is

      h 2 . The results of our calculation in respective cases are

      This trial solution gives the residual.

      The residual for this trial solution is given by

      tabulated in shown Table 2. N N

      R c j j c j j 1

      (15)

      j 1 j 1

      Imposing Galerkins requirement, we have

      N

      c j j 1

      i , j

      N

      • c j j 1

      i , j

      i 0

      (16)

      and i ,1

      1 .

      N

      (25)

      The piecewise linear interpolation (14) has zero second derivative almost everywhere, therefore, our Eq. (16) will then

      Thus equation (20) becomes the tri-diagonal system

      be reduced to the simple form as

      Gc i ,1 , (17)

      where G is the Gramian and is given by

      4

      1

      1 .

      0 c

      1

      1

      0

      .

      .

      4

      1

      0

      .

      0

      .

      .

      .

      .

      .

      .

      .

      .

      .

      0

      1

      0 c2

      . .

      G i , j

      (18)

      6N

      .

      1 .

      2

      1

      0 . .

      0

      c1

      1

      1

      2

      1 0 .

      0

      c

      1

      Equation (17) finds the best fit to the horizontal line y 1. It 0

      4 c

      is not solving the given boundary value problem prescribed by the Eqs. (11) and (12). This same failure will always occur when using piecewise linear trial functions j to solve second order problems.

      One way to view this failure is that the approach does not take

      N .

      0 . .

      N 1

      . .

      . 1 .

      2

      N

      into account the Dirac delta functions that should arise when

      . .

      . . .

      1 . .

      0

      .

      .

      0

      differentiating these basis functions j twice. Another view is that we must not ask so much of solutions-they need not be so

      1

      2 c

      N 1 1

      (26)

      differentiable. Rather than requiring the solution satisfies the

      classical statement of the problem given by Eq. (11). We only require that the solution holds when projected into finite dimensional subspaces, i.e. satisfies the weak condition

      Implementation of the above system is given by the MATLAB routine.

    2. DISCUSSION OF THE RESULT AND

, y

, y

,1

(19)

CONCLUSION

for any test function with square-integrable derivative and zero boundary values. By integrating by parts, we throw one derivative onto the test function.

Thus the weak restatement of our Galerkin problem is iven by Eqs. (11) and (12) is

Galerkins approximation weighted residual method for the solution of initial value problem is investigated. In each case the result of our calculation is shown graphically. Figs. 1-5 indicate that there is an astonishing accuracy of the Galerkins approximation method with that of exact method. After two terms, Figs. 3-5 show that each of the solution curve obtained

N 1

  • c j

j 1

,

N 1

c j

j 1

i , j

i , (20)

by exact solution overlaps on the curves that are extracted by

our calculation in respective cases of interest. Accuracy is also tested over some standard numerical approximation methods.

i j

where

i 1, 2, 3,………, N 1.

The Eq. (20) can be written as

(G S)c i ) , (21) where S represent Sobolev matrix and is given by

S i,j i ,j . (22)

Because all the basis functions j

are translates of one

another, G and S are easy to compute. A framework so of such finite element problems is given below.

2 3 N

if i j

i , j

1 N

6

0

if mod(i j) 1

otherwise

(23)

Fig.8. Solution curves by Galerkins and finite difference methods for N=3.

2N if

, N if

i j

i j 1

i j

0

otherwise,

(24)

Fig.9. Solution curves by Galerkins and finite difference methods for N=5.

Fig.10. Solution curves by Galerkins and finite difference methods for N=7.

Galerkins finite element solution of boundary value problem is investigated. In each case the result of our calculation is shown graphically. Figs. 7-8 indicate that there is an astonishing accuracy of the Galerkins approximation method with that of exact method. Figures 9-10 show that each of the solution curve obtained by exact solution overlaps on the curves that are extracted by our calculation in respective cases of interest. Accuracy is also tested over some standard numerical approximation methods. Therefore, we may conclude that the basis functions are dense in a space containing the actual solution.

Two point Boundary value problems are solved by Galerkin method. The accuracy of our calculated values is compared with the results obtained by exact solution and finite difference method. The errors are also estimated in the respective cases. They are given in Tables 1 and 2. The results show that the accuracy obtained by the finite-difference method depends upon the width of the subinterval chosen and also on the order of the approximations. As h is reduced, the accuracy increases but the number of equations to be solved also increases. Whereas, in the case of Galerkin method, the accuracy depends upon the number of basis functions chosen. It is shown that even third approximation yields an astonishing accuracy. There is only one problem of this is method that more computations are needed for more choice of basis

functions. The same conclusion can be drawn here in the case of boundary value problem as is drawn in the case of initial value problem.

Finally the conclusion can be drawn that the Galerkin finite element method is so effective that, in this method such an extraordinary accuracy is achieved with modest effort.

REFERENCES

  1. Argyris, J. H., 1963, Recent Advances in Matrix Methods of Structural Analysis, Pergamon Press, Elmsford, New York.

  2. Baker, A. J., 1983, Finite Element Computational Fluid Mechanics, New York: Hemisphere, McGraw-Hill.

  3. Becker, A. A., 2004. An introductory guide to finite element analysis,

    ASME Press, NY.

  4. Chandrupatla, T. R. and Belegundu, A. D., 2002. Introduction to finite elements in engineering, Prentice Hall, Upper Saddle River, NJ.

  5. Chung, T. J., 1978, Finite Element Analysis in Fluid Dynamics, New York: McGraw-Hill.

  6. Clough, R. W., 1960, The Finite Element Method in Plane Stress Analysis, Proceedings of 2nd Conf. on Electronic Computation, American Society of Civil Engineers, Pittsburgh, Penn., pp. 345-378.

  7. Ern, A. and Guermond, J. L., 2004. Theory practice of finite elements, Springer-Verlag, NY.

  8. Hollig, K., 2003. Finite elements with B-splines, Society of Industrial and Applied Mathematics, Philadelphia, PA.

  9. Hutton, D. V., 2004. Fundamentals of Finite Element Analysis, McGraw-Hill, Boston, MA.

  10. Johnson, C., 1987. Numerical Solution of Partial Differential Equations by the Finite Element Method, Cambridge University Press, Cambridge, UK.

  11. Liu, G. R. and Quek, S. S., 2003. The finite element method: A practical course, Butterworth- Heinemann, Boston, MA.

  12. Oden, J. T., and Wellford Jr, L. C., 1972, Analysis of viscous flow by the finite element method, AIAA J., Vol. 10, pp. 1590-1599.

  13. Qiu JX, Khoo BC, Shu CW., 2006, A Numerical Study for the Performance of the Runge-Kutta Discontinuous Galerkin Method Based on Different Numerical Fluxes, Journal of Computational Physics. Vol. 212, No. 2, pp. 540-565.

  14. Rayleigh, J. W. S., 1877. Theory of Sound, 1st Revised edition, Dover Publishers, NY.

  15. Reddy, J. N., 2004. An introduction to nonlinear finite element analysis, Oxford University Press, Oxford, UK.

  16. Ritz, W., 1909. "Uber eine Neue Methode zur Lïsung Gewisses Variations-Problem der Mathematischen Physik," J. Reine Angew. Math., Vol. 135, pp. 1-61.

  17. Roache, P. J., 1972. Computational Fluid Mechanics, Hermosa Publishers, Albuquerque, NM.

  18. Smith, I. M., 1982. Programming the Finite Element Method, John Wiley & Sons, NY.

  19. Solin, P., Segeth, K. and Dolezel, I., 2004. Higher-order finite element methods, Chapman and Hall/CRC, Boca Raton, FL.

  20. Turner, M. J., Clough, R. W., Martin, H. C., and Topp, L. P., 1956, Stiffness and Deflection Analysis of Complex Structures, J. Aeron. Sci., Vol. 23, No. 9, pp. 805-823.

  21. Zienkiewicz, O. C. and Cheung, Y. K., 1965, Finite elements in the solution of field problems. The Engineer, Vol. 10, pp. 507-510.

Leave a Reply