The Numerical Solution of Poisson Equation with Dirichlet Boundary Conditions

This work mainly focuses on the numerical solution of the Poisson equation with the Dirichlet boundary conditions. Compared to the traditional 5-point finite difference method, the Chebyshev spectral method is applied. The numerical results show the Chebyshev spectral method has high accuracy and fast convergence; the more Chebyshev points are selected, the better the accuracy is. Finally, the error of two numerical results also verifies that the algorithm has high precision.


Introduction
The Laplace equation 0 u ∇ = can be dated back to 1782 when the French mathematician P.S. Laplace discussed the problem of the gravitational field [1] [2]. About thirty years later, S.D. Poisson pointed out that if the density of gravitational field is considered, the Laplace equation should have a new form i.e. u f ∇ = , which we called Poisson equation. Now Poisson equation has been applied to modelling the temperature distribution of stable temperature field with a stable heat source or without internal heat source, the stable non-rotating flow of incompressible fluid in hydrodynamics, etc. In recent several years, some researchers find that the 2-dimensional Poisson equation with Dirichlet boundary condition is a good tool to cope with seamless image composite problems [3] [4] [5] [6] [7].
In the following part, we will focus on Poisson equation with the Dirichlet boundary condition [8].
, , u f x y x y u x y g x y x y , g x y is the boundary condition.
In general, the Poisson equation is hard to get the analytical solution, only a few can find the exact solution. Therefore, the numerical algorithm is a good way to deal with this problem. For the second-order parabolic type differential equation, the finite difference method is a popular discretization method. The precision of the traditional 5-point difference method is not good enough. In order to improve the accuracy, some scholars proposed a new method based on 5-point difference scheme, such as 9-point difference scheme. The error of the 9-point difference scheme is fourth-order. But if we want to continue to improve the accuracy of the algorithm based on the 9-point difference method, it will be very difficult. Compared to the finite difference method the spectral method has high accuracy and less computation. Especially for multidimensional problems, such as 2-dimensional or 3-dimensional Poisson equation if we use the finite difference method, we need to calculate so many nodes the amount of calculation is very large. In addition to the finite difference method and spectral method, the finite element method is also an effective method to deal with differential equations. For the in-depth discussion of these methods, we can refer to [8]- [23].
The spectral method is a well-developed algorithm, which has infinite order accuracy and exponential order convergence speed in theory [17] [18] [19]. In this work, we will use Chebyshev spectral method to find the numerical solution of 2-dimensional Poisson equation.

Preliminaries
Some basic contents including Chebyshev polynomials and Chebyshev points will be introduced in this part. The Chebyshev points will be used to construct the differentiation matrices, which is the key point to obtain high-precision solutions.
There are some other polynomials such as Legendre polynomials, Jacobi polynomials, etc. For a more detailed discussion about the properties of Chebyshev and other polynomials, one can refer to [17] [19].

Numerical Algorithms for 2-Dimensional Poisson Equation
In this part, we will show two different schemes to solve the 2-dimensional Poisson equation. The finite difference method with five points will be applied first, then the Chebyshev spectral method will be considered. The 2-dimensional Poisson equation we will discuss is as follows, .
First, we will give a discretization in x and y directions. In x direction we choose 1 1 N + points and give an equidistant discretization, that is 1 Then the points in the interval [ ] Both in x and y directions we use the central difference method respectively, as shown in Figure 1, we have Journal of Applied Mathematics and Physics If we choose the same step size, i.e. 1 2 h h h = = , then for the problem we have the following algorithm, , where the corresponding truncation error is ( )  1 .
. For more detailed proofs or properties, one can refer to [17].

Numerical Examples
In this part, the proposed algorithm will be employed to solve 2-dimensional Journal of Applied Mathematics and Physics  (16) where the exact solution is ( )   Table 1 is the detailed error when x and y take different values. Table 2 shows the absolute error when x and y take different values. The biggest absolute error is 3.7 × 10 −8 . From the absolute error tables obtained by the two methods, we find that the accuracy of the spectral method is better than that of the finite difference method. The more the Chebyshev points we use, the higher accuracy of the numerical results we get. Theoretically, if we use enough Chebyshev points, we can obtain the numerical solutions with arbitrary accuracy. Figure 4 is the numerical solution that we get with the Chebyshev spectral method. Figure 4 is very similar to Figure 2, but from the above two error tables, we find that the solution obtained by the spectral method is more consistent with the exact solution.      ,1 e sin , 0 1 where the exact solution is ( ) , e sin y u x y x π − π = . Figure 6 and Figure 7 show the absolute error of example 2 with finite difference method and Chebyshev spectral method respectively. When we choose the nodes 51  Figure 7. From the absolute error of example 2, we find that the accuracy of spectral method is much higher than that of finite difference method.   Table 3 shows the absolute error of example with finite difference method and Chebyshev spectral method.    Table 3, we can clearly find that the accuracy of spectral method is better than that of finite difference method.

Conclusion
In this work, we study the 2-dimensional Poisson equation with Dirichlet boundary conditions. We use the five-point difference method and Chebyshev spectral method to solve the corresponding two-dimensional Poisson equation. For each method, we give the corresponding numerical algorithm. Finally, we give the numerical solution of the corresponding algorithm through a numerical case.
We also obtain the absolute error respectively. The absolute error of two methods reveals that the accuracy of the spectral method is better than that of the difference method.