# Finite Difference Method for Hyperbolic Equations with the Nonlocal Integral Condition

Authors: Allaberen Ashyralyev; Necmettin Aggez
Journal: Discrete Dynamics in Nature and Society
 (2011)

---

## Abstract

The stable difference schemes for the approximate solution of the nonlocal
boundary value problem for multidimensional hyperbolic equations with dependent
in space variable coefficients are presented. Stability of these difference
schemes and of the first- and second-order difference derivatives is obtained.
The theoretical statements for the solution of these difference schemes for one-dimensional
hyperbolic equations are supported by numerical examples.


---

## Body

## 1. Introduction

Nonlocal problems have been a major research area in modern physics, biology, chemistry, and engineering when it is impossible to determine the boundary values of the unknown function. Numerical methods and theory of solutions of the nonlocal boundary value problems for partial differential equations of variable type were carried out in for example, [1–10] and the references therein. Hyperbolic equations with nonlocal integral conditions are widely used for chemical heterogeneity, plasma physics, thermoelasticity, and so forth. The solutions of hyperbolic equations with nonlocal integral conditions were investigated in [11–15]. The method of operators as a tool for investigation of the solution to hyperbolic equations in Hilbert and Banach spaces has been studied extensively (see, e.g., [16–28]).In the present paper, the nonlocal boundary value problem for the multidimensional hyperbolic equation with nonlocal integral condition(1.1)∂2u(t,x)∂t2-∑r=1m(ar(x)uxr)xr=f(t,x),x=(x1,…,xm)∈Ω,0<t<1,u(0,x)=∫01α(ρ)u(ρ,x)dρ+φ(x),ut(0,x)=ψ(x),x∈Ω¯,u(t,x)=0,0<t<1,x∈S
is considered. Here Ω is the unit open cube in the m-dimensional Euclidean space ℝm={x=(x1,…,xm):0<xj<1,1≤j≤m}  with boundary S,  Ω¯=Ω∪S, ar(x)(x∈Ω),  φ(x),  ψ(x)(x∈Ω¯),  and f(t,x)(t∈(0,1),x∈Ω) are given smooth functions, and ar(x)≥a>0.The first and second orders of approximation int and the second order of approximation in space variables difference schemes for the approximate solution of nonlocal boundary value problem (1.1) are presented. Stability of these difference schemes and of the first- and second-order difference derivatives established. Error analysis is obtained by numerical solutions of one-dimensional hyperbolic equations with integral condition.


## 2. Difference Schemes and Stability Estimates

