Applied Mathematics and Computation 216 (2010) 364–367
Contents lists available at ScienceDirect
Applied Mathematics and Computation journal homepage: www.elsevier.com/locate/amc
Interpolation by integro quintic splines Hossein Behforooz Department of Mathematics, Utica College, Utica, New York 13502, USA
a r t i c l e
i n f o
a b s t r a c t Recently, Behforooz [1], has introduced a new approach to construct cubic splines by using the integral values, rather than the usual function values at the knots. Also he has established different sets of end conditions for cubic and quintic splines by using the integral values, see Behforooz [2–4]. In this paper, we will use the same techniques of [1] to construct integro quintic splines. Although by using the integral values we expected to face a more complicated process for our construction, it turned out that the matrix of the system of linear equations that produces the parameters became a diagonally dominant matrix and the process became very simple. The selection of the required end conditions for our integro quintic splines will be discussed. The numerical examples and computational results illustrate and guarantee a higher accuracy for this approximation. Ó 2010 Elsevier Inc. All rights reserved.
Keywords: Integro quintic spline Integro cubic spline End conditions Interpolation
1. Introduction As it has been mentioned in Behforooz [1-4], sometimes we deal with situations or phenomena which involve the function y = y(x) and also its integrals. The question is, if we know the integral values of the function then how we can use these values to construct quintic splines. In this paper, we construct a piecewise quintic spline Q(x) to approximate the function y = y(x) when the integral values of y(x) over the subintervals are given. Then numerical examples will be presented in the last section (see Table 1) to illustrate the accuracy of the results of this paper. 2. Integro quintic splines Suppose that the interval [a; b] is partitioned by the following k + 1 equally spaced points
a ¼ x0 < x1 < x2 < < xk1 < xk ¼ b; such that xi ¼ a þ ih, for i ¼ 0; 1; 2; . . . ; k, with h ¼ ba . k In the traditional interpolation techniques by using spline functions, we usually assume that the function values yðxi Þ; i ¼ 0ð1Þk at k þ 1 knots xi ; i ¼ 0ð1Þk, are known and by using these values we construct the quintic spline Q(x) such that Q ðxi Þ ¼ yðxi Þ; i ¼ 0ð1Þk. In this paper. these function values are not given and we assume that the values of all k integrals of y ¼ yðxÞ on k subintervals ½xi1 ; xi are known and they are equal to:
Ii ¼
Z
xi
yðxÞdx;
i ¼ 1ð1Þk:
ð1Þ
xi1
Now, we are going to use these numbers Ii to construct a class of integro quintic spline functions Q ðxÞ. These quintic splines Q ðxÞ are piecewise quintic polynomials such that Q and all of its four derivatives Q ð1Þ ; Q ð2Þ ; Q ð3Þ and Q ð4Þ are continuous on E-mail address:
[email protected] 0096-3003/$ - see front matter Ó 2010 Elsevier Inc. All rights reserved. doi:10.1016/j.amc.2010.01.009
H. Behforooz / Applied Mathematics and Computation 216 (2010) 364–367
365
½a; b, i.e., they are pieced together at the interior knots in such a way that their left side and right side values coincide at each knot xi ; i ¼ 1ð1Þk 1 and in each subinterval ½xi1 ; xi we have:
Z
xi
yðxÞdx ¼
xi1
Z
xi
Q ðxÞdx ¼ Ii ;
i ¼ 1ð1Þk:
ð2Þ
xi1
For simplicity, we will use the following notations:
yi ¼ yðxi Þ; Q i ¼ Q ðxi Þ; mi ¼ Q ð1Þ ðxi Þ; Mi ¼ Q ð2Þ ðxi Þ; ni ¼ Q ð3Þ ðxi Þ: For our construction purpose, we tried to use the classical quintic Hermite interpolation polynomial in terms of Q i ; mi and M i together with the known integral values (2), but we obtained a difficult block matrix system of equations. Then we changed our process and we used the quintic Hermite–Birkhoff polynomials in terms of Q i ; mi and ni and we obtained a quintic-diagonal system of linear equations with a diagonally dominant coefficient matrix which was easy to handle. This is the reason why we have used an unusual quintic Hermite–Birkhoff interpolation polynomial (3). In each subinterval ½xi1 ; xi , consider the following formula for the quintic Hermite–Birkhoff interpolation polynomial Q ðxÞ:
Q ðxÞ ¼ w1 ðxÞQ i1 þ w2 ðxÞQ i þ w3 ðxÞmi1 þ w4 ðxÞmi þ w5 ðxÞni1 þ w6 ðxÞni ;
ð3Þ
where,
8 3 > w1 ðxÞ ¼ 2h15 f2ðx xi Þ5 5hðx xi Þ4 þ 5h ðx xi Þ2 g; > > > > > 3 > > w2 ðxÞ ¼ 2h15 f2ðx xi1 Þ5 5hðx xi1 Þ4 þ 5h ðx xi1 Þ2 g; > > > > > < w ðxÞ ¼ 1 f2ðx x Þ5 5hðx x Þ4 þ 3h3 ðx x Þ2 g; 3
i
4h4
i
i
3 > > w4 ðxÞ ¼ 4h14 f2ðx xi1 Þ5 þ 5hðx xi1 Þ4 3h ðx xi1 Þ2 g; > > > > 3 5 4 2 > 1 > w ðxÞ ¼ 48h > 2 f2ðx xi Þ þ 3hðx xi Þ h ðx xi Þ g; > > 5 > > : w ðxÞ ¼ 1 f2ðx xi1 Þ5 3hðx xi1 Þ4 þ h3 ðx xi1 Þ2 g: 6 48h2
ð4Þ
By considering two pieces of Q ðxÞ on ½xi1 ; xi and ½xi ; xiþ1 we can easily verify that Q ; Q ð1Þ and Q ð3Þ are continuous at the interior knots xi ; i ¼ 1ð1Þk 1. The continuity of the second and fourth derivatives Q ð2Þ ðxÞ and Q ð4Þ ðxÞ at xi ; i ¼ 1ð1Þk 1, give us the following relations: 3
12hð3mi1 þ 14mi þ 3miþ1 Þ h ðni1 6ni þ niþ1 Þ ¼ 120ðQ iþi Q i1 Þ; 3
60hðmi1 þ 2mi þ miþ1 Þ h ð3ni1 þ 14ni þ 3niþ1 Þ ¼ 120ðQ iþi Q i1 Þ:
ð5Þ ð6Þ
It follows from (5) and (6) that, for i ¼ 1ð1Þk 1, we have: 2
h 1 ðQ Q i1 Þ; ðni1 þ 18ni þ niþ1 Þ þ 2h iþ1 120 3 15 ni ¼ 2 ðmi1 þ 8mi þ miþ1 Þ þ 3 ðQ iþ1 Q i1 Þ; 2h 2h 2 12ðmi1 2mi þ miþ1 Þ ¼ h ðni1 þ 10ni þ niþ1 Þ: mi ¼
ð7Þ ð8Þ ð9Þ
Finally, the Eqs. (7) and (8), in conjunction with (5) and (6), lead us to the following consistency relations for i ¼ 2ð1Þk 2:
mi2 þ 26mi1 þ 66mi þ 26miþ1 þ miþ2 ¼ ni2 þ 26ni1 þ 66ni þ 26niþ1 þ niþ2 ¼
60 h
3
5 ðQ i2 10Q i1 þ 10Q iþ1 þ Q iþ2 Þ; h
ð10Þ
ðQ i2 þ 2Q i1 2Q iþ1 þ Q iþ2 Þ:
ð11Þ
The integration of Q ðxÞ from (3), together with (4) and (2), gives the following relation between the unknown parameters m’s, n’s, Q’s and the known values I’s: 2
4
60h ðmi1 mi Þ h ðni1 ni Þ þ 360hðQ i1 þ Q i Þ ¼ 720Ii ; i ¼ 1ð1Þk:
ð12Þ
As we see from (3), to construct a unique integro quintic spline Q ðxÞ to interpolate the function y ¼ yðxÞ we need 3k + 3 unknown parameters m0 ; m1 ; . . . ; mk , and n0 ; n1 ; . . . ; nk and Q 0 ; Q 1 ; . . . ; Q k . But, in the traditional spline construction, since y’s are given, we need only 2 k + 2 unknowns m0 ; m1 ; . . . ; mk and n0 ; n1 ; . . . ; nk . Eq. (12) together with the above equations can be used to obtain these three sets of unknowns m’s, n’s and Q’s, But, to determine these 3k + 3 parameters, we must solve a complicated system of (3k + 3) by (3k + 3) linear equations with a blocked matrix of coefficients, which practically, is not an easy task. Fortunately the good news is that we can use the Eqs. (7) and (12) and eliminate the parameters n’s and Q’s and obtain the following equations in terms of only one set of unknowns m’s or n’s in terms of known values of I’s:
366
H. Behforooz / Applied Mathematics and Computation 216 (2010) 364–367
mi2 þ 56mi1 þ 246mi þ 56miþ1 þ miþ2 ¼ ni2 þ 56ni1 þ 246ni þ 56niþ1 þ niþ2
30
ðIi1 9Ii þ 9Iiþ1 þ Iiþ2 Þ; 2 h 360 ¼ 4 ðIi1 þ 3Ii 3Iiþ1 þ Iiþ2 Þ: h
ð13Þ ð14Þ
Some of the algebra involved in derivation of the above results (13) and (14) is laborious but the proofs are otherwise elementary and for this reason they are omitted. The sets of Eqs. (13) or (14) reduce the system of linear equations from (3k + 3) by (3k + 3) full matrix system to a simple quintic-diagonal (k 2) by (k 2) system of linear equations in terms of only one set of parameters m’s or n’s. Obviously, in order to use the Eq. (13) and solve them for k + 1 unknowns m0 ; m1 ; . . . ; mk , we need, as usual, four additional linear equations. In the literature, these equations are called the end conditions. The best set of end conditions for our purpose are the first derivative end conditions at four end points xi ; i ¼ 0; 1; k 1; k. Suppose that y0 ðxi Þ ¼ ai ; i ¼ 0; 1; k 1; k, are known. Then by setting mi ¼ ai ; i ¼ 0; 1; k 1; k, we can easily solve the following (k 3) by (k 3) linear quintic-diagonal equations to obtain a unique solution set for k 3 remaining parameters m2 ; m3 ; . . . ; mk2 :
8 246m2 þ 56m3 þ m4 ¼ b2 a0 56a1 ; > > > > > > < 56m2 þ 246m3 þ 56m4 þ m5 ¼ b3 a1 ; mi2 þ 56mi1 þ 246mi þ 56miþ1 þ miþ2 ¼ bi ; i ¼ 4ð1Þk 4; > > > > mk5 þ 56mk4 þ 246mk3 þ 56mk2 ¼ bk3 ak1 ; > > : mk4 þ 56mk3 þ 246mk2 ¼ bk2 56ak1 ak ;
ð15Þ
where bi ¼ 30 ðIi1 9Ii þ 9Iiþ1 þ Iiþ2 Þ; i ¼ 2ð1Þk 2. h2 When m0 ; m1 ; . . . ; mk are known, then we can use (9) with two more end conditions, say b0 ¼ y000 ðx0 Þ ¼ n0 and bk ¼ y000 ðxk Þ ¼ nk , and compute n1 ; n2 ; . . . ; nk1 . Now that all values of the parameters m’s and n’s are known and by using (12) with one more initial value, say yðaÞ ¼ y0 ¼ Q 0 , we can compute the remaining values of Q 1 ; Q 2 ; . . . ; Q k . With these three sets of parameter values of m’s, n’s and Q’s, and using Q ðxÞ from (3) with (4), we can find Q ðxÞ to approximate yðxÞ at any point x 2 ½a; b. If the third end condition y0 ¼ yðaÞ is not given and yðaÞ is not available, then we can use the simple forward or backward difference formula for the first derivative approximation and use one of the following relations
Q 1 Q 0 ¼ hm0 or Q 1 Q 0 hm1 ;
ð16Þ
as an additional equation to mix with the Eq. (12) to find all k + 1 unknowns Q 0 ; Q 1 ; . . . ; Q k , 3. Other end conditions In practice we do not expect to know the first derivative values of the function at the end points. But the above mentioned end conditions reduce the (3k + 3) by(3k + 3) system of linear equations with full coefficient matrix to an easy system of (k 3) by (k 3) quintic-diagonal linear equations. 6 Furthermore, if y 2 C 6 ½a; b, then the quintic spline with these end conditions has the highest order of convergence Oðh Þ. In the literature, we have so many other end conditions for this purpose. Even with the same accuracy and with the same 6 order of convergence Oðh Þ. See for example, the end conditions in Behforooz and Papamichael [5] and the references therein. Most of those end conditions are in terms of the derivatives of the spline functions and the function values. But here, the problem is that we do not have the function values at the knots and when we use those types of end conditions, we have to solve a full system of linear equations with a full matrix of order (3k + 3) by (3k + 3), which is very similar to the quartic mc-spline of Delhz [6].
Table 1 Comparison of E(x) = jexp (x) Q(x)j for three spline functions. x
NCS
Not-a-knot
EðxÞ
0.01 0.02 0.07 0.10 0.26 0.36 0.62 0.93 0.96 0.98 0.99
9.95E5 1.23E4 3.36E5 1.34E5 6.17E7 2.04E8 5.43E8 8.92E5 1.37E4 3.32E4 2.74E4
1.54E6 1.84E6 7.02E7 2.82E7 1.83E7 9.95E8 2.84E7 1.74E6 1.76E6 4.54E6 3.87E7
2.00E9 9.00E9 6.01E9 2.84E8 2.02E9 3.07E9 1.11E8 1.02E9 1.34E8 3.15E9 2.12E8
H. Behforooz / Applied Mathematics and Computation 216 (2010) 364–367
367
4. Numerical examples We examined this method on several functions and the accuracy of the approximation is very high. We compared the results of this integro quintic spline with other ordinary higher degree splines and we found that our results are comparable. Here, we present the outputs of one of those functions. Let Q(x) be the integro quintic spline to interpolate the function yðxÞ ¼ expðxÞ at the knots xi ¼ 0:05i; i ¼ 0ð1Þ20, and satisfies the end conditions mi ¼ expðxi Þ; i ¼ 0; 1; 19; 20; ni ¼ expðxi Þ; i ¼ 0; 20 and y0 ¼ Q 0 ¼ expð0Þ ¼ 1. In Table 1 we have listed the values of the error EðxÞ ¼ jQ ðxÞ expðxÞj computed at some points in the interval [0,1]. For comparison, we also listed the errors which are computed by using the ordinary natural cubic spline (NCS) and the famous not-a-knot cubic spline. This example shows that our quintic spline Q(x) is more accurate than the other two spline functions (specially at the two end subintervals). As a final remark, Delhez in [6] has introduced the integro mc-spline of degree four by solving a full system of (2k + 2) by (2k + 2) blocked matrix linear equations which is more difficult than the one of our (k 2) by (k 2) quintic-diagonal Eq. (15). References [1] [2] [3] [4] [5] [6]
H. Behforooz, Approximation by integro cubic splines, Appl. Math. Comput. 175 (2006) 8–15. H. Behforooz, End conditions for cubic spline interpolation derived from integration, Appl. Math. Comput. 29 (1989) 231–246. H. Behforooz, A new approach to spline functions, Appl. Numer. Math. 13 (1993) 271–276. H. Behforooz, Another approach to the quintic splines, Appl. Math. Lett. 1 (1988) 335–338. H. Behforooz, N. Papamichael, End conditions for interpolatory quintic splines, IMA J. Numer. Anal. 1 (1981) 81–93. E.J.M. Delhez, A spline interpolation technique that preserve mass budget, Appl. Math. Lett. 16 (2003) 17–26.