A Computational Study with Finite Element Method and Finite Difference Method for 2 D Elliptic Partial Differential Equations

In this paper, we consider two methods, the Second order Central Difference Method (SCDM) and the Finite Element Method (FEM) with P1 triangular elements, for solving two dimensional general linear Elliptic Partial Differential Equations (PDE) with mixed derivatives along with Dirichlet and Neumann boundary conditions. These two methods have almost the same accuracy from theoretical aspect with regular boundaries, but generally Finite Element Method produces better approximations when the boundaries are irregular. In order to investigate which method produces better results from numerical aspect, we apply these methods into specific examples with regular boundaries with constant step-size for both of them. The results which obtained confirm, in most of the cases, the theoretical results.


Introduction
Finite Difference schemes and Finite Element Methods are widely used for solving partial differential equations [1].Finite Element Methods are time consuming compared to finite difference schemes and are used mostly in problems where the boundaries are irregular.In particularly, it is difficult to approximate derivatives with finite difference methods when the boundaries are irregular.Moreover, Finite Element methods are more complicated than Finite Difference schemes because they use various numerical methods such as interpolation, numerical integration and numerical methods for solving large linear systems (see [2]- [6]).Also the mathematically deriva-tion of Finite Element Methods come from the theory of Hilbert Space, and Sobolev Spaces as well as from variational principles and the weighted residual method (see [5]- [12]).
In this paper, we will describe the Second order Central Difference Scheme and the Finite Element Method for solving general second order elliptic partial differential equations with regular boundary conditions on a rectangular domain.In addition, for both of these methods, we consider the Dirichlet and Neumann Boundary conditions, along the four sides of the rectangular area.Also, we make a brief error analysis for Finite element method.Moreover, for the finite element method, we site two other important numerical methods which are important in order that the algorithm can be performed.
These methods are the bilinear interpolation over a linear Lagrange element, Gauss quadrature and contour Gauss Quadrature on a triangular area.Furthermore, these two schemes lead to a linear system which we have to solve.For the purpose of this paper, we solve the outcome systems with Gauss-Seidel method which is briefly discussed.In the last section, we contacted a numerical study with Matlab R2015a.We apply these methods into specific elliptical problems, in order to test which of these methods produce better approximations when the Dirichlet and Neumann boundary conditions are imposed.Our results show us that the accuracy of these two methods depends on the kind of the elliptical problem and the type of boundary conditions.In Section 2, we study the Second order Central Difference Scheme.In Section 3, we give the Finite Element Method, bilinear interpolation in P 1 , Gauss Quadrature, Finite Element algorithm and error analysis.In Section 4, we give some numerical results, in Section 5, we give the conclusions and finally in Section 6 we give the relevant references.

Second Order Central Difference Scheme
The second order general linear elliptic PDE of two variables x and y given as follow: with u defined on a rectangular domain ( ) The boundary and n is the normal vector along the boundaries.We divide the rectangular domain Ω in a uniform Cartesian grid , where N, M are the numbers of grid points in x and y directions and and 1 1 1 are the corresponding step sizes along the axes x and y.The discretize domain are shown in Figure 1.
Using now the central difference approximation we can approximate the partial derivatives of the relation (1) as follows: ( ) ( ) where

, and O h O k
O k h + are the truncation errors.We now approximate the PDE (1) using the relations (2), (3), ( 4), ( 5), (6) and we obtain the second order central difference scheme: ( ) With truncation error ( ) O k h + .The relation (7) can be written as a linear system:

Dirichlet Boundary Conditions
The dimensions of the above linear system depends on the boundary conditions.More specific, if we have the Dirichlet Boundary Conditions: , , for each 0,1, , , , for each 0,1, , then the dimensions of the matrix A, u and b are: ( )( ) for the matrix A. Moreover, the form of matrix A and the vector u are given by: As we can see the matrix A is tri-diagonal block Matrix.These block matrices 1, 2, , are tri-diagonal as well of order ( )( ) , , , , We approximate the Neumann boundary conditions in every side of the rectangular domain as follows 1 st side (North side of the rectangular area) 2 nd side (East side of the rectangular area) 3 rd side (South side of the rectangular area) , 2 for 0, 1, 2, , 1 2 4 th side (West side of the rectangular area) Using the relations (9), (10), (11), (12) the values , 1 , , and which lies outside the rectangular domain can be eliminated when appeared in the linear system.
Thus the block tri-diagonal matrix A has dimensions ( )( ) ( )( ) + and the vectors u, b are of ( )( ) + × order.The matrix A and the vector u are given below: , 0, and , , , In order to solve the linear system (8), we use the Gauss-Seidel method (GSM) (see [2] [3]).An important property that the matrix A must have is to be strictly diagonally dominant in order the GCM to converge.
Theorem 1 If A is strictly diagonally dominant, then for any choice of ( ) 0 u , Gauss-Seidel method give sequence