The discretization of problem (1.1) is carried out in two steps.  In the first step, let us define the grid sets (2.1)Ω̃h={x=xr=(h1r1,…,hmrm),r=(r1,…,rm),0≤rj≤Nj,hjNj=1,j=1,…,m},Ωh=Ω̃h∩Ω,Sh=Ω̃h∩S.
We introduce the Hilbert space L2h=L2(Ω̃h) of the grid functions (2.2)φh(x)={φ(h1r1,…,hmrm)}
defined on Ω̃h, equipped with the norm (2.3)‖φh‖L2(Ω̃h)=(∑x∈Ωh¯|φh(x)|2h1,⋯,hm)1/2.
To the differential operator Ax generated by problem (1.1), we assign the difference operator Ahx by the formula(2.4)Ahxuxh=-∑r=1m(ar(x)uxr̅h)xrrj
acting in the space of grid functions uh(x), satisfying the condition uh(x)=0 for all x∈Sh. It is known that Ahx is a self-adjoint positive definite operator in L2(Ω̃h). With the help of Ahx we arrive at the nonlocal boundary value problem(2.5)d2vh(t,x)dt2+Ahxvh(t,x)=fh(t,x),0<t<1,x∈Ω̃h,vh(0,x)=∫01α(ρ)vh(ρ,x)dρ+φh(x),x∈Ω̃h,dvh(0,x)dt=ψh(x),x∈Ω̃h
for an infinite system of ordinary differential equations.In the second step, we replace problem (2.5) by the difference scheme
(2.6)uk+1h(x)-2ukh(x)+uk-1h(x)τ2+Ahxuk+1h(x)=fk+1h(x),fk+1h(x)=fh(tk+1,x),tk+1=(k+1)τ,1≤k≤N-1,Nτ=1,x∈Ω̃h,u0h(x)=∑m=1Nα(tm)umh(x)τ+φh(x),x∈Ω̃h,(I+τ2Ahx)(u1h(x)-u0h(x))τ-1=ψh(x),x∈Ω̃h
of the first order accuracy in t.Theorem 2.1.
Letτ and h be sufficiently small numbers. Then, the solutions of the difference scheme (2.6) satisfy the following stability estimates:(2.7)max⁡0≤k≤N‖ukh‖L2h+max⁡0≤k≤N∑r=1m‖(ukh)xrrj‖L2h≤M1[max⁡1≤k≤N-1‖fkh‖L2h+‖ψh‖L2h+∑r=1m‖φxr̅rjh‖L2h],max⁡1≤k≤N-1‖τ-2(uk+1h-2ukh+uk-1h)‖L2h+max⁡0≤k≤N∑r=1m‖(ukh)xr̅xrrj‖L2h≤M1[∑r=1m‖ψxr̅rjh‖L2h‖f1h‖L2h+max⁡2≤k≤N-1‖τ-1(fkh-fk-1h)‖L2h+∑r=1m‖ψxr̅rjh‖L2h+∑r=1m‖φxr̅xrrjh‖L2h],
where M1 does not depend on τ, h, φh(x), ψh(x), and fkh(x), 1≤k<N.The proof of Theorem2.1 is based on the symmetry property of difference operator Ahx defined by the formula (2.4) and on the following theorem on coercivity inequality of the elliptic difference problem.Theorem 2.2.
For the solutions of the elliptic difference problem(2.8)Ahxuh(x)=ωh(x),x∈Ωh,uh(x)=0,x∈Sh,
the following coercivity inequality holds [29]:
(2.9)∑r=1m‖uxr̅xrrjh‖L2h≤M‖ωh‖L2h.Moreover, the second order of accuracy difference schemes(2.10)τ-2[uk+1h(x)-2ukh(x)+uk-1h(x)]+12Ahxukh(x)+14Ahx[uk+1h(x)+uk-1h(x)]=fkh(x),x∈Ω̃h,fkh=fkh(tk,x),tk=kτ,1≤k≤N-1,Nτ=1,u0h(x)=∑j=1Nτ2[α(tj)uh(tj,x)+α(tj-1)uh(tj-1,x)]+φh(x),x∈Ω̃h,(I+τ2Ahx2)τ-1[u1h(x)-u0h(x)]-τ2[f0h(x)-Ahxu0h(x)]=ψh(x),f0h=fh(0,x),fNh=fh(1,x),x∈Ω̃h,
and (2.11)τ-2(uk+1h-2ukh+uk-1h)+Ahxukh+τ24(Ahx)2uk+1h=fkh(x),fkh=fkh(tk,x),tk=kτ,1≤k≤N-1,Nτ=1,x∈Ω̃h,u0h(x)=∑j=1Nτ2[α(tj)uh(tj,x)+α(tj-1)uh(tj-1,x)]+φh(x),x∈Ω̃h,(I+τ2Ahx4)[(I+τ2Ahx4)τ-1[u1h(x)-u0h(x)]-τ2[f0h(x)-Ahxu0h(x)]]=ψh(x),f0h=fh(0,x),fNh=fh(1,x),x∈Ω̃h
for approximately solving the boundary value problem (1.1) is presented.We have the following theorem.Theorem 2.3.
Letτ and h be sufficiently small numbers. Then,  for the solution of the difference schemes (2.10) and (2.11) the stability inequalities(2.12)max⁡0≤k≤N‖ukh‖L2h+max⁡0≤k≤N∑r=1m‖(ukh)xr,jr‖L2h≤M2[max⁡0≤k≤N‖fkh‖L2h+‖ψh‖L2h+∑r=1m‖φxr̅,jrh‖L2h],max⁡1≤k≤N-1‖τ-2(uk+1h-2ukh+uk-1h)‖L2h≤M2[‖f0h‖L2h+max⁡1≤k≤N-1‖τ-1(fkh-fk-1h)‖L2h+∑r=1m‖ψxr̅,jrh‖L2h+∑r=1m‖ψxr̅,xr,jrh‖L2h]
hold, where M2 is independent of τ, h, φh(x), ψh(x),  and  fkh(x), 0≤k≤N.The proof of Theorem2.3 is based on the symmetry property of difference operator Ahx defined by formula (2.4) and on Theorem 2.2 on coercivity inequality of elliptic difference problem (2.8).In Theorems2.1 and 2.3, the constants M1 and M2 cannot be obtained sharply. Therefore, in the following section, we will study the accuracy of these difference schemes for solving the one-dimensional hyperbolic equations with the integral condition. Moreover, the method is supported by numerical experiments.


