Galerkin and Collocation Methods for the Solution of Kelin-Gordon ...

0 downloads 0 Views 836KB Size Report
Abstract: A numerical technique is presented for the solution of Klein-Gordon equation. This method ...... [2] B. Alpert, G. Beylkin, R. R. Coifman and V. Rokhlin.
ISSN 1749-3889 (print), 1749-3897 (online) International Journal of Nonlinear Science Vol.16(2013) No.2,pp.113-124

Galerkin and Collocation Methods for the Solution of Kelin-Gordon Equation Using Interpolating Scaling Functions Saba Izadkhah1 , Mohammad Shahriari2 , Behzad Nemati Saray3,∗ 1

Department of Computer, Faculty of Computer Science University of Tabriz, Tabriz, Iran Department of Applied Mathematics, Faculty of Sciences, University of Maragheh, Maragheh, Iran Department of Applied Aathematics, Faculty of Mathematical Science University of Tabriz, Tabriz, Iran 2

3

(Received 6 June 2012 , accepted 12 August 2013)

Abstract: A numerical technique is presented for the solution of Klein-Gordon equation. This method uses interpolating scaling functions. The method consists of expanding the required approximate solution as the elements of interpolating scaling functions. Using the operational matrix of derivatives, we reduce the problem to a set of algebraic equations. Some numerical examples are included to demonstrate the validity and applicability of the technique. The method is easy to implement and produces accurate results. Keywords: Galerkin method; Klein-Gordon equation; interpolating scaling function; operational matrix of derivative.

1

Introduction

In this article, we present numerical scheme for solving initial-value problem of the one-dimensional nonlinear KleinGordon equation as utt + αuxx + g(u) = f (x, t), (1) with u(x, 0) = g1 (x), u(0, t) = h1 (x),

ut (x, 0) = g2 (x),

(2)

u(1, t) = h2 (t),

where u = u(x, t) represents the wave displacement at (x, t) and α is a known constant and g(u) is the nonlinear force. In the well-known sine-Gordon equation, the nonlinear force is given by g(u) = sinu. In the physical applications, the nonlinear force g(u) has also other forms [10, 12]. The cases g(u) = sinu + sin2u and g(u) = sinhu + sinh2u are called the double sine-Gordon equation and the double sinh-Gordon equation, respectively [5, 11]. We note that one key feature is that the Klein-Gordon equation is a Hamiltonian PDE, and for a wide class of functions g(u), it has conserved Hamiltonian (or energy) ∫ 1 1 H = ( u2t + ux2 + G(u))dx, 2 2 where G′ (u) = g(u). Nonlinear partial differential equations (NLPDEs) arise in many fields of science, particularly in physics, engineering, chemistry and finance, and are fundamental for the mathematical formulation of continuum models. The nonlinear Klein-Gordon equation appears in many types of nonlinearities. The Klein-Gordon equation plays an important role in mathematical physics [10, 11, 15, 26]. The equation has attracted much attention in studying solitons and condensed matter physics [7], in investigating the interaction of solitons in a collisionless plasma, the recurrence of initial states, and in examining the nonlinear wave equations [13]. Eq. (1) is one of the important mathematical models in quantum mechanics [22] and it also occurs in relativistic physics as a model of dispersive phenomena [8]. Many papers have been published for solving Klein-Gordon equation. For example, Tension spline approach [21] and Collocation and finite difference-collocation methods for solving nonlinear Klein-Gordon equation with quadratic and ∗ Corresponding

author.

E-mail address:b− [email protected] c Copyright⃝World Academic Press, World Academic Union IJNS.2013.10.15/751

114

International Journal of Nonlinear Science, Vol.16(2013), No.2, pp. 113-124

