An Approximation Method Based on Matrix Formulated

16
Computational Methods in Applied Mathematics Vol. 12 (2012), No. 1, pp. 92–107 c 2012 Institute of Mathematics, NAS of Belarus Doi: 10.2478/cmam-2012-0006 An Approximation Method Based on Matrix Formulated Algorithm for the Heat Equation with Nonlocal Boundary Conditions Sedaghat Shahmorad · Abdollah Borhanifar · Babak Soltanalizadeh Abstract In this paper, we utilize a matrix formulation for the heat equation with nonlocal boundary conditions. We give details of the method and verify the existence of a solution for the given equation under a new suitable condition. A simple and efficient algorithm is presented for the numerical results illustrating the accuracy of the method. 2010 Mathematical subject classification: 35Lxx; 35Qxx. Keywords: heat equation; nonlocal boundary conditions; matrix formulation. 1. Introduction The Tau method was introduced by Lanczos in 1938 and was extended for the numer- ical solution of ODEs by Ortiz. In 1981, Ortiz and Samara [1] proposed an operational technique for the numerical solution of nonlinear ordinary differential equations with some supplementary conditions based on the Tau method [2]. In recent years, many authors have been used this method for solving various types of equations. For example, in [3, 4] this method has used for linear ordinary differential eigenvalue problems and in [8, 9] it has been used for partial differential equations. This method has also developed for different types of integral and integro-differential equations [11, 12]. In this paper, we introduce a new matrix formulation based on the operational approach to the Tau method for solving a nonlocal heat equation of the form u t u xx = f (x, t), x (0, 1), 0 <t 6 T, (1.1) with the nonlocal boundary conditions (NLBCs) u(0,t)= 1 0 K 0 (x)u(x, t)dx + g 0 (t), 0 <t 6 T. u(1,t)= 1 0 K 1 (x)u(x, t)dx + g 1 (t), (1.2) Sedaghat Shahmorad Department of Applied Mathematics, University of Tabriz , 29 Bahman Boulevard, Tabriz, Iran E-mail: [email protected] Abdollah Borhanifar Department of Mathematics, University of Mohaghegh Ardabili, Ardabil, Iran E-mail: [email protected] Babak Soltanalizadeh Young Researchers Club, Sarab Brach of Islamic Azad University, Sarab, Iran. E-mail: [email protected] Brought to you by | Université de Fribourg (Université de Fribourg) Authenticated | 172.16.1.226 Download Date | 4/24/12 1:17 PM

Transcript of An Approximation Method Based on Matrix Formulated

Computational Methods in Applied MathematicsVol. 12 (2012), No. 1, pp. 92–107c⃝ 2012 Institute of Mathematics, NAS of Belarus

Doi: 10.2478/cmam-2012-0006

An Approximation Method Based on MatrixFormulated Algorithm for the Heat Equation

with Nonlocal Boundary ConditionsSedaghat Shahmorad · Abdollah Borhanifar · Babak Soltanalizadeh

Abstract — In this paper, we utilize a matrix formulation for the heat equation withnonlocal boundary conditions. We give details of the method and verify the existenceof a solution for the given equation under a new suitable condition. A simple andefficient algorithm is presented for the numerical results illustrating the accuracy ofthe method.

2010 Mathematical subject classification: 35Lxx; 35Qxx.

Keywords: heat equation; nonlocal boundary conditions; matrix formulation.

1. Introduction

The Tau method was introduced by Lanczos in 1938 and was extended for the numer-ical solution of ODEs by Ortiz. In 1981, Ortiz and Samara [1] proposed an operationaltechnique for the numerical solution of nonlinear ordinary differential equations with somesupplementary conditions based on the Tau method [2]. In recent years, many authors havebeen used this method for solving various types of equations. For example, in [3, 4] thismethod has used for linear ordinary differential eigenvalue problems and in [8, 9] it has beenused for partial differential equations. This method has also developed for different types ofintegral and integro-differential equations [11, 12]. In this paper, we introduce a new matrixformulation based on the operational approach to the Tau method for solving a nonlocalheat equation of the form

ut − uxx = f(x, t), x ∈ (0, 1), 0 < t 6 T, (1.1)

with the nonlocal boundary conditions (NLBCs)u(0, t) =

∫ 1

0K0(x)u(x, t)dx+ g0(t),

0 < t 6 T.

u(1, t) =∫ 1

0K1(x)u(x, t)dx+ g1(t),

(1.2)

Sedaghat ShahmoradDepartment of Applied Mathematics, University of Tabriz , 29 Bahman Boulevard, Tabriz, IranE-mail: [email protected]

Abdollah BorhanifarDepartment of Mathematics, University of Mohaghegh Ardabili, Ardabil, IranE-mail: [email protected]

Babak SoltanalizadehYoung Researchers Club, Sarab Brach of Islamic Azad University, Sarab, Iran.E-mail: [email protected]

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 93

and initial conditionu(x, 0) = u0(x), x ∈ [0, 1]. (1.3)

Problems of this type arise in the quasi-static theory of thermoelasticity [13, 14, 15]. Forexample, the following variants of this problem were investigated by W. A. Day in [13] and[23]. In [23] the author showed that the entropy per unit volume, u(x, t), satisfies (1.3) and

ut − (1 + δ2)−1uxx = f(x, t), x ∈ (0, 1), 0 < t 6 T,

with NLBCS u(0, t) =

∫ 1

0δu(x, t)dx,