## 3. Numerical Analysis

### 3.1. The First Order of Accuracy in Time Difference Scheme

In this section, the nonlocal boundary value problem(3.1)∂2u(t,x)∂t2-(1+x)∂2u(t,x)∂x2-ux(t,x)+u(t,x)=f(t,x),f(t,x)=[(x+2)sinx-cos⁡x](et-1-t)+etsinx,0<t<1,0<x<π,u(0,x)=∫01e-su(s,x)ds+ψ(x),ψ(x)=(1-3e-1)sinx,ut(0,x)=0,0≤x≤π,u(t,0)=u(t,π)=0,0≤t≤1
for one dimensional hyperbolic equation is considered.The exact solution of problem (3.1) is(3.2)u(t,x)=(et-1-t)sinx.Applying the formulas(3.3)u(xn+1)-u(xn-1)2h-u′(xn)=O(h2),u(τ)-u(0)τ-u′(0)=O(τ),u(xn+1)-2u(xn)+u(xn-1)h2-u′′(xn)=O(h2)
and using the first order of accuracy in t implicit difference scheme (2.6), we obtain the difference scheme first order of accuracy in t and second order of accuracy in x(3.4)unk+1-2unk+unk-1τ2-(1+xn)un+1k+1-2unk+1+un-1k+1h2-un+1k+1-un-1k+12h+unk+1=f(tk+1,xn),f(tk+1,xn)=[(xn+2)sinxn-cos⁡xn](etk+1-1-tk+1)+etk+1sinxn,Nτ=1,xn=nh,1≤n≤M-1,Mh=π,un0-∑k=1Ne-kττunk=ψ(xn),tk=kτ,1≤k≤N-1,ψ(xn)=(1-3e-1)sinxn,0≤n≤M,u0k=uMk=0,un1-un0=0,0≤k≤N,1≤n≤M-1
for approximate solutions of nonlocal boundary value problem (3.1). It can be written in the matrix form(3.5)Anun+1+Bnun+Cnun-1=Dφn,1≤n≤M-1,u0=0⃗,uM=0⃗.
Here(3.6)An=[0000⋅⋅⋅0000an0⋅⋅⋅00000an⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅an00000⋅⋅⋅0an0000⋅⋅⋅00](N+1)×(N+1),Bn=[1-τe-τ-τe-2τ-τe-3τ⋅⋅⋅-τe-(N-1)τ-τe-Nτbcdn0⋅⋅⋅000bcdn⋅⋅⋅0000bc⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅dn00000⋅⋅⋅cdn-1100⋅⋅⋅00](N+1)×(N+1),Cn=[0000⋅⋅⋅0000en0⋅⋅⋅00000en⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅en00000⋅⋅⋅0en0000⋅⋅⋅00](N+1)×(N+1),an=-(1+xn)h2-12h,b=1τ2,c=-2τ2,dn=1τ2+2(1+xn)h2+1,en=-(1+xn)h2+12h,φn=[φn0φn1φn2⋮φnN](N+1)×1,φnk+1=f(tk+1,xn)=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,xn=nh,tk=kτ,1≤k≤N-1,
and D=IN+1 is the identity matrix.(3.7)Us=[us0us1us2⋮usN](N+1)×1,s=n-1,n,n+1.
This type system was used by Samarskii and Nikolaev [30] for difference equations. For the solution of the matrix equation (3.5),  we will use the modified Gauss elimination method. We seek a solution of the matrix equation by the following form: (3.8)un=αn+1un+1+βn+1,n=M-1,…,2,1,
where uM=0⃗,  αj(j=1,…,M-1) are (N+1)×(N+1) square matrices, βj(j=1,…,M-1) are (N+1)×1column matrices,  α1,β1 are zero matrices, and(3.9)αn+1=-(Bn+Cnαn)-1An,βn+1=(Bn+Cnαn)-1(Dnφn-Cnβn),n=1,2,3,…,M-1.


