- Research
- Open Access
- Published:

# An efficient spectral collocation algorithm for nonlinear Phi-four equations

*Boundary Value Problems*
**volume 2013**, Article number: 87 (2013)

## Abstract

A Jacobi-Gauss-Lobatto collocation method is developed in this work to obtain spectral solutions for different versions of nonlinear time-dependent Phi-four equations subject to nonhomogeneous initial-boundary conditions. The node points are introduced as the roots of the orthogonal Jacobi polynomial with general parameters, *α* and *β*. The objective of this paper is thus to investigate the influence of the Jacobi spectral collocation method for solving the nonlinear Phi-four equations. Moreover, the results obtained with the different Jacobi polynomial parameters, *α* and *β* are compared to examine the accuracy of most of these parameters. The accuracy and performance of the proposed method are assessed and evaluated through solving three nonlinear problems. Some numerical experiments are presented to show the convergence and the accuracy of the proposed algorithm.

## 1 Introduction

Spectral methods are an efficient and highly accurate techniques adopted in applied mathematics and fluid dynamics to numerically solve linear and nonlinear differential equations and integral equations (see, *e.g.*, [1–4] and the references therein). The three well-known versions of spectral methods are the Galerkin, tau and collocation methods. The spectral collocation method is considered the simplest method with high accuracy and stability similar to the other types of spectral methods. During the last three decades, the spectral collocation method has gained increased interest in the numerical analysis field and is considered as a good candidate for solving nonlinear physical modeling problems and fractional differential equations [4–6]. The spectral collocation method offers the exponential rate of convergence as the grid is refined or the degree of the interpolation polynomial is increased.

A well-known advantage of a collocation method is that it achieves high accuracy with relatively fewer spatial grid points when compared with other numerical methods. In this direction, a new Legendre-Gauss collocation method was proposed in [7] for solving nonlinear second-order ordinary differential equations. A generalization of this approach was well studied in [8] for treating a class of fractional differential equation. Saadatmandi and Dehghan [9] introduced the Sinc-collocation approach for solving multi-point boundary value problems; in this approach, the computation of numerical solution is reduced to solve system of algebraic equations. Recently, Bhrawy and Alofi [10] proposed the shifted Jacobi-Gauss collocation approach to find an accurate solution of the Lane-Emden type equation, meanwhile, Doha *et al.* [11] developed this approach for solving nonlinear high-order multipoint boundary value problems.

Many mathematical problems arising in science and engineering have been described by the nonlinear Klein-Gordon equation. It is a relativistic version of the Schrödinger equation. Moreover, any solution to the Dirac equation is automatically a solution to the Klein-Gordon equation, but the converse is not true [12–14]. A very important particular form of the Klein-Gordon equation is the Phi-four equation; the model phenomenon in particle physics where kink and antikink solitary waves interact.

Several numerical methods have been proposed in the literature for solving nonlinear time-dependent partial differential equations, (see, [15–21]). Dehghan *et al.* [22] proposed a finite difference scheme for solving the Klein-Gordon equation. They approximated the spatial derivative by the fourth-order finite difference scheme and the resulted system of second-order ordinary differential equations in time by the implicit Runge-Kutta-Nystrom method, which has fourth-order accuracy in time. In the literature, few numerical schemes have been presented for solving the Phi-four equation. In [23], the authors obtained the singular soliton solution of the Phi-four equation, which appears in relativistic quantum mechanics by the ansatz method, and a new spectral solution was proposed based on rational Chebyshev functions on a semiinfinite domain. Some analytical methods for solving the Phi-four equation and other related equations were given in [24–31]. To the best of the authors’ knowledge, there are no results on the Jacobi-Gauss-Lobatto collocation method for solving nonlinear Phi-four equations. This partially motivated our interest in such method.