cubic nonlinearity [18]. Several second-order of finite difference schemes is in [20]. We note that alternative approaches using spectral and pseudo-spectral methods have recently been presented in [16, 19]. Dehghan and Ghesmati [9] developed a technique based on the dual reciprocity boundary element method to obtain the approximate solution of the nonlinear Klein-Gordon equation. Note that the solution of the nonlinear Klein-Gordon equation in unbounded domain is also investigated in [27]. The interested reader can see [4, 6, 14, 25] for more works on this equation. In this paper interpolating scaling functions (ISF ) are constructed. These bases are used to construct Alpert multiwavelets [2, 3]. Operational matrix of derivative is derived in [17, 23]. In the present work we use interpolation property and solve the Klein-Gordon equation. Interpolating scaling functions are used to reduce Klein-Gordon equation to a system of nonlinear equation and Newton method are applied to solve the system at nonlinear equation. Recently Lakestani and Nemati Saray used these bases to solve Telegraph equation[17] and nonlinear generalized Burgers-Huxley equation [12].

2

Interpolating scaling functions

Suppose Pr is the Legendre polynomial of order r and r is any fixed nonnegative integer number. Let τk denotes the roots of Pr for k = 0, ..., r − 1. The interpolating scaling functions (ISF ) are given by [23] { √ ϕk (t) :=

2 ωk Lk (2t

− 1),

0,

t ∈ [0, 1], otherwise,

where ωk is the Gauss-Legendre quadrature weight 2 , ´ rPr (τk )Pr−1 (τk )

ωk =

and Lk (t) is the lagrange interpolating polynomial defined by [2] Lk (t) =

(

r−1 ∏ i=0,i̸=k

t − τi τk − τi

) .

for k = 0, ..., r − 1. We can expand any polynomial g of degree less than r with the functions with an orthonormal basis on [0, 1] as following, g(t) =

r−1 ∑

dk ϕk (t),

k=0

where the coefficients are given by

√ dk =

ωk ( g τˆk ), 2

k = 0, ..., r − 1,

and τˆk =

τk + 1 . 2

Let ϕknl (t) defined by ϕknl (t) = 2(n/2) ϕk (2n t − l)

(3)

where k = 0, ..., r − 1, l = 0, ..., 2n − 1, and n is any fixed nonnegative integer number. Note that we have the following orthonormality relation ∫ 1 ´ ϕknl (t)ϕkn´l (t)dt = δl´l δkk´ , 0

k, k´ = 0, ..., r − 1 and l, ´l = 0, ..., 2n − 1.

IJNS email for contribution: [email protected]

S. Izadkhah, M. Shahriari,B. N. Saray: Galerkin and Collocation Methods for the Solution · · ·

2.1

115

Function approximation

For any two fixed nonnegative integer numbes r and n, a function f(t) defined over [0, 1) may be represented by ISF expansion as, n r−1 2∑ −1 ∑ f (t) = sknl ϕknl (t) = S T Φ(t) (4) k=0 l=0

where

[ r−1 r−1 0 0 T S = s0n0 , ..., sr−1 n0 |sn1 , ..., sn1 |...|sn,2n −1 , ..., sn,2n −1 ] ,

(5)

[ r−1 r−1 0 0 T Φ(t) = ϕ0n0 (t), ..., ϕr−1 n0 (t)|ϕn1 (t), ..., ϕn1 (t)|...|ϕn,2n −1 (t), ..., ϕn,2n −1 (t)] , and the coefficients cknl are computed by ∫



1

sknl =

hl+1

f (t)ϕknl (t)dt = 0

f (t)ϕknl (t)dt, hl

where

l and l = 0, ..., 2n − 1. 2n These coefficients may be computed using Gauss-Legendre quadrature [12, 17]. √ ωk sknl = 2−n/2 f (2−n (ˆ τk + l)), k = 0, ..., r − 1, l = 0, ..., 2n − 1. 2 hl =

(6)

Also a function g(x, t) of two independent variables for 0 ≤ x ≤ 1, and 0 ≤ t ≤ 1, may be expanded in terms of interpolating scaling functions as g(x, t) =

N ∑ N ∑

gij Φi (x)Φj (t) = ΦT (x)GΦ(t),

(7)

i=1 j=1

such that G is an N × N matrix as



g11 · · ·  .. G= . gN 1 · · ·

N = r2n , and



1



gi,j =

 g1N ..  , .  gN N

1

g(x, t)Φi (t)Φj (x)dtdx. 0

0

We used two step of (6) to obtaine √ gi,j = 2

−n

ωk 2



) ωk′ ( −n g 2 (ˆ τk + l), 2−n (ˆ τk ′ + l ′ ) , 2

(8)

where i = rl + (k + 1), j = rl′ + (k ′ + 1), k = 0, · · · , r − 1 and l = 0, · · · , 2n − 1 .

2.2

The operational matrix of derivative

Let the derivative of f (t) in Eq. (4) be given by r−1 2∑ −1 ∑ d f (t) = s˜knl ϕknl (t) = S˜T Φ(t), dt n

(9)

k=0 l=0

where S˜ is a vector defined similarly to (5). We express relation between S and S˜ by S˜ = DS,

IJNS homepage: http://www.nonlinearscience.org.uk/

(10)

116

International Journal of Nonlinear Science, Vol.16(2013), No.2, pp. 113-124

where D is the operational matrix for derivatives of the scaling function. By using (9) we get [17, 23] ∫ s˜knl

(

hl+1

ϕknl (t)

= hl

) d f (t) dt. k = 0, ..., r − 1, l = 0, ..., 2n − 1, dt

Using integration by parts, we obtain s˜knl

[ ]h = f (t)ϕknl (t) hl+1 −



l

(

hl+1

f (t) hl

) d k ϕ (t) dt. dt nl

From (3) and (4) we get r−1 ∑ [ ] s˜knl = 2(n/2) f (hl+1 )ϕk (1) − f (hl )ϕk (0) − 2n qki sinl ,

(11)

i=0

where



(

1 i

qki =

ϕ (t) 0

) d k ϕ (t) dt. dt

Employing the Gauss-Legendre quadrature formula, we obtain √ ωi d k qki = ϕ (ˆ τi ). 2 dt To evaluate f (hl ) and f (hl+1 ) we use the average of left and right limit on hl as ) (r−1 r−1 ∑ 1 ∑ i i i i f (hl ) = s ϕ (hl ) + snl ϕnl (hl ) , l = 1, ..., 2n − 1. 2 i=0 n,l−1 n,l−1 i=0

(12)

Using (3), we can express (12) as f (hl ) = 2

n/2 1

2

(r−1 ∑

sin,l−1 ϕi (1)

+

i=0

r−1 ∑

) sinl ϕi (0)

.

(13)

i=0

Also, to evaluate the values of functions f at the point h0 and h2n we have f (h0 ) =

r−1 ∑

sin0 ϕin0 (h0 ) = 2n/2

r−1 ∑

sin0 ϕi (0),

sin,2n −1 ϕin,2n −1 (h2n ) = 2n/2

i=0

r−1 ∑

sin,2n −1 ϕi (1).

i=0

Substituting (13)-(15) in (11), we obtain [r−1( ) ] r−1 ∑ 1 ∑ 1 i k n i k i k i k i s˜n0 = 2 ϕ (1)ϕ (1) − ϕ (0)ϕ (0) − qki sn0 + ϕ (0)ϕ (1)sn1 , 2 2 i=0 i=0 s˜knl

) ( r−1 ∑ 1 i 1 i k i =2 ϕ (1)ϕk (1) − ϕ (1)ϕ (0) sn,l−1 + 2 2 i=0 i=0 ) ] r−1 ∑ 1 i 1 i k i k i − ϕ (0)ϕ (0) − qki snl + ϕ (0)ϕ (1)sn,l+1 , 2 2 i=0 n