### 3.2. The Second Order of Accuracy in Time Difference Scheme

Applying (3.3)  and using the second order of accuracy in t implicit difference scheme (2.10), we obtain the second order of accuracy difference scheme in t and in x(3.10)unk+1-2unk+un-1k-1τ2-(1+xn)[un+1k-1-2unk-1+un-1k-14h2-un+1k-2unk+un-1k2h2-un+1k+1-2unk+1+un-1k+14h2]-[un+1k-1-un-1k-18h+un+1k-un-1k4h+un+1k+1-un-1k+18h]+12unk+unk+1+unk-14=φnk,φnk=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,Mh=π,xn=nh,1≤n≤M-1,Nτ=1,tk=kτ,1≤k≤N-1,un0=∑k=1Nτ2[e-kτunk+e-(k-1)τunk-1]+ψ(xn),0≤n≤M,ψ(xn)=(1-3e-1)sinxn,0≤n≤M,un1-un0=τ22[un+10-un-102h+(1+xn)un+10-2un0+un-10h2-un0+sinxn],1≤n≤M-1,u0k=uMk=0,0≤k≤N
for approximate solutions of the nonlocal boundary value problem (3.1). We have again (N+1)×(M+1) system of linear equations. We can write the system as a matrix equation (3.5).Here(3.11)An=[0000⋅⋅⋅000an2anan0⋅⋅⋅0000an2anan⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅an2ananwn000⋅⋅⋅000](N+1)×(N+1),Bn=[1-τ2-τe-τ-τe-2τ⋅⋅⋅-τe-(N-1)τ-τ2e-Nτbndnbn⋅⋅⋅000bndn⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅bn0000⋅⋅⋅dnbnyn10⋅⋅⋅00](N+1)×(N+1),Cn=[0000⋅⋅⋅000cn2cncn0⋅⋅⋅0000cn2cncn⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅cn2cncnzn000⋅⋅⋅000](N+1)×(N+1),an=-(1+xn)4h2-18h,bn=1τ2+1+xn2h2+14,cn=-(1+xn)4h2+18h,dn=-2τ2+1+xnh2+12,yn=-1+(1+xn)τ2h2+τ22,wn=-τ24h-(1+xn)τ22h2,zn=τ24h-(1+xn)τ22h2,φn=[φn0φn1⋮φnN](N+1)×1,φnk=f(tk,xn)=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,1≤k≤N-1,D=IN+1,Us=[us0us1us2⋮usN](N+1)×1,s=n-1,n,n+1.
For the solution of the matrix equation (3.5), we used the same algorithm as in the first order of accuracy difference scheme.


### 3.3. The Second Order of Accuracy in Time Difference Scheme Generated byA2

