# A Crank-Nicolson Difference Scheme for Solving a Type of Variable Coefficient Delay Partial Differential Equations

Authors: Wei Gu; Peng Wang
Journal: Journal of Applied Mathematics
 (2014)

---

## Abstract

A linearized Crank-Nicolson difference scheme is constructed to solve a type of variable coefficient delay partial differential equations. The difference scheme is proved to be unconditionally stable and convergent, where the convergence order is two in both space and time. A numerical test is provided to illustrate the theoretical results.


---

## Body

## 1. Introduction

In the past few years, many scholars pay their attention to the theory of delay differential equations (DDEs) [1, 2]. There are many research results on delay ordinary differential equations [3, 4]; however, only few scholars focus on studies of delay partial differential equations. As we know, since, in most cases, DDEs’ exact solutions cannot be computed analytically, efficient numerical methods are needed to solve such equations.In this paper, the numerical solutions of the following variable coefficient delay partial differential equations are considered:(1)r(x,t)ut-duxx=f(u(x,t-s)),(x,t)∈(0,1)×(0,T],(2)u(x,t)=ϕ(x,t),x∈[0,1],t∈[-s,0],(3)u(0,t)=α(t),u(1,t)=β(t),t∈(0,T],
where d>0 is the constant diffusion coefficient, s>0 is the delay term, Ω=[0,1]×[-s,T], r(x,t)∈C((0,1)×(0,T]), and r(x,t)≥c0>0. In the case of r(x,t)=1, numerical solutions of (1)–(3) have been considered in [5–7]. A Crank-Nicolson scheme and a linearized compact difference scheme have been proposed by Zhang and Sun in [5] and [6], respectively. Q. F. Zhang and C. J. Zhang considered a new linearized compact multisplitting scheme in [7]. We will construct a Crank-Nicolson scheme for solving (1)–(3). The unconditional stability and convergence will be shown in this paper, where the convergence order is two in both space and time. To testify the theoretical results, a numerical test is provided.The paper is organized as follows. In Section2, a linearized Crank-Nicolson scheme is constructed to solve (1)–(3). Section 3 considers the solvability, stability, and convergence of the Crank-Nicolson scheme. In Section 4, a numerical test is provided to illustrate the theoretical results. Section 5 gives a brief discussion of this paper.


## 2. Construction of the Linearized Crank-Nicolson Scheme

In this subsection, a linearized Crank-Nicolson scheme for solving (1)–(3) is constructed. In this paper, we make the following assumptions:(H1)
assume that (1)–(3) had a unique solution u∈C4,3(Ω), u, and its partial derivatives are bounded by a constant c1;(H2)
f(u(x,t-s)) has second derivatives, and we denote
(4)c2=max⁡|ε1|≤ε0,|ε2|≤ε0,|ε3|≤ε0{f′′|f(u(x,t-s)+ε1)|,|f′(u(x,t-s)+ε2)|,|f′′(u(x,t-s)+ε3)|}, where ε0>0, and c2 are constants.Two positive integersM and j are taken; then let h=1/M, τ=s/j, xi=ih, tk=kτ and tk+1/2=(tk+tk+1)/2. Define Ωhτ=Ωh×Ωτ, where Ωh={xi∣0≤i≤M} and Ωτ={tk∣-j≤k≤N}, N=[T/τ]. Denote Uik=u(xi,tk), 0≤i≤M, -j≤k≤N. Let
(5)𝒲={vik∣0≤i≤M,-j≤k≤N}
be the grid function space defined on Ωhτ. Introduce the following notations:
(6)vik+1/2=vik+vik+12,δtvik+1/2=vik+1-vikτ,δxvi+1/2k=vi+1k-vikh,δx2vik=vi+1k-2vik+vi-1kh2.Considering (1) at the point (xi,tk+1/2), we have
(7)r(xi,tk+1/2)∂u∂t(xi,tk+1/2)-d∂2u∂x2(xi,tk+1/2)=f(u(xi,tk+(1/2)-j)),1≤i≤M-1,0≤k≤N-1.From Taylor expansion,(8)∂u∂t(xi,tk+1/2)=δtUik+1/2-τ224∂3u∂t3(xi,ηik),ηik∈(tk,tk+1),∂2u∂x2(xi,tk+1/2)=12[∂2u∂x2(xi,tk)+∂2u∂x2(xi,tk+1)]-τ28∂4u∂x2∂t2(xi,γik)=12(δx2Uik+δx2Uik+1)-h224[∂4u∂x4(ξik,tk)+∂4u∂x4(ξik+1,tk+1)]-τ28∂4u∂x2∂t2(xi,γik),ξik,ξik+1∈(xi-1,xi+1),γik∈(tk,tk+1),f(u(xi,tk+(1/2)-j))=f(u(xi,tk-j))+τ2f′(u(xi,tk-j))ut′(xi,tk-j)+ζik-j=f(Uik-j)+τ2f′(Uik-j)δtUik+(1/2)-j+ζik-j,ζik-j∈(tk-j,tk+1-j),
where |ζik-j|≤c3τ2. Substituting (8) into (7) and denoting rik+1/2=r(xi,tk+1/2), we obtain
(9)rik+1/2δtUik+1/2-dδx2Uik+1/2=f(Uik-j)+τ2f′(Uik-j)δtUik+(1/2)-j+Rik,
where
(10)|Rik|≤c4(τ2+h2),1≤i≤M-1,0≤k≤N-1.
Discretizing the initial and boundary conditions of (2) and (3), we obtain
(11)Uik=ϕ(xi,tk),0≤i≤M,-j≤k≤0,(12)U0k=α(tk),UMk=β(tk),1≤k≤N.
Replacing Uik by uik and omitting Rik, we obtain the following Crank-Nicolson scheme:
(13)rik+1/2δtuik+1/2-dδx2uik+1/2=f(uik-j)+τ2f′(uik-j)δtuik+(1/2)-j,uik=ϕ(xi,tk),0≤i≤M,-j≤k≤0,u0k=α(tk),uMk=β(tk),1≤k≤N.


