ANALELE ŞTIINŢIFICE ALE UNIVERSITĂŢII AL.I. CUZA DIN IAŞI (S.N.) MATEMATICĂ, Tomul LIX, 013, f.1 DOI: 10.478/v10157-01-00-y ALGORITHM FOR THE CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION BY ION LIXANDRU Abstract. When havng just one varable, the exstence and unqueness of the nterpolaton splne functon reduces to studyng the solutons of an algebrcal system of equatons. Ths allows us to fnd a practcal way of calculatng the nterpolaton splne functon. Also n the case of two varables splne functons, we can construct a lnear system of equatons determned by the contnuty condtons of the splne functon and of ts partal dervatves on the edge of each dvson rectangle. The exstence and unqueness of the soluton of the obtaned system ensure the exstence and unqueness of the two varables nterpolaton splne functon and offers a practcal calculaton method. Ths can be used to determne approxmate global solutons, of some partal dfferental equatons, solutons whose values can be determned at any pont of ther doman of defnton and can provde nformaton on dervatves approxmate of solutons. After calculatng the two varable cubc splne functon, we must assess the rest of the approxmaton. Mathematcs Subject Classfcaton 010: 65D07. Key words: cubc splne functon of two varables, tangent plane, the flatness condtons, connecton to nodes, nterpolaton algorthm, partal dervatves. 1. Introducton Although there s a well-founded theory about the splne functons of two varables, t can not be appled n practce, due to hgh formulas that appear and for the fact that n these formulas become nvolved partal dervatves of the functon gong up to fve or sx orders, etc. Ths artcle proposes a practcal method for calculatng a splne nterpolaton functon of two varables based on contnuty of the splne functon and of ts partal dervatves on the border of each dvson rectangle. In order to do so, we Unauthentcated
150 ION LIXANDRU set condtons of connecton n nodes, smoothness condtons (exstence of a sngle tangent plane n each node) and addtonal condtons on partal dervatves of order two, maxmum three. Out of these condtons we obtan systems of lnear equatons, systems to be flled wth new equatons, gven by the lmt condtons (head of range). In the lterature there are several ways to supplement systems such as: to set condtons where explctly appear the functon dervatves (but not knowng the functon we want to nterpolate, obvously we do not know these dervatves), we set condtons that on the frst two (.e. the last two ntervals of nterpolaton) to have the same splne functon (n ths case we break the trdagonal form of the lnear system so that some algorthms for solvng them are not applcable), on the frst and the last nterval the nterpolaton functon to be of degree two, etc. In the artcle are obtaned new condtons on the lmt, compatble wth the exstng ones wthn range, by a process of transton to lmt n the exstng condtons and cancelaton of all parameters wth negatve or zero ndex (whch practcally does not exst). These are systems wth a sngle soluton that ensures the exstence and unqueness of splne nterpolaton functons of two varables, provdes a practcal method of calculaton and the possblty of developng an algorthm for calculatng the splne nterpolaton functon of two varables. Usng n the artcle the contnuty module of a two varable functon, we obtan an assessment formula for the rest of the approxmaton, for a semnatural two varable cubc splne functon (the partal mxed dervatves of order two are zero on half of the doman s boundary).. The calculaton of the two varables cubc splne functon Gven D = [a, b] [c, d], f : D R, f C(D). x : a = x 1 < x <... < x m = b, dvson of the nterval [a, b], wth the pace h x = x +1 x, = 1, m 1. y : c = y 1 < y <... < y m = d, dvson of the nterval [c, d], wth the pace h y j = y j+1 y j, j = 1, n 1. f, y j ) = z j -gven, = 1, m, j = 1, n; D j = [x, x +1 ] [y j, y j+1 ], = 1, m 1, j = 1, n 1 ([]). We search for s j : D j R, nterpolaton cubc splne functon (s, y j ) = Unauthentcated
3 CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION 151, y j+ ) +1, y j+ ) +, y j+), y ) j+1, y j) D,j+1 D,j +1, y j+1 ), y ), y ) +1 j D +1,j+1 D +1,j, y ) + j + j+1 z j ; = 1, m, j = 1, n) as: (1) s j, y) = a j x ) 3 + b j x ) + c j x ) + α j (y y j ) 3 + β j (y y j ) + γ j (y y j ) + d j x ) (y y j ) + δ j x )(y y j ) + ε j x )(y y j ) + z j, x [x, x +1 ], y [y j, y j+1 ], = 1, m 1, j = 1, n 1. Obvously s j, y j ) = z j, = 1, m, j = 1, n. Out of the jonng condtons n the nodes: s j +1, y j ) = z +1,j, s j, y j+1 ) = z,j+1, we get: () (3) a j (h x ) 3 + b j (h x ) + c j (h x ) + z j = z +1,j, = 1, m 1, j = 1, n, α j (h y j )3 + β j (h y j ) + γ j (h y j ) + z j = z,j+1, = 1, m, j = 1, n 1. If n the case of one varable cubc splne functon, the smoothness condtons mposed the exstence of an unque tangent n every node, at the two curves, for the two varables splne functons we mpose the exstence of a sngle tangent plan at the two surfaces n every node. As the tangent plan has the normal vector: N ( s j x, s j y, 1), we set the condtons: { sj x a) +1, y j ) = s +1,j x +1, y j ) s j y +1, y j ) = s +1,j y +1, y j ) { sj x b), y j+1 ) = s,j+1 x, y j+1 ) s j y, y j+1 ) = s,j+1 y, y j+1 ) s j x, y) = 3a j x ) + b j x ) + c j + d j x )(y y j ) + δ j (y y j ) + ε j (y y j ) s j y, y) = 3α j(y y ) + β j (y y j ) + γ j + d j x ) + δ j Unauthentcated
15 ION LIXANDRU 4 x )(y y j ) + ε j x ) From a) and b) we obtan: (4) (5) (6) (7) 3a j (h x ) + b j (h x ) + c j = c +1,j, = 1, m 1, j = 1, n d j (h x ) + ε j (h x ) + γ j = γ +1,j, = 1, m 1, j = 1, n δ j (h y j ) + ε j (h y j ) + c j = c,j+1, = 1, m, j = 1, n 1 3α j (h y j ) + β j (h y j ) + γ j = γ,j+1, = 1, m, j = 1, n 1. The exstence of an unque tangent plan to the two surfaces, n every node, does not provde the unqueness of the surface. We must set supplementary condtons connected to the partal dervatves of order two: s j x +1, y j ) = s +1,j x +1, y j ) a) s j x y +1, y j ) = s +1,j x y +1, y j ) s j y +1, y j ) = s +1,j y +1, y j ) s j x, y j+1 ) = s,j+1 x, y j+1 ) b) s j x y, y j+1 ) = s,j+1 x y, y j+1 ) s j y, y j+1 ) = s,j+1 y, y j+1 ) s j = 6a x j x ) + b j + d j (y y j ) s j x y = d j x ) + δ j (y y j ) + ε j s j y = 6α j (y y j ) + β j + δ j (y y j ) From a) and b) we get: (8) (9) (10) (11) (1) (13) 3a j (h x ) + b j = b +1,j, = 1, m 1, j = 1, n, d j (h x ) + ε j = ε +1,j, = 1, m 1, j = 1, n δ j (h x ) + β j = β +1,j, = 1, m 1, j = 1, n d j (h y j ) + b j = b,j+1, = 1, m, j = 1, n 1 δ j (h y j ) + ε j = ε,j+1, = 1, m, j = 1, n 1 3α j (h y j ) + β j = β,j+1, = 1, m, j = 1, n 1. From (), (4) and (8) we obtan the system: a j (h x )3 + b j (h x ) + c j (h x ) + z j = z +1,j (14) 3a j (h x ) + b j (h x ) + c j = c +1,j 3a j (h x ) + b j = b +1,j, = 1, m 1, j = 1, n. Unauthentcated
5 CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION 153 Successvely elmnatng between () and (4) a j and b j we get: (15) (16) b j = 3 z +1,j z j (h x )3 c +1,j + c j (h x ), = 1, m 1, j = 1, n a j = z +1,j z j (h x )3 + c +1,j + c j (h x ), = 1, m 1, j = 1, n. Introducng (15) and (16) n (8) we obtan: (17) h x +1c j + [(h x ) + (h x +1)]c +1,j + (h x )c +,j = 3[(h x ) z +,j z +1,j (h x +1 ) + (h x +1) z +1,j z j (h x ) ], = 1, m, j = 1, n. So that the system (17) to have an unque soluton we stll need n equatons (condtons). Gong to the lmt n (17) wth 0, m 1 and cancellng all parameters wth zero or negatve ndex, we get: c 1,j + c j = 3 z j z 1j (h (18) x 1 ) c m 1,j + c j m = 3 z mj z m 1,j, j = 1, n. (h x m 1 ) In concluson, we calculate c j from (17) and (18), and then a j and b j out of (16) and (15). Analogcally, out of (3), (7) and (13) we obtan: (19) (0) β j = 3 z,j+1 z j (h y j )3 γ,j+1 + γ j (h y j ), = 1, m, j = 1, n 1 α j = z,j+1 z j (h y j )3 + γ,j+1 + γ j (h y j ), = 1, m, j = 1, n 1 (1) (h y j+1 )γ j + [(h y j ) + (hy j+1 )]γ,j+1 + (h y j )γ j+ = 3[(h y j )z,j+ z,j+1 (h y j+1 ) + (h y j+1 )z,j+1 z,j (h y j ) ], = 1, m, j = 1, n. In order that (1) to have an unque soluton, we go to the lmt wth and cancel all the parametres wth zero or negatve ndex. We obtan the followng equatons: γ,1 + γ = 3 z z 1 (h () y 1 ) γ,n 1 + γ n = 3 z n z,n 1, = 1, m. (h y n 1 ) Unauthentcated
154 ION LIXANDRU 6 Out of (1) and () we determne γ j, then from (0) and (19) α j and β j. Further on, from (11) we determne: (3) d j = b,j+1 b,j h y, = 1, m, j = 1, n 1 j from (10) we fnd out (4) δ j = β +1,j β j h x, = 1, m 1, j = 1, n, out of (5) or (6) we fnd: (5) (6) ε j = γ +1,j γ j d j (h x ) (h x ), = 1, m 1, j = 1, n ε j = c,j+1 c j δ j (h y j ) (h y j ), = 1, m, j = 1, n 1 ([1]). Specal case Although they are useful from a practcal pont of vew, the above presented facts have some dsadvantages such as: the great calculaton number (we practcally reach to solvng a system of 9mn equatons wth 9mn unknowns, system whch s decomposed n three systems of 3mn equatons wth 3mn unknowns), t does not allow the passng to a three varables nterpolaton splne functon, etc. Consderng n (1) d j = δ j = ε j = 0 (that s droppng the terms n x y, xy, xy), we get: (1 ) s j, y) = a j x ) 3 + b j x ) + c j x ) + α j (y y j ) 3 + β j (y y j ) + γ j (y y j ), x [x, x +1 ], y [y j, y j+1 ], = 1, m 1, j = 1, n 1 meanng the sum of two splne functons wth one varable: one compared to x, the other compared to y. In order to obtan an assessment of the rest of the approxmaton of the functon f, wth the two varable cubc splne functon gven by (1), we express frst the coeffcents of the functon s j wth the help of ts partal dervatves of order two. Unauthentcated
7 CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION 155 Frst let us decompose s j nto three components: f j ) = a j x ) 3 + b j x ) + c j x ) g j (y) = α j (y y j ) 3 + β j (y y j ) + γ j (y y j ) (7) h j, y) = d j x ) (y y j ) + δ j x )(y y 1 ) +ε j x )(y y j ) + z j. We denote (8) s j x, y j ) = E j, s j x y, y j ) = F j ; s j y, y j ) = G j. As s j = 6a x j x ) + b j + d j (y y j ) and s j x, y j ) = E j b j = E j b j = 1 E j, s j x +1, y j ) = 6a j h x + b j E +1,j E j E +1,j = 6a j h x + b j a j = 6h x s j +1, y j ) = z +1,j a j (h x )3 + b j (h x ) + c j h x + z j = z +1,j c j = z +1,j z j h x E +1,j+E j 6 h x f j ) = E +1,j E j 6h x x ) 3 + 1 E j x ) + [ z +1,j z j 6h x = E +1,j x ) 3 6h x E +1,j + E j h x ] x ) 6 E j 6 [hx +1 x) 3 ] + E j [hx +1 x) ] + z +1,j x x h x z j h x +1 x) h x x ) 3 = E +1,j 6h x +1 x) 3 + E j 6 h x E +1,j h x x ) E j 6 3 hx [h x +1 x)] E j 6 (hx ) + E j hx +1 x) E j +1 x) + E j (hx ) E j h x +1 x) + E j +1 x) x x x +1 x + z +1,j h x z j + z j h x Unauthentcated
156 ION LIXANDRU 8 E +1,j h x x ) E j 6 3 (hx ) + 1 E jh x +1 x) x x = E +1,j 6h x [ x ) (h x ) x +1 x ] + E j 6h x [ +1 x) (h x ) ] + z j x +1 x h x + z +1,j x x h x z j + z +1,j + z j z +1,j + z j. But z j x +1 x h x + z +1,j x x h x z +1,j + z j = x +1z j x z +1,j + x z j x +1 z +1,j x(z j z +1,j ) h x = (z j z +1,j ) x +1 + x x h x. Consequently, we have: (9) x x f j ) = E +1,j 6h x [ x ) (h x ) ] x +1 x + E j 6h x [ +1 x) (h x ) ] + (z j z +1,j ) x +1 + x x h x f, y) + f, y) z j. + z +1,j + z j We wrte x = max{h x = 1, m 1}, x = mn{h x = 1, m 1}, α = x. x y = max{h y j j = 1, n 1}, y = mn{h y y j j = 1, n 1}, β =, y = x y ω(f, h) = sup{ f + t 1, y + t ) f, y) x, x + t1 [a, b], y, y + t [c, d], t 1 < h 1, t < h } - the contnuty module of f(h = (h 1, h )), z j f, y) < ω(f, ) z +1,j + z j f, y) 1 ( z +1,j f, y) + z j f, y) ) < ω(f, ). Unauthentcated
9 CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION 157 So: (30) z +1,j + z j Gven α) = x +1+x x h x α ) = 1 h x 1 α) 1 α) 1, f, y) < ω(f, ); f, y) z j < ω(f, ). < 0 α +1 ) α) α ) (31) (z j z +1,j ) x +1 + x x h x 1 z j z +1,j < 1 ω(f, ). Gven β) = x x 6h x [ x ) (h x ) ] β ) = 1 6h x [3 x ) (h x ) ], β ) = 0 x = x + hx 3 ; β ) = 0, β +1 ) = 0, β + hx 3 ) = (hx ) 9 3 β) 1 9 3 (hx ), (3) Smlar: (33) x x 6h x [ x ) (h x ) ] 1 9 3 (hx ). x +1 x 6h x [ +1 x) (h x ) ] 1 9 3 (hx ). We must fnd now an upper bound for (h x ) ( E +1,j + E j ). condton s j x +1, y j ) = s +1,j x From the h +1, y j ), we obtan E x +1,j + 1 h x z +1,j h E x +1,j 6 1 h h x z j +E x h j 6 = E x +1 +1,j + 1 h h x z +,j E x +1 +,j +1 6 1 h x z +1,j + +1 h E x +1 +1,j 6 6( z +,j z +1,j h x +1 E +,j h x z +1,j z j h x ) = E +1,j (h x + hx +1 ) + E jh x + (34) h x E j + (h x + h x +1)E +1,j + E +,j h x +1 = 6( z +1,j z +1,j h x +1 z +1,j z j h x ). We wrte: (35) (36) P x +1 = h x h x + ; L x hx +1 = hx +1 +1 h x + hx +1 D+1 x 6 = h x + ( z +,j z +1,j hx +1 h x +1 ; (P x +1 + L x +1 = 1) z +1,j z j h x ). Unauthentcated
158 ION LIXANDRU 10 For 0 and h x 0 = 0 P x 1 = 0, Lx 1 = 1, Dx 1 = 6 z j z 1j (h x 1 ). m 1 and h x m = 0 P x m = 1, L x m = 0, D x m = 6 z mj z m 1,j (h x m 1 ). Wth these, the relatons (34) become: (37) P+1E x j + E +1,j + L x +1E +,j = D+1. x 1 0 0... 0 0 0 0 P Beng gven A x x L x 0... 0 0 0 0 =........................... 0 0 0 0... 0 Pm 1 x L x, m 1 0 0 0 0... 0 0 1 E j = (E 1j, E j,..., E mj ) t, D x = (D1 x, Dx,..., Dx m) t (38) A x E j = D x A x E j (h x ) = D x (h x ) (h x ) D x +1 = (h x ) 6 h x + hx +1 z +,j z +1,j h z +1 z +1,j z j h x = 6(hx ) (z +,j z +1,j )h x (z +1,j z j )h x +1 h x + hx +1 h x hx +1 h x 6 x h x +1 (hx + hx +1 )( z +,j z +1,j + z +1,j z j ) 6α x x ( z +,j z +1,j + z 1,j z j ) 6α ω(f, ) (h x ) ( E +1,j + E j ) A 1 x (h x ) E j, where A = max{ n j=1 a j ; = 1, n}. As A x s a domnant dagonal matrx ( a > n j=1,j 1 a j, = 1, n), t s nvertble and A 1 x max{( a n a j ) 1 = 1, n} = 1 j=1 (h x ) ( E +1,j ) [6α ω(f, ) + ( x ) ( D x 1 + D x m )]. But ( x ) ( D x 1 + Dx m ) = 6( x ) ( z j z 1j (h x 1 ) + z mj z m 1,j (h x m) ) 6( x x ) ω(f, ) = α ω(f, ) (h x ) ( E +1,j + E j ) 36α ω(f, ). Unauthentcated
11 CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION 159 In concluson, we have: (39) f j ) 5 4 ω(f, ) + β ω(f, ). 3 Smlarly we obtan: (40) g j (y) 5 4 ω(f, ) + β ω(d, ). 3 From (7) h j x = d j x )(y y j ) + δ j (y y j ) + ε j (y y j ) h j y = d j x ) + δ j x )(y y ) + ε j x ) h j = d x j (y y j ); δ j (y y j ) + ε j h j y = δ j x ); h j x y = d j x ) + s j x y, y j ) = F j ε j = F j s j x y +1, y j ) = d j h x + ε j = F +1,j d j = F +1,j F j h x s j x y, y j+1 ) = δ j h y j + ε j = F,j+1 δ j = F,j+1 F j. So we have: h y j h j, y) = F +1,j F j h x (41) + F j x )(y y j ). x ) (y y j ) + F,j+1 F j h y x )(y y j ) j We notce that s j and all ts partal dervatves of order one or two are zero n all ponts, y j ). So we must set supplementary condtons on the mxed partal dervatves of order three 3 s j x y = F 1,j F j h x the condton 3 s j x y, y j ) = 3 s +1,j x y +1, y j ), we get ; F,j+1 F j h y. From j (4) F +1,j F j h x = F +,j F +1,j h x, = 1, m. +1 If we set the condtons F mj = 0, j = 1, n, F n = 0, = 1, m then we obtan a sem-natural two varable cubc splne functon (the partal mxed dervatves of order two are zero on half of D s boundary). Consecutvely Unauthentcated
160 ION LIXANDRU 1 replacng n (4) wth 1,,...,, 1 we get: (43) F +1,j F j h x = F,j F 1,j h x 1 = F j h x x ) (y y j ) F +1,j F j h x x ) (y y j ) 1 x F j ( x) y = α F j x y. We wrte S = max{ F j j = 1, n}, we obtan: (44) F +1,j F j h x x ) (y y j ) αs x y Smlarly, we get: (45) F,j+1 F j h x x )(y y j ) βt j x y, where T = max{ F ; = 1, m}. From (43) F +1,j F j = hx h x F j. But 1 F +1,j F j F +1,j F j = hx h x F j. Calculatng at = 1,,..., 1 1 and summng up, we obtan F +1,j F 1j hx 1 +hx +...+hx 1 h x F j. But 1 h x 1 + hx +... + hx 1 = x a b a. So F j b a h x F j F j x )(y 1 y j ) b a F j x y, that s: x (46) F j x )(y y j ) α(b a)s y. From (7), (44), (45) we obtan: h,y) j (47) f, y) αs x y + βt x y + αs(b a) y + z j f, y) αs + βt From (7), (39), (40) we get x y + αs(b a) y + ω(f, ). s,y) j f, y) 5 4 ω(f, ) + α ω(f, ) + 5 4 ω(f, ) + β ω(f, ) 3 3 + αs + βt x y + αs(b a) y + ω(f, ), Unauthentcated
13 CALCULATION OF THE TWO VARIABLES CUBIC SPLINE FUNCTION 161 that s: (48) s,y) j f, y) 6ω(f, ) + 4 3 ω(f, )(α + β ) αs + βt + x y + αs(b a) y. If the dvsons x and y are unform, then x = b a m, y α = β = 1 from where we get: = d c n, (49) s,y) j f, y) ω(f, )(6 + 4 3 ) + (b a)(d c)( S + T mn + S n ). 3. Concluson For the practcal use of splne nterpolaton functons we have to fnd effectve ways to analytcally represent them. Out of the connecton n nodes, smoothness condtons, condtons of contnuty of partal dervatves of order two or three, plus the lmt condtons (head of range) we obtan compatble systems out of whch are determned the coeffcents of splne functon of two varables. Ths ensures the exstence and unqueness of t and allow the development of an algorthm for actually calculatng the splne functon of two varables. In order to obtan the assessment formula of the rest, n the range we used convex lnear combnatons, a fact that ensures the stablty of the algorthm. REFERENCES 1. Lxandru, I.; Epureanu, Al.; Frumuşanu, G.; Crăcun, M.V. Algorthm for Modelng Manufacturng Systems Thermo-Mechancal Felds Dynamcs, Based on B- splne Functons, The Anals of Dunărea de Jos Unversty of Galaţ, Tehnologes n Machne Buldng. Reconfgurable Manufacturng Systems. Thematc Seres, 008.. Mcula, Gh. Splne Functons and Applcatons, Techncal Publshng House Bucureşt, 1978. Receved: 5.III.010 Revsed: 15.III.011 Department of Mathematcs, Dunărea de Jos Unversty of Galaţ, 80001 - Galaţ, ROMANIA onlxandru17@yahoo.com Unauthentcated