Numerical Solution of Reaction–Diffusion Equations with Convergence Analysis

In this manuscript, we implement a spectral collocation method to find the solution of the reaction–diffusion equation with some initial and boundary conditions. We approximate the solution of equation by using a two-dimensional interpolating polynomial dependent to the Legendre–Gauss–Lobatto collocation points. We fully show that the achieved approximate solutions are convergent to the exact solution when the number of collocation points increases. We demonstrate the capability and efficiency of the method by providing four numerical examples and comparing them with other available methods.


Introduction
One of the special cases of partial differential equations (PDEs) is reaction diffusion equation (RDE) that has attracted the attention of many researchers, recently [1,20,28,32,33]. RDEs are the mathematical models which correspond with physical and chemical phenomena. Often, it is the change in space and time in viscosity of one and more chemical materials: chemical reactions in which the materials converted in each other, and diffusion which causes the materials to extend over a surface in space. RDEs are also applied in sciences such that biology [14], geology [15], ecology [20] and physics [23].
The general form of RDEs can be described as follows and here we can consider the following initial and boundary conditions where K is the diffusion coefficient, 1 ∶ [0, T] → ℝ , 2 ∶ [0, T] → ℝ and 3 ∶ [0, L] → ℝ are given sufficiently smooth functions. The target of this manuscript is to present an effective numerical method for solving the RDE (1) with conditions (2) and to analyze the convergence of the method.
There are several methods for solving this class of PDEs such as traveling wave method [19], finite elements [6], fixed-node finite-difference schemes [7] and spectral methods [4]. One of other methods for solving RDE presented by Reitz [22]. He applied different several methods for solving RDE. His methods had good numerical stability and can be used for multidimensional cases. Sharifi and Rashidian [24] applied an explicit finite difference associated with extended cubic B-spline collocation method for solving RDEs. Wang et al. [27] used the compact boundary value method (CBVM) for solving RDE. Their method is the combination of compact fourth-order differential method (CFODM) and P-order boundary value method (POBVM). This method is locally stable and have unique solution. Furthermore this method have fourth-order accuracy in space and P-order accuracy in place. Wu et al. [29] applied variational iteration method (VIM) for structuring integral equations to solve RDE. In this method, Lagrange multipliers and a discrete numerical integral formula are used to solve RDE. This method for first time was proposed by He [11]. Biazar and Mehrlatifan [3] solved RDE using the compact finite difference method. Diaz and Puri [8] applied the explicit positivity-preserving finite-difference method for solving RDE. Lee et al. [17] in their work investigated and found exact solutions 1 3 of derivative RD system and next they showed some exact solutions of derivative nonlinear Schrödinger equation ( DNLS) via Hirota bilinearization method. Gaeta and Mancinelli [9] analyzed the asymptotic scaling properties of anomalous RDE. Their numerical results showed that for large t, well defined scaling properties. Another method for solving RDE is lifted local Galerkin which was presented by Xiao et al. [30]. Yi and Chen [31] introduced a new method based on repeated character maping of traveling wave for solving RDE. Toubaei et al. [26] represented one of the most applied functions of RDE in chemistry and biologic sciences in their paper and then they solved RDE by using collocation methods and finite differences methods. Koto [16] applied the implicit-explicit Range-Kutta method for RDE. Diaz [7] utilized a logarithmic numerical model. He considered the monotonousness, bounding and positiveness of approximations in following of his work and for first time he showed that the logarithmic designs are stable and convergent. The nonclassical symmetries method is used by Hashemi and Nucci [10] to solve the diffusion reaction equations. An et al. [2] suggested a method to compute the numerical approximation for both solutions and gradients, while the other methods can also compute the numerical solutions. Moreover, in this method they computed the element by element instead of solving the whole of system that this can decrease the expenses of computations.
Despite the existence of above-mentioned numerical methods , providing a numerical convergent method with simple structure and high accuracy, for solving RDEs, is still required. Hence, we extend a spectral collocation method to estimate the solution of RDEs. Spectral methods are one of the most powerful methods for solving the ordinary and partial differential equations [5,25]. In this method, we apply a two-dimensional Lagrange interpolating polynomial to estimate the solution of the RDE. We apply the Legendre-Gauss-Lobatto (LGL) nodes as interpolating or collocation points and convert the RDE with its initial and boundary conditions into a system of algebraic equations. By solving this system, the coefficients of interpolating polynomial can be gained. We fully show that the approximate solutions are convergent to the exact solution when the number of collocation points tends to infinity. Note that spectral collocation methods have high accuracy and exponential convergence and, up to now many researchers utilized them to solve different continuous-time problems involving the ordinary and partial differential equations [12,13,18].
The paper is structured as follow: in Sect. 2, we implement the spectral collocation method for approximating the solution of RDE. In Sect. 3, we study the convergence of approximations to the exact solution of RDE. In Sect. 4, four numerical examples are given to show the efficiency and accuracy of methods comparing with those of others. Finaly, the conclusions and the suggestions are presented in Sect. 5.

Approximating the Solution by Spectral Collocation Method
We approximate the solution of system (1)-(2) as follows where D mi and D (2) nj are defined as follow and By replacing the relations (9), (10) and (11) in (1) we get where ũ mn for m, n = 0, 1, … , N are the unknowns. By solving algebraic system (14), we achieve the point-wise approximate solutions ũ mn (m, n = 0, 1, … , N) and the continuous approximate solution u N (., .) defined by (3).