In this paper, we propose an orthogonal collocation scheme for solving the Phi-four equation based on Jacobi family in which the nodes of the Jacobi-Gauss-Lobatto quadrature whose distributions can be tuned by two parameters, *α* and *β*. Firstly, we apply the Jacobi-Gauss-Lobatto collocation (J-GL-C) method on the model equation for discretizing spatial derivatives, using (N-1) nodes of the Jacobi-Gauss-Lobatto interpolation, which depends upon the two general parameters (\alpha ,\beta >-1). These equations together with the two-point boundary conditions, which are enforced in the collocated equation, constitute the system of (N-1) ordinary differential equations (ODEs) in time. Secondly, the Runge-Kutta method of fourth-order is investigated for the time integration of the resulting nonlinear system of (N-1) second-order ODEs. Finally, the accuracy of the proposed method is shown by test problems.

The outline of this paper is as follows. In Section 2, we give some properties of Jacobi polynomials. In Section 3, the J-GL-C method technique for nonlinear time-dependent Phi-four equation is implemented, and in Section 4 the proposed method is applied to three Phi-four equations. Finally, a conclusion is drawn in Section 5.

## 2 Some properties of Jacobi polynomials

Due to obtaining the solution in terms of the Jacobi parameters *α* and *β*, the use of Jacobi polynomials for solving differential equations has gained increasing popularity in recent years (see, [32, 33]). These orthogonal polynomials are eigenfunctions of the Sturm-Liouville equation:

The orthogonal Jacobi polynomials are satisfying the following relations:

Let {w}^{(\alpha ,\beta )}(x)={(1-x)}^{\alpha}{(1+x)}^{\beta}, then we define the weighted space {L}_{{w}^{(\alpha ,\beta )}}^{2} as usual, equipped with the following inner product and norm:

and the discrete inner product and norm

where {x}_{N,j}^{(\alpha ,\beta )} (0\le j\le N) and {\varpi}_{N,j}^{(\alpha ,\beta )} (0\le j\le N) are the nodes and the corresponding Christoffel numbers of the Jacobi-Gauss-Lobatto quadrature formula on the interval (-1,1).

The set of Jacobi polynomials forms a complete {L}_{{w}^{(\alpha ,\beta )}}^{2}-orthogonal system, and

## 3 J-GL-C method for nonlinear Phi-four model

Since the collocation method is an efficient numerical technique for approximating various problems in physical space, including variable coefficient and nonlinear terms (see, for instance [10, 33]), we present the J-GL-C method to numerically solve the nonlinear time-dependent Phi-four equations.

### 3.1 Jacobi spectral collocation method in space dimensional

The J-GL-C method will be used to approximate solutions of the following nonlinear Phi-four equation:

where

subject to the initial-boundary conditions

Now, suppose the change of variables x=\frac{2}{B-A}y+\frac{A+B}{A-B}, u(x,t)=v(y,t), which will be used to transform problem (6)-(8) into another one in the classical interval, [-1,1], for the space variable, to directly implement collocation method based on Jacobi family defined on [-1,1],

where {D}^{\ast}=\{x:-1\le x\le 1\}, subject to the initial-boundary conditions

The node points are the set of points in a specified domain where the dependent variable values are approximated. In general, the choice of the location of the node points are optional, but taking the nodes of Jacobi-Gauss-Lobatto quadrature whose distributions can be tuned by two parameters, *α* and *β*; referred to as Jacobi -Gauss-Lobatto collocation points, gives particularly accurate solutions for the spectral methods. The aim of this work is to consider the advantage of the Jacobi collocation method in a specified domain, [-1,1] using the nodes of Jacobi-Gauss-Lobatto quadrature. Now, we outline the main step of the J-GL-C method for solving the nonlinear Phi-four model. Let us expand the dependent variable in a Jacobi series,

and in virtue of (5) and (4), we deduce that

To evaluate the previous integral accurately, we present the Jacobi-Gauss-Lobatto quadrature. For any \varphi \in {S}_{2N+1}(-1,1),