Applying (3.3) and formulas(3.12)u(xn+2)-4u(xn+1)+6u(xn)-4u(xn-1)+u(xn-2)h4-u(iv)(xn)=O(h2),2u(0)-5u(h)+4u(2h)-u(3h)h2-u′′(0)=O(h2),2u(π)-5u(π-h)+4u(π-2h)-u(π-3h)h2-u′′(π)=O(h2)
and using difference scheme (2.11), we obtain the second order of accuracy difference scheme(3.13)unk+1-2unk+unk-1τ2-(1+xn)un+1k-2unk+un-1kh2-un+1k-un-1k2h+unk+τ24[(1+xn)2un+2k+1-4un+1k+1+6unk+1-4un-1k+1+un-2k+1h4+4(1+xn)un+2k+1-2un+1k+1+2un-1k+1-un-2k+12h3-2xnun+1k+1-2unk+1+un-1k+1h2-un+1k+1-un-1k+1h+unk+1]=φnk,φnk=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,Mh=π,xn=nh,2≤n≤M-2,Nτ=1,tk=kτ,1≤k≤N-1,un0=∑k=1Nτ2[e-kτunk+e-(k-1)τunk-1]=ψ(xn),0≤n≤M,ψ(xn)=(1-3e-1)sinxn,0≤n≤M,un1-un0=τ22[un+10-un-102h+(1+xn)un+10-2un0+un-10h2-un0+sinxn],2≤n≤M-2,u0k=uMk=0,0≤k≤N,u1k=45u2k-15u3k,0≤k≤N,uM-1k=45uM-2k-15uM-3k,0≤k≤N
for approximate solutions of problem (3.1). One can write the (N+1)×(M+1) system of linear equations (3.13) as the matrix equation(3.14)Anun+2+Bnun+1+Cnun+Dnun-1+Enun-2=Rφn,u0=0⃗,uM=0⃗,2≤n≤M-2,u1=45u2-15u3,uM-1=45uM-2-15uM-3.Here,An,Bn,Cn,  Dn,  En, and R are (N+1)×(N+1) square matrices:(3.15)An=[0000⋅⋅⋅000an0⋅⋅⋅0000an⋅⋅⋅0⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅an0000⋅⋅⋅0],Bn=[000⋅⋅⋅000bncn⋅⋅⋅0000bn⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅cn0000⋅⋅⋅bncnyn00⋅⋅⋅00],Cn=[1-τ2-τe-τ-τe-2τ⋅⋅⋅-τe-(N-2)τ-τe-(N-1)τ-τ2e-Nτdenfn⋅⋅⋅0000den⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅enfn0000⋅⋅⋅denfnwn10⋅⋅⋅000],Dn=[000⋅⋅⋅0000gnln⋅⋅⋅00000gn⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅gnln0000⋅⋅⋅0gnlnzn00⋅⋅⋅000],En=[0000⋅⋅⋅0000mn0⋅⋅⋅00000mn⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅mn00000⋅⋅⋅0mn0000⋅⋅⋅00].
We denote (3.16)an=τ24((1+xn)2h4+2(1+xn)h3),bn=-(1+xn)h2-12h,d=1τ2,en=-2τ2+2(1+xn)h2+1,gn=12h-1+xnh2,cn=τ24(-4(1+xn)2h4-4(1+xn)h3-2xnh2-1h),ln=τ24(-4(1+xn)2h4-4(1+xn)h3-2xnh2+1h),fn=1τ2+τ24(6(1+xn)2h4+4xnh2+1),mn=τ24((1+xn)2h4-2(1+xn)h3),zn=τ24h-(1+xn)τ22h2,wn=-1+(1+xn)τ2h2+τ22,yn=-τ24h-(1+xn)τ22h2,φn=[φn0φn1⋮φnN](N+1)×1,φnk=f(tk,xn)=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,1≤k≤N-1,R=IN+1istheidentitymatrix,Us=[Us0Us1⋮UsN](N+1)×1,
where s=n±2, n±1, n.For the solution of matrix equation (3.14), we will use the modified Gauss elimination method. We seek a solution of the matrix equation by the following formula: (3.17)Un=αn+1un+1+βn+1un+2+γn+1,n=M-2,…,2,1,
where αj,βj(j=1,…,M-1) are (N+1)×(N+1) square matrices, γj(j=1,…,M-1) are (N+1)×1column matrices, and α1, β1, γ1, γ2 are zero matrices. α2, β2 are(3.18)α2=45IN+1,β2=-15IN+1,Fn=Cn+Dnαn+Enαn-1αn+Enβn-1αn+1=Fn-1[-Bn-Dnβn-Enαn-1βn],βn+1=-Fn-1An,γn+1=Fn-1[Rφn-Dnγn+Enαn-1γn+Enγn-1].
For solution of the last difference equation, we need to find uM, uM-1(3.19)uM=0⃗,uM-1=((βM-2+5I)-(4I-αM-2)αM-1)-1((4I-αM-2))γM-1-γM-2.


### 3.4. Error Analysis

The errors are computed by(3.20)EMN=max⁡1≤k≤N-1,1≤n≤M-1|u(tk,xn)-unk|
of the numerical solutions, where u(tk,xn) represents the exact solution and  unk represents the numerical solution at (tk,xn) and the results are given in Table 1.Table 1Difference schemesN=M=20N=M=40N=M=80Difference schemes (3.4)0.07430.03570.0175Difference schemes (3.10)0.00120.00030090.0000756Difference schemes (3.13)0.00054530.00012310.00002923Thus, the results show that the second order of accuracy difference schemes (3.10) and (3.13) are more accurate comparing with the first order of accuracy difference scheme (3.4).