Convergence Analysis
In this section we analyze the convergence of the proposed method. We assume Λ = [0, T] × [0, L] and C k (Λ) is the set of all continuously differentiable functions from order k. To check the convergence of the method, we initial with the following definition.

Definition 3.1
The continuous function F ∶ ℝ + → ℝ + with the following properties is called modulus of continuity [21] 1. F is increasing, A special case for modulus of continuity is Here we consider that O 2 is unit circle in ℝ 2 . The continuous function f on Λ , accepts F(.) as modulus of continuity when the following is finite where to show the set of the first continuously differentiable functions on the unit circle O 2 and equippe it with the following norm Now we define According to above if for some maps We define P(N, N, Λ) , the space of all Polynomials, as Proof The proof has been obtained from Theorem 2.1 in Ragozin [21]. ◻ Related to the existence of solution, we convert system (14) into the following system where N is enough large and F(.) is a function which satisfies Definition 3.1. Since (21) is a solution for system (14) as N → ∞ . We now define In the following, we show that system (21) is feasible. We want to prove that ũ N = (ũ mn ; m, n = 0, 1, … , N) satisfies system (21). By (24), (25) and (26) x, u(t, x)), Here we want to give the convergence theorem of solutions.  (21) and {u N (., .)} ∞ N=N is the sequence of polynomials defined in (3). We assume that for any x ∈ [0, L] , the sequence {(u N (0, x), u N t (., .))} ∞ N=N has a subse- p(., .)) uniformly, where p(., .) ∈ C 2 (Λ) , ∞ (.) ∈ C 2 ([0, L]) and lim i→∞ N i = ∞ . Then satisfies the system (1)- (2).

Hence, by (35) we get
On the other hand, since lim i→∞ (21) we get and this contradicts relation (36). So ũ(., .) satisfies the Eq. (1). Moreover, it is easy to show that ũ(., .) satisfies the initial and boundary conditions (2) and this completes the proof. ◻

Examples
In this section, we have provided four of examples to illustrate the efficiency of method in solving RDEs. The first example is constructed by the authors to test the method. The next three examples show the comparison of the suggested method with other existing methods. We solve the corresponding system (14) using FSOLVE command in MATLAB software. The absolute error of gained estimate solution u N (., .) is defined by Also, We calculate the L 2 and L ∞ errors of approximations by the following relations Example 4.1 Consider the RDE (1)-(2) with g(t, x, u) = u + e t sinx, K = 1 and the following conditions The accurate solution is u(t, x) = e t sinx, (t, x) ∈ [0, 1] 2 . We solve this equation for N = 10 using suggested method. Figure 1 shows the obtained approximate solution and its absolute error. Also, Fig. 2 illustrates that by increasing N, the L 2 and L ∞ errors decrease. This shows our presented method has good accuracy and stable treatment. 2 , K = 1 and the following conditions ⎧ ⎪ ⎨ ⎪ ⎩ u(t, 0) = 1 (t) = e t sint, u(t, 1) = 2 (t) = e t−1 sin(t + 1), u(0, x) = 3 (x) = e (−x) sinx. The accurate solution for this example is u(t, x) = e t−x sin(t + x), (t, x) ∈ [0, 1] 2 . We illustrate the obtained approximate solution and its absolute error for N = 10 in Fig. 3. E N 2 and E N ∞ errors are presented in Fig. 4. It can be seen that by increasing N, these errors decrease and our method is stable. Also we compare the presented method with IMEX Range-Kutta method [16], that are shown in Table 1. These results present that the E N 2 error of suggested method is less than that of the method [16]. (1+e x−5t ) 2 , (t, x) ∈ [0, 1] . We solve this equation for N = 20 using our approach . Figure 5 shows the gained approximate solution and its absolute error. Also, Fig. 6 illustrates that by increasing N, the E N 2 and E N ∞ errors decrease and the presented method has good accuracy. Then we compare with VIM method [29], that are shown in Table 2.   Our approach, N = 20 −8.5 −18 VIM method [29], N = 40 -−3.5 The accurate solution is u(t, x) = e (−0.5−0.1 2 )t sin( x), (t, x) ∈ [0, 1] 2 . We illustrate the obtained results, for N = 9, in Fig. 7. E N 2 and E N ∞ errors, for N = 9, are presented in Fig. 8. It can be seen that the errors decrease when N increases. We also give the absolute error of suggested method, compact finite difference method [3], explicit finite difference method [8] and collocation method [24] in the Table 3 . The results show that the error of suggested method is less than that of others.

Conclusions and Suggestions
In this text we showed that spectral collocation method can be utilized to find a solution for RDE with a simple structure. We analyzed the convergence of approximate solutions to the accurate solution by utilizing the theory of module of continuity and a normed space of polynomials. We presented two main theorem related to feasibility of obtained estimate solutions and their convergence. We solved some numerical examples and illustrated the capability of the presented method. For future work, we will utilize this powerful method and its convergence results for other types of PDEs involving delay and fractional derivatives.
Author Contributions MH carried out the research, study, methodology and writing. MG carried out the methodology and supervisor role. MHNS participated in MATLAB program and methodology. DB participated in the validity confirmation and advisor role.  Table 3 The comparison of maximum of E N (., .) for Example 4.4 t = 0.8 Our method, N = 9 method [24], N = 9 Method [8] Method [3], N = 9 3.4708 × 10 −10 1.25216 × 10 −6 3.1835 × 10 −2 1.09 × 10 −4 Funding There are no funders to report for this submission.

Availability of Data and Materials
There is no data and material outside the article.

Declarations
Conflict of interest he authors declare that they have no competing interests.

Consent to participate Not applicable.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.