Skip to main content

Theory and Modern Applications

Legendre spectral element method for solving sine-Gordon equation

Abstract

In this paper, we study the Legendre spectral element method for solving the sine-Gordon equation in one dimension. Firstly, we discretize the equation by Legendre spectral element in space and then discretize the time by the second-order leap-frog method. We study the stability and convergence of the method and show the convergence of our method. Finally, we show the results with numerical examples.

1 Introduction

A spectral element method combines the high accuracy of spectral methods and flexibility of finite element method, and the approximate result of this method provides high accuracy and spectral convergence. In this method the solution is approximated on each element using spectral methods. One of the advantages of this method is the high accuracy and stable solving algorithm with a small number of elements under a wide range of conditions [1].

Finite element method was proposed for the first time in 1943 by Courant [2]. He solved the Poisson equation based on minimizing piecewise linear approximations on finite subdomains.

The spectral method is a conventional method for solving partial differential equations, which was first introduced by Navier for elastic sheet problems in 1825. In spectral method the solution is approximated on one general domain.

In 1984, Patera applied a spectral method to a greater number of subdomains by a division of domains. He proposed the spectral element method by combining the spectral method and the finite element method [3]. In his innovative method, Patera uses the Chebyshev polynomials as the interpolation basis functions. Legendre’s spectral element was developed by Maday and Patera [4]. The use of the Lagrangian interpolation conjugate with the Gauss–Legendre–Lobatto quadrature leads to a matrix of mass with diameter structure [5]. The diagonal mass matrix is a very important property of the Legendre spectral element method and is different from the Chebyshev spectral element method [6].

The Legendre spectral element method is widely used in solving partial differential equations. Chen et al. [7] used the Legendre spectral element method to solve a constrained optimal control problem. An alternating direction implicit (ADI) Legendre spectral element method for the two-dimensional Schrodinger equation is developed in [8], and the optimal \(H^{1}\) error estimate for the linear case is given. The aim of [9] is the Lagrange–Galerkin spectral element method for solving two-dimensional shallow water equations. The authors of [10] considered the numerical approximation of the acoustic wave equation by the spectral element method based on the Gauss–Lobatto–Legendre quadrature formulas and finite difference Newmark’s explicit time advancing schemes. A modified set of basis functions for use with spectral element methods is presented in [11] for solving a mixed elliptic boundary value problem. These basis functions are constructed so that the axial conditions along a plane or axis of symmetry are satisfied identically. A numerical spectral element method for the computation of fluid flows governed by the incompressible Euler equations in a complex geometry is presented in [12]. Zhuang and Chen [13] used this method to solve biharmonic equations. In [14], the authors used the spectral element method with least-square formulation for parabolic interface problems. Ai et al. [15] used fully diagonalized Legendre spectral element methods using Sobolev orthogonal/biorthogonal basis functions for solving second-order elliptic boundary value problems. A Legendre spectral element formulation of an improved time-splitting method is developed for the natural convection heat transfer problem in a square cavity by Wang and Qin [16].

The sine-Gordon equation is one of the most important partial differential equations, which applies to many scientific fields such as the motion of a rigid pendula attached to a stretched wire [17], solid state physics, nonlinear optics, and the stability of fluid motions.

We consider the one-dimension sine-Gordon equation

$$\begin{aligned} \begin{aligned} &{u_{tt}} - {u_{xx}} + \sin ( u ) = 0, \quad x \in \varOmega , t \in ( {0,T} ), \\ &{u_{x}} ( {x,t} ) = 0, \quad x \in \partial \varOmega , t \in ( {0,T} ), \\ &u ( {x,0} ) = {u _{0}} ( x ), \qquad {u_{t}} ( {x,0} ) = {u _{1}} ( x ), \quad x \in \varOmega , \end{aligned} \end{aligned}$$
(1)

where u is a function of x and t, and \({u _{0}} ( x )\) and \({u _{1}} ( x )\) are known analytic functions.

Different numerical methods are presented for Eq. (1). Dehghan and Shokri [18] solved a one-dimensional sine-Gordon equation using collocation points and approximating the solution using thin plate splines radial basis function. Dehghan and Mirzaei [19] used a numerical method of the boundary integral equation to approximate the solution of one-dimensional equation (1). Mohebbi and Dehghan [20] have also used the finite difference method for numerical solution of equation (1).

In [21] the authors present an analysis of the stability spectrum for all stationary periodic solutions to the sine-Gordon equation. Yousif an Mahmood [22] used the variational homotopy perturbation method for solving the Klein–Gordon and sine-Gordon equations. In [23] a new scheme, which has energy-preserving property, is proposed for solving the sine-Gordon equation with periodic boundary conditions. This method is obtained by the Fourier pseudo-spectral method and the fourth-order average vector field method. Baccouch [24] presented superconvergence results for the local discontinuous Galerkin method for the sine-Gordon nonlinear hyperbolic equation in one space dimension.