## 3.1. The First Order of Accuracy in Time Difference Scheme

In this section, the nonlocal boundary value problem(3.1)∂2u(t,x)∂t2-(1+x)∂2u(t,x)∂x2-ux(t,x)+u(t,x)=f(t,x),f(t,x)=[(x+2)sinx-cos⁡x](et-1-t)+etsinx,0<t<1,0<x<π,u(0,x)=∫01e-su(s,x)ds+ψ(x),ψ(x)=(1-3e-1)sinx,ut(0,x)=0,0≤x≤π,u(t,0)=u(t,π)=0,0≤t≤1
for one dimensional hyperbolic equation is considered.The exact solution of problem (3.1) is(3.2)u(t,x)=(et-1-t)sinx.Applying the formulas(3.3)u(xn+1)-u(xn-1)2h-u′(xn)=O(h2),u(τ)-u(0)τ-u′(0)=O(τ),u(xn+1)-2u(xn)+u(xn-1)h2-u′′(xn)=O(h2)
and using the first order of accuracy in t implicit difference scheme (2.6), we obtain the difference scheme first order of accuracy in t and second order of accuracy in x(3.4)unk+1-2unk+unk-1τ2-(1+xn)un+1k+1-2unk+1+un-1k+1h2-un+1k+1-un-1k+12h+unk+1=f(tk+1,xn),f(tk+1,xn)=[(xn+2)sinxn-cos⁡xn](etk+1-1-tk+1)+etk+1sinxn,Nτ=1,xn=nh,1≤n≤M-1,Mh=π,un0-∑k=1Ne-kττunk=ψ(xn),tk=kτ,1≤k≤N-1,ψ(xn)=(1-3e-1)sinxn,0≤n≤M,u0k=uMk=0,un1-un0=0,0≤k≤N,1≤n≤M-1
for approximate solutions of nonlocal boundary value problem (3.1). It can be written in the matrix form(3.5)Anun+1+Bnun+Cnun-1=Dφn,1≤n≤M-1,u0=0⃗,uM=0⃗.
Here(3.6)An=[0000⋅⋅⋅0000an0⋅⋅⋅00000an⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅an00000⋅⋅⋅0an0000⋅⋅⋅00](N+1)×(N+1),Bn=[1-τe-τ-τe-2τ-τe-3τ⋅⋅⋅-τe-(N-1)τ-τe-Nτbcdn0⋅⋅⋅000bcdn⋅⋅⋅0000bc⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅dn00000⋅⋅⋅cdn-1100⋅⋅⋅00](N+1)×(N+1),Cn=[0000⋅⋅⋅0000en0⋅⋅⋅00000en⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅en00000⋅⋅⋅0en0000⋅⋅⋅00](N+1)×(N+1),an=-(1+xn)h2-12h,b=1τ2,c=-2τ2,dn=1τ2+2(1+xn)h2+1,en=-(1+xn)h2+12h,φn=[φn0φn1φn2⋮φnN](N+1)×1,φnk+1=f(tk+1,xn)=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,xn=nh,tk=kτ,1≤k≤N-1,
and D=IN+1 is the identity matrix.(3.7)Us=[us0us1us2⋮usN](N+1)×1,s=n-1,n,n+1.
This type system was used by Samarskii and Nikolaev [30] for difference equations. For the solution of the matrix equation (3.5),  we will use the modified Gauss elimination method. We seek a solution of the matrix equation by the following form: (3.8)un=αn+1un+1+βn+1,n=M-1,…,2,1,
where uM=0⃗,  αj(j=1,…,M-1) are (N+1)×(N+1) square matrices, βj(j=1,…,M-1) are (N+1)×1column matrices,  α1,β1 are zero matrices, and(3.9)αn+1=-(Bn+Cnαn)-1An,βn+1=(Bn+Cnαn)-1(Dnφn-Cnβn),n=1,2,3,…,M-1.


## 3.2. The Second Order of Accuracy in Time Difference Scheme