Finite Element Method
In this section we consider an alternative form of the general linear PDE (1) where With boundary conditions ( ) And the boundary 1 2 ∂Ω = Γ Γ  In order to approximate the solution of ( 13) with FEM algorithm we must transform the PDE into its weak form and solve the following problem.Find ( ) where ( ) are bilinear and linear functionals as well.
It is sufficient now to consider that ( ) when the Neumann boundary Conditions are applied , else if we have only Dirichlet Boundary conditions then the line integral is equal to zero.
The finite element method approximates the solution of the partial differential Equation ( 13) by minimizing the functional: where Also with D we denote the weak derivatives of u.The spaces ( ) H Γ are Sobolev function spaces which also considered to be Hilbert spaces(see [7]- [9]).
The uniqueness of the solution of weak form ( 14) depends on Lax-Milgram theorem along with trace theorem (see [7]).In addition according to Rayleigh-Ritz theorem the solution of the problem ( 14) are reduced to minimization of the linear functional ( ) [7]).The first step in order the FEM algorithm to be performed is the discretization of the rectangular domain by using Lagrange linear triangular elements.We denote with P k the set of all polynomials of degree k ≤ in two variables [7].For k = 1 we have the linear Lagrange triangle and x y a bx cy Also the triangulation of the rectangular area should have the below properties:  We assume that the triangular elements ( ) , are open and disjoint, where h is the maximum diameter of the triangle element. The vertices of the triangles all call nodes, we use the letter V for vertices and E for nodes. We also assume that there are no nodes in the interior sides of triangles.

Bilinear Interpolation in P1
Let as consider now the triangulation of the rectangular domain as we describe to a previous section.In every triangle T i of the domain we interpolate the function u with the below linear polynomial: x y a bx cy ϕ = + + with interpolation conditions: of a triangular element.Thus it creates the below linear system with unknown coefficients a, b, c.
Solving the system we find the approximate polynomial of u , is the interpolation function or shape function and it has the following property:

Gauss Quadrature
An important step in order to implement the Finite Element algorithm is to compute numerically the double and line integrals which occurs in every triangular element (see [5] [12]).

Gauss Quadrature in Canonical Triangle
As a canonical triangle we consider the triangle with vertices (0, 0), (0, 1) and (1, 0) and we denote Where n g is the number of Gauss integration points, w i are the weights and ( ) x y are the Gauss integration points.
The linear space P κ is the space of all linear polynomial of two variables of order k The following Table 1 gives the number of quadrature points for degrees 1 to 4 as given in Ref. [10].It should be mentioned that for some N, the corresponding ng is not necessarily unique.(see [10] and references therein).
Gauss quadrature in general triangular element Initially we transform the general triangle Τ into a canonical triangle using the linear basis functions: , The variables x, y for the random triangle can be written as affine map of basis functions: Also we have the Jacobian determinant of the transformation Using the above relations we obtain the Gauss quadrature rule for the general triangular element:  , and then the Gaussian quadrature for single variable function.
Using the basis functions we have the following relations in every side of the triangle Along side 1 (P 1 P 2 ):

y s x x y y g x x x y y y x x y y x x y y g x y x x y y x x y y c g x y
Along side 3: (P 3 P 1 ): The error of the bilinear interpolation Gauss quadrature depend on the dimension of the polynomial subspace (see [11]).

Finite Element Algorithm
The Finite element algorithm has the purpose to find the approximate solution of the problem (15) in a subspace of 1 1 H Γ .We consider as subspace the 1  of all piecewise linear polynomials with two variables polynomials of degree one.i.e.: The index i represents the number of triangular elements which exist in the rectangular domain.The polynomials must be piecewise because the linear combination of them must form a continuous and integrable function with continuous first and second derivatives.
Firstly as we describe in a previous section, we have to triangulate the domain before the algorithm evaluated.
After that the algorithm seeks approximation of the solution of the form: where , 1, 2, , i i m ϕ =  is the linear combination of independent piecewise linear polynomials and , 1, 2, , i i m γ =  are constants with m is the number of nodes.Actually, the polynomials i ϕ corresponds to shape functions , 1, 2, 3 j j Ν = in every vertex of the triangles.Thus the approximate solution is the linear combination of all the independent interpolation functions multiplied with some constant i γ .Some of these constants for example, for v into the functional ( ) J v and we have: Consider J as a function of 1 2 , , , n γ γ γ  .For minimum to occur we must have 0, 1, 2, , .This set of equations can be written as a linear system: where , , , , , , The choice of subspace 1  for our approximation is important because can ensure us that the matrix A will be positive definite and band( [2]- [4]).According to the previous analysis leads again to a linear system, which can be solved as we described in a previous section with Gauss-Seidel Method (see [2]- [4]).