0 < t 6 T.

u(1, t) =∫ 1

0δu(x, t)dx,

where

δ = −(3λ+ 2γ)( θ0(λ+ 2γ)c

) 12B,

and λ, γ are the elastic modula, θ is the reference temperature, c is the specific heat per unitvolume and B is the thermal expansion coefficient.

In [13], the quasi-static flexure of a thermoelastic rod with a unit length was considered.In this case, the entropy u satisfies (1.3) and

ut − (1 + δ2)−1uxx = f(x, t), x ∈ (0, 1), 0 < t 6 T,

with NLBCs u(0, t) = −

∫ 1

02δ2(2− 3x)u(x, t)dx,

0 < t 6 T.

u(1, t) = −∫ 1

02δ2(1− 3x)u(x, t)dx,

where

δ2 =θ0B

2

cA,

here A is the flexural rigidity, B is the measure of the cross-coupling between thermal andmechanical energy, θ0 is the reference temperature, and c is the specific heat per unit volume.W. A. Day [13, 14] proved the existence and uniqueness of solution of (1.1)-(1.3) underconsidering the conditions∫ 1

0

|K0(x)|dx < 1,

∫ 1

0

|K1(x)|dx < 1. (1.4)

Then G. Ekolin [16] presented a θ −method for θ = 0, 1 and proved the convergence of hismethod by conditions (1.4). He also proved the convergence of the Crank-Nicholson methodunder the condition (∫ 1

0

|K0(x)|2dx) 1

2+(∫ 1

0

|K1(x)|2dx) 1

2 6√3

2, (1.5)

which is stronger than (1.4).Y. Liu [17] presented a θ-method for θ > 0.5 and proved its convergence under conditions

(1.4) along with an extra condition∫ 1

0

|K0(x)|2dx+

∫ 1

0

|K1(x)|2dx < 2. (1.6)

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

94 Sedaghat Shahmorad et al.

Recently[26, 27] the problem of solving the heat equation with nonlocal boundary conditionshas been investigated very actively. In [28, 29], general conditions for the existence of aunique solution to parabolic problems with nonlocal boundary conditions were formulated.

In the present paper, we give a simple algorithm with a high accuracy of solutions dis-tinguishing it from other existing methods, such as the θ-method and the Crank-Nicholsonmethod, since we obtain a simple recurrence relation (see (3.8) in Section 3) for computingthe unknown coefficients of the approximate solution, which marked by simplifies the com-putational procedure.

2. Matrix formulation

In (1.1)−(1.3), the functions f(x, t), K0(x), K1(x), g0(t), g1(t) , and u0(x) are generally notpolynomials. We assume that these functions are polynomials or they can be approximatedby polynomials to any degree of accuracy. For this purpose, we can use one or two variateTaylor or Chebyshev series or other suitable methods. So we can write

f(x, t) ≃∑n

i=0

∑nj=0 fijx

itj = XTFT,

K0(x) ≃∑n

i=0 kixi = XTK, K1(x) ≃

∑ni=0 k

′ix

i = XTK ′,g0(x) ≃

∑nj=0 gjt

j = GT, g1(x) ≃∑n

j=0 g′jt

j = G′T,

u0(x) ≃∑n

i=0 aixi = XTA,

(2.1)

where

X = [1, x, x2, ..., xn]T , T = [1, t, t2, ..., tn]T ,A = [a0, a1, a2, ..., an]

T ,K = [k0, k1, k2, ..., kn]

T , K ′ = [k′0, k

′1, k

′2, ..., k

′n]

T ,G = [g0, g1, g2, ..., gn], G′ = [g′0, g

′1, g

′2, ..., g

′n],

F = [F0, F1, F2, ..., Fn],Fi = [f0i, f1i, f2i, ..., fni]

T , i = 0, 1, 2, ..., n.

(2.2)

Remark 2.1. Note that we have taken all polynomials of degree n, since otherwise themaximum degree of F, K0, K1, g0, g1, u0 can be used.

Therefore, we consider an approximate solution of the form

Un(x, t) =n∑

i=0

n∑j=0

uijxitj = XTUT, (2.3)

whereU = [U0, U1, U2, ..., Un], (2.4)

withUi = [u0i, u1i, u2i, ..., uni]

T .

The matrix U is an (n+1)×(n+1) matrix containing (n+1)2 unknown coefficients of un(x, t).To find these unknowns, we proceed as follows. We first consider the initial condition

u(x, 0) = u0(x), x ∈ [0, 1].

Then by substituting from (2.1) and (2.3), we obtain

n∑i=0

ui0xi =

n∑i=0

aixi,

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 95

or, equivalently,XTU0 = XTA,

which impliesU0 = A, (2.5)

since X is a basis vector. From (2.5) we can find the first column of U . Thus, the requiredequations reduced to n(n+ 1) equations. Now we consider the first of the NLBCs

u(0, t) =

∫ 1

0

K0(x)u(x, t)dx+ g0(t), 0 < t 6 T

and substitute again from (2.1) and (2.3) to obtain∑nj=0 u0jt

j =∫ 1

0

(∑nh=0 khx

h)(∑n

i=0

∑nj=0 uijx

itj)dx+

∑nj=0 gjt

j

=∑n

h=0

∑ni=0

∑nj=0 khuijt

j∫ 1

0xh+idx+

∑nj=0 gjt

j

=∑n

h=0

∑ni=0

∑nj=0 khuijt

