Abstract
In this paper, we develop a numerical scheme that conserves the discrete energy for solving the Klein-Gordon equation with cubic nonlinearity. We prove theoretically that our scheme conserves not just discrete energy, but also other energy-like discrete quantities. In addition, we prove the convergence and the stability of the scheme. Finally, we present some numerical simulations to demonstrate the performance of our energy-conserving scheme.
1. Introduction
The Klein–Gordon equation is a well-studied equation in mathematical physics in terms of radiation theory, nonlinear optics and general relativity of scattering [1,2,3]. In particular, much work has been carried out on the Klein–Gordon equation with respect to wave collisions and resonance behavior [4]. Recently, we considered the Klein–Gordon equation with quintic nonlinearity from the analytical point of view and were able to obtain a number of new wave solutions [5]. In this paper, our focus is on the numerical study of the initial value problem of the Klein–Gordon equation with cubic nonlinearity
with the initial conditions
where and are arbitrary positive constants, and and are known smooth functions. Here, one should note that the non-local version of , where the dependence of previous time history is considered, gives a time-fractional nonlinear Klein–Gordon equation [6]. There have been a number of analytical and numerical studies to understand the solutions of nonlinear time and space-fractional Klein–Gordon equations [7,8,9,10,11]. The numerical studies have focused on various techniques to discretize the fractional derivatives. However, no special attention was given to the nonlinearities in the equations, as we do in Section 2.
In order to construct a numerical scheme for solving , we re-cast the initial value problem as the following initial boundary value problem:
with the initial conditions
and the boundary conditions
Here is negative, and is positive with and being large values so that the finite spatial domain mimics the infinite domain . Moreover, T can be large. In some cases, the boundary conditions may be replaced by
The boundary conditions at and for the problem correspond to the asymptotic conditions for of as x goes to and ∞. The solution of the initial boundary value problem – formally satisfies the following energy identity:
In the literature, one can find a number of numerical schemes with conservation properties for solving the nonlinear Klein–Gordon equation. For example, a three-level finite difference method that conserves energy was developed in [12], while other finite-difference algorithms that preserve energy or linear momentum were studied in [13]. In addition, there are schemes that were constructed using a variational iteration method [14,15], a homotopy-perturbation idea [16,17], radial basis functions [18], spline-collocation approach [19] and discrete Fourier transforms [20] to solve the Klein–Gordon equation under various conditions. Further, some of the recent studies on the nonlinear Klein–Gordon equation have involved making use of pseudo-spectral discretization methods [21], employing a differential quadrature method with cubic B-splines [22] and domain decomposition methods [23]. Other studies include making use of the sinc-collocation idea along with a discrete gradient method to study the Klein–Gordon–Schrödinger equation [24] and developing a higher order method for the Klein–Gordon equation employing a local discontinuous Galerkin method [25]. However, in [25], the numerical simulations were carried out only for the linear Klein–Gordon equation. In [26], energy-preserving schemes were constructed for higher dimensional Klein–Gordon equations using the discrete gradient method and Duhamel principle. In addition, there have been a couple of interesting analytical studies of the Klein–Gordon equation, one utilizing an operational matrix method with clique polynomials [27] and the other a series method using differential transforms [28].
Most of the existing numerical methods investigate the conservation of discrete energy only numerically. If one is to validate the numerical results of an energy conserving numerical scheme, it is important to prove theoretically that the scheme conserves the discrete energy. The work in [29] carried out a theoretical study of four explicit finite difference schemes for solving the Klein–Gordon equation. In the spirit of [29], this paper presents an implicit conservative finite difference scheme for the initial boundary value problem –. It should be noted that in [30] implicit finite difference schemes were studied for the coupled system of Klein–Gordon–Zakharov equations. Later, more work along the same lines was conducted in [31] for the same system. Even though there is some similarity, in contrast to those works, our study considers not just the conservation of the discrete energy, but other energy-like discrete quantities as well. A predictor–corrector idea is employed to deal with the nonlinearity which appears in the problem. Furthermore, we give some a priori estimates and then prove by the discrete energy method that the difference scheme is stable and second-order convergent. Some numerical results are presented to illustrate the theoretical results. Three-dimensional plots are displayed to demonstrate the sensitivity of the discrete energy and other discrete quantities to the choices of time steps, wave speed, and coefficients and .
2. Finite Difference Scheme and Its Conservation Law
Before we propose the conservative finite difference scheme for the Klein–Gordon equation with cubic nonlinearity –, we give some notations as follows when we discretize the space and time domains:
where h and are the step sizes of space and time, respectively. In addition, we define the following inner product and norms:
It should be noted that in the following, C stands for a general positive constant that may take different values on different occasions. In addition, for brevity, we omit the subscript 2 of .
Lemma 1.
For any two mesh functions and there is the identity
This lemma can be easily proved using the notational definitions directly.
Let be the difference approximation of at that is, In addition, assume that and
Now, we consider the following finite difference scheme for the Klein–Gordon equation with cubic nonlinearity –:
In order to employ the finite difference scheme , we need initial values at two different time levels. They are chosen from the initial conditions given in such that
making use of a fictitious time level .
The boundary conditions are as below.
It should be pointed out that our two-time-level split approximation of the nonlinear cubic term is very different than the standard nonlinear approximation. As will be seen later in Theorems 1 and 2, this split approximation makes the theoretical analysis easier.
In , the explicit forms of and are given as follows:
As noted before, the solution of the initial boundary-value problem – satisfies the following energy identity:
Now, we present some properties of our finite difference scheme.
Theorem 1.
The difference scheme – possesses the following property:
where
Proof.
Computing the inner product of with , we have
In the computation of the above equation, we have used the boundary conditions and Lemma 1.
Now, using the Taylor’s series expansions for and about we can easily show that
Here and is denoted by .
So, if the higher order terms of are neglected beyond , we have
Therefore, for the finite difference approximation of we obtain the relationship
In a similar fashion, we can obtain
Using these relationships for the finite difference approximations, we obtain
So, we have
where
This completes the proof of the theorem. □
Theorem 2.
The difference scheme – possesses the following invariant:
where
Proof.
Computing the inner product of with , we have
In the computation of Equation , we have used the boundary conditions and Lemma 1. By adding and subtracting , and to the left-hand side of Equation and rearranging the terms, we obtain
Hence, result follows from Equation . This completes the proof. □
Now, from Equations and , we can easily observe that
and therefore, it follows from that
Moreover, from Equation and Equation we have
or equivalently,
In addition, from Equation we obtain
Therefore, it follows from and that
Theorem 3.
The difference scheme – possesses the following property:
where
Moreover, if is given by Equation we have
Proof.
From and we have
In addition, from Equations , and we obtain
Hence, result follows from Equation , and result follows from Equation . This completes the proof. □
It should be pointed out that even though our numerical scheme (with two-time-level split approximation) is second order, it does not immediately follow that every discrete quantity that will be conserved will also be conserved up to second order. As we have shown in Theorems 1–3, if a discrete quantity, such as , or is defined using only the time level, then each one of them will be conserved up to order one. On the other hand, the discrete energy defined at two time levels n and is shown to be conserved (Theorem 2) without any order restrictions.
3. Some a Priori Estimates for the Numerical Solutions
In this section, we will obtain some a priori estimates for the numerical solutions of the scheme Our work makes use of the lemmas presented in [32].
Lemma 2
(Discrete Sobolev’s Estimate). For any discrete function on the finite interval there is the inequality
where ε and are two constants independent of and step length
Lemma 3
(Gronwall’s Inequality). Suppose that the nonnegative mesh functions satisfy the inequality
where are nonnegative constants. Then, for any there is
Theorem 4.
Assume that and
then the following estimates hold:
Proof.
From Equation we have
In addition, from Equation we obtain
Therefore, it follows from the last two equations that
Hence, we obtain
In addition, we can obtain the following estimate by Lemma 2:
This completes the proof. □
4. Convergence and Stability of the Difference Scheme
In this section, we will discuss the convergence and the stability of the difference scheme –. First, we define the truncation error by
Lemma 4.
Assume that the conditions of Theorem 4 are satisfied, and then the truncation error of the difference scheme – satisfies
By Taylor’s expansion, Lemma 4 can be proved directly. Moreover, we note that the approximation of the initial condition has the truncation error of order , which is consistent with the scheme.
Now, we are going to analyze the convergence of the difference scheme –. Let us set
Theorem 5.
Assume that the conditions of Lemma 4 are satisfied. Then the solution of the difference scheme – converges to the solution of the problem stated in – with order in the norm for
Proof.
Subtracting from , we obtain
Then computing the inner product of with , we have
where
and
Using Young’s inequality we have
and
where
Therefore,
where
and
So, we have
Let
then by and Lemma 4, we have
Summing up for n , we obtain
and hence, we have
Applying Gronwall’s inequality (Lemma , we obtain
Therefore, we obtain
From the discrete initial conditions, we know that and are of second-order accuracy, then
Hence, the following inequalities can be obtained by :
It follows from Lemma 2 that
This completes the proof of Theorem 5. □
It should be remarked that since our boundary value problem – involves second derivatives of in time and space, in order for the difference scheme – to be a consistent second order method in both time and space, foundational theory in numerical analysis dictates that (also, see [31]). If for example, , still the finite difference scheme – works, but now, it will be a consistent first order method in both time and space, i.e., is not an essential condition for the method to be consistent.
In the same way as above and under the conditions of Theorem 5, we can also prove that the solution of the difference scheme – is stable in the sense of norm .
5. Numerical Results
In this section, we will test the efficiency of our numerical scheme by considering a number of simulations. A predictor–corrector idea is employed to deal with the nonlinearity which appears in the problem.
Let us first define the “error” functions as
and
- Bell Solitary Wave Solution
We consider the following initial boundary value problem of the Klein–Gordon equation with cubic nonlinearity
subject to the initial conditions
and the homogenous Dirichlet boundary conditions
Note that the initial conditions are derived from the exact solitary wave solution of given by [33]
This exact solution is of bell shape and represents a soliton which travels with velocity c and whose amplitude is . The exact solution of the above initial boundary value problem satisfies the following energy identity:
This is fairly straightforward and is obtained by applying Equation in Equation at . For our computations, we consider parameters and Hence, the approximate value of the constant E is
Since – is a three-time-level numerical scheme, in order to get the computer simulation started, at the beginning, we need initial values at two different time levels. For our computations of bell solitary wave solution and kink solitary solution, respectively, these initial values were obtained from and making use of the respective exact solutions given by and .
In Figure 1, the solitary wave computed by the numerical scheme – is compared with the wave of exact solution at time . As one can see, both waves are indistinguishable—the numerical solution simply overlaps the exact solution.
Figure 1.
U computed by the numerical scheme – with and . Comparison between the exact solution and the numerical solution at time . Initial condition (solid line); exact solution (dotted line); and numerical solution (dashed line).
The curves of discrete energy and discrete quantities and obtained by the numerical scheme – at a larger T value are plotted in Figure 2. The figure shows that the numerical scheme )– possesses very good conservation properties when compared to the theoretical results.
Figure 2.
Discrete energy and discrete quantities , and computed by the numerical scheme – with and at time (Up-Left); (Up-Right); (Down-Left); and (Down-Right).
In order investigate the influence of the time-step size , the computations were repeated with a fixed space step and a different time-step size . Figure 3 shows the sensitivities of and to the time-step size . We can easily see that the discrete quantities and are more sensitive than the discrete energy to the changing of the time-step size
Figure 3.
Discrete energy and discrete quantities , and computed by the numerical scheme – with at time (Up-Left); (Up-Right); (Down-Left); and (Down-Right).
- Kink Solitary Wave Solution
Now, let us consider the following kink solitary wave solution of given by [33]
This kink solution approaches as . So, for solving , initial conditions can be obtained from this exact solution (Equation along with the boundary conditions given by
For computations, we choose . We solved with the numerical scheme – for different velocities c and several values of and
Figure 4 shows the comparison between the exact solution and the numerical solution with and at time for . One can easily see that the solitary wave solution computed by the numerical scheme – agrees very well with the exact solution. In addition, the curves of discrete energy and discrete quantities , and obtained by the numerical scheme – are plotted in Figure 5. This shows that the numerical scheme – possesses extremely good conservation properties.
Figure 4.
U computed by the numerical scheme – with and . Comparison between the exact solution and the numerical solution at time . Initial condition (solid line); exact solution (dotted line); and numerical solution (dashed line).
Figure 5.
Discrete energy and discrete quantities , and computed by the numerical scheme – with and at time (Up-Left); (Up-Right); (Down-Left); and (Down-Right).
Table 1 gives the numerical errors for the scheme – with different h and at time . In fact, the errors are presented for mesh widths h and time steps as they are halved. Using simple arithmetic, one can easily verify that the error decreases as second order in time and space when and h are halved. Table 2 and Table 3 show the conservation of discrete energy and discrete quantities and computed by the numerical scheme – with at time and 50. Moreover, Table 4 gives the errors between exact and approximate discrete energies and quantities with different velocities at different times in the case when and .
Table 1.
The numerical errors for different h and at time .
Table 2.
Discrete energy and discrete quantities and with .
Table 3.
Discrete energy and discrete quantities and with and .
Table 4.
The errors between exact and approximate discrete energies and quantities with different velocities at different times.
Figure 6 and Figure 7 show the error functions and with and and at time . The error functions are computed at different values for and . Hence, for a small velocity c, the number of error oscillations decreases as decreases and increases—i.e., when the cubic term dominates the linear term in the Klein–Gordon nonlinearity.
Figure 6.
The error functions and computed when equals and and equals and .
Figure 7.
The error functions and computed when equals and and equals and 10.
6. Conclusions
In this paper, we constructed a finite difference scheme that conserves the discrete energy (and some other discrete quantities) for solving the Klein–Gordon equation with cubic nonlinearity. Theoretical analysis is provided to show the conservation properties of the numerical scheme. In addition, we obtain theoretical error estimates and prove the stability and the convergence of the scheme. Finally, we carry out a number of computer simulations using the scheme. In particular, we consider the cases where the solutions are either traveling pulses or traveling wave fronts. The numerical simulations demonstrate that our method performs very well in both instances—conserving the discrete energies and producing accurate and stable solutions. One observation is that if it is imperative to conserve the other discrete quantities along with the discrete energy, one may have to choose a smaller time step. This is because since the conservation of the discrete quantities are correct up to the order of the spatial mesh and the time step, at instances, some of the discrete quantities, other than the discrete energy, are susceptible to an increasing time step. However, this does not affect the performance of our method. One can still conserve the discrete energy and obtain excellent numerical results that are stable and accurate. In addition, in the case of traveling wave fronts with low speeds, we find that our scheme performs well (with no error oscillations) if the cubic term is dominant compared to the linear term (i.e., larger and smaller ). As we noted in the introduction, there are a few energy conserving explicit finite difference schemes in the literature for solving the Klein–Gordon equation. However, because of the explicitness, the stability of these schemes is conditional resulting in restrictive choices for the spatial mesh width and time step. In contrast, since our energy-conserving scheme is an implicit scheme, the stability is unconditional, and we do not have any restrictions on the spatial mesh width or the time step. As pointed out in [29], an energy-conserving scheme is very suitable for studying the long-time behavior of wave solutions. For example, the wave collisions and resonance behavior that were studied decades ago in [4] could be well understood if one employs an implicit method such as ours that does not dissipate energy. At this juncture, one should note that another interesting equation with cubic nonlinearity is the nonlinear Schrödinger equation [34]. An energy-conserving circularly exact leapfrog scheme was developed in [34] to study the nonlinear Schrödinger equation. However, our work could be easily modified to study the nonlinear Schrödinger equation as well. Further, this work could be extended to Klein–Gordon equations with other nonlinearities. For instance, if the nonlinear term in Equation is , where and p is any positive integer (note that, gives ), one could construct a numerical scheme such that in Equation , the nonlinear term is split judiciously as
and more generally as,
where . Then, as in Section 2, one could proceed to show that the scheme will be energy conserving for any positive integer p. So, the idea of re-arranging the nonlinearity in a judicious manner could even be adopted in combination with the standard discretization of fractional derivatives in order to develop new and efficient numerical schemes for the fractional nonlinear Klein–Gordon equations. Therefore, we believe that our work adds to the body of knowledge with regards to the computational study of Klein–Gordon equations.
Author Contributions
Investigation, L.A., V.M.; Software, L.A.; Supervision, V.M.; Writing — original draft, L.A., V.M.; Writing — review & editing, L.A., V.M. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Conflicts of Interest
The authors declare no conflict to interest.
References
- Caudrey, P.J.; Eilbeck, J.C.; Gibbon, J.D. The sine-Gordon equation as a model classical field theory. Il Nuovo Cimento B 1975, 25, 497–512. [Google Scholar] [CrossRef]
- Dodd, R.K.; Morris, H.C.; Eilbeck, J.C.; Gibbon, J.D. Soliton and Nonlinear Wave Equations; Academic Press: London, UK; New York, NY, USA, 1982. [Google Scholar]
- Wazwaz, A.M. New travelling wave solutions to the Boussinesq and the Klein–Gordon equations. Commun. Nonlinear Sci. Numer. Simul. 2008, 13, 889–901. [Google Scholar] [CrossRef]
- Manoranjan, V.S. Some numerical experiments on Higgs model. Comput. Phys. Commun. 1983, 29, 1–5. [Google Scholar] [CrossRef]
- Alzaleq, L.M.; Manoranjan, V. Qualitative analysis and exact traveling wave solutions for the Klein-Gordon equation with quintic nonlinearity. Phys. Scr. 2019, 94, 085208. [Google Scholar] [CrossRef]
- Amin, M.; Abbas, M.; Iqbal, M.K.; Baleanu, D. Numerical Treatment of Time-Fractional Klein–Gordon Equation Using Redefined Extended Cubic B-Spline Functions. Front. Phys. 2020, 8, 288. [Google Scholar] [CrossRef]
- Golmankhaneh, A.K.; Golmankhaneh, A.K.; Baleanu, D. On nonlinear fractional Klein–Gordon equation. Signal Process. 2011, 91, 446–451. [Google Scholar] [CrossRef]
- Kurulay, M. Solving the fractional nonlinear Klein-Gordon equation by means of the homotopy analysis method. Adv. Differ. Equations 2012, 2012, 187. Available online: http://www.advancesindifferenceequations.com/content/2012/1/187 (accessed on 2 November 2012). [CrossRef] [Green Version]
- Li, C.; Zeng, F. Finite Difference Methods for Fractional Differential Equations. Int. J. Bifurc. Chaos 2012, 22, 1230014. [Google Scholar] [CrossRef]
- Liu, J.; Nadeem, M.; Habib, M.; Akgül, A. Approximate Solution of Nonlinear Time-Fractional Klein-Gordon Equations Using Yang Transform. Symmetry 2022, 14, 907. [Google Scholar] [CrossRef]
- Nagy, A.M. Numerical solution of time fractional nonlinear Klein-Gordon equation using Sinc-Chebyshev collocation method. Appl. Math. Comput. 2017, 310, 139–148. [Google Scholar] [CrossRef]
- Strauss, W.; Vazquez, L. Numerical solution of a nonlinear Klein-Gordon equation. J. Comput. Phys. 1978, 28, 271–278. [Google Scholar] [CrossRef]
- Li, S.; Vu-Quoc, L. Finite difference calculus invariant structure of a class of algorithms for the nonlinear Klein-Gordon equation. SIAM J. Numer. Anal. 1995, 32, 1839–1875. [Google Scholar] [CrossRef]
- Abbasbandy, S. Numerical solution of non-linear Klein-Gordon equations by variational iteration method. Int. J. Numer. Methods Eng. 2007, 70, 876–881. [Google Scholar] [CrossRef]
- Shakeri, F.; Dehghan, M. Numerical solution of the Klein-Gordon equation via He’s variational iteration method. Nonlinear Dyn. 2008, 51, 89–97. [Google Scholar] [CrossRef]
- Aslanov, A. The homotopy-perturbation method for solving klein-gordon-type equations with unbounded right-hand side. Z. Naturforschung A 2009, 64, 149–152. [Google Scholar] [CrossRef]
- Yousif, M.A.; Mahmood, B.A. Approximate solutions for solving the Klein–Gordon and sine-Gordon equations. J. Assoc. Arab. Univ. Basic Appl. Sci. 2017, 22, 83–90. [Google Scholar] [CrossRef] [Green Version]
- Dehghan, M.; Shokri, A. Numerical solution of the nonlinear Klein-Gordon equation using radial basis functions. J. Comput. Appl. Math. 2009, 230, 400–410. [Google Scholar] [CrossRef] [Green Version]
- Khuri, S.A.; Sayfy, A. A spline collocation approach for the numerical solution of a generalized nonlinear Klein-Gordon equation. Appl. Math. Comput. 2010, 216, 1047–1056. [Google Scholar] [CrossRef]
- Mohebbi, A.; Asgari, Z.; Shahrezaee, A. Fast and high accuracy numerical methods for the solution of nonlinear Klein-Gordon equations. Z. Naturforschung A 2011, 66, 735–744. [Google Scholar] [CrossRef]
- Dutykh, D.; Chhay, M.; Clamond, D. Numerical study of the generalised Klein–Gordon equations. Phys. D Nonlinear Phenom. 2015, 304, 23–33. [Google Scholar] [CrossRef] [Green Version]
- 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. 2018, 7, 359–366. [Google Scholar] [CrossRef]
- El-Sayed, S.M. The decomposition method for studying the Klein–Gordon equation. Chaos Solitons Fractals 2003, 18, 1025–1030. [Google Scholar] [CrossRef]
- Zhang, J.; Kong, L. New energy-preserving schemes for Klein-Gordon-Schrödinger equations. Appl. Math. Model. 2016, 40, 6969–6982. [Google Scholar] [CrossRef]
- He, Y. High-Order Energy and Linear Momentum Conserving Methods for the Klein-Gordon Equation. Mathematics 2018, 6, 200. [Google Scholar] [CrossRef] [Green Version]
- Wang, B.; Wu, X. The formulation and analysis of energy-preserving schemes for solving high-dimensional nonlinear Klein-Gordon equations. IMA J. Numer. Anal. 2019, 39, 2016–2044. [Google Scholar] [CrossRef]
- Kumbinarasaiah, S.; Ramane, H.S.; Pise, K.S.; Hariharan, G. Numerical-solution-for-nonlinear-klein–gordon equation via operational-matrix by clique polynomial of complete graphs. Int. J. Appl. Comput. Math. 2021, 7, 1–19. [Google Scholar] [CrossRef]
- Kanth, A.R.; Aruna, K. Differential transform method for solving the linear and nonlinear Klein–Gordon equation. Comput. Phys. Commun. 2009, 180, 708–711. [Google Scholar] [CrossRef]
- Jiménez, S.; Vázquez, L. Analysis of four numerical schemes for a nonlinear Klein-Gordon equation. Appl. Math. Comput. 1990, 35, 61–94. [Google Scholar] [CrossRef]
- Wang, T.; Chen, J.; Zhang, L. Conservative difference methods for the Klein-Gordon-Zakharov equations. J. Comput. Appl. Math. 2007, 205, 430–452. [Google Scholar] [CrossRef]
- Chen, J.; Zhang, L. Two energy conserving numerical schemes for the Klein-Gordon-Zakharov equations. J. Appl. Math. 2013, 2013, 46208. [Google Scholar] [CrossRef] [Green Version]
- Zhou, Y. Applications of Discrete Functional Analysis to the Finite Difference Method; Pergamon Press: Oxford, UK, 1991. [Google Scholar]
- Alzaleq, L.M. A Klein-Gordon Equation Revisited: New Solutions and a Computational Method. Ph.D. Thesis, Washington State University, Pullman, WA, USA, 2016. [Google Scholar]
- Sanz-Serna, J.M.; Manoranjan, V.S. A Method for the Integration in Time of Certain Partial Differential Equations. J. Comput. Phys. 1983, 52, 273–289. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).