Applying (3.3)  and using the second order of accuracy in t implicit difference scheme (2.10), we obtain the second order of accuracy difference scheme in t and in x(3.10)unk+1-2unk+un-1k-1τ2-(1+xn)[un+1k-1-2unk-1+un-1k-14h2-un+1k-2unk+un-1k2h2-un+1k+1-2unk+1+un-1k+14h2]-[un+1k-1-un-1k-18h+un+1k-un-1k4h+un+1k+1-un-1k+18h]+12unk+unk+1+unk-14=φnk,φnk=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,Mh=π,xn=nh,1≤n≤M-1,Nτ=1,tk=kτ,1≤k≤N-1,un0=∑k=1Nτ2[e-kτunk+e-(k-1)τunk-1]+ψ(xn),0≤n≤M,ψ(xn)=(1-3e-1)sinxn,0≤n≤M,un1-un0=τ22[un+10-un-102h+(1+xn)un+10-2un0+un-10h2-un0+sinxn],1≤n≤M-1,u0k=uMk=0,0≤k≤N
for approximate solutions of the nonlocal boundary value problem (3.1). We have again (N+1)×(M+1) system of linear equations. We can write the system as a matrix equation (3.5).Here(3.11)An=[0000⋅⋅⋅000an2anan0⋅⋅⋅0000an2anan⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅an2ananwn000⋅⋅⋅000](N+1)×(N+1),Bn=[1-τ2-τe-τ-τe-2τ⋅⋅⋅-τe-(N-1)τ-τ2e-Nτbndnbn⋅⋅⋅000bndn⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅bn0000⋅⋅⋅dnbnyn10⋅⋅⋅00](N+1)×(N+1),Cn=[0000⋅⋅⋅000cn2cncn0⋅⋅⋅0000cn2cncn⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅cn2cncnzn000⋅⋅⋅000](N+1)×(N+1),an=-(1+xn)4h2-18h,bn=1τ2+1+xn2h2+14,cn=-(1+xn)4h2+18h,dn=-2τ2+1+xnh2+12,yn=-1+(1+xn)τ2h2+τ22,wn=-τ24h-(1+xn)τ22h2,zn=τ24h-(1+xn)τ22h2,φn=[φn0φn1⋮φnN](N+1)×1,φnk=f(tk,xn)=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,1≤k≤N-1,D=IN+1,Us=[us0us1us2⋮usN](N+1)×1,s=n-1,n,n+1.
For the solution of the matrix equation (3.5), we used the same algorithm as in the first order of accuracy difference scheme.


## 3.3. The Second Order of Accuracy in Time Difference Scheme Generated byA2