jvh+i+1 +∑n

j=0 gjtj, 0 < t 6 T.

(2.6)

or, equivalently,U ′0T = DUT +G0T. (2.7)

where U ′0 = [u00, u01, u02, ..., u0n],

G0 = [g0, g1, g2, ..., gn],D = [d0, d1, d2, ..., dn],

with

di =n∑

h=0

khvh+i+1, i = 0, 1, 2, ..., n,

and

vh+i+1 =1

h+ i+ 1, h, i = 0, 1, 2, ..., n.

Since T is a basis vector, Eq. (2.7) can be written as

U ′0 = DU +G0. (2.8)

In a similar manner the second NLBCs

u(1, t) =

∫ 1

0

K1(x)u(x, t)dx+ g1(t), 0 < t 6 T.

reduces to the matrix equationD′U = G′

0, (2.9)

with G′

0 = [g′0, g′1, g

′2, ..., g

′n],

D′ = [1− d′0, 1− d′1, 1− d′2, ..., 1− d′n],d′i =

∑nh=0 k

′hvh+i+1; i = 0, 1, 2, ..., n.

Now we use the following lemmas to write Eq. (1.1) in the matrix form to obtain theremaining equations. These lemmas can be proved by induction.

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

96 Sedaghat Shahmorad et al.

Lemma 2.1. The effect of r repeated differentiation on coefficients vectora = [a0, a1, a2, ..., an] of the polynomial yn(x) = aX is the same as that of the post-multiplicationof a by the matrix ηr

dr

dxryn(x) = aηrX,

where

η =

0 0 0 0 . . . 0 01 0 0 0 . . . 0 00 2 0 0 . . . 0 00 0 3 0 . . . 0 0...

......

......

......

0 0 0 0 . . . n 0

(n+1)(n+1)

Lemma 2.2. Let un(x, t) = XTUT, with X = [1, x, x2, ..., xn]T , T = [1, t, t2, ..., tn]T andU = [U0, U1, U2, ..., Un] with Uj = [u0,j, u1,j, u2,j, ..., un,j]

T ,then

dr

dxrun(x, t) = XT (ηT )rUT,

dr

dtrun(x, t) = XTUηrT.

(2.10)

Corollary 2.1. By using Lemma 2.2, we haveuxx = XT (ηT )2UT,

ut = XTUηT.(2.11)

Therefore, substituting (2.1), (2.3), and (2.11) into (1.1) leads to

XTUηT −XT (ηT )2UT = XTFT,

or, equivalently,Uη − (ηT )2U = F (2.12)

since X and T are basis vectors.

3. Obtaining of final linear equations

In this Section, we rearrange the linear equations obtained in the previous Section tohave a system of (n+ 1)2 equations for (n+ 1)2 unknowns. To generate these equations, wenotice that Eqs. (1.1)-(2) are not satisfied for x ∈ [0, 1] and t ∈ [0, T ]; therefore, we selectonly the equations that are satisfied in the corresponding intervals, that is:

• equation (1.3) is defined for each point of the corresponding interval; thus, we selectall the generated equations from (2.5).

• equations (2) are not defined for t = 0; thus, we eliminate the first equations from(2.8) and (2.9).

• equation (1.1) is not defined for x = 0, 1 and t = 0; thus, we eliminate the correspondinggenerated equations from (2.12).

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 97

Therefore, we find (n + 1) equations from (2.5), 2n equations from (2.8) and (2.9), andn(n− 1) equations from (2.12). So that we proceed as follows:we write from (2.8)

(d0 − 1)u0j +n∑

i=1

diuij = −gj, j = 1, 2, 3, ..., n.

or, equivalently,

[d0 − 1, d1, d2, . . . , dn

]

u01 u02 u03 . . . u0n

u11 u12 u13 . . . u1n

u21 u22 u23 . . . u2n...

......

......

un1 un2 un3 . . . unn

=

[−g1,−g2,−g3, . . . ,−gn

]. (3.1)

Also, we write from (2.9)

n∑i=0

(1− d′i)uij = g′j, j = 1, 2, 3, ..., n.

or

[1− d′0, 1− d′1, 1− d′2, . . . , 1− d′n,

]

u01 u02 u03 . . . u0n

u11 u12 u13 . . . u1n

u21 u22 u23 . . . u2n...

......

......

un1 un2 un3 . . . unn

=

[g1, g2, g3, . . . , gn

]. (3.2)

Now we simplify (2.12) to get the remaining equations:

u00 u01 u02 u03 . . . u0n

u10 u11 u12 u13 . . . u1n

u20 u21 u22 u23 . . . u2n...

......

......

...un−1,0 un−1,1 un−1,2 un−1,3 . . . un−1n

un0 un1 un2 un3 . . . unn

0 0 0 0 . . . 0 01 0 0 0 . . . 0 00 2 0 0 . . . 0 0...

......

......

......

0 0 0 0 . . . n 0

0 0 2 0 0 . . . 00 0 0 6 0 . . . 00 0 0 0 12 . . . 0...

......

......

...0 0 0 0 0 . . . n(n− 1)0 0 0 0 0 . . . 00 0 0 0 0 . . . 0

u00 u01 u02 . . . u0n

u10 u11 u12 . . . u1n

u20 u21 u22 . . . u2n...

......

......

un−1,0 un−1,1 un−1,2 . . . un−1n

un0 un1 un2 . . . unn

Brought to you by | Université de Fribourg (Université de Fribourg)