where {S}_{N}(-1,1) is the set of polynomials of degree less than or equal to *N*, {x}_{N,j}^{(\alpha ,\beta )} (0\le j\le N) and {\varpi}_{N,j}^{(\alpha ,\beta )} (0\le j\le N) are the nodes and the corresponding Christoffel numbers of the Jacobi-Gauss-Lobatto quadrature formula on the interval (-1,1), respectively.

In accordance to (14), the coefficients {a}_{j}(t) in terms of the solution at the collocation points can be approximated by

Therefore, (12) can be rewritten as

or equivalently

Furthermore, if we differentiate (12) once, and evaluate it at all Jacobi-Gauss-Lobatto collocation points, we can write the first spatial partial derivative in terms of the values at theses collocation points as

or shortened to

where

Similar steps can be applied to the second spatial partial derivative to get

where

In the proposed Jacobi-Gauss-Lobatto collocation method, the residual of (9) is set to zero at N-1 of Jacobi-Gauss-Lobatto points, moreover, the boundary conditions (10) will be enforced at the two collocation points −1 and 1. Therefore, adopting (19)-(22), enable one to write (9)-(10) in the form:

where

This provides a (N-1) system of second-order ordinary differential equations in the expansion coefficients {a}_{j}(t), namely

where

This means that problem (9)-(11) is transformed to the following system of ordinary differential equations (SODEs):

subject to the initial values

Finally, (25)-(26) can be rewritten into a matrix form of N-1 second-order ordinary differential equations with their vectors of initial values:

where

and

where

**Remark 3.1** It is well known that the Legendre polynomials, the Chebyshev polynomials of the first, second, third and fourth kinds, and the ultraspherical polynomials are special cases of the Jacobi polynomials. Therefore, this work covers all the previous mentioned polynomials. More specifically, Legendre, Chebyshev and ultraspherical spectral collocation methods can be obtained as special cases from the proposed method.

### 3.2 System of differential equations in time

This subsection presents the implicit Runge-Kutta of fourth order investigated in this study and difference between the measured value of approximate solution and its exact value. One of the most important family of implicit and explicit iterative finite difference methods for the approximation of solutions of ordinary differential equations is the method of implicit Runge-Kutta of fourth order. The SODEs (27) can be solved by using the implicit Runge-Kutta of fourth order

where

Thus, we can calculate the values of {u}_{i}, i=1,\dots ,n for any time *t* and then the approximated solution (16) of the PDEs (9) can be obtained.

The difference between the measured or inferred value of approximate solution and its exact value (absolute error) is given by

where u(x,t) and \tilde{u}(x,t) are the exact and approximate solutions at the point (x,t), respectively. Moreover, the maximum absolute error is given by

## 4 Numerical results

This section considers three numerical examples to demonstrate the accuracy and applicability of the proposed method in the present paper. Comparison of the results obtained by adopting different choices of the two Jacobi parameters *α* and *β* reveals that the present method is very convenient for all choices of *α* and *β* and produces highly accurate solutions to the Phi-four equations.

**Example 1**

As a first example, we consider the nonlinear time-dependent Phi-four equation in the form

subject to the boundary conditions

and the initial conditions

If we apply the generalized tanh method [34], then the exact solution of (32) is

Maximum absolute errors of (32) subject to (33) and (34) are introduced in Table 1 using the J-GL-C method for with various choices of *N*, *α* and *β* in the interval [0,1], while the absolute errors of problem (32) are presented in Table 2 for \alpha =\beta =\frac{1}{2}, {\lambda}_{1}={\lambda}_{2}={\lambda}_{3}=1 and N=24 with different values of (x,t) in the interval [0,10].