s˜kn,2n −1

[r−1( ∑

n

=2

l = 0, ..., 2n − 2,

( r−1 ∑ 1 i k i ϕi (1)ϕk (1) − ϕ (1)ϕ (0)sn,2n −2 + 2 i=0 i−0

[r−1 ∑

(14)

i=0

i=0

f (h2n ) =

r−1 ∑

IJNS email for contribution: [email protected]

(15)

S. Izadkhah, M. Shahriari,B. N. Saray: Galerkin and Collocation Methods for the Solution · · ·

117

) ] 1 − ϕi (0)ϕk (0) − qki sin,2n −1 . 2 From the above equations the matrix D can be expressed as a block tridiagonal matrix which is obtained from   R H  −H T R H      . . . .. .. ..   , D = 2n    .. .. ..   . . .    −H T R H  −H T R here, each block is an r × r matrix and for k, i = 1, ..., r, we have 1 i ϕ (1)ϕk (1) − ϕi (0)ϕk (0) − qki , 2

[R]ki = [R]ki =

1 i 1 ϕ (1)ϕk (1) − ϕi (0)ϕk (0) − qki , 2 2

[ ] 1 R ki = ϕi (1)ϕk (1) − ϕi (0)ϕk (0) − qki , 2 1 i ϕ (0)ϕk (1). 2 Since (11)-(15) are exact for polynomials up to degree r − 1, the operational matrix of derivative is exact for polynomials up to degree r − 1. [H]ki =

3

Description of numerical method

We consider Klein-Gordon equation which has the form utt + αuxx + g(u) = f (x, t),

x ∈ Ω = [0, 1] ⊂ R, 0 < t ≤ 1,

(16)

with the initial and boundary conditions u(x, 0) = g1 (x), u(0, t) = h1 (x),

3.1

ut (x, 0) = g2 (x),

u(1, t) = h2 (t),

x ∈ Ω,

x ∈ δΩ, 0 < t ≤ 1.

(17) (18)

Galerkin method based on interpolating scaling function (GCM)

The solution u(x, t) of (16) can be approximated as u(x, t) ≃ ΦT (t)U Φ(x).

(19)

By using (9), we obtain ut (x, t) ≃ ΦT (t)DU Φ(x),

utt (x, t) ≃ ΦT (t)D2 U Φ(x),

(20)

Also uxx (x, t) = ΦT (t)U D2 Φ(x).

(21)

gˆ(x, t) = g(u(x, t)),

(22)

We suppose that Using (9), we can approximate gˆ(x, t) as the following form gˆ(x, t) ≃ ΦT (t)GΦ(x),

IJNS homepage: http://www.nonlinearscience.org.uk/

(23)

118

International Journal of Nonlinear Science, Vol.16(2013), No.2, pp. 113-124

where G is a (N × N ) matrix. The entries of this matrix are obtained by √ √ ) ωk ωk′ ( −n Gi,j = 2−n gˆ 2 (ˆ τk + l), 2−n (ˆ τk′ + l′ ) , i = rl + (k + 1), j = rl′ + (k ′ + 1). 2 2 also the function f (x, t) is f (x, t) ≃ ΦT (t)F Φ(x). using the (20), (21) and (23), we obtain ΦT (t)D2 U Φ(x) + αΦT (t)U D2 Φ(x) + ΦT (t)GΦ(x) = ΦT (t)F Φ(x).

(24)

The entries of vectors Φ(t) and Φ(x) are independent, so from (24) we get Υ = D2 U + αU D2 + G − F.

(25)

One can obtain the equation (25) has (N − 1) × (N − 2) independent equations, because the rank of D2 is N − 2. Here we choose Υi,j = 0 for i = 2, · · · , N − 1, j = 2, · · · , N − 1. (26) Using (4), we can approximate the functions g1 (x), g2 (x), h1 (t) and h2 (t) as: g1 (x) = X1T Φ(x), g2 (x) = X2T Φ(x),

(27)

T

h1 (t) = Φ (t)X3 , h2 (t) = ΦT (t)X4 , where X1 , X2 , X3 and X4 are vectors of dimension N , and can be found as √ wk −n X1i = 2 2 g1 (2−n (˜ τk + l)), 2 √ wk −n 2 X2i = 2 g2 (2−n (˜ τk + l)), 2 √ wk −n 2 X3i = 2 h1 (2−n (˜ τk + l)), 2 √ n wk X4i = 2− 2 h2 (2−n (˜ τk + l)), 2 for

i−k−1 , k = 0, · · · , r − 1, i = 1, · · · , N. r Applying (19) in the initial and boundary conditions (17) and (18), we get l=

ΦT (0)U Φ(x) = X1T Φ(x), ΦT (0)DU Φ(x) = X2T Φ(x), ΦT (t)U Φ(0) = ΦT (t)X3 ,

(28)

ΦT (t)U Φ(1) = ΦT (t)X4 . The entries of vector Φ(x) and Φ(t) are independent, so (28) gives ΦT (0)U = X1T , DΦT (0)U = X2T , U Φ(0) = X3 ,

IJNS email for contribution: [email protected]

(29)

S. Izadkhah, M. Shahriari,B. N. Saray: Galerkin and Collocation Methods for the Solution · · ·

119

U Φ(1) = X4 . Assume that Ω1 = ΦT (0)U − X1T , Ω2 = DΦT (0)U − X2T , Ω3 = U Φ(0) − X3 ,

(30)

Ω4 = U Φ(1) − X4 . By choosing Ω1i = 0,

i = 2, · · · , N − 1,

Ω2i = 0,

i = 2, · · · , N − 1,

Ω3i = 0,

i = 1, · · · , N,

Ω4i = 0,

i = 1, · · · , N.

(31)

From (26) and (31) we have N 2 nonlinear equations, which can be solved for Ui,j , i, j = 1, · · · , N . This nonlinear system of equations solve by Newton method and we will get the approximated solution of the Klein-Gordon equation.

3.2

Collocation method interpolating scaling functions (CCM)

In this method, Υ in (25) is given by another manner. For applying collocation method, we need to have some collocation i points. These points are given by xi = N −1 for i = 0, · · · , N − 1. By putting (20)-(22) in equation (16), we have ΦT (t)D2 U Φ(x) + αΦT (t)U D2 Φ(x) + g(ΦT (t)U Φ(x)) − ΦT (t)F Φ(x) = 0,

(32)

Using collocation points to obtain N 2 equations but we have (N − 2) × (N − 2) independent equations because the rank of D2 is N − 2. By interplaiting (27) in these collocation points, we give N 2 equations. These system of equations are nonlinear and Newton method is used to solve them.

4

Test problems

In this section we give some computational results of numerical experiments with methods based on preceding section, to support our theoretical discussion. To show the efficiency of the present method for our problems in comparison with the exact solution, we report norm infinity and the L2 errors of the solution which are defined by L∞ = max |ui − u ˜i | 0≤i≤10

and

(∫

) 12

1

|ui − u ˜i | dx 2

L2 = 0

i , i = 0, · · · , 10. Also ui and u ˜i are the exact and computed values of the solution u at point ti . where ti = 10 Example 1. Consider the following Klein-Gordon equation

utt − uxx + u2 = 6xt(x2 − t2 ) + x6 t6 .

(33)

The analytical solution is given in [18] as u(x, t) = x3 t3 , also the initial and boundary conditions are given by { u(x, 0) = 0, ut (x, 0) = 0, 0 ≤ x ≤ 1, u(0, t) = 0, u(1, t) = t3 , 0 ≤ t ≤ 1. Table 1 consist of norm infinity and L2 norm of example 1 for n = 1, 2. Also we show that the methods represented in this paper is the better than the collocation method used in [18].

IJNS homepage: http://www.nonlinearscience.org.uk/

120

International Journal of Nonlinear Science, Vol.16(2013), No.2, pp. 113-124

t 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

GCM L2 n=1 5.47 × 10−21 1.66 × 10−20 4.71 × 10−20 5.74 × 10−20 1.41 × 10−19 8.56 × 10−20 8.01 × 10−20 7.25 × 10−20 1.16 × 10−19 1.27 × 10−19

Table 1: Norm infinity and L2 norm of errors. CCM L∞ L2 L∞ n=1 n=1 n=1 1.30 × 10−20 3.54 × 10−18 1.39 × 10−17 −20 3.79 × 10 3.07 × 10−18 1.10 × 10−17 −20 9.90 × 10 2.09 × 10−18 6.20 × 10−18 −20 2.90 × 10 3.87 × 10−18 1.71 × 10−17 −19 2.13 × 10 1.83 × 10−17 3.96 × 10−17 −19 1.10 × 10 2.13 × 10−18 2.42 × 10−17 −20 5.00 × 10 3.58 × 10−18 5.74 × 10−18 −19 2.53 × 10 2.93 × 10−18 1.40 × 10−17 −19 1.30 × 10 1.77 × 10−18 6.65 × 10−18 −20 4.00 × 10 4.85 × 10−18 4.18 × 10−18

t 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

[? ] L2 n=3 3.9 × 10−9 6.3 × 10−8 3.0 × 10−7 9.1 × 10−7 1.2 × 10−6 4.2 × 10−6 3.2 × 10−6 6.1 × 10−6 5.7 × 10−6 5.5 × 10−6

L∞ n=3 6.0 × 10−9 9.2 × 10−8 4.7 × 10−7 1.4 × 10−6 3.0 × 10−6 5.8 × 10−6 5.9 × 10−6 7.3 × 10−6 6.8 × 10−6 7.5 × 10−6

Table 2: L∞ and L2 norms of errors for c = 0.5. GCM CCM L2 L∞ L2 L∞ 1.13 × 10−6 1.07 × 10−5 2.28 × 10−6 4.46 × 10−5 2.81 × 10−6 2.77 × 10−5 5.66 × 10−6 4.19 × 10−5 4.53 × 10−6 3.05 × 10−5 9.08 × 10−6 3.10 × 10−5 4.99 × 10−6 1.30 × 10−5 1.23 × 10−5 2.64 × 10−5 3.23 × 10−6 6.76 × 10−6 1.45 × 10−5 1.63 × 10−6 5.18 × 10−6 2.04 × 10−6 1.65 × 10−5 1.55 × 10−6 3.60 × 10−6 1.31 × 10−5 1.81 × 10−5 1.65 × 10−5 1.01 × 10−6 3.20 × 10−5 1.96 × 10−5 1.23 × 10−5 2.68 × 10−6 6.84 × 10−5 2.16 × 10−5 6.35 × 10−6 8.94 × 10−6 4.13 × 10−5 2.42 × 10−5 7.90 × 10−7

Example 2. Consider the following Klein-Gordon equation(1) 5 3 utt − uxx + u + u3 = 0. 2 2 with initial conditions

√ u(x, 0) = √ ut (x, o) =

and Dirichlet boundary conditions

2 tan ( 3



x ∈ [0, 1] , t > 0,

(34)

−1 x), 2c2 − 5

√ −2 −1 2 sec ( x), 3(2c2 − 5) 2c2 − 5

x ∈ [0, 1] ,



√ 2 −1 tan ( (ct)), u(0, t) = 3 2c2 − 5 √ √ 2 −1 u(1, t) = tan ( (1 + ct)), t > 0. 3 2c2 − 5

The exact solution for this problem is



2 tan ( 3



−1 (x + ct)). 2c2 − 5

We applied our Methods to solve this problem. The computed solution and exact solution at grid points are compared, the observed errors, L∞ , L2 are tabulated in Table 2 for different times and absolute errors are showed in figure 1.

IJNS email for contribution: [email protected]

S. Izadkhah, M. Shahriari,B. N. Saray: Galerkin and Collocation Methods for the Solution · · ·

121

Figure 1: plot of absolute errors for example 2 with r = 5, n = 1. left(GCM), right(CCM)

t 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0

Table 3: L∞ and L2 norms of errors for n = 1. GCM CCM L2 L∞ L2 L∞ 2.59 × 10−6 5.39 × 10−5 9.16 × 10−5 2.16 × 10−4 5.81 × 10−6 8.17 × 10−5 2.32 × 10−4 3.57 × 10−4 1.61 × 10−5 8.75 × 10−5 3.18 × 10−4 4.35 × 10−4 4.80 × 10−5 8.43 × 10−5 3.41 × 10−4 4.83 × 10−4 6.36 × 10−5 7.79 × 10−5 2.97 × 10−4 4.98 × 10−4 5.60 × 10−5 8.26 × 10−5 1.56 × 10−4 4.73 × 10−4 5.32 × 10−5 1.01 × 10−4 2.20 × 10−5 4.25 × 10−4 4.42 × 10−5 7.82 × 10−5 1.94 × 10−5 3.21 × 10−4 5.71 × 10−5 1.23 × 10−4 3.09 × 10−4 1.73 × 10−4 3.95 × 10−5 5.74 × 10−5 3.53 × 10−4 8.89 × 10−6

Example 3. In this example (1), we consider the nonlinear Klein-Gordon equation with g(u) = βu + γu3 nonlinearity with constants α = −2.5, β = 1 and γ = 1.5. The initial conditions are given by { u(x, 0) = B tan (Kx), 0 ≤ x ≤ 1, ut (x, 0) = BcK sec2 (kx) 0 ≤ x ≤ 1, and the exact solution by [11, 18] is √

u(x, t) = B tan K(x + ct),



−β where B = βγ and K = 2(α+c 2 ) . In this example f = 0. We extract the boundary conditions from the exact solution. Table 3 shows L2 and L∞ errors for presented methods, with r = 5, n = 1. Fig. 2 show the plot of error using presented methods. Example 4. In this example Sinc-Gordon equation is solved by presented method. Sinc-Gordon equation is a equation with g(u) = sin(u) nonlinearity and α = −1, c = 0.2 and f (x, t) = 0. We extract the boundary and initial conditions from the exact solution. The exact solution of this equation is

u(x, t) = 4 arctan

x ) c sinh ( √1−c 2 ct cosh ( √1−c ) 2

.

Fig.3 shows the plots of absolute error.

IJNS homepage: http://www.nonlinearscience.org.uk/

122

International Journal of Nonlinear Science, Vol.16(2013), No.2, pp. 113-124

Figure 2: plot of absolute errors for example 3 with r = 5, n = 1, left(GCM) and right(CCM)

Figure 3: plot of absolute errors for example 4 with r = 5, n = 1, left(GCM) and right(CCM)

IJNS email for contribution: [email protected]

S. Izadkhah, M. Shahriari,B. N. Saray: Galerkin and Collocation Methods for the Solution · · ·

5

123

Conclusion

In this paper we presented the numerical schemes for solving the Klein-Gordon equation. This technique is based on the interpolating scaling functions and Galerkin method. The numerical results given in the previous section demonstrate the accuracy of these schemes. The obtained results showed that this technique can solve the problem effectively.

References [1] A. Elhanbaly and M. Abdou. Exact travelling wave solutions for two nonlinear evolution equations using the improved f-expansion method. Math. Comput. Model, 46(2007):1265-1276. [2] B. Alpert, G. Beylkin, R. R. Coifman and V. Rokhlin. Wavelet-like bases for the fast solution of second-kind integral equations.SIAM J. Sci. Statist. Comput, 14(1)(1993):159-184. [3] B. Alpert, G. Beylkin, D. Gines and L. Vozovoi.Adaptive solution of partial differential equations in multiwavelet bases.J. Comput. Phys, 182(2002):149-190. [4] A.G. Bratsos.A numerical method for the one-dimensional sine-Gordon equation, Numer.Methods Partial Differ. Equ, 24(2008):833-844. [5] A.G. Bratsos and E.H. Twizell.The solution of the sine-Gordon equation using the method of lines.Int. J. Comput. Math, 61(1996):271-292. [6] A.G. Bratsos. On the numerical solution of the Klein-Gordon equation, Numer.Methods Partial Differ. Equ, 25(2009):939-951. [7] P.J. Caudrey, I.C. Eilbeck and J.D. Gibbon.The sine-Gordon equation as a model classical field theory.Nuovo Cimento, 25(1975):497-511. [8] E.Y. Deeba and S.A. Khuri. A decomposition method for solving the nonlinear Klein-Gordon equation.J. Comput. Phys, 124(1996):442-448. [9] M. Dehghan and A. Ghesmati. Application of the dual reciprocity boundary integral equation technique to solve the nonlinear Klein-Gordon equation. Comput. Phys. Com- mun, 181(8)(2010):1410-1418. [10] M. Dehghan, A. Mohebbi and Z. Asghari. Fourth-order compact solution of the nonlinear Klein-Gordon equation.Numerical Algorithms, 52(2009):523-540. [11] M. Dehghan and A. Shokri. Numerical solution of the nonlinear Klein-Gordon equation using radial basis functions. J. Comput. Appl. Math, 230(2009):400-410. [12] M. Dehghan, B. N. Saray and M. Lakestani. Three methods based on the interpolation scaling functions and the mixed collocation finite difference schemes for the numerical solution of the nonlinear generalized BurgersHuxley equation.Mathematical and Computer Modelling, 55(2012):1129-1142. [13] R. K. Dodd, I. C. Eilbeck, J. D. Gibbon and H. C. Morris.Solitons and Nonlinear Wave Equations. Academic, London, 1982. [14] A. Ebaid.Exact solutions for the generalized Klein-Gordon equation via a transformation and Exp-function method and comparison with Adomiansmethod. J.Comput. Appl. Math, 223(2009):278-290. [15] S. M. El-Sayed. The decomposition method for studying the Klein-Gordon equation. Chaos Solitons Fractals, 18(2003):1025-1030. [16] B. Y. Guo, X. Li and L. Vazquez.A Legendre spectral method for solving the nonlinear Klein-Gordon equation.Math. Appl. Comput, 15(1996):19-36. [17] M. Lakestani and B. N. Saray. Numerical solution of telegraph equation using interpolating scaling functions,Computers and Mathematics with Applications, 60(2010):1964-1972. [18] M. Lakestani and M. Dehghan. Collocation and finite difference-collocation methods for the solution of nonlinear Klein-Gordon equation.Computer Physics Communications, 181(2010):1392-1401. [19] X. Li and B. Y. Guo. A Legendre spectral method for solving nonlinear Klein-Gordon equation. J. Comput.Math, 15(2)(1997):105-126. [20] M. A. M. Lynch. Large amplitude instability in finite difference approximations to the Klein-Gordon equation.Appl. Numer. Math, 31(1999):173-182. [21] J. Rashidinia and R. Mohammadi.Tension spline approach for the numerical solution of nonlinear Klein-Gordon equation.Computer Physics Communications, 181 (2010):78-91. [22] F. Shakeri and M. Dehghan. Numerical solution of the Klein-Gordon equation via Hes variational iteration method.Nonlinear Dynamics, 51 (2008):89-97.

IJNS homepage: http://www.nonlinearscience.org.uk/

124

International Journal of Nonlinear Science, Vol.16(2013), No.2, pp. 113-124

[23] M. Shamsi and M. Razzaghi.Numerical solution of the controlled duffing oscillator by the interpolating scaling functions. Electrmagn. Waves and Appl, 18(5)(2004):691-705. [24] M. Shamsi and M. Razzaghi. Solution of Hallen’s integral equation using multiwavelets. Comput. Phys.Comm, 168(2005):187-197. [25] A. M. Wazwaz. New travelling wave solutions to the Boussinesq and the Klein-Gordon equations. Commun. Nonlinear Sci. Numer. Simul, 13(2008):889-901. [26] A. M. Wazwaz. The tanh and the sinecosine methods for compact and noncompact solutions of the nonlinear KleinGordon equation. Appl. Math. Comput, 167(2005):1179-1195. [27] Z. Zhang. Split local absorbing conditions for one-dimensional nonlinear Klein-Gordon equation on unbounded domain. J. Comput. Phys, 227(2008):8992-9004.

IJNS email for contribution: [email protected]