Authenticated | 172.16.1.226Download Date | 4/24/12 1:17 PM

98 Sedaghat Shahmorad et al.

=

f00 f01 f02 . . . f0nf10 f11 f12 . . . f1n...

......

......

fn0 fn1 fn2 . . . fnn

. (3.3)

Let B and F denote the right and left sides of (3.3) respectively, then we have

B =

u01 − 2u20 . . . nu0n − 2u2,n−1 −2u2n

u11 − 6u30 . . . nu1n − 6u3,n−1 −6u3n

u21 − 12u40 . . . nu2n − 12u4,n−1 −12u4n...

......

...un−2,1 − n(n− 1)un0 . . . nun−2,n − n(n− 1)un,n−1 −n(n− 1)unn

un−1,1 . . . nun−1,n 0un1 . . . nunn 0

=

f00 f01 f02 . . . f0nf10 f11 f12 . . . f1n...

......

......

fn0 fn1 fn2 . . . fnn

= F. (3.4)

In view of (2.5), (3.1) and (3.2), and since Eq. (1.1) is defined only for x ∈ (0, 1) and0 < t 6 T , we eliminate the first and last rows and the last column of the matrices B andF in (3.4) and denote the resulting matrices by B′ and F ′. Then

B′ =

u11 − 6u30 . . . nu1n − 6u3,n−1

u21 − 12u40 . . . nu2n − 12u4,n−1...

......

un−3,1 − n(n− 1)un0 . . . nun−2,n − n(n− 1)un,n−1

un−1,1 . . . nun−1,n

=

f10 f11 f12 . . . f1,n−1

f20 f21 f22 . . . f2,n−1...

......

......

fn−1,0 fn−1,1 fn−2,2 . . . fn−1,n−1

= F ′. (3.5)

Eqs. (2.5), (3.1), (3.2), and (3.5) give a system of (n+1)2 equations with (n+1)2 unknowns.By solving this system the unknown coefficients of U can be obtained. To this end, weproceed as follows.

From Eqs. (2.5) and (3.5) we get

ui0 = ai, i = 0, 1, 2, ..., n (3.6)

and

un−1,j = fn−1,j−1, j = 1, 2, 3, ..., n. (3.7)Brought to you by | Université de Fribourg (Université de Fribourg)

Authenticated | 172.16.1.226Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 99

Then we get n equations from (3.1) and n equations from (3.2). Finally, by (3.5), n(n− 2)equations can be generated as

uij =1j

(fij−1 + (i+ 2)(i+ 1)ui+2,j−1

),

i = 1, 2, ..., n− 2, j = 1, 2, ..., n− 2.(3.8)

Now we have (n + 1)(n + 1) equations from (3.1), (3.2), (3.6), (3.7) and (3.8). By solvingthis system of (n+ 1)(n+ 1) equations, we can obtain the value of

uij, i = 0, 1, 2, ..., n, j = 0, 1, 2, ..., n.

To find the remaining unknowns, we suggest the following. We know that by (2.5) the firstcolumn of U was obtained. Thus, at every step we obtain one column of U by an interestingprocess. For example, to find two column of U , we have first

ui1 =12

(fi1 + (i+ 2)(i+ 1)ui+2,0

), i = 1, 2, ..., n− 2, (3.9)

and thenun−1,1 = f(n− 1, 0).

