Numerical Solution and Simulation of Second-Order Parabolic PDEs with Sinc-Galerkin Method Using Maple
Abstract
An efficient solution algorithm for sinc-Galerkin method has been presented for obtaining numerical solution of PDEs with Dirichlet-type boundary conditions by using Maple Computer Algebra System. The method is based on Whittaker cardinal function and uses approximating basis functions and their appropriate derivatives. In this work, PDEs have been converted to algebraic equation systems with new accurate explicit approximations of inner products without the need to calculate any numeric integrals. The solution of this system of algebraic equations has been reduced to the solution of a matrix equation system via Maple. The accuracy of the solutions has been compared with the exact solutions of the test problem. Computational results indicate that the technique presented in this study is valid for linear partial differential equations with various types of boundary conditions.
1. Introduction
Sinc methods for differential equations were originally introduced by Stenger in [1–3]. The sinc functions were first analyzed in [4, 5] and a detailed research of the method for two-point boundary-value problems can be found in [6, 7]. In [8], parabolic and hyperbolic problems are presented in detail. To solve a problem arising from chemical reactor theory, the properties of the sinc-Galerkin method are used to reduce the computation of nonlinear two-point boundary-value problems to some algebraic equations in [9]. A computer algorithm for sinc method to solve numerically the linear and nonlinear ODEs and their simulations has been presented in [7, 10], respectively. The full sinc-Galerkin method is developed for a family of complex-valued partial differential equations with time-dependent boundary conditions [9]. A study of the performance of the Galerkin method using sinc basis functions for solving Bratu’s problem is presented in [11]. In [12] a numerical algorithm has been presented for recovering the unknown function and obtaining a solution to the inverse ill-posed problem. They have presented a Galerkin method with the sinc basis functions in both space and time domains for solving the direct problem. A sinc-collocation method has been developed for solving linear systems of integrodifferential equations of Fredholm and Volterra type with homogeneous boundary conditions in [13].
2. Sinc-Approximation Formula for PDEs
A list of conformal mappings may be found in Table 1 [14].
(a, b) | ϕ (z) | zk | |
---|---|---|---|
a | b | ||
0 | 1 | ||
0 | ∞ | ln(z) | ekh |
0 | ∞ | ln(sinh(z)) | |
−∞ | ∞ | z | kh |
−∞ | ∞ | sinh−1(z) | kh |
Definition 1. Let B(DE) be the class of functions F that are analytic in DE and satisfy
The proof of the following theorems can be found in [1].
Theorem 2. Let Γ be (0,1), F ∈ B(DE), and then for h > 0 sufficiently small
For the sinc-Galerkin method, the infinite quadrature rule must be truncated to a finite sum; the following theorem indicates the conditions under which exponential convergence results.
Theorem 3. If there exist positive constants α, β, and C such that
Making the selections
Theorems 2 and 3 can be used to approximate the integrals that arise in the formulation of the discrete systems corresponding to two-point BVPs.
3. Discrete Solutions Scheme for Two-Point BVPs
4. Matrix Representation of the Derivatives of Sinc Basis Functions at Nodal Points
Let Am(u) denote a diagonal matrix, whose diagonal elements are u(x−N), u(x−N+1), …, u(xN) and nondiagonal elements are zero. Then (38) reproduces the following matrixes accordingly.
5. Numerical Simulation
The example in this section will illustrate the sinc method.
Example 4. This problem has been addressed in [1]. The following equation is given in Dirichlet-type boundary condition:
t | Exact solution | Sinc-Galerkin solution | Error | |
---|---|---|---|---|
N = 16, x = 0.6 | 0.1 | 0.35446621870000 | 0.59102026517764600 | 0.23655404647764600 |
0.11 | 0.00001833412226 | −0.08327827240548060 | 0.08329660652774060 | |
0.21 | 0.9482992112 × 10−9 | −0.03068110846399060 | 0.03068110941228980 | |
0.31 | 0.4904905672 × 10−13 | −0.01083286679129120 | 0.01083286679134030 | |
0.41 | 0.2536973471 × 10−17 | −0.000420168677914081 | 0.000420168677914083 | |
0.51 | 0.1312203514 × 10−21 | −0.00108069489771883 | 0.00108069489771883 | |
0.61 | 0.6787134677 × 10−26 | −0.00492511086695295 | 0.00492511086695295 | |
0.71 | 0.3510522275 × 10−30 | 0.00331706758955819 | 0.00331706758955819 | |
0.81 | 0.1815753976 × 1034 | −0.00303031084399243 | 0.00303031084399243 | |
0.91 | 0.9391658013 × 10−39 | 0.00342519240062265 | 0.00342519240062265 |