Other numerical methods have also been used to solve the sine-Gordon equation such as Chebyshev tau meshless method [25], meshless method of lines [26], high-accuracy multiquadric quasi-interpolation [27], reduced differential transform method [28], pseudo-spectral method [29], modified cubic B-spline differential quadrature method [30], modified cubic B-spline collocation method [31], etc.

In this paper, we study the Legendre spectral element method for solving Eq. (1). First, using the Legendre spectral element method, we obtain a semi-discrete spatial form of Eq. (1), and then, using the leap-frog method, we obtain a complete discrete form of Eq. (1). We bring theorems on stability and convergence, and, finally, we show the results by a numerical example.

This paper is organized as follows: In Sect. 2, we perform a spatial discretization of Eq. (1) using the Legendre spectral element method. In Sect. 3, we perform a time discretization of Eq. (1) using the second-order leap-frog method. In Sect. 4, we present stability and convergence theorems. Finally, in Sect. 5, we present a numerical example to validate the stability and convergence of the numerical scheme with respect to the discretization parameters.

2 Space discretization

In this section, we explain the Legendre spectral element method and spatial discretization of Eq. (1).

2.1 Legendre spectral element method

In the Legendre spectral element method, we first divide the domain Ω into \(N_{e}\) nonoverlapping subdomains \(\varOmega _{e}\):

$$ \bar{\varOmega }= \bigcup_{e = 1}^{{N_{e}}} {{{ \bar{\varOmega }}_{e}}} , \qquad \bigcap_{e = 1}^{{N_{e}}} {{\varOmega _{e}}} = \emptyset . $$

We define the approximation space

$$ {U^{h}} = \{ {u \in U: u| {_{{\varOmega _{e}}}} \in {P_{N}}} \}, $$

where \({P_{N}}\) is a polynomial space of dimension less than or equal to N. Basis functions are considered as the Lagrangian interpolation polynomials defined at Gauss–Lobatto integration points on each element. If \(N_{e} = 1\), then we obtain the spectral Galerkin method of order \(N-1\). If \(N = 1\) or \(N = 2\), then we obtain a standard Galerkin finite element method based on linear and quadratic elements, respectively.

Now on each element \(\varOmega _{e}\), we define the approximate solution of order N as

$$\begin{aligned} {u^{e}} ( {x,t} ) = \sum_{j = 0}^{N} {u_{j}^{e} ( t ){\varphi _{j}} ( x )} , \quad 1 \le e \le {N_{e}}, \end{aligned}$$
(2)

where \({\varphi _{j}}\) is the jth Lagrange polynomial of order N on the Gauss–Legendre–Lobatto points \(\{ {{\xi _{i}}} \} _{i = 0}^{N}\) [32]:

$$ {\varphi _{j}} ( \xi ) = \frac{1}{{N ( {N + 1} ) {L_{N}} ( {{\xi _{j}}} )}}\frac{{ ( {{\xi ^{2}} - 1} ) {{L'}_{N}} ( \xi )}}{{\xi - {\xi _{j}}}}, \quad 0 \le j \le N, - 1 \le \xi \le 1, $$

and \(L_{N}\) is the Legendre polynomial of order N.

To convert the \([-1,1 ]\) to the eth element and its inverse, we use the mapping functions

$$\begin{aligned}& x ( \xi ) = \frac{{ ( {{x_{e}} - {x_{e - 1}}} ) \xi }}{2} + \frac{{{x_{e}} + {x_{e - 1}}}}{2}, \quad - 1 \le \xi \le 1, \\& \xi ( x ) = \frac{{2x - ( {{x_{e}} + {x_{e - 1}}} )}}{ {{x_{e}} - {x_{e - 1}}}}, \quad {x_{e - 1}} \le x \le {x_{e}}, \end{aligned}$$

where \(x_{e}\) and \(x_{e-1}\) are the endpoints of the eth element. The stiffness [33] and mass matrices [34] on each element are calculated as follows:

$$\begin{aligned}& {S_{ij}^{e} = \int _{{x_{e - 1}}}^{{x_{e}}} \varphi '_{i} ( x )\varphi '_{j} ( x )\,dx = \frac{2}{{{h_{e}}}} \int _{ - 1}^{1} \varphi '_{i} ( \xi )\varphi ' _{j} ( \xi )\,d\xi ,} \\& {M_{ij}^{e} = \int _{{x_{e - 1}}}^{{x_{e}}} {{\varphi _{i}} ( x ) { \varphi _{j}} ( x )\,dx} = \frac{{{h_{e}}}}{2} \int _{ - 1} ^{1} {{\varphi _{i}} ( \xi ){ \varphi _{j}} ( \xi )\,d\xi } ,} \end{aligned}$$

where

$$ h_{e}=x_{e}-x_{e-1}. $$

Using the Gauss quadrature, we obtain [35]

$$\begin{aligned}& S_{ij}^{e} = \frac{2}{{{h_{e}}}}\sum _{k = 0}^{N} {{d_{ik}} {d_{jk}} {w_{k}}} , \\& {M_{ij}^{e} = \frac{{{h_{e}}}}{2}{\delta _{ij}} {w_{i}}}, \end{aligned}$$

where

$$ {w_{k}} = \frac{2}{{N ( {N + 1} ){{ [ {{L_{N}} ( {{t_{k}}} )} ]}^{2}}}},\quad 0 \le k \le N, $$

and

$$\begin{aligned}& {{d_{ik}} = \frac{{{L_{N}} ( {{\xi _{k}}} )}}{{{L_{N}} ( {{\xi _{i}}} )}}\frac{1}{{{\xi _{k}} - {\xi _{i}}}},\quad i \ne k,} \\& {{d_{ii}} = \frac{{{{L'}_{N}} ( {{\xi _{i}}} )}}{{2{L_{N}} ( {{\xi _{i}}} )}}. } \end{aligned}$$

2.2 Space discretization of the sine-Gordon equation

We obtain the weak form of Eq. (1) as follows. For each element \(\varOmega _{e}\), we find \({u^{e}} \in {U^{h}}\) such that

$$ \int _{{\varOmega _{e}}} {u_{tt}^{e}v\,dx} + \int _{{\varOmega _{e}}} {u_{x}^{e}{v_{x}}\,dx} = - \int _{{\varOmega _{e}}} {\sin \bigl( {{u^{e}}} \bigr)v\,dx} ,\quad v \in {U^{h}}, 1 \le e \le {N_{e}}. $$

The second integral on the left-hand side is obtained by integration by parts. Now, taking the kth Lagrange function of order N as the test function v and using Eq. (2), we have

$$\begin{aligned}& \sum_{j = 0}^{N} { \frac{d}{{d{t^{2}}}} \biggl( {u_{j}^{e} \int _{{\varOmega _{e}}} {{\varphi _{j}} {\varphi _{k}}\,dx} } \biggr)} + \sum_{j = 0}^{N} {u_{j}^{e} \biggl( \int _{{\varOmega _{e}}} \varphi ' _{j} \varphi '_{k}\,dx \biggr)} \\& \quad = - \sum_{j = 0}^{N} {\sin \bigl( {u_{j}^{e}} \bigr) \biggl( { \int _{{\varOmega _{e}}} {{\varphi _{j}} {\varphi _{k}}\,dx} } \biggr)} . \end{aligned}$$
(3)

We obtain the right-hand side of Eq. (3) using the following equation [36]:

$$ \sin \bigl( {{u^{e}}} \bigr) \cong \sum_{j = 0}^{N} {\sin \bigl( {u_{j}^{e}} \bigr){\varphi _{j}}} . $$

The matrix form of the semidiscrete form of Eq. (3) is

$$\begin{aligned} M^{e}U_{tt}^{e} ( t ) + S^{e}{U^{e}} ( t ) = - M^{e}\sin \bigl( {{U^{e}} ( t )} \bigr), \end{aligned}$$
(4)

where the vector \(U^{e}\) contains an approximation solution of order N on the element \(\varOmega _{e}\) at time t, \(M^{e}\) is a local diagonal mass matrix, and \(S^{e}\) is a local stiffness matrix on the element \(\varOmega _{e}\).

To obtain a semidiscrete form on the general domain, we must assemble the local matrices \(M^{e}\) and \(S^{e}\) and obtain the general matrices M and S [35]. So Eq. (4) becomes

$$\begin{aligned} M{U_{tt}} ( t ) + SU ( t ) = - M\sin \bigl( {U ( t )} \bigr), \end{aligned}$$
(5)

where U is the vector of the approximate solution on the general domain Ω at time t.

3 Time discretization

For full discretization of Eq. (5), we first divide the interval \((0,T )\) into subintervals \([t_{n},t_{n+1} ]\), where \({t_{0}} = 0\) and \(t_{n+1}=t_{n}+k\) for \(n=0,\ldots,N_{t}-1\). Now, using the leap-frog method, we obtain the full discrete form of Eq. (1):

$$\begin{aligned} M\frac{{{U_{n + 1}} - 2{U_{n}} + {U_{n - 1}}}}{{{k^{2}}}} + S{U_{n}} = - M\sin ( {{U_{n}}} ), \end{aligned}$$
(6)

where \(U_{n}\) is the vector of approximation solution at time \(t_{n}\). After simplifying, Eq. (6) becomes

M U n + 1 = ( 2 M − k 2 S ) U n − M U n − 1 − k 2 M sin ( U n ) , U 0 = [ u 0 ( 0 ) u 0 ( t 1 ) ⋮ u 0 ( t N t ) ] , d d t U 0 = [ u 1 ( 0 ) u 1 ( t 1 ) ⋮ u 1 ( t N t ) ] .
(7)

For \(n=0\), we have

$$ M{U_{1}} = \bigl( {2M - {k^{2}}S} \bigr){U_{0}} - M{U_{ - 1}} - {k^{2}}M\sin ( {{U_{0}}} ). $$

For calculation of \(U_{-1}\), we have

$$ \frac{d}{{dt}}{U_{0}} = \frac{{{U_{1}} - {U_{ - 1}}}}{{2k}}, $$

and thus

$$ {U_{ - 1}} = {U_{1}} - 2k\frac{d}{{dt}}{U_{0}}. $$

So, for \(n=0\), we have

$$\begin{aligned} 2M{U_{1}} = \bigl( {2M - {k^{2}}S} \bigr){U_{0}} + 2kM\frac{d}{ {dt}}{U_{0}} - {k^{2}}M\sin ( {{U_{0}}} ). \end{aligned}$$
(8)

For \(n>0\), we also have

$$\begin{aligned} M{U_{n + 1}} = \bigl( {2M - {k^{2}}S} \bigr){U_{n}} - M{U_{n - 1}} - {k^{2}}M\sin ( {{U_{n}}} ). \end{aligned}$$
(9)

Because the mass matrix M is diagonal, solving Eqs. (8) and (9) is easier than by similar methods.

4 Stability and convergence analysis

In this section, we analyze the stability of leap-frog method and the convergence of the spectral element method presented in the previous sections.

4.1 Stability of leap-frog method

Equation (9) can be written as

$$ {U_{n + 1}} = \bigl( {2I - {k^{2}}A} \bigr){U_{n}} + {F_{n,n - 1}}, $$

where

$$ A = {M^{ - 1}}S $$

and

$$ {F_{n,n - 1}} = - {U_{n - 1}} + {k^{2}}\sin ( {{U_{n}}} ). $$

Since \(F_{n,n - 1}\) is a known vector at each step and does not play any role in the stability analysis, we need to consider the equation

$$\begin{aligned} {U_{n + 1}} = \bigl( {2I - {k^{2}}A} \bigr){U_{n}}. \end{aligned}$$
(10)

Theorem 4.1

Equation (10) is stable under the following condition:

$$ {C^{*}} {N^{ - 1}} \le {k^{2}} \le \tilde{C} {N^{ - 3}} {h^{2}},\quad h = \max_{1 \le e \le {N_{e}}} {h_{e}}. $$

Proof

We must show that

$$ \bigl\Vert {2I - {k^{2}}A} \bigr\Vert _{2}^{2} = \rho \bigl( {2I - {k ^{2}}A} \bigr) \le 1. $$

If \(\mu _{i}\) are the eigenvalues of the diagonal matrix M and \(\lambda _{i}\) are the eigenvalues of the matrix S, then \({\frac{ {{\lambda _{i}}}}{{{\mu _{i}}}}}\) are the eigenvalues of the matrix A. We must show that

$$ \biggl\vert {2I - {k^{2}}\frac{{{\lambda _{i}}}}{{{\mu _{i}}}}} \biggr\vert \le 1. $$

From this inequality we obtain

$$\begin{aligned} {k^{ - 2}} \le \frac{{{\lambda _{i}}}}{{{\mu _{i}}}} \le 3{k^{ - 2}}. \end{aligned}$$
(11)

According to [37], we have that

$$\begin{aligned}& {C_{1}} {N^{ - 1}}h \le {\lambda _{i}} \le {C_{2}} {N^{2}} {h^{ - 1}}, \\& {C_{3}} {N^{ - 2}}h \le {\mu _{i}} \le {C_{4}} {N^{ - 1}} {h^{ - 2}}, \end{aligned}$$

and, consequently,

$$ {C_{5}}N \le \frac{{{\lambda _{i}}}}{{{\mu _{i}}}} \le {C_{6}} {N^{3}} {h^{ - 2}}. $$

According to Eq. (11),

$$ {C^{*}} {N^{ - 1}} \le {k^{2}} \le \tilde{C} {N^{ - 3}} {h^{2}} . $$

 □

4.2 Convergence of spectral element method

In [38] the convergence theorem is presented for the spectral element method for acoustic waves.

Theorem 4.2

([38])

Suppose that \(u \in {C^{2}} ( {0,T;{H^{s}} ( \varOmega )} ) \cap {C^{4}} ( {0,T;{L^{2}} ( \varOmega )} )\) is the exact solution of

$$ M\frac{{{u_{n + 1}} - 2{u_{n}} + {u_{n - 1}}}}{{{k^{2}}}} + S{u_{n}} = 0 $$

and U is the approximation result of the spectral element method under stability conditions on k. Then, for all \(t_{n} > 0\), we have

$$ { \bigl\Vert {u ( {{t_{n}}} ) - {U_{n}}} \bigr\Vert _{{L^{2}} ( \varOmega )}} \le O \bigl( {{h^{\min ( {N,s} )}} {N^{ - s}} + {k^{2}}} \bigr). $$

5 Numerical results

In this section, we consider a numerical example to validate the proposed scheme. The accuracy of the scheme is verified in the \(L_{2}\) and \(L_{\infty }\) norms and root mean square errors.

We set

$$\begin{aligned}& {{L_{2}}\operatorname{err}( {{t_{n}}} ) \equiv {{ \bigl\Vert {u ( {{t_{n}}} ) - {U_{n}}} \bigr\Vert }_{2}}}, \\& {{L_{\infty }}\operatorname{err}( {{t_{n}}} ) \equiv {{ \bigl\Vert {u ( {{t_{n}}} ) - {U_{n}}} \bigr\Vert }_{\infty }},} \\& {RMS\operatorname{err}( {{t_{n}}} ) = \frac{{{L_{2}}\operatorname{err}( {{t_{n}}} )}}{{{N_{e,N}} + 1}},} \end{aligned}$$

where \(N_{e,N}\) are all nodes of the domain, and \(U_{n}\) is the vector of nodal values of the numerical solution corresponding to the discretization parameters N, \(N_{e}\), and k at time \(t_{n}\), and for each continuous function f,

$$\begin{aligned}& \Vert f \Vert _{2} = \sqrt{\sum _{r = 1}^{{N_{e,N}}} {{f^{2}} ( {{x_{r}}} )} } , \\& {{{ \Vert f \Vert }_{\infty }} = \mathop{\max } _{1 \le r \le {N_{e,N}}} \bigl\vert {f ( {{x_{r}}} )} \bigr\vert .} \end{aligned}$$

Example 5.1

We consider the equation

$$\begin{aligned}& \begin{aligned} &{u_{tt}} - {u_{xx}} + \sin ( u ) = 0, \quad - 20 \le x \le 20, t \ge 0, \\ &{u_{x}} ( { - 20,t} ) = u ( {20,t} ) = 0, \quad t \ge 0, \\ &u ( {x,0} ) = 4\arctan \biggl( {c\sinh \biggl( {\frac{x}{ {\sqrt{1 - {c^{2}}} }}} \biggr)} \biggr), \quad - 20 \le x \le 20, c = 0.2, \\ &{u_{t}} ( {x,0} ) = 0, \quad - 20 \le x \le 20, \end{aligned} \end{aligned}$$
(12)

and the exact solution is given by

$$\begin{aligned} u ( {x,t} ) = 4\arctan \biggl( {c\sinh \biggl( {\frac{ {\frac{x}{{\sqrt{1 - {c^{2}}} }}}}{{\cosh (\frac{{ct}}{{\sqrt{1 - {c^{2}}} }}}}} \biggr)} \biggr), \quad -20\le x \le 20, t \ge 0. \end{aligned}$$
(13)

We solve this problem with the Legendre spectral element method presented in this paper with several values of N, k, and \(N_{e}\) at final time \(T = 1\). Table 1 shows the errors of Legendre spectral element method with several values of N at final time \(T = 1\) with \(k=0.1, 0.01\) and \({N_{e}}=20\).

Table 1 Numerical results for sine-Gordon equation Example 5.1 with \(N{_{e}}=20\) and \(T=1\)

Table 2 shows the maximum pointwise error \(\vert {u_{ \mathrm{exact}}-u_{\mathrm{LSEM}}} \vert \) at several times \(T=1,2, \ldots,10\) with \(N =4\), \(N{_{e}}=20\), and \(k=0.01\).

Table 2 Maximum pointwise error at several times for sine-Gordon equation in Example 5.1 with \(N =4\), \(N_{e}=20\), and \(k=0.01\)

Figures 1 and 2 show graphs of approximate solution and absolute error and Fig. 3 shows graph of approximate and exact solution at \(T = 1\), using present method with \(N = 4\), \({N_{e}} =20\) and \(k = 0.1\).

Figure 1
figure 1

LSEM approximation for sine-Gordon equation for Example 5.1 with \(N = 4\), \(N_{e} = 20\), and \(k=0.1\) for \(t\le 1\)

Figure 2
figure 2

Absolute error for sine-Gordon equation for Example 5.1 with \(N = 4\), \(N_{e} = 20\), and \(k=0.1\)

Figure 3
figure 3

Comparison between the LSEM and exact solutions for Example 5.1 at \(T = 1\) with \(N =4\), \(N_{e}=20\) and \(k = 0.1\)

In the following figures (4, 5, and 6) we have used a logarithmic scale for both axes. In Fig. 4, we show the RMSerr as a function of the degree of the polynomials N for two fixed values of k (\(k = 0.1,0.01\)) and \(N_{e} = 20\).

Figure 4
figure 4

The RMSerr as a function of N, \(k = 0.1, 0.01\) for Example 5.1

Figure 5
figure 5

The RMSerr as a function of k: \(N = 7\), \(N_{e} = 20\) for Example 5.1

Figure 6
figure 6

The RMSerr as a function of \(N_{e}\): \(N = 4\), \(k = 0.1,0.01\) for Example 5.1

In Fig. 5, we report the quantity RMSerr for k ranging from 0.001 to 0.1 and fixed \(N = 7\) and \(N_{e} = 20\).

Figure 6 shows the RMSerr as a function of \(N_{e}\) for two fixed values of k (\(k= 0.1, 0.01\)) and \(N = 4\).

Example 5.2

In this example, we obtain the numerical solutions of Eq. (1) the computational domain \(\varOmega = [-1,1 ]\) with the initial conditions

$$\begin{aligned}& \begin{aligned} &u ( {x,0} ) = 0, \\ &{u_{t}} ( {x,0} ) = 4\operatorname{sech}( x ). \end{aligned} \end{aligned}$$
(14)

The analytical solution is given in [39] as

$$\begin{aligned} u ( {x,t} ) = 4\arctan \bigl( {t\cdot \operatorname{sech}( x )} \bigr). \end{aligned}$$
(15)

The boundary conditions are obtained from the exact solution. We compute the numerical solution in the domain \(\varOmega = [-1,1 ]\) with several values of N, k, \(N_{e}\), and time t. The obtained results are compared with the results in [18, 30, 31]. Table 3 shows the results at the different time levels. It can be seen from Table 3 that the present results are in good agreement with those in the literature. A graph comparing the exact and numerical solutions at \(T = 1\) with \(N=4\), \(k=0.01\), and \(N_{e}=20\) is depicted in Fig. 7. We also draw the space-time graph of approximate solution for \(t\le 2\) in Fig. 8 with \(N = 2\), \(N_{e} = 10\), and \(k = 0.01\).

Figure 7
figure 7

Comparison between the LSEM and exact solutions for Example 5.2 at \(t = 1\) with \(N =4\), \(N_{e}=20\), and \(k = 0.01\)

Figure 8
figure 8

LSEM approximation for sine–Gordon equation Example 5.2 with \(N = 2\), \(N_{e} = 10\), and \(k=0.01\) for \(t\le 2\)

Table 3 Comparison of \(L_{2 }\operatorname{err}\) and \(L_{\infty }\operatorname{err}\) of Example 5.2 with \(N = 7\), \(N_{e}=30\), and \(k=0.001\) at different time levels

Example 5.3

Consider the sine-Gordon equation (1) in the range \(\varOmega = [-10,10 ]\) with the initial conditions

$$\begin{aligned} \textstyle\begin{cases} u ( {x,0} ) = 0, \\ {u_{t}} ( {x,0} ) = 4\gamma \operatorname{sech}( {\gamma x} ), \end{cases}\displaystyle \end{aligned}$$
(16)

where \(c=0.5\) is the velocity of solitary wave, and \(\gamma = \frac{1}{ {\sqrt{1 + {c^{2}}} }}\). The exact solution [31] is given as

$$\begin{aligned} u ( {x,t} ) = 4\arctan \bigl( {{c^{ - 1}}\sin ( {\gamma ct} )\operatorname{sech}( { \gamma x} )} \bigr). \end{aligned}$$
(17)

The boundary conditions can be obtained from the exact solution. The numerical solution for Example 5.3 is computed in the domain \([-10, 10 ]\) using the parameter values \(N = 7\), \(N_{e}=30\), and \(k=0.001\). Computed results are compared with the results obtained in [30, 31, 40]. Table 4 shows \(L_{2}\operatorname{err}\) and \(L_{\infty }\operatorname{err}\) at different time levels. From Table 4 we can see that the present results are in good agreement with those of [31, 40], but it has more errors than [30]. Figure 9 shows the comparison between the numerical and exact solutions at \(t = 1\) with \(N=3\), \(N_{e}=30\), and \(k=0.01\). In Fig. 10, we show the space-time graph of approximate solution for \(t\le 10\) using the present method with \(N = 3\), \(N_{e} = 30\), and \(k = 0.1\).

Figure 9
figure 9

Comparison between the LSEM and exact solutions for Example 5.3 at \(t = 1\) with \(N =3\), \(N_{e}=30\) and \(k = 0.01\)

Figure 10
figure 10

LSEM approximation for sine-Gordon equation Example 5.3 with \(N = 3\), \(N_{e} = 30\) and \(k=0.1\), for \(t\le 10\)

Table 4 Comparison of the \(L_{2}\operatorname{err}\) and \(L_{\infty }\operatorname{err}\) of Example 5.3 with \(N = 7\), \(N_{e}=30\), and \(k=0.001\) at different time levels

6 Conclusion and discussion

The spectral polynomials are useful tools for solving ordinary and partial differential equations. Also, the incorporation of the finite element method with spectral polynomials, that is, the use of spectral polynomials as new shape functions in the finite element method is very efficient for obtaining a numerical algorithm with high accuracy. In this paper, we constructed a Legendre spectral element method for the solution of the one-dimensional sine-Gordon equation. We used the Legendre spectral element method for discretizing the spatial space. Also, we used a leap-frog scheme for discretizing the temporal space with the stability condition \({C^{*}}{N^{ - 1}} \le {k^{2}} \le \tilde{C}{N^{ - 3}}{h^{2}}\). We presented theorems on the stability and convergence. Finally, using one test problem, we demonstrated that the algorithm is efficient for obtaining approximation solutions of the sine-Gordon equation.

References

  1. Vosse, F.N., Minev, P.D.: Spectral Element Methods: Theory and Applications. Eindhoven University of Technology, EUT Report 96-w-001 (1996)

  2. Courant, R.: Variational method for the solution of problems of equilibrium and vibration. Bull. Am. Math. Soc. 49, 1–23 (1943)

    Article  MathSciNet  Google Scholar 

  3. Patera, A.T.: A spectral element method for fluid dynamics: laminar flow in a channel expansion. J. Comput. Phys. 54, 468–488 (1984)

    Article  Google Scholar 

  4. Maday, Y., Patera, A.T.: Spectral Element Methods for the Incompressible Navier–Stokes Equations, Surveys on Computational Mechanics. ASME, New York (1989)

    Google Scholar 

  5. Bathe, K.J.: Finite Element Procedures, 2nd edn. Prentice Hall International, Englewood Cliffs (1995)

    MATH  Google Scholar 

  6. Priolo, E., Seriani, G.A.: A numerical investigation of Chebyshev spectral element method for acoustic wave propagation. In: Proceedings of the 13th IMACS Conference Comparat, vol. 54, pp. 154–172 (1991)

    Google Scholar 

  7. Chen, Y., Yi, N., Liu, W.: A Legendre–Galerkin spectral method for optimal control problems governed by elliptic equations. SIAM J. Numer. Anal. 46, 2254–2275 (2008)

    Article  MathSciNet  Google Scholar 

  8. Zeng, F., Ma, H., Zhao, T.: Alternating direction implicit Legendre spectral element method for Schrödinger equations. J. Shanghai Univ. Nat. Sci. Ed. 17(6), 724–727 (2011)

    MATH  Google Scholar 

  9. Giraldo, F.X.: Strong and weak Lagrange–Galerkin spectral element methods for the shallow water equations. Comput. Math. Appl. 45, 97–121 (2003)

    Article  MathSciNet  Google Scholar 

  10. Zampieri, E., Pavarino, L.F.: Approximation of acoustic waves by explicit Newmark’s schemes and spectral element methods. J. Comput. Appl. Math. 185, 308–325 (2006)

    Article  MathSciNet  Google Scholar 

  11. VanOs, R.G., Phillips, T.N.: The choice of spectral element basis functions in domains with an axis of symmetry. J. Comput. Appl. Math. 201, 217–229 (2007)

    Article  MathSciNet  Google Scholar 

  12. Xu, C., Maday, Y.: A spectral element method for the time-dependent two-dimensional Euler equations: applications to flow simulations. J. Comput. Appl. Math. 91, 63–85 (1998)

    Article  MathSciNet  Google Scholar 

  13. Zhuang, Q., Chen, L.: Legendre–Galerkin spectral-element method for the biharmonic equations and its applications (in press)

  14. Khan, A., Upadhyay, C.S., Gerritsma, M.: Spectral element method for parabolic interface problems. Comput. Methods Appl. Mech. Eng. (2018). https://doi.org/10.1016/j.cma.2018.03.011

    Article  MathSciNet  Google Scholar 

  15. Ai, Q., Li, H.Y., Wang, Z.Q.: Diagonalized Legendre spectral methods using Sobolev orthogonal polynomials for elliptic boundary value problems. Appl. Numer. Math. (2018). https://doi.org/10.1016/j.apnum.2018.01.003

    Article  MathSciNet  MATH  Google Scholar 

  16. Wang, Y., Qin, G., Wang, Z.Q.: An improved time-splitting method for simulating natural convection heat transfer in a square cavity by Legendre spectral element approximation. Comput. Fluids (2018). https://doi.org/10.1016/j.compfluid.2018.07.013

    Article  MathSciNet  MATH  Google Scholar 

  17. Wazwaz, A.M.: A variable separated ODE method for solving the triple sine-Gordon and the triple sinh-Gordon equations. Chaos Solitons Fractals 33, 703–710 (2007)

    Article  MathSciNet  Google Scholar 

  18. Dehghan, M., Shokri, A.: A numerical method for one-dimensional nonlinear sine-Gordon equation using collocation and radial basis functions. Numer. Methods Partial Differ. Equ. 24, 687–698 (2008)

    Article  MathSciNet  Google Scholar 

  19. Dehghan, M., Mirzaei, D.: The boundary integral equation approach for numerical solution of the one-dimensional sine-Gordon equation. Numer. Methods Partial Differ. Equ. 24, 1405–1415 (2008)

    Article  MathSciNet  Google Scholar 

  20. Mohebbi, A., Dehghan, M.: High order solution of one-dimensional sine-Gordon equation using compact finite difference and DIRKN methods. Math. Comput. Model. 51, 537–549 (2010)

    Article  MathSciNet  Google Scholar 

  21. Deconinck, B., McGil, P., Sega, B.L.: The stability spectrum for elliptic solutions to the sine-Gordon equation. Physica D 360, 17–35 (2017)

    Article  MathSciNet  Google Scholar 

  22. Yousif, M.A., Mahmood, B.A.: Approximate solutions for solving the Klein–Gordon and sine-Gordon equations. J. Assoc. Arab Univ. Basic Appl. Sci. 22, 83–90 (2017)

    Google Scholar 

  23. Jiang, C., Sun, J., Li, H., Wang, Y.: A fourth-order AVF method for the numerical integration of sine-Gordon equation. Appl. Math. Comput. 313, 144–158 (2017)

    MathSciNet  Google Scholar 

  24. Baccouch, M.: Superconvergence of the local discontinuous Galerkin method for the sine-Gordon equation in one space dimension. J. Comput. Appl. Math. 333, 292–313 (2018)

    Article  MathSciNet  Google Scholar 

  25. Shao, W., Wu, X.: The numerical solution of the nonlinear Klein–Gordon and sine-Gordon equations using the Chebyshev tau meshless method. Comput. Phys. Commun. 185, 1399–1409 (2014)

    Article  MathSciNet  Google Scholar 

  26. Hussain, A., Haq, S., Uddin, M.: Numerical solution of Klein–Gordon and sine-Gordon equations by meshless method of lines. Eng. Anal. Bound. Elem. 37, 1355–1366 (2013)

    Article  MathSciNet  Google Scholar 

  27. Jiang, Z.W., Wang, R.H.: Numerical solution of one-dimensional sine-Gordon equation using high accuracy multiquadric quasi-interpolation. Appl. Math. Comput. 218, 7711–7716 (2012)

    MathSciNet  MATH  Google Scholar 

  28. Keskin, Y., Aglar, I., Ko, A.: Numerical solution of sine-Gordon equation by reduced differential transform method, vol. 1 (2011)

  29. Taleei, A., Dehghan, M.: A pseudo-spectral method that uses an overlapping multidomain technique for the numerical solution of sine-Gordon equation in one and two spatial dimensions. Math. Methods Appl. Sci. 37, 1909–1923 (2014)

    Article  MathSciNet  Google Scholar 

  30. Shukla, H.S., Tamsir, M.: Numerical solution of nonlinear sine-Gordon equation by using the modified cubic B-spline differential quadrature method. Beni-Suef Univ. J. Basic Appl. Sci. 7(4), 359–366 (2018)

    Article  Google Scholar 

  31. Mittal, R.C., Bhatia, R.: Numerical solution of nonlinear sine-Gordon equation by modified cubic B-spline collocation method. Int. J. Partial Differ. Equ. (2014). https://doi.org/10.1155/2014/343497

    Article  MATH  Google Scholar 

  32. Hesthaven, J.S., Gottlieb, S., Gottlieb, D.: Spectral Method for Time-Dependent Problems. Cambridge University Press, Cambridge (2007)

    Book  Google Scholar 

  33. Ern, A., Guermond, J.L.: Theory and Practice of Finite Elements. Springer, New York (2004)

    Book  Google Scholar 

  34. Hand, L.N., Finch, J.D.: Analytical Mechanics. Cambridge University Press, Cambridge (2008)

    Google Scholar 

  35. Pozrikidis, C.: Introduction to Finite and Spectral Element Methods Using Matlab. Chapman & Hall, London (2005)

    MATH  Google Scholar 

  36. Argyris, J., Haase, M., Heinrich, J.C.: Finite element approximation to two dimensional sine-Gordon solitons. Comput. Methods Appl. Mech. Eng. 86, 1–26 (1991)

    Article  MathSciNet  Google Scholar 

  37. Bernardi, C., Maday, Y.: Approximations Spectrales de Problèmes aux Limites Elliptiques. Springer, Berlin (1992)

    MATH  Google Scholar 

  38. Zampieri, E., Pavarino, L.F.: An explicit second order spectral element method for acoustic waves. Adv. Comput. Math. 25, 381–401 (2006)

    Article  MathSciNet  Google Scholar 

  39. Wei, G.W.: Discrete singular convolution for the sine-Gordon equation. Physica D 137, 247–259 (2000)

    Article  MathSciNet  Google Scholar 

  40. Bratsos, A.G.: A fourth order numerical scheme for the one dimensional sine-Gordon equation. Int. J. Comput. Math. 85, 1083–1095 (2008)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

The authors are thankful to the honorable reviewers and editors for their valuable suggestions and comments, which improved the paper.

Availability of data and materials

The results and numerical data obtained in this paper have been fully tested. These results are obtained using MATLAB R2017a(win64) software and Windows 8 operating system on a intel(R) Core(TM) i7 CPU, 1.73 GHz processor with 4 GB RAM. The authors declare that all data and material in the paper are available and veritable.

Funding

Not applicable.

Author information

Authors and Affiliations

Authors

Contributions

Both authors contributed equally and significantly in writing this article. Both authors wrote, read, and approved the final manuscript.

Corresponding author

Correspondence to Mahmoud Lotfi.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lotfi, M., Alipanah, A. Legendre spectral element method for solving sine-Gordon equation. Adv Differ Equ 2019, 113 (2019). https://doi.org/10.1186/s13662-019-2059-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13662-019-2059-7

MSC

Keywords