Note that we have obtained u1,1, u2,1, u3,1, ..., un−1,1. To find u0,1, un,1, we utilize (3.1),(3.2).Thus we write [

d0 − 1 dn1− d′0 1− d′n

[u01

un1

]=

[c11c21

]. (3.10)

where c11 = −g1 −

∑n−1i=1 diui1,

c21 = g′1 −∑n−1

i=1 (1− d′i)ui1.

(3.11)

Now, by solving (3.10), we obtain the values of u0,1 and un,1. Now 2nd column of U has beenobtained. Likewise, the remaining columns of U can be obtained.

4. Existence condition and algorithm

In Section 1 (Introduction), we discussed various conditions for the methods presented inthe literature. Here we introduce a new simple sufficient condition for the existence of asolution.

From the last paragraph of Section 3 we conclude the solution for systems (2.5), (3.1),(3.2) and (3.5) depends on the unique solvability of (3.10). Therefore, a solution is deter-mined for (2.5),(3.1),(3.2),(3.5), and, finally, for (1.1) if

det

[d0 − 1 dn1− d′0 1− d′n

]= 0, (4.1)

or, equivalently,

(d0 − 1)(1− d′n) = (1− d′0)(dn). (4.2)Brought to you by | Université de Fribourg (Université de Fribourg)

Authenticated | 172.16.1.226Download Date | 4/24/12 1:17 PM

100 Sedaghat Shahmorad et al.

Algorithmstep 1: Choose n ∈ N as the degree of the approximate solution.step 2: Determine the vectors K, K ′, G, G′ and A and the matrix F .step 3: For i = 0, 1, 2, ..., n, set

di =n∑

h=0

kh1

h+ i+ 1, d′i =

n∑h=0

k′h

1

h+ i+ 1,

and then set

D = [d0, d1, d2, ..., dn], D′ = [d′0, d′1, d

′2, ..., d

′n].

step 4: Set

P =

[d0 − 1 dn1− d′0 1− d′n

].

step 5: Set DET= (d0 − 1)(1− d′n)− dn(1− d′0).step 6: If DET=0, then enter a new value for ”n” and go to step 2.step 7: Set X = [1, x, x2, x3, ..., xn]T , and T = [1, t, t2, t3, ..., tn]T .step 8: For i = 0, 1, 2, ..., n, set ui0 = ai.step 9: For j = 1, 2, 3, ..., n

i=1,2,3,...,n-2 do

uij =1j

(fi,j−1 + (i+ 2)(i+ 1)ui+2,j−1

).

un−1,j =1

jf(n− 1, j − 1).

then set c1j = −gj −

∑n−1i=1 diuij,

c2j = g′j +∑n−1

i=1 (1− d′i)uij.

and

C =

[c0jc1j

].

Solve the system PL = C and find the matrix L.Finally set u0j = L1j and unj = L2j.

step 10: Set Un(x, t) = XTUT.step 11: End

Step 10 gives the approximate solution of equation (1.1) - (1.3).

Remark 4.1. For the complexity analysis of the algorithm, we found the number of re-quired operations for the matrix U . The first column of U does not require any computation.For computing D and D′, 4n+2 operations are needed and each column of U requires O(n)operations. Thus, our procedure requires O(n2) operations for computing n+ 1 columns ofU . Finally, for computing Un(x, t) = XTUT O(n2) operations are needed. Thus, we canassert that our algorithm is of order O(n2).

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 101

In the finite difference schemes, the order of accuracy computed for equations is similarto (1.1) - (1.3). For example, for the methods of [31] and [25] the orders of accuracy asO(h2+ l2) and O(h3+ l3), respectively, were reported. In [30], different orders such as O(eλt)were obtained for different cases of the problem.

5. Error estimation

In this section, we describe the computational and the estimation error for the proposedmethod to ensure that the method can be applied to problems whose exact solutions are notknown.

Consider Eqs. (1.1) – (1.3) and define the error function as

e(x, t) = u(x, t)− un(x, t), (5.1)

where u(x, t) and un(x, t) are the exact and approximate solutions of Eq. (1.1) with condi-tions (2) and (1.3).

Substituting the found value of un(x, t) from (5.1) into (1.1) - (1.3), we get

(un)t(x, t)− (un)xx(x, t) = f(x, t) + p1(x, t), x ∈ (0, 1), 0 < t 6 T, (5.2)

and un(0, t)−

∫ 1

0K0(x)un(x, t)dx = g0(t) + p2(t),

0 < t 6 T,

un(1, t)−∫ 1

0K1(x)un(x, t)dx = g1(t) + p3(t),

(5.3)

and

un(x, 0) = u0(x) + p4(x), x ∈ [0, 1], (5.4)

where p1, p2, p3, p4 are perturbation terms associated with un(x, t).Subtracting (4.2), (5.1), and (5.2) from (1.1), (2), and (1.3), respectively, and using

equation (4.1), we find that the error function e(x, t) is satisfied in the following equations:

et(x, t)− exx(x, t) = −p1(x, t), x ∈ (0, 1), 0 < t 6 T, (5.5)e(0, t)−

∫ 1

0K0(x)e(x, t)dx = −p2(t),

0 < t 6 T,

e(1, t)−∫ 1

0K1(x)e(x, t)dx = −p3(t),

(5.6)

e(x, 0) = −p4(x), x ∈ [0, 1]. (5.7)

Now, in order to construct the approximation en(x, t) to e(x, t), we solve problem (5.3) -(5.5) in the same manner as we did before for problem (1.1) - (1.3).

6. Numerical Examples

In this section, we illustrate the efficiency and accuracy of the presented method using thefollowing numerical examples.

Notice that for approximating f(x, t), K0(x), K1(x), g0(t), g1(t), and u0(x), we usethe Taylor expansion, whenever it is needed.

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

102 Sedaghat Shahmorad et al.

Example 6.1 (Constructed)

Consider the heat equation

ut − uxx = x+ 2x2t− 2t2, x ∈ (0, 1), 0 < t 6 T

with nonlocal boundary conditionsu(0, t) =

∫ 1

0xu(x, t)dx+ (1

6− t

3− t2

4),

0 < t 6 T.

u(1, t) =∫ 1

0u(x, t)dx+ (1

2+ t

2+ 2

3t2),

and initial conditionu(x, 0) = 1 + x, x ∈ [0, 1].

The exact solution of this problem is u(x, t) = 1 + x+ xt+ x2t2.If we choose n = 3 in the algorithm, then we obtain

U =

1 0 0 01 1 0 00 0 1 00 0 0 0

and then

Un(x, t) = XTUT = 1 + x+ xt+ x2t2, x ∈ [0, 1].

we get from step 10, which is the exact solution.

Example 6.2 ([13])

Consider the heat equation

ut − uxx = −e−t(x(x− 1) +

δ

6(1 + δ)+ 2

), x ∈ (0, 1), 0 < t 6 T.

with nonlocal boundary conditionsu(0, t) = −δ

∫ 1

0u(x, t)dx,

0 < t 6 T.

u(1, t) = −δ∫ 1

0u(x, t)dx,

and initial condition

u(x, 0) = x(x− 1) +δ

6(1 + δ), x ∈ [0, 1].

The exact solution is

u(x, t) = e−t(x(x− 1) +

δ

6(1 + δ)

).

For this problem, we compare the results of the presented method with the results obtainedfor δ = 0.0144 in [18, 19] (see Tables 6.2.1, 6.2.2, 6.2.3) and the best approximations in [21](see Table 6.2.4). The numerical results of the presented method are reported in Tables 6.2.4and 6.2.5 for ϵ = 10−15 and different values of n.

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 103

Table 6.2.1 Table 6.2.2 Table 6.2.3Forward Euler method Backward Euler method Crank-Nicolson method

M N Error32 2561 2.3e-0665 10563 5.7e-07

M N Error32 182 5.6e-0565 525 1.9e-05130 1483 6.8e-06

M N Error32 32 2.1e-0565 66 5.0e-06130 131 1.2e-06260 260 3.2e-07

Table 6.2.4Method of [21] Absolute and estimation errors for x=0.5

t N = 33 n = 20 n = 30 |e30(x, t)|∆t = 0.025

0.30 8.2× 10−7 2.776× 10−17 0.278× 10−16 2.220× 10−16

0.60 6.5× 10−7 2.776× 10−17 0.278× 10−16 2.220× 10−16

0.90 4.9× 10−7 2.776× 10−17 0.278× 10−16 1.110× 10−16

1.20 3.6× 10−7 1.388× 10−17 0.139× 10−16 1.110× 10−16

1.50 2.7× 10−7 2.082× 10−17 0.069× 10−16 5.551× 10−16

1.80 1.9× 10−7 1.041× 10−15 0.069× 10−16 02.10 1.5× 10−7 2.584× 10−14 0.035× 10−16 5.551× 10−16

2.40 1.1× 10−7 4.216× 10−13 1.318× 10−16 8.604× 10−16

2.70 8.1× 10−8 0.939× 10−12 0.312× 10−16 1.388× 10−16

3.00 5.9× 10−8 4.459× 10−11 0.121× 10−16 2.776× 10−17

Table 6.2.5Absolute and estimation errors for t = 0.5

x n = 10 n = 15e(x, t) |e15(x, t)| |e∗15(x, t)|

0. 2.778× 10−14 2.168× 10−17 8.673× 10−19 1.258× 10−17

0.1 1.029× 10−12 2.082× 10−17 2.220× 10−16 1.388× 10−16

0.2 1.851× 10−12 2.776× 10−17 2.220× 10−16 2.776× 10−16

0.3 2.438× 10−12 2.776× 10−17 2.220× 10−16 4.163× 10−16

0.4 2.790× 10−12 0 2.220× 10−16 6.106× 10−16

0.5 2.908× 10−12 0 2.220× 10−16 8.049× 10−16

0.6 2.790× 10−12 2.776× 10−17 0 9.992× 10−16

0.7 2.438× 10−12 0 4.441× 10−16 1.277× 10−15

0.8 1.851× 10−12 5.551× 10−17 1.110× 10−15 1.610× 10−15

0.9 1.029× 10−12 0 3.775× 10−15 2.220× 10−15

1.0 2.772× 10−14 4.012× 10−17 1.517× 10−16 3.957× 10−15

Example 6.3 ([18])

Consider the heat equation

ut − uxx =−2(x2 + t+ 1)

(t+ 1)3, x ∈ (0, 1), 0 < t 6 1.

with nonlocal boundary conditionsu(0, t) =

∫ 1

0xu(x, t)dx+ −1

4(t+1)2,

0 < t 6 1.

u(1, t) =∫ 1

0xu(x, t)dx+ 3

4(t+1)2,

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

104 Sedaghat Shahmorad et al.

and the initial conditionu(x, 0) = x2, x ∈ [0, 1]

whose exact solution is

u(x, t) =( x

1 + t

)2

.

In [20], this problem was solved for x=0.4 with various values of ∆t (see Table 6.3.1). Thenumerical results of the presented method are reported in Tables 6.3.2 and 6.3.3.

Table 6.3.1Errors of Dehghan’s method in [18]

∆t method(1.1) method(2) method(1.3) method(1.4)0.0500 7.3× 10−2 3.8× 10−3 7.5× 10−2 7.8× 10−2

0.0250 1.8× 10−2 2.1× 10−4 1.9× 10−2 1.9× 10−2

0.0100 4.4× 10−3 1.2× 10−5 4.0× 10−3 3.9× 10−3

0.0050 1.2× 10−3 7.1× 10−7 1.0× 10−3 1.0× 10−3

0.0025 3.0× 10−4 4.3× 10−8 2.5× 10−4 2.4× 10−4

0.0010 7.5× 10−5 2.5× 10−9 6.1× 10−5 6.0× 10−5

Table 6.3.2Absolute and estimation errors for x=0.5

t n = 100 n = 250 n = 500 |e500(x, t)|0 0 0 0 00.1 0 0 0 4.441× 10−16

0.2 2.776× 10−17 2.776× 10−17 2.776× 10−17 4.441× 10−16

0.3 8.327× 10−17 8.327× 10−17 8.327× 10−17 4.441× 10−16

0.4 2.776× 10−17 2.776× 10−17 2.776× 10−17 4.441× 10−16

0.5 1.388× 10−17 1.388× 10−17 1.388× 10−17 2.220× 10−16

0.6 4.163× 10−17 4.163× 10−17 4.163× 10−17 8.882× 10−16

0.7 3.386× 10−15 0 0 3.331× 10−16

0.8 2.999× 10−9 1.943× 10−16 1.943× 10−16 1.776× 10−15

0.9 3.193× 10−4 1.083× 10−10 2.776× 10−17 4.441× 10−15

Table 6.3.3Absolute and estimation errors for t = 0.5

x n = 50 n = 60e(x, t) |e60(x, t)|

0. 5.932× 10−30 5.995× 10−30 5.551× 10−17

0.1 1.535× 10−16 8.674× 10−19 00.2 6.141× 10−16 3.469× 10−18 00.3 1.381× 10−15 6.939× 10−18 2.220× 10−16

0.4 2.456× 10−15 1.388× 10−17 3.331× 10−16

0.5 3.830× 10−15 1.388× 10−17 4.441× 10−16

0.6 5.523× 10−15 2.776× 10−17 6.661× 10−16

0.7 7.494× 10−15 2.776× 10−17 1.110× 10−15

0.8 9.825× 10−15 5.551× 10−17 1.332× 10−15

0.9 1.243× 10−14 5.551× 10−17 1.554× 10−15

1.0 0 0 0

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 105

Example 6.4 (Constructed)

Consider the heat equation

ut − uxx = (x2 − 2)et, x ∈ (0, 1), 0 < t 6 1.

with NLBCs u(0, t) =

∫ 1

060u(x, t)dx− 20et,

0 < t 6 1.

u(1, t) =∫ 1

0600u(x, t)dx− 199et,

and the initial conditionu(x, 0) = x2, x ∈ [0, 1]

where the exact solution isu(x, t) = x2et.

Note that in this problem we have K0(x) = 60 and K1(x) = 600; therefore, the conditions(1.4), (1.5) and (1.6) are not satisfied for this problem. But we can solve this problem by thepresented method. The numerical results are reported in Tables 6.4.1 and 6.4.2 for ϵ = 10−15

and different values of n.

Table 6.4.1Absolute and estimation errors for x=0.5

t n = 10 n = 20 n = 25 |e25(x, t)|0 0 0 0 00.1 1.110× 10−16 1.110× 10−16 1.110× 10−16 6.661× 10−16

0.2 1.665× 10−16 5.551× 10−17 5.551× 10−17 4.441× 10−16

0.3 1.144× 10−14 5.551× 10−17 5.551× 10−17 4.441× 10−16

0.4 2.718× 10−13 5.551× 10−17 5.551× 10−17 4.441× 10−16

0.5 3.191× 10−12 1.110× 10−16 1.110× 10−16 4.441× 10−16

0.6 2.391× 10−11 5.551× 10−17 5.551× 10−17 4.441× 10−16

0.7 1.315× 10−10 0 0 00.8 5.762× 10−10 0 0 00.9 2.124× 10−9 0 0 01.0 6.828× 10−9 0 0 0

Table 6.4.2Absolute and estimation errors for t = 0.5

x n = 10 n = 20e(x, t) |e20(x, t)| |e∗20(x, t)|

0. 1.169× 10−20 1.161× 10−20 0 3.591× 10−17

0.1 1.276× 10−13 3.469× 10−18 8.882× 10−16 3.816× 10−17

0.2 5.105× 10−13 1.388× 10−17 8.882× 10−16 5.551× 10−17

0.3 1.149× 10−12 5.551× 10−17 8.882× 10−16 8.327× 10−17

0.4 2.042× 10−12 5.551× 10−17 8.882× 10−16 1.110× 10−16

0.5 3.191× 10−12 1.110× 10−16 4.441× 10−18 1.665× 10−16

0.6 4.595× 10−12 2.220× 10−16 8.882× 10−16 2.220× 10−16

0.7 6.254× 10−12 2.220× 10−16 8.882× 10−16 2.220× 10−16

0.8 8.168× 10−12 2.220× 10−16 4.441× 10−18 2.220× 10−16

0.9 1.034× 10−11 4.441× 10−16 4.441× 10−18 4.44.× 10−16

1.0 0 0 0 0

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

106 Sedaghat Shahmorad et al.

Remark 6.1. Note that in Tables 6.2.5 and 6.4.2 e∗n shows the estimation error after asmall change on the right side of the given problem (for example, ϵ = 10−15).

7. Conclusions

In this paper, we have solved the heat equation with nonlocal boundary conditions by the op-erational matrix method. With the use of this method numerical results have been obtainedby a simple algorithm with a high accuracy. We have also determined a new condition forthe existence of a solution which is tested easily (see Example 6.4). Furthermore, if the exactsolution of Eq. (1.1) is a polynomial of degree m, then by this method the exact solutionis obtained for n > m (see Example 6.1). With the help of finite difference schemes onecan obtain approximations of u(x, t) only for the discrete values of x and t, but the methodproposed in this paper permits obtaining a continuous u(x, t) for all values of x and t.

Acknowledgments

The authors thank the referees for their careful reading and useful comments on this paper.

References

[1] E.L. Ortiz and H. Samara, An operational approach to the Tau method for the numerical solution ofnonlinear differential equations, Computing 27 (1981), 15-25.

[2] E.L. Ortiz, The Tau method, SIAM. J. Numer. Anal., 6 (1969), 480-492.

[3] K.M. Liu and E.L. Ortiz, Eigenvalue problems for singularly perturbed differential equations, in: J.J.H.Miller (Ed.), Proceedings of the BAIL II Conference, Boole Press, Dublin, 1982, pp. 324-329.

[4] K.M. Liu and E.L. Ortiz, Approximation of eigenvalues defined by ordinary differential equations withthe Tau method, in: B. Kagestrm, A. Ruhe (Eds.), Matrix Pencils, Springer-Verlag, Berlin, 1983, pp.90-102.

[5] A.Tari, M. Y. Rahimi, S.Shahmorad, and F.Talati, Development of the Tau method for the numericalsolution of the two-dimensional linear volterra integro-differential equations, Computational Methods inApplied Mathematics, 9 (2009) pp. 421–435.

[6] A. Saadatmandi and M. Dehghan, Numerical solution of the one-dimensional wave equation with anintegral condition, Numer. Methods Partial Diff. Eq. 23 (2007) 282-92.

[7] A. Saadatmandi and M. Dehghan, Numerical solution of hyperbolic telegraph equation using the Cheby-shev Tau method, Numer Methods Partial Diff Eq., 26 (2010) 239-252.

[8] K.M. Liu and E.L. Ortiz, Numerical solution of eigenvalue problems for partial differential equationswith the Tau-lines Method, Comput. Math. Appl., 12B (5/6) (1986) 1153-1168.

[9] K.M. Liu, E.L. Ortiz, and K.S. Pun, Numerical solution of Steklov’s partial differential equation eigen-value problem, in: J.J.H. Miller (Ed.), Computational and asymptotic methods for boundary andinterior layers (III), Boole Press, Dublin, 1984, pp. 244-249.

[10] D. Gottlieb, M. Hussaini, and S. Orszag, Theory and applications of spectral methods, Spectral methodsfor partial differential equations, R. Voigt, D. Gottlieb, and M. Hussaini, editors, SIAM, Philadelphia,1984.

[11] M. Hosseini and S.Shahmorad, A matrix formulation of the Tau method for Fredholm and Volterraintegro–diferential equations, Korean J. Comput. Appl. Math., 9 (2002), 497–507.

[12] A. Tari and S. Shahmorad, A computational method for solving tow–dimensional linear Fredholmintegral equations of the second kind, ANZIAM J., 49 (2008), 543-549.

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM

An approximation method based on matrix formulated algorithm 107

[13] W.A. Day, Existence of a property of solutions of the heat equation subject to linear thermoelasticityand other theories, Quart. Appl. Math., 40 (1982), 319-330.

[14] W.A. Day, A decreasing property of solutions of a parabolic equation with applications to thermoelas-ticity and other theories, Quart. Appl. Math., XLIV (1983), 468-475.

[15] J.R. Cannon, The one-dimensional heat equation, in: K. Rach (Ed.), Encyclopedia of Math. Appl., 23,Addison-Wesley, Reading, MA, 1984.

[16] G.Ekolin, Finite difference methods for a nonlocal boundary value problem for the heat equation. BIT,31 (1991), 245–261.

[17] Y.Liu, Numerical solution of the heat equation with nonlocal boundary conditions, J. Comput. Appl.Math., 110 (1999), 115–127.

[18] M. Dehghan, Efficient techniques for the second-order parabolic equations subject to nonlocal specifi-cations, Appl. Numer. Math., 52 (2005), 39–62.

[19] M. Dehghan, Fully implicit finite difference methods for two-dimensional diffusion with a nonlocalboundary condition, J. Comput. Appl Math., 106 (1999), 255-269.

[20] M. Dehghan, A finite difference method for a non-local boundary value problem for 2- dimensional heatequation, Appl. Math. Comput., 112 (1) (2000), 133-142.

[21] W. T. Ang, Numerical solution of non-classical parabolic problem: an integro-differential approach,Appl. Math. Comput., 175 (2) (2006), 969–979.

[22] M. Dehghan, Numerical solution of a parabolic equation with nonlocal boundary specifications. Appl.Math. Comput., 145 (2003),185-194.

[23] W.A. Day, Prabolic equations and thermodynamics. Quart. Appl. Math., 50 (1992), 523–33.

[24] M. Akram and M. A. Pasha, A numerical method for the heat equation with a nonlocal boundarycondition, International Journal for Information and Systems Sciences 1 (2) (2005), 162-171.

[25] M. Akram and M. A. Pasha, A numerical scheme for the parabolic equation subject to mass specification,International Journal for Information and Systems Sciences, 2s (2) (2006), 326-335.

[26] J. Martin-Vaquero and J. Vigo-Aguiar, A note on efficient techniques for the second-order parabolicequation subject to nonlocal conditions. Appl. Numer. Math. 59 (2009) 1258–1264.

[27] J. Martin-Vaquero and J. Vigo-Aguiar, On the numerical solution of the heat conduction equationssubject to nonlocal conditions. Appl. Numer. Math. 59 (2009) 2507–2514.

[28] R. Ciegis, A. Stikonas, O. Stikoniene, and O. Suboc, Stationary problems with nonlocal boundaryconditions. Mathematical Modelling and Analysis. 6(2) (2001) 178–191.

[29] R. Ciegis, A. Stikonas, O. Stikoniene, and O. Suboc, Monotone finite- difference scheme for parabolicalproblem with nonlocal boundary conditions. Differential Equations, 38(7) (2002) 1027–1037.

[30] R. Ciegis and N. Tumanova, Numerical solution of parabolic problems with nonlocal boundary condi-tions. Numerical Functional Analysis and Optimization, (31) (2010) 1318–1329.

[31] A. Gumel, On the numerical solution of the diffusion equation subject to the specification of mass. JAust Math Soc Ser B, 40 (1999) 475-83.

Brought to you by | Université de Fribourg (Université de Fribourg)Authenticated | 172.16.1.226

Download Date | 4/24/12 1:17 PM