In Figure 1, we see that the approximate solution and the exact solution for different values of *t* (0, 0.5 and 0.9) of problem (32) are completely coinciding in the case of \alpha =\beta =\frac{1}{2}, {\lambda}_{1}={\lambda}_{2}={\lambda}_{3}=1, \nu =2 and N=24. Moreover, the approximate solution of problem 32 where \alpha =-\beta =\frac{1}{2}, {\lambda}_{1}={\lambda}_{2}={\lambda}_{3}=1, \nu =2 and N=20 is plotted in Figure 2, while the absolute error of (32) with \alpha =\beta =-\frac{1}{2}, {\lambda}_{1}={\lambda}_{2}={\lambda}_{3}=1, \nu =2 and N=4 is displayed in Figure 3. This assertion that the obtained numerical results are very accurate and compare favorably with the exact solution.

**Example 2**

Consider the Phi-four equation

subject to initial-boundary conditions

The exact solution of this equation is

Table 3 lists the maximum absolute errors of (37) subject to (38) and (39), using the J-GL-C method for with various choices of *N*, *α* and *β*. Moreover, in Table 4, we introduce absolute errors using the J-GL-C method for the special value -\alpha =\beta =\frac{1}{2} (Chebyshev polynomials of the third kind) and N=12.

In case of \alpha =\beta =-\frac{1}{2} (Chebyshev polynomials of the first kind), we display in Figure 4 the approximate solution and the exact solution at t=0.5 of problem (37) \nu =0.01 and N=16. In Figure 5, we display the approximate solution for x\in [-5,5] and t\in [0,1] with \alpha =\beta =-\frac{1}{2}, \nu =0.01 and N=16. Moreover, the absolute error between the exact and approximate solutions of problem (37) with \alpha =\beta =0 (Legendre polynomials), \nu =0.01 and N=12 is plotted in Figure 6.

**Example 3**

Consider the nonlinear time-dependent one-dimensional Phi-four equation in the form

subject to the initial-boundary values

The exact solution using generalized tanh method is

Maximum absolute errors of (42) subject to (43) and (44) are introduced in Table 5 using the J-GL-C method for with various choices of *N*, *α* and *β*, while the absolute errors are presented in Table 6 for \alpha =\beta =\frac{1}{2} (Chebyshev polynomials of the second kind) and N=12 at different values of (x,t).

In Figure 7, we see that the approximate solutions and the exact solutions for three values of *t* (t=0,0.5,0.9) of problem (42) are completely coincide for all values of *x* in the interval x\in [-1,1]. The approximate solution is plotted in Figure 8 with values of parameters listed in its caption, and the absolute error using J-GL-C method is displayed in Figure 9. From the presented results, it can be concluded that the numerical solutions are in excellent agreement with the exact solutions.

## 5 Conclusions

In this paper, we have implemented the Jacobi-Gauss-Lobatto collocation method with different parameters, *α* and *β* in the Jacobi family to solve the nonlinear time-dependent Phi-four problem. The Jacobi collocation method in space reduces Phi-four equation to a system of second-order ordinary differential equations in time, which can be solved by fourth-order implicit Runge-Kutta method. The numerical results demonstrate that the proposed J-GL-C method is accurate and efficient. Comparison of the results obtained by adopting different choices of the two Jacobi parameters *α* and *β* reveals that the present method was very convenient for all choices of *α* and *β*, and produces highly accurate solutions to the nonlinear Phi-four equations.

## References

Canuto C, Hussaini MY, Quarteroni A, Zang TA:

*Spectral Methods: Fundamentals in Single Domains*. Springer, New York; 2006.Doha EH, Bhrawy AH: An efficient direct solver for multidimensional elliptic robin boundary value problems using a Legendre spectral-Galerkin method.

*Comput. Math. Appl.*2012, 64: 558-571. 10.1016/j.camwa.2011.12.050Kamrani M, Hosseini SM: Spectral collocation method for stochastic Burgers equation driven by additive noise.

*Math. Comput. Simul.*2012, 82: 1630-1644. 10.1016/j.matcom.2012.03.007Saadatmandi A, Dehghan M: A tau approach for solution of the space fractional diffusion equation.

