<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JAMP</journal-id><journal-title-group><journal-title>Journal of Applied Mathematics and Physics</journal-title></journal-title-group><issn pub-type="epub">2327-4352</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jamp.2021.912194</article-id><article-id pub-id-type="publisher-id">JAMP-113731</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  The Numerical Solution of Poisson Equation with Dirichlet Boundary Conditions
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Peng</surname><given-names>Guo</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>The Business School, Shanghai Dianji University, Shanghai, China</addr-line></aff><pub-date pub-type="epub"><day>08</day><month>12</month><year>2021</year></pub-date><volume>09</volume><issue>12</issue><fpage>3007</fpage><lpage>3018</lpage><history><date date-type="received"><day>1,</day>	<month>November</month>	<year>2021</year></date><date date-type="rev-recd"><day>6,</day>	<month>December</month>	<year>2021</year>	</date><date date-type="accepted"><day>9,</day>	<month>December</month>	<year>2021</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  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.
 
</p></abstract><kwd-group><kwd>Poisson Equation</kwd><kwd> Finite Difference Method</kwd><kwd> Chebyshev</kwd><kwd> Spectral Method</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The Laplace equation ∇ u = 0 can be dated back to 1782 when the French mathematician P.S. Laplace discussed the problem of the gravitational field [<xref ref-type="bibr" rid="scirp.113731-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref2">2</xref>]. 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 [<xref ref-type="bibr" rid="scirp.113731-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref7">7</xref>].</p><p>In the following part, we will focus on Poisson equation with the Dirichlet boundary condition [<xref ref-type="bibr" rid="scirp.113731-ref8">8</xref>].</p><p>{ − ∇ u = f ( x , y ) ( x , y ) ∈ Ω u ( x , y ) = g ( x , y ) ( x , y ) ∈ ∂ Ω (1)</p><p>The above Equation (1) is the 2-dimensional Poisson equation, where ∇ u = ∂ 2 u ∂ x 2 + ∂ 2 u ∂ y 2 , g ( x , y ) is the boundary condition.</p><p>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 [<xref ref-type="bibr" rid="scirp.113731-ref8">8</xref>] - [<xref ref-type="bibr" rid="scirp.113731-ref23">23</xref>].</p><p>The spectral method is a well-developed algorithm, which has infinite order accuracy and exponential order convergence speed in theory [<xref ref-type="bibr" rid="scirp.113731-ref17">17</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref18">18</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref19">19</xref>]. In this work, we will use Chebyshev spectral method to find the numerical solution of 2-dimensional Poisson equation.</p></sec><sec id="s2"><title>2. Preliminaries</title><p>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.</p><p>Definition 1. In the interval [ − 1,1 ] , with the weight ω ( x ) = 1 1 − x 2 , the polynomials with the following relations are called Chebyshev polynomials [<xref ref-type="bibr" rid="scirp.113731-ref20">20</xref>].</p><p>{ T 0 ( x ) = 1 , T 1 ( x ) = x , T n + 1 ( x ) = 2 x T n ( x ) − T n − 1 ( x ) , n ≥ 1. (2)</p><p>where T n ( x ) , n ≥ 0 are the Chebyshev polynomials.</p><p>A big difference between Chebyshev polynomials and other polynomials is that Chebyshev polynomials have an explicit relation, i.e. T n ( x ) = cos ( n ⋅ arccos ( x ) ) . The zeros of Chebyshev polynomials x k = cos k π n , n = 0 , 1 , ⋯ , n are called Chebyshev points. These Chebyshev points are highly clustered on both sides of the interval. This feature of the Chebyshev points can help one overcome Runge phenomenon in interpolation. The Chebyshev polynomials satisfy the following orthogonal properties with weight 1 1 − x 2</p><p>Property 1</p><p>∫ − 1 1 1 1 − x 2 T m ( x ) T n ( x ) d x = { 0 , m ≠ n , π 2 , m = n = 0 , π , m = n ≠ 0. (3)</p><p>First-order derivative of Chebyshev polynomials T ′ n ( x ) and the original Chebyshev polynomials T n ( x ) satisfy the following relations.</p><p>Property 2</p><p>{ T 0 ( x ) = T ′ 1 ( x ) , T 1 ( x ) = 1 4 T ′ 2 ( x ) , T n ( x ) = 1 2 ( n + 1 ) T ′ n + 1 ( x ) − 1 2 ( n − 1 ) T ′ n − 1 ( x ) , n ≥ 2. (4)</p><p>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 [<xref ref-type="bibr" rid="scirp.113731-ref17">17</xref>] [<xref ref-type="bibr" rid="scirp.113731-ref19">19</xref>].</p></sec><sec id="s3"><title>3. Numerical Algorithms for 2-Dimensional Poisson Equation</title><p>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,</p><p>{ − ( ∂ 2 u ∂ x 2 + ∂ 2 u ∂ y 2 ) = f ( x , y ) ,       ( x , y ) ∈ [ a , b ] &#215; [ c , d ] u ( a , y ) = g 1 ( y ) , u ( b , y ) = g 2 ( y ) , u ( x , c ) = g 3 ( x ) , u ( x , d ) = g 4 ( x ) . (5)</p><p>1) 5-point finite difference method</p><p>First, we will give a discretization in x and y directions. In x direction we choose N 1 + 1 points and give an equidistant discretization, that is h 1 = b − a N 1 . Then the points in the interval [ a , b ] can be expressed as x i = a + i h 1 , where i = 0 , 1 , 2 , ⋯ , N 1 . Similarly, in y direction, the points in [ c , d ] can be expressed as y j = a + j h 2 , j = 0 , 1 , 2 , ⋯ , N 2 , where h 2 = d − c N 2 .</p><p>Both in x and y directions we use the central difference method respectively, as shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>, we have</p><p>( ∂ 2 u ∂ x 2 ) ( x i , y j ) = u i + 1 , j + u i − 1 , j − 2 u i , j h 1 2 + O ( h 1 2 ) , (6)</p><p>( ∂ 2 u ∂ y 2 ) ( x i , y j ) = u i , j + 1 + u i , j − 1 − 2 u i , j h 2 2 + O ( h 2 2 ) . (7)</p><p>If we choose the same step size, i.e. h 1 = h 2 = h , then for the problem we have the following algorithm,</p><p>− u i + 1 , j + u i − 1 , j + u i , j + 1 + u i , j − 1 − 4 u i , j h 2 = f i , j , (8)</p><p>where the corresponding truncation error is O ( h 1 2 + h 2 2 ) , if h 1 = h 2 = h , the truncation error can be written as O ( h 2 ) .</p><p>The size of the nodes on grids is ( N 1 + 1 ) &#215; ( N 2 + 1 ) . Considering that the boundary values are known, we arrange the remaining nodes in columns to form a new column vector. Let’s U = ( u 1 , 1 , u 2 , 1 , ⋯ , u N 1 − 1 , 1 , ⋯ , u N 1 − 1 , N 2 − 1 ) T , the 2-dimensional Poisson equation can be written in a matrix form A U = F , where A N 1 − 1, N 2 − 1 is the coefficient matrix, F is a matrix on the right-hand side of the relation (8). The detailed expression of the coefficient matrix A is as follows,</p><p>A = h − 2 ( B − I − I B − I ⋱ ⋱ ⋱ − I B − I − I B ) , (9)</p><p>where B N 1 − 1, N 1 − 1 has the following expression,</p><p>B = ( 4 − 1 − 1 4 − 1 ⋱ ⋱ ⋱ − 1 4 − 1 − 1 4 ) . (10)</p><p>2) Chebyshev spectral method</p><p>The Chebyshev points are x k = − cos k π n , n = 0 , 1 , ⋯ , n . Obviously, all the Chebyshev points are in the interval [ − 1,1 ] . Before we use the Chebyshev spectral method, we should map the interval [ − 1,1 ] into the interval [ a , b ] with the following transformation,</p><p>x = b + a 2 + b − a 2 x k . (11)</p><p>Similarly, for y ∈ [ c , d ] , if we use the transformation</p><p>y = d + c 2 + d − c 2 x k , (12)</p><p>the interval [ − 1,1 ] can also be mapped into [ c , d ] . The differentiation matrices D 1 for the interval [ − 1,1 ] can be derived directly from the explicit expression of Chebyshev polynomials. But the expression of the first-order differentiation matrices is slightly different, i.e. D [ a , b ] 1 = b − a 2 D 1 , D [ c , d ] 1 = d − c 2 D 1 . For more detailed proofs or properties, one can refer to [<xref ref-type="bibr" rid="scirp.113731-ref17">17</xref>].</p><p>{ D 0 , 0 1 = − D N , N 1 = 2 N 2 + 1 6 , D i , i 1 = − x i 2 ( 1 − x i 2 ) , i = 1 , 2 , ⋯ , N − 1 , D i , j 1 = c i ( − 1 ) i + j c j ( x i − x j ) , i ≠ j , i , j = 0 , 1 , ⋯ , N , (13)</p><p>where</p><p>c i = { 2 , i = 0 , i = N 1 , otherwise . (14)</p><p>The second-order derivative can be computed easily by D 2 = ( D 1 ) 2 . If we arrange the matrixu in a column vector, ∂ 2 u ∂ x 2 can be writen in the matrix form ( D 2 ⊗ I ) u , and ∂ 2 u ∂ y 2 can be written in the matrix form ( I ⊗ D 2 ) u . Let’s L denote ( D 2 ⊗ I + I ⊗ D 2 ) , where ⊗ is the Kronecker product. Then for the 2-dimensional Poisson equation, the Chebyshev spectral algorithm can be given as follows,</p><p>− L U = F . (15)</p><p>where U and F are similar as given in 5-point difference method. The numerical results can be computed directly. Jie et al. have proved the error estimate for the Chebyshev spectral method with Dirichlet boundary conditions [<xref ref-type="bibr" rid="scirp.113731-ref17">17</xref>].</p></sec><sec id="s4"><title>4. Numerical Examples</title><p>In this part, the proposed algorithm will be employed to solve 2-dimensional Poisson equation with Dirichlet boundary conditions.</p><p>Example 1. Consider the following 2-dimensional Poisson equation</p><p>{ − ( ∂ 2 u ∂ x 2 + ∂ 2 u ∂ y 2 ) = − e x y ( x 2 + y 2 ) , ( x , y ) ∈ [ 0 , 1 ] &#215; [ 0 , 1 ] , u ( x , 0 ) = 1 ,               0 ≤ x ≤ 1 u ( x , 1 ) = e − x ,               0 ≤ x ≤ 1 u ( 0 , y ) = 1 ,               0 ≤ y ≤ 1 u ( 1 , y ) = e − y ,               0 ≤ y ≤ 1 (16)</p><p>where the exact solution is u ( x , y ) = e − x y .</p><p><xref ref-type="fig" rid="fig2">Figure 2</xref> shows the numerical solution of Example 1 with five points finite difference method. <xref ref-type="fig" rid="fig3">Figure 3</xref> shows the absolute error at different points in the interval [ 0,1 ] &#215; [ 0,1 ] . The biggest error is about 8.5 &#215; 10<sup>−6</sup>. <xref ref-type="table" rid="table1">Table 1</xref> is the detailed error when x and y take different values.</p><p><xref ref-type="table" rid="table2">Table 2</xref> shows the absolute error when x and y take different values. The biggest absolute error is 3.7 &#215; 10<sup>−8</sup>. 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.</p><p><xref ref-type="fig" rid="fig4">Figure 4</xref> is the numerical solution that we get with the Chebyshev spectral method. <xref ref-type="fig" rid="fig4">Figure 4</xref> is very similar to <xref ref-type="fig" rid="fig2">Figure 2</xref>, but from the above two error tables, we find that the solution obtained by the spectral method is more consistent with the exact solution.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> The errors of Example 1 with finite difference method</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle" >x = 0.1</th><th align="center" valign="middle" >x = 0.3</th><th align="center" valign="middle" >x = 0.5</th><th align="center" valign="middle" >x = 0.7</th><th align="center" valign="middle" >x = 0.9</th></tr></thead><tr><td align="center" valign="middle" >y = 0.05</td><td align="center" valign="middle" >1.73E−07</td><td align="center" valign="middle" >4.73E−07</td><td align="center" valign="middle" >6.99E−07</td><td align="center" valign="middle" >8.53E−07</td><td align="center" valign="middle" >6.77E−07</td></tr><tr><td align="center" valign="middle" >y = 0.10</td><td align="center" valign="middle" >3.50E−07</td><td align="center" valign="middle" >9.46E−07</td><td align="center" valign="middle" >1.37E−06</td><td align="center" valign="middle" >1.60E−06</td><td align="center" valign="middle" >1.15E−06</td></tr><tr><td align="center" valign="middle" >y = 0.15</td><td align="center" valign="middle" >5.34E−07</td><td align="center" valign="middle" >1.43E−06</td><td align="center" valign="middle" >2.02E−06</td><td align="center" valign="middle" >2.27E−06</td><td align="center" valign="middle" >1.51E−06</td></tr><tr><td align="center" valign="middle" >y = 0.20</td><td align="center" valign="middle" >7.30E−07</td><td align="center" valign="middle" >1.92E−06</td><td align="center" valign="middle" >2.66E−06</td><td align="center" valign="middle" >2.88E−06</td><td align="center" valign="middle" >1.80E−06</td></tr><tr><td align="center" valign="middle" >y = 0.25</td><td align="center" valign="middle" >9.43E−07</td><td align="center" valign="middle" >2.43E−06</td><td align="center" valign="middle" >3.30E−06</td><td align="center" valign="middle" >3.45E−06</td><td align="center" valign="middle" >2.04E−06</td></tr><tr><td align="center" valign="middle" >y = 0.30</td><td align="center" valign="middle" >1.18E−06</td><td align="center" valign="middle" >2.98E−06</td><td align="center" valign="middle" >3.94E−06</td><td align="center" valign="middle" >3.99E−06</td><td align="center" valign="middle" >2.26E−06</td></tr><tr><td align="center" valign="middle" >y = 0.35</td><td align="center" valign="middle" >1.44E−06</td><td align="center" valign="middle" >3.55E−06</td><td align="center" valign="middle" >4.60E−06</td><td align="center" valign="middle" >4.53E−06</td><td align="center" valign="middle" >2.47E−06</td></tr><tr><td align="center" valign="middle" >y = 0.40</td><td align="center" valign="middle" >1.73E−06</td><td align="center" valign="middle" >4.16E−06</td><td align="center" valign="middle" >5.27E−06</td><td align="center" valign="middle" >5.06E−06</td><td align="center" valign="middle" >2.68E−06</td></tr><tr><td align="center" valign="middle" >y = 0.45</td><td align="center" valign="middle" >2.06E−06</td><td align="center" valign="middle" >4.81E−06</td><td align="center" valign="middle" >5.94E−06</td><td align="center" valign="middle" >5.59E−06</td><td align="center" valign="middle" >2.90E−06</td></tr><tr><td align="center" valign="middle" >y = 0.50</td><td align="center" valign="middle" >2.42E−06</td><td align="center" valign="middle" >5.47E−06</td><td align="center" valign="middle" >6.61E−06</td><td align="center" valign="middle" >6.11E−06</td><td align="center" valign="middle" >3.11E−06</td></tr></tbody></table></table-wrap><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> The errors of Example 1 with spectral method</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle" >x = 0.1</th><th align="center" valign="middle" >x = 0.3</th><th align="center" valign="middle" >x = 0.5</th><th align="center" valign="middle" >x = 0.7</th><th align="center" valign="middle" >x = 0.9</th></tr></thead><tr><td align="center" valign="middle" >y = 0.05</td><td align="center" valign="middle" >1.44E−12</td><td align="center" valign="middle" >6.49E−12</td><td align="center" valign="middle" >1.13E−12</td><td align="center" valign="middle" >1.6E−12</td><td align="center" valign="middle" >1.28E−11</td></tr><tr><td align="center" valign="middle" >y = 0.10</td><td align="center" valign="middle" >3.61E−12</td><td align="center" valign="middle" >9.50E−11</td><td align="center" valign="middle" >1.64E−10</td><td align="center" valign="middle" >6.79E−10</td><td align="center" valign="middle" >1.63E−09</td></tr><tr><td align="center" valign="middle" >y = 0.15</td><td align="center" valign="middle" >1.32E−11</td><td align="center" valign="middle" >3.81E−10</td><td align="center" valign="middle" >1.56E−10</td><td align="center" valign="middle" >8.99E−10</td><td align="center" valign="middle" >1.51E−09</td></tr><tr><td align="center" valign="middle" >y = 0.20</td><td align="center" valign="middle" >3.85E−11</td><td align="center" valign="middle" >1.14E−09</td><td align="center" valign="middle" >1.65E−10</td><td align="center" valign="middle" >1.62E−09</td><td align="center" valign="middle" >1.74E−09</td></tr><tr><td align="center" valign="middle" >y = 0.25</td><td align="center" valign="middle" >9.51E−11</td><td align="center" valign="middle" >3.02E−09</td><td align="center" valign="middle" >2.29E−09</td><td align="center" valign="middle" >1.07E−08</td><td align="center" valign="middle" >2.21E−08</td></tr><tr><td align="center" valign="middle" >y = 0.30</td><td align="center" valign="middle" >1.93E−10</td><td align="center" valign="middle" >6.04E−09</td><td align="center" valign="middle" >3.48E−09</td><td align="center" valign="middle" >1.72E−08</td><td align="center" valign="middle" >3.24E−08</td></tr><tr><td align="center" valign="middle" >y = 0.35</td><td align="center" valign="middle" >3.44E−10</td><td align="center" valign="middle" >1.02E−08</td><td align="center" valign="middle" >2.70E−10</td><td align="center" valign="middle" >9.20E−09</td><td align="center" valign="middle" >2.58E−09</td></tr><tr><td align="center" valign="middle" >y = 0.40</td><td align="center" valign="middle" >5.87E−10</td><td align="center" valign="middle" >1.76E−08</td><td align="center" valign="middle" >3.04E−09</td><td align="center" valign="middle" >2.44E−08</td><td align="center" valign="middle" >2.81E−08</td></tr><tr><td align="center" valign="middle" >y = 0.45</td><td align="center" valign="middle" >9.33E−10</td><td align="center" valign="middle" >2.79E−08</td><td align="center" valign="middle" >4.19E−09</td><td align="center" valign="middle" >3.55E−08</td><td align="center" valign="middle" >3.71E−08</td></tr><tr><td align="center" valign="middle" >y = 0.50</td><td align="center" valign="middle" >1.40E−09</td><td align="center" valign="middle" >4.12E−08</td><td align="center" valign="middle" >1.72E−13</td><td align="center" valign="middle" >3.05E−08</td><td align="center" valign="middle" >9.86E−10</td></tr></tbody></table></table-wrap><p><xref ref-type="fig" rid="fig5">Figure 5</xref> is the error of the solution obtained by the Chebyshev spectral method. From this figure, we can see that the overall error of the solution obtained by the Chebyshev spectrum method is relatively small compared with the difference method.</p><p>Example 2. Consider the following 2-dimensional Laplace equation,</p><p>{ ∂ 2 u ∂ x 2 + ∂ 2 u ∂ y 2 = 0 , ( x , y ) ∈ [ 0 , 1 ] &#215; [ 0 , 1 ] , u ( x , 0 ) = sin π x ,               0 ≤ x ≤ 1 u ( x , 1 ) = e − x sin π x ,               0 ≤ x ≤ 1 u ( 0 , y ) = 0 ,               0 ≤ y ≤ 1 u ( 1 , y ) = 0 ,               0 ≤ y ≤ 1 (17)</p><p>where the exact solution is u ( x , y ) = e − π y sin π x .</p><p><xref ref-type="fig" rid="fig6">Figure 6</xref> and <xref ref-type="fig" rid="fig7">Figure 7</xref> show the absolute error of example 2 with finite difference method and Chebyshev spectral method respectively. When we choose the nodes n x = n y = 51 in x and y directions, for the finite difference method the maximum error is 1.16 &#215; 10<sup>−4</sup> as shown in <xref ref-type="fig" rid="fig6">Figure 6</xref>. For the same example, if we use spectral method with 51 &#215; 51 Chebyshev points in the interval [ 0,1 ] &#215; [ 0,1 ] , the maximum error is 2.33 &#215; 10<sup>−7</sup> as shown in <xref ref-type="fig" rid="fig7">Figure 7</xref>. From the absolute error of example 2, we find that the accuracy of spectral method is much higher than that of finite difference method.</p><p>The second example is the Laplace equation which is a special case of Poisson equation. <xref ref-type="table" rid="table3">Table 3</xref> shows the absolute error of example with finite difference method and Chebyshev spectral method. E r r o r f represents the maximum absolute error with finite difference method and E r r o r s represents the maximum absolute error with Chebyshev spectral method. We select the same number of nodes, i.e. n x = n y = 10 , 30 , 50 , 70 , 90 , and then compare the absolute errors</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> The errors of Example 2</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >n x = n y</th><th align="center" valign="middle" >10</th><th align="center" valign="middle" >30</th><th align="center" valign="middle" >50</th><th align="center" valign="middle" >70</th><th align="center" valign="middle" >90</th></tr></thead><tr><td align="center" valign="middle" >E r r o r f</td><td align="center" valign="middle" >2.88E−3</td><td align="center" valign="middle" >3.24E−4</td><td align="center" valign="middle" >1.16E−4</td><td align="center" valign="middle" >5.95E−5</td><td align="center" valign="middle" >3.59E−5</td></tr><tr><td align="center" valign="middle" >E r r o r s</td><td align="center" valign="middle" >1.37E−4</td><td align="center" valign="middle" >1.64E−6</td><td align="center" valign="middle" >2.33E−7</td><td align="center" valign="middle" >6.50E−8</td><td align="center" valign="middle" >2.49E−08</td></tr></tbody></table></table-wrap><p>of the two methods. From <xref ref-type="table" rid="table3">Table 3</xref>, we can clearly find that the accuracy of spectral method is better than that of finite difference method.</p></sec><sec id="s5"><title>5. Conclusion</title><p>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.</p></sec><sec id="s6"><title>Acknowledgements</title><p>This research was funded by the Humanity and Social Science Youth Foundation of Ministry of Education (No. 18YJC630120), the Applied Mathematics of Shanghai DianJi University (No. 16JCXK02) and the Key Projects of Shanghai Soft Science Research Program (No. 18692106600).</p></sec><sec id="s7"><title>Conflicts of Interest</title><p>The author declares no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s8"><title>Cite this paper</title><p>Guo, P. (2021) The Numerical Solution of Poisson Equation with Dirichlet Boundary Conditions. Journal of Applied Mathematics and Physics, 9, 3007-3018. https://doi.org/10.4236/jamp.2021.912194</p></sec></body><back><ref-list><title>References</title><ref id="scirp.113731-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Abramowitz, M. and Stegun, I.A. (1972) Handbook of Mathematical Functions. Dover, New York.</mixed-citation></ref><ref id="scirp.113731-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Wang, Z.X. and Guo, D.R. (1982) Special Functions. World Scientific Press, Singapore.</mixed-citation></ref><ref id="scirp.113731-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Hao, W. and Dan, X. (2009) Improved Poisson Image Editing and Its Implementation on GPU. 2009 IEEE 10th International Conference on Computer-Aided Industrial Design &amp; Conceptual Design, Wenzhou, 26-29 November 2009, 1044-1048. https://doi.org/10.1109/CAIDCD.2009.5375343</mixed-citation></ref><ref id="scirp.113731-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Morel, J.M., Petro, A.B. and Sbert, C. (2012) Fourier Implementation of Poisson Image Editing. Pattern Recognition Letters, 33, 342-348. https://doi.org/10.1016/j.patrec.2011.10.010</mixed-citation></ref><ref id="scirp.113731-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Martino, J.M.D., Facciolo, G. and Meinhardt-Llopis, E. (2016) Poisson Image Editing. Image Processing On Line, 5, 300-325. https://doi.org/10.5201/ipol.2016.163</mixed-citation></ref><ref id="scirp.113731-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Tian, C., Li, H. and Gao, X. (2018) Photo-Realistic 2D Expression Transfer Based on FFT and Modified Poisson Image Editing. Neurocomputing, 309, 1-10. https://doi.org/10.1016/j.neucom.2018.03.045</mixed-citation></ref><ref id="scirp.113731-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Kruse, A.W., Alenin, A.S. and Tyo, S. (2020) Contrast-Based Phase Angle of Polarization Image Construction Using Poisson Image Editing. Conference: Computational Optical Sensing and Imaging, Washington DC, 22-26 June 2020, CTh4C.5.https://doi.org/10.1364/COSI.2020.CTh4C.5</mixed-citation></ref><ref id="scirp.113731-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Sauer, T. (2012) Numerical Analysis. 2nd Edition, Addison Wesley Longman, Boston.</mixed-citation></ref><ref id="scirp.113731-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Dou, M.Y., Li, H.Y. and Liu, X.W. (2017) An Inertial Proximal Peaceman-Rachford Splitting Method. Scientia Sinica: Mathematica, 47, 333-348. https://doi.org/10.1360/N012016-00134</mixed-citation></ref><ref id="scirp.113731-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Sweilam, N.H., Moharram, H.M. and Ahmed, S. (2012) On the Parallel Iterative Finite Difference Algorithm for 2-D Poisson equation with MPI Cluster. International Conference on Informatics &amp; Systems IEEE, Giza, 14-16 May 2012, MM-78-MM-85.</mixed-citation></ref><ref id="scirp.113731-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Yang, F. and Fu, C.L. (2010) The Inverse Problem of the Identification of the Heat Source for the Poisson equation. Acta Mathematica Scientia, 30, 1080-1087.</mixed-citation></ref><ref id="scirp.113731-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Barnett, A., Wu, B. and Veerapaneni, S. (2015) Spectrally Accurate Quadratures for Evaluation of Layer Potentials Close to the Boundary for the 2D Stokes and Laplace Equations. SIAM Journal on Scientific Computing, 37, 519-542. https://doi.org/10.1137/140990826</mixed-citation></ref><ref id="scirp.113731-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Heinrich, B. (1996) The Fourier-Finite-Element Method for Poisson equation in Axisymmetric Domains with Edges. SIAM Journal on Numerical Analysis, 33, 1885-1911. https://doi.org/10.1137/S0036142994266108</mixed-citation></ref><ref id="scirp.113731-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Nkemzi, B. and Jung, M. (2020) The Fourier-Finite-Element Method for Poisson equation in Three-Dimensional Axisymmetric Domains with Edges: Computing the Edge Flux Intensity Functions. Journal of Numerical Mathematics, 28, 75-98. https://doi.org/10.1515/jnma-2019-0002</mixed-citation></ref><ref id="scirp.113731-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Febrianto, E., Ortiz, M. and Cirak, F. (2021) Mollified Finite Element Approximants of Arbitrary Order and Smoothness. Computer Methods in Applied Mechanics and Engineering, 373, Article ID: 113513. https://doi.org/10.1016/j.cma.2020.113513</mixed-citation></ref><ref id="scirp.113731-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Et., A. (2021) A New Finite Element Method Using Matlab for Poisson Equation in Axisymmetric Domain. Turkish Journal of Computer and Mathematics Education, 12, 671-678. https://doi.org/10.17762/turcomat.v12i1S.1963</mixed-citation></ref><ref id="scirp.113731-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Jie, S. and Tao, T. (2006) Spectral and High-Order Methods with Applications. Science Press, Beijing.</mixed-citation></ref><ref id="scirp.113731-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Jie, S., Tao, T. and Wang, L.L. (2011) Spectral Methods: Algorithms, Analysis and Applications. Springer-Verlag, Berlin.</mixed-citation></ref><ref id="scirp.113731-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Boyd, J.P. (2001) Chebyshev and Fourier Spectral Methods. Dover, New York.</mixed-citation></ref><ref id="scirp.113731-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Trefethen, L.N. (2000) Spectral Methods in MATLAB. SIAM, Philadelphia. https://doi.org/10.1137/1.9780898719598</mixed-citation></ref><ref id="scirp.113731-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Kosloff, D. (2012) Solution of the Equations of Dynamic Elasticity by a Chebychev Spectral Method. Geophysics, 55, Article No. 734. https://doi.org/10.1190/1.1442885</mixed-citation></ref><ref id="scirp.113731-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Long, Y. and Zeng, B. (2021) Sign-Changing Solutions for Discrete Dirichlet Boundary Value Problem. Journal of Applied Mathematics and Physics, 5, 2228-2243. https://doi.org/10.4236/jamp.2017.511182</mixed-citation></ref><ref id="scirp.113731-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Mangoubi, J., Moukoko, D., Moukamba, F., et al. (2016) Existence and Uniqueness of Solution for Cahn-Hilliard Hyperbolic Phase-Field System with Dirichlet Boundary Condition and Regular Potentials. Applied Mathematics, 7, 1919-1926. https://doi.org/10.4236/am.2016.716157</mixed-citation></ref></ref-list></back></article>