(21)

Equation (20) and (21) can be written as matrix form

(22)

where A and B are and matrices, respectively.

Again using the first and second initial conditions given in Equation (14), we have

(23)

and

(24)

Equation (24) can be written as

Equation (22) using Equation (23) gives a linear system of equations with unknown and equations, which can be solved to find in each step so the unknown function in any time can be found. Moreover, we defined the error bound for and as

where and.

5. Numerical Results and Discussions

In this section, we use Chebyshev wavelets spectral collocation method described in section 4 to solve nonlinear type of Klein-Gordon and Sine-Gordon equations. The proposed method provides a reliable technique which is computer oriented if compared with traditional techniques. To give the clear overview of this method we consider three examples of Klein-Gordon equation and Sine-Gordon equation. All the results are calculated by using the symbolic calculus software MATLAB 2013a and Mathematica.

Example 1 [25] We consider the nonlinear Klein-Gordon Equation (13) with, and in the interval with the initial conditions

and the Dirichlet boundary condition

The analytical solution is given by

The obtained and errors of Example 1 at step size 0.0001 is presented in comparison with the existing method in Table 1 and Table 2 for and and graphically shown in Figure 1 for. It is evident from Table 1, Table 2 and Figure 1 that the solutions obtain by using CWSCM are in good agreement and are better than the results obtained by existing method presented in [25] . However, the errors may be reduced significantly if we increase level of resolution.

Table 1. and error of Example 1 at and compared with [25] .

Table 2. and error of Example 1 at and compared with [25] .

Figure 1. Comparison of exact solution with approximate solution for Example 1 at.

Example 2 [25] We consider the nonlinear Klein-Gordon Equation (13) with, and in the interval with the initial con- ditions

and the Dirichlet boundary condition

The analytical solution is given by

The and errors of Example 2 at step size 0.0001 are presented in com- parison with the existing method in Table 3 and Table 4 for and . From Table 3, Table 4 and Figure 2, it is clear that CWSCM performs much better than existing methods [25] and with the increase in number of collocation points the errors decrease for the solution.

Table 3. and error of Example 2 at and compared with [25] .

Table 4. and error of Example 2 at and compared with [25] .

Example 3 [20] Consider the following nonlinear Sine-Gordon equation

where, and the initial conditions

and the Dirchlet boundary conditions

The exact solution is given by

Figure 2. Comparison of exact solution with approximate solution for Example 2 at.

The numerical solution of Sine-Gordon equation has presented in Table 5 which shows the comparison of the errors of the present method with the exact solution. It is obvious from the table that the present method is more accurate, simple and fast. Comparison between an exact and approximate solution is shown in Figure 3.

6. Concluding Remarks

In this article, we have proposed an efficient and accurate method based on Chebyshev wavelets to solve both Klein-Gordon and Sine-Gordon equations arising in different field of sciences, engineering and technology. The main advantage of this method is that it transforms the problem into algebraic equation so that the computation is effective and simple. To appraise the performance and efficiency of the method, three benchmark problems are included and discussed. The numerical results are compared with a few existing methods reported recently in the literature. The numerical experi- ments confirm that the spectral method coupled with Chebyshev wavelets is superior to other existing ones.

Table 5. and error of Example 3 at and 4.

Figure 3. Comparison of exact solution with approximate solution for Example 3 at.

Acknowledgements

We thank the Editor and the referee for their comments.

Cite this paper

Iqbal, J. and Abass, R. (2016) Numerical Solution of Klein/Sine-Gordon Equations by Spectral Method Coupled with Chebyshev Wavelets.*Applied Mathematics*, **7**, 2097-2109. doi: 10.4236/am.2016.717167.

Iqbal, J. and Abass, R. (2016) Numerical Solution of Klein/Sine-Gordon Equations by Spectral Method Coupled with Chebyshev Wavelets.

References

[1] Dehghan, M. and Shokri, A. (2009) Numerical Solution of the Nonlinear Klein-Gordon Equation Using Radial Basis Functions. Journal of Computational and Applied Mathematics, 230, 400-410.

http://dx.doi.org/10.1016/j.cam.2008.12.011

[2] Dehghan, M., Mohebbi, A. and Asghari, Z. (2009) Fourth-Order Compact Solution of the Nonlinear Kleingordon Equation. Numerical Algorithms, 52, 523-540.

http://dx.doi.org/10.1007/s11075-009-9296-x

[3] Wazwaz, A.M. (2005) The Tanh and the Sine-Cosine Methods for Compact and Noncompact Solutions of the Nonlinear Klein-Gordon Equation. Applied Mathematics and Computation, 167, 1179-1195.

http://dx.doi.org/10.1016/j.amc.2004.08.006

[4] Duncan, D.B. (1997) Symplectic Finite Difference Approximations of the Nonlinear Klein-Gordon Equation. SIAM Journal on Numerical Analysis, 34, 1742-1760.

http://dx.doi.org/10.1137/S0036142993243106