*Comput. Math. Appl.*2011, 62: 1135-1142. 10.1016/j.camwa.2011.04.014Bhrawy AH, Alshomrani M: A shifted Legendre spectral method for fractional-order multi-point boundary value problems.

*Adv. Differ. Equ.*2012., 2012: Article ID 8Bhrawy AH, Alofi AS: The operational matrix of fractional integration for shifted Chebyshev polynomials.

*Appl. Math. Lett.*2013, 26: 25-31. 10.1016/j.aml.2012.01.027Guo BY, Yan JP: Legendre-Gauss collocation method for initial value problems of second order ordinary differential equations.

*Appl. Numer. Math.*2009, 59: 1386-1408. 10.1016/j.apnum.2008.08.007Doha EH, Bhrawy AH, Ezz-Eldien SS: A new Jacobi operational matrix: an application for solving fractional differential equation.

*Appl. Math. Model.*2012, 36: 4931-4943. 10.1016/j.apm.2011.12.031Saadatmandi A, Dehghan M: The use of Sinc-collocation method for solving multi-point boundary value problems.

*Commun. Nonlinear Sci. Numer. Simul.*2012, 17: 593-601. 10.1016/j.cnsns.2011.06.018Bhrawy AH, Alofi AS: A Jacobi-Gauss collocation method for solving nonlinear Lane-Emden type equations.

*Commun. Nonlinear Sci. Numer. Simul.*2012, 17: 62-70. 10.1016/j.cnsns.2011.04.025Doha EH, Bhrawy AH, Hafez RM: On shifted Jacobi spectral method for high-order multi-point boundary value problems.

*Commun. Nonlinear Sci. Numer. Simul.*2012, 17: 3802-3810. 10.1016/j.cnsns.2012.02.027Wang ML, Zhou YB: The periodic wave solutions for the Klein-Gordon-Schrodinger equations.

*Phys. Lett. A*2003, 318: 84-92. 10.1016/j.physleta.2003.07.026Yomba E: On exact solutions of the coupled Klein-Gordon-Schrodinger and the complex coupled KdV equations using mapping method.

*Chaos Solitons Fractals*2004, 21: 209. 10.1016/j.chaos.2003.10.028Li XY, Yang S, Wang ML:The periodic wave solutions for the (3+1)-dimensional Klein-Gordon-Schrodinger equations.

*Chaos Solitons Fractals*2005, 25: 629-636. 10.1016/j.chaos.2004.11.028Arafa AAM, Rida SZ: Numerical solutions for some generalized coupled nonlinear evolution equations.

*Math. Comput. Model.*2012, 56: 268-277. 10.1016/j.mcm.2011.12.046Jiwari R, Mittal RC, Sharma KK: A numerical scheme based on weighted average differential quadrature method for the numerical solution of Burgers’ equation.

*Appl. Math. Comput.*2013, 219: 6680-6691. 10.1016/j.amc.2012.12.035Bhrawy AH, Al-shomrani M: A Jacobi Dual-Petrov Galerkin-Jacobi Collocation Method for Solving Korteweg-de Vries equations.

*Abstr. Appl. Anal.*2012., 2012: Article ID 16Khan Y: A method for solving nonlinear time-dependent drainage model.

*Neural Comput. Appl.*2013. doi:10.1007/s00521-012-0933-2Khan Y, Diblik J, Faraz N, Smarda Z: An efficient new perturbative Laplace method for space-time fractional telegraph equations.

*Adv. Differ. Equ.*2012., 2012: Article ID 204El-Kady M, El-Sayed SM, Fathy HE: Development of Galerkin method for solving the generalized Burger’s-Huxley equation.

*Math. Probl. Eng.*2013., 2013: Article ID 9Van Gorder RA, Vajravelu K: Analytical and numerical solutions of the density dependent Nagumo telegraph equation.

*Nonlinear Anal., Real World Appl.*2010, 11: 3923-3929. 10.1016/j.nonrwa.2010.02.019Dehghan M, Mohebbi A, Asgari Z: Fourth-order compact solution of the nonlinear Klein-Gordon equation.

