Solution of Two Point Boundary Value Problems Using Orthogonal Collocation On Finite Elements
Solution of Two Point Boundary Value Problems Using Orthogonal Collocation On Finite Elements
Solution of Two Point Boundary Value Problems Using Orthogonal Collocation On Finite Elements
www.elsevier.com/locate/amc
Abstract
*
Corresponding author.
E-mail address: [email protected] (V.K. Kukreja).
0096-3003/$ - see front matter 2005 Elsevier Inc. All rights reserved.
doi:10.1016/j.amc.2005.01.049
S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370 359
1. Introduction
oc
a 1 c þ a2 ¼ k1 at x ¼ 0; ð2aÞ
ox
oc
a 3 c þ a4 ¼ k2 at x ¼ 1: ð2bÞ
ox
The method of orthogonal collocation has been used widely for two point
boundary value problems. Most of the investigators [1,4,8,9] have discussed
the initial and boundary value problems for the zeros of Jacobi polynomials
with a = b = 0.
The formulae for derivatives of the trial functions are valid for all xi;
i = 1, 2, . . . , N + 1 as Lagrangian interpolation polynomial are continuous and
differentiable.
S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370 361
For i = j first and second order derivatives of li(x) are obtained by substituting
k = 2 and 3, respectively, in equation (6), i.e.,
l0i ðxj Þ ¼ w00 ðxj Þ=2w0 ðxj Þ and l00i ðxj Þ ¼ w000 ðxj Þ=3w0 ðxj Þ: ð7Þ
For i 5 j these derivatives are obtained by putting k = 1 and 2, respectively, in
equation (6):
The discretization matrices A and B can be computed only when the derivatives
of different order of w(x) at xj are known. The formulae for finding different
derivatives of w(xj) are:
!
0
XN þ1
1 Y
N þ1
w ðxÞ ¼ ðx xi Þ ; ð9aÞ
m ¼1
ðx xm1 Þ i¼1
1
( !)
X
N þ1
1 X
N þ1
1 Y
N þ1
w00 ðxÞ ¼ 2! ðx xi Þ ;
ðx xm2 Þ m1 ¼1
ðx xm1 Þ i¼1 ð9bÞ
m2 ¼ 1
m2 6¼ m1
8 9
>
> ( !)>
>
X
N þ1 >
< X
N þ1 X
N þ1 Y
N þ1 >
=
1 1 1
w000 ðxÞ ¼ 3! ðx xi Þ :
ðx xm3 Þ >
> ðx xm2 Þ m ¼1 ðx xm1 Þ i¼1 >
>
m3 ¼ 1 >
: m2 ¼ 1 1 >
;
m3 6¼ m2 ;m1 m2 6¼ m1
ð9cÞ
The discretization end points are fixed as u1 = 0 and uN+1 = 1. The zeros of
shifted Chebyshev polynomials have been used as collocation points, because
362 S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370
these polynomials have the tendency to keep the error down to a minimum [10]
and yield satisfactory results for the unsymmetrical BVPÕs. The collocation
points are obtained by mapping the computational domain of the interval
[1, 1] to [0, 1] with the help of following relationship:
rj 1
uN þ2j ¼ þ ; ð10Þ
2 2
where rj is the jth collocation point in the interval [1, 1]. The N + 1 interpola-
tion points are chosen to be the extreme values of an Nth order shifted Cheby-
shev polynomial
pðj 1Þ
rj ¼ cos ; j ¼ 1; 2; . . . ; N þ 1:
N
The quadrature abscissa weights wi are calculated using the formula given by
[2,11].
a2 dc1
a1 c1 þ ¼ k1 at x ¼ 0; ð11bÞ
Dx1 du
a4 dcn
a3 cn þ ¼ k2 at x ¼ 1: ð11cÞ
Dxn du
Since the function and its first derivative must be continuous at the boundary
of the elements, therefore,
c‘ ¼ c‘þ1 ; ð12aÞ
1 dc‘ 1 dc‘þ1
¼ : ð12bÞ
Dx‘ du Dx‘þ1 du
S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370 363
4. Convergence criterion
When the domain is divided into n elements with each element consisting of
N 1 interior collocation points, a set of (nN) + 1 coupled differential
algebraic equations (DAE) appear. The set of coupled DAEÕs is solved using
MATLAB with ode15s subroutine. The subroutine uses backward differentia-
tion formula to solve the system of equations. The convergence of the method
for steady state is checked by the following formula:
2
L ¼ ðDx‘ Þ kM 1 kC with kLk < 1: ð14Þ
Since for large values of P, as considered in Sections 6.1 and 6.2, the value of C
increases, therefore the value of Dx‘ should be small enough to make kLk < 1,
thus more elements should be inserted. With the increase in number of elements
the method converges asymptotically [6,8].
5. Error calculation
6. Numerical examples
6.1. Problem 1
1.0
P=0 analytical
P=0 OCFE
P=10 analytical
0.8 P=10 OCFE
P=40 analytical
P=40 OCFE
0.6
C
0.4
0.2
0.0
0.0 0.5 1.0 1.5 2.0
Time
Fig. 1. Comparison of analytic and numerical values calculated by using OCFE for different values
of P.
S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370 365
tion profiles follow a Gaussian curve. The solution profile for large values of P
was obtained by introducing more than 20 elements in the spatial domain as
compared to the small values of P where the solution profiles were obtained
only for 5–7 elements.
Fig. 2 shows the relative error for different values of P. When P = 8, mag-
nitude of the relative error is less than 1.5 · 104, but for large values of,
i.e., P = 40 it is 6.02 · 104 for 20 elements. The relative error decreases by
increasing the number of elements, e.g., for P = 40, 15% error was observed
in case of five elements which changes to 0.05% approximately if 25 elements
are taken instead of five. Fig. 3 gives the relation between relative error and
number of elements for P = 40. When the number of elements is 14, the mag-
nitude of the relative error is approximately 2.3 · 103 which decreases upto
4.85 · 104 for 25 elements. Therefore, in order to reduce the relative error
the number of elements must be increased.
Various investigators [4,5,7] have followed the OCFE but none of them have
considered the effect of collocation points on the solution profiles. For P = 80
and number of elements 17 the relative error with respect to analytic solutions
is compared for five and nine collocation points (Fig. 4). However, in case of
nine collocation points the number of equations increases as compared to
the five collocation points but this increment in the computation time is com-
pensated by the reduction in the magnitude of relative error. The main reason
of the fluctuation of the results in case of five collocation points is that the dif-
ference between two consecutive collocation points is very large near the cor-
ners causing fluctuation in the solution profile at the outlet. As the degree of
the approximation increases over nine, the need of additional collocation
0.0004
0.0002
0.0000
Relative Error
-0.0004
-0.0006
For P=8
For P=40
-0.0008
Time
0.005
0.000
0.0 0.5 1.0 1.5 2.0
-0.005
Relative Error
-0.010
-0.015
For n=14
-0.020
For n=17
For n=25
-0.025
Time
0.004
0.000
0.0 0.5 1.0 1.5 2.0
Relative Error
-0.004
-0.008
-0.012
For N=5
For N=9
-0.016
Time
Fig. 4. Comparison of error for five and nine collocation points with 17 elements.
points required for higher degree polynomials becomes less important since no
significant change in the results is observed.
6.2. Problem 2
The diffusion reaction problem represented by Eq. (15) is also solved for
DirichletÕs boundary conditions, i.e., C = 0 at x = 0, for all t P 0. The solution
profile has steep gradients near the boundary. In this case, the system of equa-
tions is solved by taking seven interior collocation points within each element
for large values of parameter. For 10 or more elements the results are matching
exactly with the analytic ones of [14] for P P 40.
S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370 367
0.003
0.002
0.001
Relative Error
0.000
0.0 0.5 1.0 1.5 2.0
-0.001
-0.002
For P=40
For P=100
-0.003
Time
Fig. 5 shows the relative error for P = 40 and 100 for 15 number of elements.
For P > 100 the method gives convincing results for 19 elements. Since for
large values of P the effect of convective transport becomes negligible, which
makes the system of equations stiffer and therefore more elements are intro-
duced. Fig. 6 shows the comparison of the error for P = 40 for different number
of elements varying from 7 to 17. The magnitude of error is 4 · 104 approx-
imately for seven numbers of elements which reduces upto 3.25 · 105 for 17
numbers of elements. Therefore, a sufficient accuracy for the numerical solu-
tions can be obtained by increasing the number of elements. However, in such
a situation computation time also increases.
0.00015
0.00000
0.0 0.5 1.0 1.5 2.0
Relative Error
-0.00015
-0.00030
For n=7
For n=10
For n=17
-0.00045
Time
8.0
For OCFE
For OCM
4.0
2.0
0.0
0.0 0.5 1.0 1.5
-2.0
Time
Fig. 7. Percentage error of OCM and OCFE with respect to analytic solution.
7. Conclusions
Acknowledgments
EMR-II. Ms. Shelly Arora is thankful to CSIR for providing Junior Research
Fellowship F. No. 9/797(3)/2002-EMR-I.
Appendix A
where c‘i ¼ cðu‘i Dx‘ þ x‘ Þ and B and A represents the second and first order
derivatives, respectively. Since the solution profiles and their first derivatives
are assumed to be continuous at the boundaries, the collocation equations
for the boundaries are:
c‘N þ1 ¼ c‘þ1
1 ;
1 XN þ1
1 X N þ1
AN þ1i c‘i ¼ A1i c‘þ1
i :
Dx‘ i¼1 Dx‘þ1 i¼1
The boundary conditions are satisfied as:
X
N þ1 X
N þ1
a1 c11 þ a2 A1i c1i ¼ k 1 and a3 cnN þ1 þ a4 AN þ1i cni ¼ k 2 :
i¼1 i¼1
M D
B.C. at x= 0 ooooooooo
0
xxxxxxxxxx
xxxxxxxxxx
0
B.C. at x=1 ooooooooo
Fig. 8. Block diagonal matrix structure for OCFE, the crosses arise after the application of OCM
with in each element. The single column on the right-hand side arises from the time derivatives of
the C and the boxes represented by empty circles are for boundary conditions and continuity
conditions.
370 S. Arora et al. / Appl. Math. Comput. 171 (2005) 358–370
The resulting set of DAEÕs appearing in a block diagonal matrix structure gi-
ven in Fig. 8 is solved using ode15s.
References
[1] J. Villadsen, W.E. Stewart, Solution of boundary value problems by orthogonal collocation,
Chem. Eng. Sci. 22 (1967) 1483–1501.
[2] M.L. Michelsen, J. Villadsen, A convenient computational procedure for collocation
constants, Chem. Eng. J. 4 (1971) 64–68.
[3] W.R. Paterson, D.L. Cresswell, A simple method for the calculation of effectiveness factor,
Chem. Eng. Sci. 26 (1971) 605–616.
[4] G.F. Carey, B.A. Finlayson, Orthogonal collocation on finite elements, Chem. Eng. Sci. 30
(1975) 587–596.
[5] Z. Ma, G. Guiochon, Application of orthogonal collocation on finite elements in the
simulation of non-linear chromatography, Comput. Chem. Eng. 15 (6) (1991) 415–426.
[6] S.E. Onah, Asymptotic behavior of the Galerkin and the finite element collocation methods for
a parabolic equation, Appl. Math. Comput. 127 (2002) 207–213.
[7] W.E. Jacobsen, Yi Liu, On the use of reduced order models in bifurcation analysis of
distributed parameter systems, Comput. Chem. Eng. 28 (2004) 161–169.
[8] J. Villadsen, J.P. Sorensen, Solution of parabolic partial differential equations by a double
collocation method, Chem. Eng. Sci. 24 (1969) 1337–1349.
[9] B.A. Finlayson, The Method of Weighted Residuals and Variational Principles, Academic
Press, New York, 1972.
[10] L.T. Fan, G.K.C. Chen, L.E. Erickson, Efficiency and utility of collocation methods in solving
the performance equations of flow chemical reactors with axial dispersion, Chem. Eng. Sci. 26
(1971) 379–387.
[11] R.A. Adomaitis, Y. Lin, A collocation/quadrature-based Sturm–Liouville problem solver,
Appl. Math. Comput. 110 (2000) 205–223.
[12] J. Villadsen, M.L. Michelsen, Solution of Differential Equation Models by Polynomial
Approximation, Prentice-Hall, Englewood Cliffs, NJ, 1978.
[13] H. Brenner, The diffusion model of longitudinal mixing in beds of finite length. Numerical
values, Chem. Eng. Sci. 17 (1962) 229–243.
[14] L.E. Grahs, Washing of cellulose fibres, Analysis of displacement washing operation, Ph.D.
Thesis, Chalmers University of Technology, Goteborg, Sweden, 1974.
[15] F. Shirashi, Highly accurate solution of the axial dispersion model expressed in S-system
canonical form by Taylor series method, Chem. Eng. J. 83 (2001) 175–183.