[5] Grella, G. and Marinaro, M. (1978) Special Solutions of the Sine-Gordon Equation in 2 + 1 Dimensions. Lettere al Nuovo Cimento, 23, 459-464.

http://dx.doi.org/10.1007/BF02770537

[6] Koshelev, A.E. (2010) Stability of Dynamic Coherent States in Intrinsic Josephson-Junction Stacks near Internal Cavity Resonance. Physical Review B, 82, 174-512.

http://dx.doi.org/10.1103/PhysRevB.82.174512

[7] Krasnov, V.M. (2010) The Emission form Intrinsic Josephson Junctions at Zeros Magnetic Field via Breather Auto-Oscillations. Physical Review B, 83, 174-512.

[8] El-Sayed, S.M. (2003) The Decomposition Method for Studying the Klein-Gordon Equation. Chaos Solitons & Fractals, 18, 1025-1030.

http://dx.doi.org/10.1016/S0960-0779(02)00647-1

[9] Batiha, B., Noorani, M.S.M. and Hashim, I. (2007) Numerical Solution of Sine-Gordon Equation by Variational Iteration Method. Physics Letters A, 370, 437-440.

http://dx.doi.org/10.1016/j.physleta.2007.05.087

[10] Shakeri, F. and Dehghan, M. (2008) Numerical Solution of the Klein Gordon Equation via He’s Variational Iteration Method. Nonlinear Dynamics, 51, 89-97.

http://dx.doi.org/10.1007/s11071-006-9194-x

[11] Dehghan, M. and Shokri, A. (2008) A Numerical Method for One-Dimensional Nonlinear Sine-Gordon Equation Using Collocation and Radial Basis Functions. Numerical Methods for Partial Differential Equations, 24, 687-698.

http://dx.doi.org/10.1002/num.20289

[12] Sirendaoreji (2007) Auxiliary Equation Method and New Solutions of Klein-Gordon Equations. Chaos, Solitons & Fractals, 31, 943-950.

http://dx.doi.org/10.1016/j.chaos.2005.10.048

[13] Guo, B.-Y., Xun, L. and Vazquez, L. (1996) A Legendre Spectral Method for Solving the Nonlinear Klein-Gordon Equation. The Journal of Computational and Applied Mathematics, 15, 19-36.

[14] Li, X. and Guo, B. Y. (1997) A Legendre Spectral Method for Solving the Nonlinear Klein-Gordon Equation. Journal of Computational Mathematics, 15, 105-126.

[15] Sweilam, N.H., et al. (2016) New Spectral Second Kind Chebyshev Wavelets Scheme for Solving Systems of Integro-Differential Equations. International Journal of Applied and Computational Mathematics, 4, 29-51.

[16] Hariharan, G. (2011) Haar Wavelet Method for Solving the Klein-Gordon and the Sine-Gordon Equations. International Journal of Nonlinear Sciences, 11, 180-189.

[17] Yin, F., Song, J. and Lu, F. (2014) A Coupled Method of Laplace Transform and Legendre Wavelets for Nonlinear Klein-Gordon Equations. Mathematical Methods in the Applied Sciences, 37, 781-791.

http://dx.doi.org/10.1002/mma.2834

[18] Iqbal J. and Abass R. (2016) Numerical Solution of Hammerstein Integral Equation Using Chebyshev Wavelet Method. Journal of Mathematical and Computational Science.

[19] Guo, B.Y., Li, X. and Vazquez, L. (1996) A Legendre Spectral Method for Solving the Nonlinear Klein-Gordon Equation. Applied Mathematics and Computation, 15, 19-36.

[20] Fukang, Y., et al. (2015) Spectral Methods Using Legendre Wavelets for Nonlinear Klein/ Sine-Gordon Equations. Journal of Computational and Applied Mathematics, 275, 321-334.

http://dx.doi.org/10.1016/j.cam.2014.07.014

[21] Babolian, E. and Fattahzadeh, F. (2007) Numerical Solution of Differential Equations by Using Chebyshev Wavelet Operational Matrix of Integration. Applied Mathematics and Computation, 188, 417-426.

http://dx.doi.org/10.1016/j.amc.2006.10.008

[22] Boggess, A. and Narcowich, F.J. (2001) A First Course in Wavelets with Fourier Analysis. John Wiley and Sons, Hoboken.

[23] Gu, J.S. and Jiang, W.S. (1996) The Haar Wavelets Operational Matrix of Integration. International Journal of Systems Science, 27, 623-628.

http://dx.doi.org/10.1080/00207729608929258

[24] Hosseini, S.Gh. and Mohammadi, F. (2011) A New Operational Matrix of Derivative for Chebyshev Wavelets and Its Applications in Solving Ordinary Differential Equations with Non Analytic Solution. Applied Mathematical Sciences, 5, 2537-2548.

[25] Lakestani, M. and Dehghan, M. (2010) Collocation and Finite Difference-Collocation Methods for the Solution of Nonlinear Klein-Gordon Equation. Computer Physics Communications, 181, 1392-1401.

http://dx.doi.org/10.1016/j.cpc.2010.04.006