*Numer. Algorithms*2009, 52: 523-540. 10.1007/s11075-009-9296-xChowdhury A, Biswas A: Singular solitons and numerical analysis of phi-four equation.

*Math. Sci.*2012., 6: Article ID 42Sassaman R, Biswas A: Soliton perturbation theory for Phi-four model and nonlinear Klein-Gordon equations.

*Commun. Nonlinear Sci. Numer. Simul.*2009, 14: 3239-3249. 10.1016/j.cnsns.2008.12.020Khater AH, Callebaut DK, Bhrawy AH, Abdelkawy MA: Nonlinear periodic solutions for isothermal magnetostatic atmospheres.

*J. Comput. Appl. Math.*2013, 242: 28-40.Soliman AA: Exact traveling wave solution of nonlinear variants of the RLW and the PHI-four equations.

*Phys. Lett. A*2007, 368: 383-390. 10.1016/j.physleta.2007.04.040Triki H, Wazwaz A: Envelope solitons for generalized forms of the phi-four equation.

*Journal of King Saud University. Science*2012. doi:10.1016/j.jksus.2012.08.001Zhou H, Shen J: Bifurcations of travelling wave solutions for modified nonlinear dispersive phi-four equation.

*Appl. Math. Comput.*2010, 217: 1584-1597. 10.1016/j.amc.2009.07.001Deng X, Zhao M, Li X: Travelling wave solutions for a nonlinear variant of the Phi-four equation.

*Math. Comput. Model.*2009, 49: 617-622. 10.1016/j.mcm.2008.03.011Russo M, Van Gorder RA, Choudhury SR: Painleve property and exact solutions for a nonlinear wave equation with generalized power-law nonlinearities.

*Commun. Nonlinear Sci. Numer. Simul.*2013, 18: 1623-1634. 10.1016/j.cnsns.2012.11.019Van Gorder RA, Sweet E, Vajravelu K: Analytical solutions of a coupled nonlinear system arising in a flow between stretching disks.

*Appl. Math. Comput.*2010, 216: 1513-1523. 10.1016/j.amc.2010.02.053Doha EH, Bhrawy AH: A Jacobi spectral Galerkin method for the integrated forms of fourth-order elliptic differential equations.

*Numer. Methods Partial Differ. Equ.*2009, 25: 712-739. 10.1002/num.20369Bhrawy AH, Alghamdi MA: A shifted Jacobi-Gauss-Lobatto collocation method for solving nonlinear factional Langevin equation involving two fractional orders in different intervals.

*Bound. Value Probl.*2012., 2012: Article ID 62Fan E, Hon YC: Generalized tanh method extended to special types of nonlinear equations.

*Z. Naturforsch.*2002, 57a: 692-700.

## Acknowledgements

This study was supported by the Deanship of Scientific Research of King Abdulaziz University. The authors would like to thank the reviewers for their constructive comments and suggestions to improve the quality of the article.

## Author information

### Authors and Affiliations

### Corresponding author

## Additional information

### Competing interests

The authors declare that they have no competing interests.

### Authors’ contributions

The authors have equal contributions to each part of this paper. All the authors read and approved the final manuscript.

## Authors’ original submitted files for images

Below are the links to the authors’ original submitted files for images.

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## About this article

### Cite this article

Bhrawy, A.H., Assas, L.M. & Alghamdi, M.A. An efficient spectral collocation algorithm for nonlinear Phi-four equations.
*Bound Value Probl* **2013, **87 (2013). https://doi.org/10.1186/1687-2770-2013-87

Received:

Accepted:

Published:

DOI: https://doi.org/10.1186/1687-2770-2013-87

### Keywords

- nonlinear Phi-four equations
- nonlinear time-dependent equations
- Jacobi collocation method
- Jacobi-Gauss-Lobatto quadrature
- implicit Runge-Kutta method