Applying (3.3) and formulas(3.12)u(xn+2)-4u(xn+1)+6u(xn)-4u(xn-1)+u(xn-2)h4-u(iv)(xn)=O(h2),2u(0)-5u(h)+4u(2h)-u(3h)h2-u′′(0)=O(h2),2u(π)-5u(π-h)+4u(π-2h)-u(π-3h)h2-u′′(π)=O(h2)
and using difference scheme (2.11), we obtain the second order of accuracy difference scheme(3.13)unk+1-2unk+unk-1τ2-(1+xn)un+1k-2unk+un-1kh2-un+1k-un-1k2h+unk+τ24[(1+xn)2un+2k+1-4un+1k+1+6unk+1-4un-1k+1+un-2k+1h4+4(1+xn)un+2k+1-2un+1k+1+2un-1k+1-un-2k+12h3-2xnun+1k+1-2unk+1+un-1k+1h2-un+1k+1-un-1k+1h+unk+1]=φnk,φnk=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,Mh=π,xn=nh,2≤n≤M-2,Nτ=1,tk=kτ,1≤k≤N-1,un0=∑k=1Nτ2[e-kτunk+e-(k-1)τunk-1]=ψ(xn),0≤n≤M,ψ(xn)=(1-3e-1)sinxn,0≤n≤M,un1-un0=τ22[un+10-un-102h+(1+xn)un+10-2un0+un-10h2-un0+sinxn],2≤n≤M-2,u0k=uMk=0,0≤k≤N,u1k=45u2k-15u3k,0≤k≤N,uM-1k=45uM-2k-15uM-3k,0≤k≤N
for approximate solutions of problem (3.1). One can write the (N+1)×(M+1) system of linear equations (3.13) as the matrix equation(3.14)Anun+2+Bnun+1+Cnun+Dnun-1+Enun-2=Rφn,u0=0⃗,uM=0⃗,2≤n≤M-2,u1=45u2-15u3,uM-1=45uM-2-15uM-3.Here,An,Bn,Cn,  Dn,  En, and R are (N+1)×(N+1) square matrices:(3.15)An=[0000⋅⋅⋅000an0⋅⋅⋅0000an⋅⋅⋅0⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅an0000⋅⋅⋅0],Bn=[000⋅⋅⋅000bncn⋅⋅⋅0000bn⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅cn0000⋅⋅⋅bncnyn00⋅⋅⋅00],Cn=[1-τ2-τe-τ-τe-2τ⋅⋅⋅-τe-(N-2)τ-τe-(N-1)τ-τ2e-Nτdenfn⋅⋅⋅0000den⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅enfn0000⋅⋅⋅denfnwn10⋅⋅⋅000],Dn=[000⋅⋅⋅0000gnln⋅⋅⋅00000gn⋅⋅⋅000⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅000⋅⋅⋅gnln0000⋅⋅⋅0gnlnzn00⋅⋅⋅000],En=[0000⋅⋅⋅0000mn0⋅⋅⋅00000mn⋅⋅⋅00⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅0000⋅⋅⋅mn00000⋅⋅⋅0mn0000⋅⋅⋅00].
We denote (3.16)an=τ24((1+xn)2h4+2(1+xn)h3),bn=-(1+xn)h2-12h,d=1τ2,en=-2τ2+2(1+xn)h2+1,gn=12h-1+xnh2,cn=τ24(-4(1+xn)2h4-4(1+xn)h3-2xnh2-1h),ln=τ24(-4(1+xn)2h4-4(1+xn)h3-2xnh2+1h),fn=1τ2+τ24(6(1+xn)2h4+4xnh2+1),mn=τ24((1+xn)2h4-2(1+xn)h3),zn=τ24h-(1+xn)τ22h2,wn=-1+(1+xn)τ2h2+τ22,yn=-τ24h-(1+xn)τ22h2,φn=[φn0φn1⋮φnN](N+1)×1,φnk=f(tk,xn)=[(xn+2)sinxn-cos⁡xn](etk-1-tk)+etksinxn,1≤k≤N-1,R=IN+1istheidentitymatrix,Us=[Us0Us1⋮UsN](N+1)×1,
where s=n±2, n±1, n.For the solution of matrix equation (3.14), we will use the modified Gauss elimination method. We seek a solution of the matrix equation by the following formula: (3.17)Un=αn+1un+1+βn+1un+2+γn+1,n=M-2,…,2,1,
where αj,βj(j=1,…,M-1) are (N+1)×(N+1) square matrices, γj(j=1,…,M-1) are (N+1)×1column matrices, and α1, β1, γ1, γ2 are zero matrices. α2, β2 are(3.18)α2=45IN+1,β2=-15IN+1,Fn=Cn+Dnαn+Enαn-1αn+Enβn-1αn+1=Fn-1[-Bn-Dnβn-Enαn-1βn],βn+1=-Fn-1An,γn+1=Fn-1[Rφn-Dnγn+Enαn-1γn+Enγn-1].
For solution of the last difference equation, we need to find uM, uM-1(3.19)uM=0⃗,uM-1=((βM-2+5I)-(4I-αM-2)αM-1)-1((4I-αM-2))γM-1-γM-2.


## 3.4. Error Analysis

The errors are computed by(3.20)EMN=max⁡1≤k≤N-1,1≤n≤M-1|u(tk,xn)-unk|
of the numerical solutions, where u(tk,xn) represents the exact solution and  unk represents the numerical solution at (tk,xn) and the results are given in Table 1.Table 1Difference schemesN=M=20N=M=40N=M=80Difference schemes (3.4)0.07430.03570.0175Difference schemes (3.10)0.00120.00030090.0000756Difference schemes (3.13)0.00054530.00012310.00002923Thus, the results show that the second order of accuracy difference schemes (3.10) and (3.13) are more accurate comparing with the first order of accuracy difference scheme (3.4).



---

*Source: 562385-2011-02-22.xml*