6. Conclusions
We have developed a Maple algorithm to solve and simulate second-order parabolic PDEs with Dirichlet-type boundary conditions based on sinc-Galerkin approximation on some closed real intervals and the method has been compared with the exact solutions. When compared with other computational approaches, this method turns out to be more efficient in the sense that selection parameters and changing boundary conditions and also giving different problems to the algorithms. The accuracy of the solutions improves by increasing the number of sinc grid points N. The method presented here is simple and uses sinc-Galerkin method that gives a numerical solution, which is valid for various boundary conditions. Several PDEs have been solved by using our technique in less than 20 seconds. All computations and graphical representations have been prepared automatically by our algorithm.
Conflict of Interests
The author declares that he has no conflict of interests.
Appendix
See Algorithm 1.
-
Algorithm 1
-
restart:
-
with(linalg):
-
with(LinearAlgebra):
-
N:=16:
-
d:=Pi/2:
-
h:=0.75/sqrt(N);
-
s:=.5/sqrt(N);
-
SIZE:=2*N+1;
-
delta0:=(i,j)->piecewise(j=i,1,j<>i,0):
-
delta1:=(i,j)->piecewise(i=j,0,i<>j,((-1) ∧(i-j))/(i-j)):
-
delta2:=(i,j)->piecewise(i=j,(-Pi ∧2)/3,i<>j,-2*(-1) ∧(i-j)/(i-j) ∧2):
-
I_0:=Matrix(SIZE,delta0):
-
I_1:=Matrix(SIZE,delta1):
-
I_2:=Matrix(SIZE,delta2):
-
xk:=1/2+1/2*tanh(k*h/2);
-
xk_func:=unapply(xk,k);
-
phi:=unapply(log((x)/(1-x)),x);
-
Dphi:=unapply(simplify(diff(phi(x),x)),x);
-
g:=unapply(simplify(1/diff(phi(x),x)),x);
-
Dg:=unapply(diff(g(x),x),x);
-
gk:=unapply(subs(x=xk,g(x)),k);
-
Dgk:=unapply(subs(x=xk,Dg(x)),k);
-
g_Div_Dphi:=unapply(g(x)/Dphi(x),x);
-
g_Div_Dphi_k:=unapply(subs(x=xk,g_Div_Dphi(x)),k);
-
#Temporal Spaces;
-
tl:=exp(l*s);
-
tl_func:=unapply(tl,l);
-
gamm:=unapply(log(t),t);
-
Dgam:=unapply(diff(gamm(t),t),t);
-
g_gamm:=unapply(1/diff(gamm(t),t),t);
-
g_gamm_l:=unapply(subs(t=tl,g_gamm(t)),l);
-
gamm_Div_Dgam:=unapply(g_gamm(t)/Dgam(t),t);
-
gamm_Div_Dgam:= t-> t ∧2;
-
gamm_Div_Dgam_l:=unapply(subs(t=tl,gamm_Div_Dgam(t)),l);
-
GenerateDiagonalAm := proc( x )
-
local i:=1:
-
local A:=Matrix(SIZE):
-
for i from 1 by 1 to SIZE
-
do
-
A[i,i]:=evalf(x(-N+i-1)):
-
end do:
-
return A;
-
end proc;
-
B:= -2*h*MatrixMatrixMultiply(I_0,GenerateDiagonalAm(gk))+
-
MatrixMatrixMultiply(I_1,GenerateDiagonalAm(Dgk))+1/h*I_2:
-
DD:=h*GenerateDiagonalAm(g_Div_Dphi_k):
-
C:=MatrixMatrixMultiply(GenerateDiagonalAm(g_gamm_l),s*(I_0-I_1)):
-
E:=s*GenerateDiagonalAm(gamm_Div_Dgam_l):
-
Fkl:=unapply((Pi ∧2-4)*sin(Pi*xk_func(k-N-1))*exp(-tl_func(l-N-1)),k,l);
-
F:=evalf(Matrix(SIZE,Fkl)):
-
V:=Matrix(SIZE,v):
-
EQN_SYS:=evalf(
-
MatrixMatrixMultiply(
-
MatrixMatrixMultiply(
-
Matrix(inverse(DD)),B
-
),V
-
)
-
)
-
+evalf(
-
MatrixMatrixMultiply(
-
MatrixMatrixMultiply(
-
V,C),Matrix(inverse(E)
-
)
-
)
-
):
-
SYS:=[]:
-
for i from 1 by 1 to SIZE
-
do
-
for j from 1 by 1 to SIZE
-
do
-
SYS:=[op(SYS),EQN_SYS(i,j)=F(i,j)];
-
end do:
-
end do:
-
vars:=seq(seq(v(i,j),i=1..2*N+1),j=1..2*N+1):
-
A,b:LinearAlgebra[GenerateMatrix](evalf(SYS),[vars]):
-
c:=linsolve(A,b):
-
CoeffMatrix=Matrix(SIZE):
-
cnt:=1;
-
for i to SIZE do
-
for j to SIZE do
-
CoeffMatrix[j,i]:=c[cnt]:
-
cnt:=cnt+1
-
end do;
-
end do;
-
CoeffMatrix:=Matrix(CoeffMatrix,SIZE):
-
ApproximateSol:=unapply(
-
evalf(
-
sum(
-
sum("CoeffMatrix"[m+N+1,n+N+1]
-
*sin(Pi*(phi(x)-m*h)/h)/(Pi*(phi(x)-m*h)/h)
-
*sin(Pi*(gamm(t)-n*s)/s)/(Pi*(gamm(t)-n*s)/s)
-
,m=-N..N),
-
n=-N…N)
-
)
-
+exp(-4*t)*sin(Pi*x)
-
,x,t):
-
plot3d(ApproximateSol(x,t),x=0..1,t=0..1):
-
Exact:=unapply(exp(-Pi ∧2*t)*sin(Pi*x),x,t);
-
plot3d(Exact(x,t),x=0..1,t=0..1);
-
plot3d({Exact(x,t),ApproximateSol(x,t)},x=0..1,t=0..1);
-
XX:=.6;
-
#Numerical Comparision EXACT
-
for j from 0.1 to 10 by 1
-
do
-
evalf(Exact(XX,j)):
-
od;
-
#Numerical Comparision APPROX
-
for j from 0.1 to 10 by 1
-
do
-
evalf(ApproximateSol(XX,j)):
-
od;
-
#Numerical Comparision ERROR
-
for j from 0.1 to 10 by 1
-
do
-
abs(evalf(evalf(ApproximateSol(XX,j)-Exact(XX,j)))):
-
od;