Error Analysis
Let us consider again the problem ( 14) Find ( ) The approximation of finite element of the problem (18) is given below: Find ,

Cea's lemma
The finite element approximation 1 h u ∈  of the weak solution ( ) Ω is the best fit to  in the norm ( ) The error analysis of finite element method depend on the Cea's lemma for elliptic boundary value problems.The proof can be found in [1] [7].Now we will present without proof the following statement [7].
where ( ) C u is positive constant dependent on the smoothness of the function u, h is the mesh size parameter and s is a positive real number, dependent on the smoothness of u and the degree of the piecewise polynomials comprising in 1  .In our case we have the Lagrange linear elements so the degree of the piecewise polynomials is one.Combining, relations Cea's lemma we shall be able to deduce that: The relation ( 21) gives a bound of the global error h e u u = − in terms of the size mesh parameter h.Such a bound on the global error is called priori error bound.
L 2 -norm For proving an error estimate in L 2 -norm the regularity of the solution of ( 13) plays an essential role.By the Aubin-Nitsche duality argument the error estimate in L 2 norm between u and its finite element approximation h u is ( ) O h .However this bound can be improved to ( )

Numerical Study
In this section we contact a numerical study using Matlab R2015a.For the purpose of this paper we cite representative examples of second order general elliptic partial differential equations in order to make comparisons between these two methods with various step-sizes and the mesh size parameters of finite element method.Thus in each example we present results for the absolute and relevant absolute errors in L 2 norm along with their graphs.Also we make graphical representations of the exact and approximate solution of the specific problem as well.
The problems of the examples can be found in [13] [14].

Example 1
Find the approximate solution of the partial differential equation  2 and Table 3) In Figure 2 and Figure 3 we have the graphs for SCDM and in Figure 4 and

Results (Table 4 and Table 5)
In Figure 6 and Figure 7 we have the graphs for SCDM and in Figure 8 and Figure 9 for FEM.

Example 3
Find the approximate solution of the partial differential equation with Dirichlet boundary conditions along the rectangular domain

Results (Table 6 and Table 7)
In Figure 10 and Figure 11 we have the graphs for SCDM and in Figure 12 and Figure 13 for FEM.
Overall, what stands out from these examples is that the finite element method has better approximations for the first problem compared to finite difference method for all the step-sizes that we have.But in the second problem we have a small difference in the results with better accuracy for the finite difference method and in the third problem the finite element method has bigger relevant errors than the difference method.More specifically, in example 1 according to the tables we have better approximations for the finite element method in both of step sizes and the mesh size parameters to specific points but the graphs of the percentage of relevant errors suggest that the second order central finite difference scheme produce better approximations generally.On the other hand, in the other two examples according to the tables and the graphs of errors in the second problem we have a small difference between these methods and in the third problem we have better approximations of the second order central difference scheme almost in all points of the domain.Conclusively, we can notice that in the third example for both of these methods the results which we obtained are almost identical when different step sizes are applied in CFDM and mesh size parameters in FEM.

Conclusion
Finally, we can say that the data which we obtained from these examples show that both of these methods produce quite sufficient approximations for our problems.Also the results prove that the accuracy of them depends on the kind of the elliptical problem and the type of boundary conditions.For further research, the approximations of these methods can be improved.This improvement can be made if in the second order difference scheme we keep more taylor series terms in order to approximate the derivatives and in finite element method if we use higher order elements such as quadratic Lagrange triangular elements or cubic Hermite triangular elements.
Moreover in this paper two types of boundary conditions are considered:
The approximation rule of the double integral in canonical triangle is given below: of the triangle.Contour quadrature ruleIn the Finite Element Method when the Neumann boundary conditions are imposed it is essential to compute numerically the below Contour integral in general triangular area.
The basic idea is to transform the straight contour P i P j to an interval

Figure 5 for FEM. Example 2 with
Find the approximate solution of the partial differential equation Dirichlet boundary conditions along the rectangular domain 0 u = on three lower side of ∂Ω and Neumann boundary condition