## 3. The Solvability, Convergence, and Stability of the Crank-Nicolson Scheme

Define the following grid function space onΩh:
(14)V=v∣v=(v0,v1,…,vM),v0=vM=0.Ifv∈V, introducing the following notations:
(15)∥v∥=h∑i=1M-1‍(vi)2,|v|1=h∑i=1M‍(vi-vi-1h)2,∥v∥∞=max⁡0≤i≤M|vi|.
The following two inequalities are satisfied [8]:
(16)∥v∥∞≤12|v|1,(17)∥v∥≤16|v|1.
For the analysis of the difference scheme, the following Lemma is needed.Lemma 1 (see [8]).
Let{Fk∣k≥0} be nonnegative sequence and satisfy
(18)Fk+1≤A+Bτ∑i=1k‍Fl,k=0,1,…;
then
(19)Fk+1≤Aexp⁡(BKτ),k=0,1,2,…,
where A and B are nonnegative constants.Theorem 2.
The difference scheme (13) has a unique solution, under the condition that h and τ are small enough.Proof.
From the positive definiteness of the coefficient matrix of the scheme (13), we can easily obtain the results of Theorem 2 by the mathematical induction method.Denotingeik=Uik-uik, 0≤i≤M, -j≤k≤N, subtracting (13) from (9), (11), and (12), respectively, we obtain the following error equations:
(20)rik+1/2δteik+1/2-dδx2eik+1/2=f(Uik-j)-f(uik-j)+τ2[f′(Uik-j)δtUik+(1/2)-j-f′(uik-j)δtuik+(1/2)-j]+Rik,(21)eik=0,0≤i≤M,-j≤k≤0,(22)e0k=0,eMk=0,1≤k≤N.Theorem 3.
Lettingh and τ be small enough, one has
(23)∥ek∥∞≤C(τ2+h2),0≤k≤N,
where C>0 is independent of h and τ.Proof.
Multiplying (20) by hδteik+1/2 and summing up for i from 1 to M-1, we obtain
(24)h∑i=1M-1rik+1/2(δteik+1/2)2-dh∑i=1M-1δx2eik+1/2δteik+1/2=I1+I2,
where
(25)I1=h∑i=1M-1{f(Uik-j)-f(uik-j)+τ2[f′(Uik-j)δtUik+(1/2)-j-f′(uik-j)δtuik+(1/2)-j]}δteik+1/2,I2=h∑i=1M-1Rikδteik+1/2.
The mathematical induction method will be used to prove Theorem3. From (21), we have ∥ek∥∞=0, for -j≤k≤0. Suppose that (23) is true for 0<k≤l, we will prove that (23) is also valid for k=l+1.
From the inductive assumption, we have(26)∥ek∥∞≤C(τ2+h2),0≤k≤l.
In the following, each term of (24) will be estimated. Consider
(27)h∑i=1M-1rik+1/2(δteik+1/2)2≥c0∥δtek+1/2∥2,-dh∑i=1M-1δx2eik+1/2δteik+1/2=d2τ(|ek+1|12-|ek|12).
From (H1) and (H2), we have
(28)f(Uik-j)-f(uik-j)+τ2[f′(Uik-j)δtUik+(1/2)-j-f′(uik-j)δtuik+(1/2)-j]≤c2|eik-j|+τ2[f′(Uik-j)δteik+(1/2)-j+(f′(Uik-j)-f′(uik-j))×(δtUik+(1/2)-j-δteik+(1/2)-j)]≤C(|eik-j|+|eik+1-j|).
Using the above inequality, we have
(29)I1≤Ch∑i=1M-1(|eik-j|+|eik+1-j|)|δteik+1/2|≤ɛh∑i=1M-1(δteik+1/2)2+Ch(∑i=1M-1(eik-j)2+∑i=1M-1(eik+1-j)2)=ɛ∥δtek+1/2∥2+C(∥ek-j∥2+∥ek+1-j∥2),I2≤ɛh∑i=1M-1(δteik+1/2)2+Ch∑i=1M-1(Rik)2≤ɛ∥δtek+1/2∥2+C(τ2+h2)2.
Inserting (27)–(29) into (24), we obtain
(30)c0∥δtek+1/2∥2+d2τ(|ek+1|12-|ek|12)≤2ɛ∥δtek+1/2∥2+C(∥ek-j∥2+∥ek+1-j∥2)+C(τ2+h2)2,0≤k≤l.
Taking ɛ=c0/2, we have
(31)d2τ(|ek+1|12-|ek|12)≤C(∥ek-j∥2+∥ek+1-j∥2)+C(τ2+h2)2,0≤k≤l.
The above inequality has the following form:
(32)|ek+1|12≤|ek|12+Cτ(∥ek-j∥2+∥ek+1-j∥2)+Cτ(τ2+h2)2,0≤k≤l.
Summing up (32) for k, noticing (21), and exploiting (17), we have
(33)|ek+1|12≤|e0|12+Cτ∑m=0k(∥em-j∥2+∥em+1-j∥2)+Cτ∑k=0l(τ2+h2)2≤Cτ∑m=1k+1-j∥em∥2+C(τ2+h2)2≤Cτ∑m=1k|em|12+C(τ2+h2)2,0≤k≤l.
By Lemma 1, we have
(34)|el+1|12≤C(τ2+h2)2,
where C is a constant which depends on c0, c1, c2, d, and T. From (16), we obtain
(35)∥el+1∥∞≤C(τ2+h2).
By the inductive principle, this completes the proof.Remark 4.
Theorem3 shows that the convergence order of the variable coefficient delay partial differential equations (1) is o(t2+h2). However, for the constant coefficient delay partial differential equations (r(x,t)=1 in (1)), a Crank-Nicolson scheme with o(t2+h2) convergence is constructed in [5], and a new difference scheme with o(t2+h4) convergence is constructed in [9].To discuss the stability of the difference scheme (13), we consider the following problem:
(36)r(x,t)vt-dvxx=f(v(x,t-s)),(x,t)∈(0,1)×(0,T],v(x,t)=ϕ(x,t)+ψ(x,t),x∈[0,1],t∈[-s,0],v(0,t)=α(t),v(1,t)=β(t),t∈(0,T].
The following difference scheme solving for (36) can be obtained:
(37)rik+1/2δtvik+1/2-dδx2vik+1/2=f(vik-j)+τ2f′(vik-j)δtvik+(1/2)-j,vik=ϕ(xi,tk)+ψik,0≤i≤M,-j≤k≤0,v0k=α(tk),vMk=β(tk),1≤k≤N,
where ψik is a perturbation of ϕ(xi,tk).Similar to the proof of Theorem3, the following stability result can be obtained.Theorem 5.
Denote(38)ηik=vik-uik,0≤i≤M,-j≤k≤N.
Then, there exist constants c5 and c6 such that
(39)∥ηk∥∞≤c5τh∑m=-j0∑i=1M-1(ψik)2
under the condition that h and τ are small enough and max⁡-j≤k≤0,0≤i≤M⁡|ψik|≤c6.Remark 6.
Under the condition of assumptions (H1) and (H2) andmax⁡-j≤k≤0,0≤i≤M⁡|ψik|≤c6, for small h and τ, we can get the stability results of Theorem 5 (which can be referred to in [8, 10, 11]), where the difficulty is that rik+1/2≠1; the proof can be referred to in the proof of Theorem 3.


## 4. Numerical Test

In this section, a numerical example is considered to validate the algorithm provided in this paper, and the numerical solutionsuik of the example are obtained by exploiting scheme (13). Define
(40)E∞(h,τ)=max⁡0≤i≤M,0≤k≤N|u(xi,tk)-uik|.Consider the following problem:(41)r(x,t)ut-uxx=u(x,t-0.1),x∈(0,1),t∈(0,1],u(x,t)=e-x(1+t),x∈(0,1),t∈[-0.1,0],u(0,t)=1+t,u(1,t)=e-1(1+t),t∈(0,1],
where r(x,t)=2(t+0.95). The exact solution of (41) is u(x,t)=e-x(1+t).Table1 provides some numerical results of difference scheme (13) solving for (41) with step size h=τ=0.01. Table 2 gives the maximum absolute errors between numerical solutions and exact solutions with different step sizes. From Table 2, we can see that when both the space step size and the time step size are reduced by a factor of 1/2, then the maximum absolute errors are reduced by a factor of approximately 1/4.Table 1
Numerical results of (41) when h=τ=1/100.
(
x
,
t
)
Numerical solution
Exact solution
|
u
(
x
i
,
t
k
)
-
u
i
k
|
(
0.5,0.1
)
0.667184
0.667184
2.501
e
-
007
(
0.5,0.2
)
0.727837
0.727837
4.324
e
-
007
(
0.5,0.3
)
0.788490
0.788490
5.702
e
-
007
(
0.5,0.4
)
0.849144
0.849143
6.812
e
-
007
(
0.5,0.5
)
0.909797
0.909796
7.753
e
-
007
(
0.5,0.6
)
0.970450
0.970449
8.586
e
-
007
(
0.5,0.7
)
1.031103
1.031102
9.347
e
-
007
(
0.5,0.8
)
1.091756
1.091755
1.006
e
-
006
(
0.5,0.9
)
1.152409
1.152408
1.074
e
-
006
(
0.5,1.0
)
1.213062
1.213061
1.140
e
-
006Table 2
Maximum norm errors of (41) with different step sizes.
h
τ
E
∞
(
h
,
τ
)
E
∞
(
h
,
τ
)
/
E
∞
(
h
/
2
,
τ
/
2
)
1/10
1/10
1.138
e
-
004
*
1/20
1/20
2.872
e
-
005
3.962
1/40
1/40
7.182
e
-
006
3.999
1/80
1/80
1.796
e
-
006
4.000
1/160
1/160
4.489
e
-
007
4.000Figure1 provides us with the error curves of numerical solutions for (41) at t=1 by using scheme (13). Figures 2 and 3 give the error surface of the numerical solutions with step sizes h=τ=1/80 and h=τ=1/160, respectively.Figure 1
Error curves of difference scheme (13) solving for problem (41) with different step sizes, when t=1.Figure 2
Error surface maps of difference scheme (13) solving for problem (41) with step size h=τ=1/80.Figure 3
Error surface maps of difference scheme (13) solving for problem (41) with step size h=τ=1/160.Generally speaking, from the results of the tables and the figures provided, we can see that the numerical results are coincident with the theoretical results.


## 5. Conclusion

In this paper, a type of variable coefficient delay partial differential equations is considered. A linearized Crank-Nicolson scheme is constructed and is proved to be unconditionally stable and convergent. Finally, a numerical test is provided to illustrate the theoretical results.



---

*Source: 560567-2014-02-27.xml*