13.07.2015 Views

Computing bivariate splines in scattered data fitting and the finite ...

Computing bivariate splines in scattered data fitting and the finite ...

Computing bivariate splines in scattered data fitting and the finite ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Numer Algor (2008) 48:237–260DOI 10.1007/s11075-008-9175-xORIGINAL PAPER<strong>Comput<strong>in</strong>g</strong> <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong> <strong>in</strong> <strong>scattered</strong> <strong>data</strong> fitt<strong>in</strong>g<strong>and</strong> <strong>the</strong> f<strong>in</strong>ite-element methodLarry L. SchumakerReceived: 8 October 2007 / Accepted: 25 January 2008 /Published onl<strong>in</strong>e: 21 May 2008© Spr<strong>in</strong>ger Science + Bus<strong>in</strong>ess Media, LLC 2008Abstract A number of useful <strong>bivariate</strong> spl<strong>in</strong>e methods are global <strong>in</strong> nature,i.e., all of <strong>the</strong> coefficients of an approximat<strong>in</strong>g spl<strong>in</strong>e must be computed at onetime. Typically this <strong>in</strong>volves solv<strong>in</strong>g a system of l<strong>in</strong>ear equations. Examples<strong>in</strong>clude several well-known methods for fitt<strong>in</strong>g <strong>scattered</strong> <strong>data</strong>, such as <strong>the</strong>m<strong>in</strong>imal energy, least-squares, <strong>and</strong> penalized least-squares methods. F<strong>in</strong>iteelementmethods for solv<strong>in</strong>g boundary-value problems are also of this type.It is shown here that <strong>the</strong>se types of globally-def<strong>in</strong>ed <strong>spl<strong>in</strong>es</strong> can be efficientlycomputed, provided we work with spl<strong>in</strong>e spaces with stable local m<strong>in</strong>imaldeterm<strong>in</strong><strong>in</strong>g sets.Keywords Bivariate <strong>spl<strong>in</strong>es</strong> · Data fitt<strong>in</strong>g · F<strong>in</strong>ite-element method ·Scattered <strong>data</strong>1 IntroductionBivariate <strong>spl<strong>in</strong>es</strong> def<strong>in</strong>ed over triangulations are important tools <strong>in</strong> severalapplication areas <strong>in</strong>clud<strong>in</strong>g <strong>scattered</strong> <strong>data</strong> fitt<strong>in</strong>g <strong>and</strong> <strong>the</strong> numerical solutionof boundary-value problems by <strong>the</strong> f<strong>in</strong>ite element method. Methods for comput<strong>in</strong>gspl<strong>in</strong>e approximations fall <strong>in</strong>to two classes:1. Local methods, where <strong>the</strong> coefficients of <strong>the</strong> spl<strong>in</strong>e are computed one at atime or <strong>in</strong> small groups,2. Global methods, where all of <strong>the</strong> coefficients of <strong>the</strong> spl<strong>in</strong>e have to becomputed simultaneously, usually as <strong>the</strong> solution of a s<strong>in</strong>gle l<strong>in</strong>ear systemof equations.L. L. Schumaker (B)Department of Ma<strong>the</strong>matics, V<strong>and</strong>erbilt University, Nashville, TN 37240, USAe-mail: larry.schumaker@v<strong>and</strong>erbilt.edu.


238 Numer Algor (2008) 48:237–260In this paper we focus on global methods, <strong>and</strong> <strong>in</strong> particular those that arisefrom m<strong>in</strong>imiz<strong>in</strong>g a quadratic form, possibly with some constra<strong>in</strong>ts. The purposeof this paper is to show how such m<strong>in</strong>imization problems can be efficientlysolved for spl<strong>in</strong>e spaces that possess stable local m<strong>in</strong>imal determ<strong>in</strong><strong>in</strong>g sets(MDS) (see Section 2). In particular, we show how our approach appliesto three commonly used <strong>scattered</strong> <strong>data</strong> fitt<strong>in</strong>g methods: <strong>the</strong> m<strong>in</strong>imal energymethod, <strong>the</strong> discrete least-squares (DLSQ) method, <strong>and</strong> <strong>the</strong> penalized leastsquares(PLSQ) method. In addition, we discuss how it works for solv<strong>in</strong>gboundary-value problems <strong>in</strong>volv<strong>in</strong>g partial differential equations.The st<strong>and</strong>ard approach to solv<strong>in</strong>g global variational problems <strong>in</strong>volv<strong>in</strong>gpiecewise polynomials on triangulations is to use Lagrange multipliers toenforce <strong>in</strong>terpolation <strong>and</strong> smoothness conditions, see Remark 1. This results<strong>in</strong> a l<strong>in</strong>ear system of equations for <strong>the</strong> coefficients of <strong>the</strong> spl<strong>in</strong>e. This approachcan be used even when <strong>the</strong> dimension of <strong>the</strong> approximat<strong>in</strong>g spl<strong>in</strong>e space is notknown. In this case <strong>the</strong> l<strong>in</strong>ear system may be s<strong>in</strong>gular, <strong>and</strong> we can only f<strong>in</strong>d anapproximate solution. This leads to spl<strong>in</strong>e fits which only satisfy <strong>the</strong> desiredsmoothness conditions approximately. In addition, <strong>the</strong> Lagrange multiplierapproach generally leads to very large systems of equations, which is its ma<strong>in</strong>disadvantage. In comparison, <strong>the</strong> method proposed here• <strong>in</strong>volves much smaller systems of equations,• is generally much faster,• produces spl<strong>in</strong>e fits ly<strong>in</strong>g <strong>in</strong> <strong>the</strong> prescribed spl<strong>in</strong>e spaces.Our method can be used with spl<strong>in</strong>e spaces of any degree <strong>and</strong> smoothness,as long as <strong>the</strong>y have stable local MDS. There are many examples of such spaces<strong>in</strong> [14]. We discuss <strong>the</strong> method for <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong>, but <strong>the</strong> approach appliesto spherical <strong>spl<strong>in</strong>es</strong> <strong>and</strong> trivariate <strong>spl<strong>in</strong>es</strong> as well, see Remarks 2 <strong>and</strong> 3.The paper is organized as follows. In Section 2 we recall some of <strong>the</strong>basic <strong>the</strong>ory of <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong>, <strong>in</strong>clud<strong>in</strong>g <strong>the</strong> concepts of MDS <strong>and</strong> stablelocal bases. We also recall how to compute with <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong> us<strong>in</strong>g <strong>the</strong>Bernste<strong>in</strong>–Bézier representation. In Section 3 we discuss <strong>the</strong> computationof <strong>spl<strong>in</strong>es</strong> solv<strong>in</strong>g general quadratic m<strong>in</strong>imization problems. Three explicitexamples of such problems are described <strong>in</strong> Sections 4–6, namely, m<strong>in</strong>imalenergy, DLSQ, <strong>and</strong> PLSQ spl<strong>in</strong>e fitt<strong>in</strong>g. The Galerk<strong>in</strong> method for solv<strong>in</strong>gelliptic boundary-value problems is treated <strong>in</strong> Section 7. Section8 is devotedto numerical experiments to illustrate <strong>the</strong> performance of our method. InSection 9 we describe a useful algorithm for comput<strong>in</strong>g all of <strong>the</strong> Bernste<strong>in</strong>basis polynomials (or <strong>the</strong>ir directional derivatives) at a given po<strong>in</strong>t <strong>in</strong> anefficient manner. F<strong>in</strong>ally, we collect several remarks <strong>in</strong> Section 10.2 Prelim<strong>in</strong>ariesIn work<strong>in</strong>g with <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong>, we follow <strong>the</strong> notation used <strong>in</strong> <strong>the</strong> book [14].For convenience, we review some key concepts here. Given d > r ≥ 0, <strong>and</strong>a


Numer Algor (2008) 48:237–260 239triangulation △ of a doma<strong>in</strong> ⊂ IR 2 , <strong>the</strong> associated space of <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong>of smoothness r <strong>and</strong> degree d is def<strong>in</strong>ed to beS r d (△) := {s ∈ Cr () : s| T ∈ P d , all T ∈△}.Here P d is <strong>the</strong> ( )d+22 -dimensional space of <strong>bivariate</strong> polynomials of degree atmost d. Given r ≤ ρ ≤ d, we also work with <strong>the</strong> superspl<strong>in</strong>e spaceS r,ρd (△) := { s ∈ Sd r (△) : s ∈ Cρ (v), all v ∈ V } ,where V is <strong>the</strong> set of vertices of △,<strong>and</strong>wheres ∈ C ρ (v) means that all polynomialpieces of s on triangles shar<strong>in</strong>g <strong>the</strong> vertex v have common derivatives upto order ρ at v.2.1 Bernste<strong>in</strong>–Bézier methodsWe make use of <strong>the</strong> Bernste<strong>in</strong>–Bézier representation of <strong>spl<strong>in</strong>es</strong>. Given d <strong>and</strong>△, letD d,△ := ∪ T∈△ D d,T be <strong>the</strong> correspond<strong>in</strong>g set of doma<strong>in</strong> po<strong>in</strong>ts, where foreach T := 〈v 1 ,v 2 ,v 3 〉,{D d,T := ξijk T := iv }1 + jv 2 + kv 3.di+ j+k=dThen every spl<strong>in</strong>e s ∈ Sd 0 (△) is uniquely determ<strong>in</strong>ed by its set of coefficients{c ξ } ξ∈Dd,△ ,<strong>and</strong>s| T := ∑c ξ Bξ T ,ξ∈D d,Twhere { }BξT are <strong>the</strong> Bernste<strong>in</strong> basis polynomials associated with <strong>the</strong> triangle T.Suppose now that S(△) is a subspace of Sd 0(△). ThenasetM ⊆ D d,△of doma<strong>in</strong> po<strong>in</strong>ts is called a MDS for S(△) provided it is <strong>the</strong> smallest setof such po<strong>in</strong>ts such that <strong>the</strong> correspond<strong>in</strong>g coefficients {c ξ } ξ∈M can be set<strong>in</strong>dependently, <strong>and</strong> all o<strong>the</strong>r coefficients of s can be consistently determ<strong>in</strong>edfrom smoothness conditions, i.e., <strong>in</strong> such a way that all smoothness conditionsare satisfied, see p. 136 of [14]. The dimension of S(△) is <strong>the</strong>n equal to<strong>the</strong> card<strong>in</strong>ality of M. Clearly, M = D d,△ is a MDS for Sd 0 (△), <strong>and</strong> thus <strong>the</strong>dimension of Sd 0(△) is n V + (d − 1)n E + ( )d−1 nT ,wheren2V , n E , n T are <strong>the</strong>number of vertices, edges, <strong>and</strong> triangles of △.For each η ∈ D d,△ \ M, letƔ η be <strong>the</strong> smallest subset of M such that c η canbe computed from <strong>the</strong> coefficients {c ξ } ξ∈Ɣη by smoothness conditions. Then Mis called local provided <strong>the</strong>re exists an <strong>in</strong>teger l not depend<strong>in</strong>g on △ such thatƔ η ⊆ star l (T η ), all η ∈ D d,△ \ M, (1)where T η is a triangle conta<strong>in</strong><strong>in</strong>g η. Recall that given a set U ⊂ , <strong>the</strong>n star(U)is <strong>the</strong> set of triangles <strong>in</strong> △ <strong>in</strong>tersect<strong>in</strong>g U, while star l (U) := star(star l−1 (U)).


240 Numer Algor (2008) 48:237–260M is said to be stable provided <strong>the</strong>re exists a constant K depend<strong>in</strong>g only on l<strong>and</strong> <strong>the</strong> smallest angle <strong>in</strong> <strong>the</strong> triangulation △ such that2.2 Stable local bases|c η |≤K maxξ∈Ɣ η|c ξ |, all η ∈ D d,△ \ M. (2)Suppose M is a stable local MDS for S(△). For each ξ ∈ M,letψ ξ be <strong>the</strong> spl<strong>in</strong>e<strong>in</strong> S(△) such that c ξ = 1 while c η = 0 for all o<strong>the</strong>r η ∈ M. Then<strong>the</strong><strong>spl<strong>in</strong>es</strong>{ψ ξ } ξ∈M are clearly l<strong>in</strong>early <strong>in</strong>dependent <strong>and</strong> form a basis for S(△).Thisbasisis called <strong>the</strong> M-basis for S(△), see Sect. 5.8 of [14]. It is stable <strong>and</strong> local <strong>in</strong> <strong>the</strong>sense that for all ξ ∈ M,1) ‖ψ ξ ‖ ≤ K,2) supp ψ ξ ⊆ star l (T ξ ),whereT ξ is a triangle conta<strong>in</strong><strong>in</strong>g ξ,where l is <strong>the</strong> <strong>in</strong>teger constant <strong>in</strong> (1), <strong>and</strong> <strong>the</strong> constant K depends only on l<strong>and</strong> <strong>the</strong> smallest angle <strong>in</strong> △. Here <strong>and</strong> <strong>in</strong> <strong>the</strong> sequel, for any set U ⊂ IR 2 , ‖·‖ Udenotes <strong>the</strong> ∞-norm over po<strong>in</strong>ts <strong>in</strong> U. There are many spaces with stable localbases. For example, <strong>the</strong> spaces Sd 0 (△) have stable local bases with l = 1. Thesame is true for <strong>the</strong> superspl<strong>in</strong>e spaces S r,2r4r+1(△) for all r ≥ 1. Therearealsoseveral families of macro-element spaces def<strong>in</strong>ed for all r ≥ 1 with <strong>the</strong> sameproperty, see [14].2.3 Computational methodsWe now list several useful techniques for work<strong>in</strong>g with <strong>spl<strong>in</strong>es</strong> numerically.1. Us<strong>in</strong>g <strong>the</strong> well-known smoothness conditions for two polynomial patchesto jo<strong>in</strong> toge<strong>the</strong>r smoothly across an edge of a triangulation (see Theorem2.28 of [14]), for each η ∈ D d,△ \ M, we can f<strong>in</strong>d real numbers { a η }ξ ξ∈Ɣ ηsuch that for every spl<strong>in</strong>e s ∈ S(△) with coefficients {c β } β∈M ,c η = ∑ ξ∈Ɣ ηa η ξ c ξ . (3)Note that for spaces with locally supported bases, <strong>the</strong> number of nonzeroa η ξ <strong>in</strong> (3) will generally be quite small. If we <strong>in</strong>tend to use <strong>the</strong> spl<strong>in</strong>e spaceS(△) for several fitt<strong>in</strong>g problems, <strong>the</strong>se weights can be precomputed <strong>and</strong>stored.2. To store a particular spl<strong>in</strong>e s <strong>in</strong> <strong>the</strong> space S(△), we simply store itscoefficient vector c := (c ξ ) ξ∈M . Recall that <strong>the</strong> length of this vector is just<strong>the</strong> dimension of S(△).3. To evaluate s at a po<strong>in</strong>t (x, y) <strong>in</strong> a triangle T, weuse<strong>the</strong>formulae(3) tocompute <strong>the</strong> B-coefficients of s correspond<strong>in</strong>g to all doma<strong>in</strong> po<strong>in</strong>ts <strong>in</strong> T.Then we can use <strong>the</strong> well-known de Casteljau algorithm to f<strong>in</strong>d s(x, y),seep. 26 of [14].


Numer Algor (2008) 48:237–260 2414. If we need to evaluate s at many po<strong>in</strong>ts, for example to display <strong>the</strong> surfacecorrespond<strong>in</strong>g to s, it may be most efficient to compute <strong>and</strong> store all of <strong>the</strong>B-coefficients {c ξ } ξ∈Dd,△ of s us<strong>in</strong>g (3). The total number of B-coefficientsis equal to <strong>the</strong> dimension of Sd 0(△), whichisnco := n V + (d − 1)n E +)nT ,wheren V , n E , n T are <strong>the</strong> numbers of vertices, edges, <strong>and</strong> triangles( d−12of △.3 <strong>Comput<strong>in</strong>g</strong> <strong>spl<strong>in</strong>es</strong> solv<strong>in</strong>g quadratic m<strong>in</strong>imization problemsSuppose S(△) ⊆ Sd 0 (△) is a space of <strong>spl<strong>in</strong>es</strong> with a stable local MDS M. Let{ψ ξ } ξ∈M be <strong>the</strong> associated M-basis. In this paper we focus on variational spl<strong>in</strong>eproblems where <strong>the</strong> coefficients of <strong>the</strong> desired spl<strong>in</strong>e are <strong>the</strong> solution of asystem of equations of <strong>the</strong> form∑〈ψ ξ ,ψ η 〉c ξ = r η , η ∈ M, (4)ξ∈Mwhere 〈·, ·〉 is some appropriate <strong>in</strong>ner-product. We suppose <strong>the</strong> <strong>in</strong>ner-productis such that〈ψ, φ〉 = ∑ 〈ψ| T ,φ| T 〉, all ψ, φ ∈ S(△). (5)T∈△Note that if S(△) has a local basis, <strong>the</strong>n only a small number of terms <strong>in</strong> (5)will be nonzero.To f<strong>in</strong>d a coefficient vector c := {c ξ } ξ∈M satisfy<strong>in</strong>g (4), we have to compute<strong>the</strong> matrixM := [〈ψ ξ ,ψ η 〉] ξ,η∈M<strong>and</strong> <strong>the</strong> vector r = (r η ) η∈M . This matrix will be sparse whenever S(△) has alocal basis. To describe an efficient algorithm for f<strong>in</strong>d<strong>in</strong>g M, we make <strong>the</strong>follow<strong>in</strong>g observation.Lemma 1 For every ξ ∈ M <strong>and</strong> every triangle T ∈△,ψ ξ | T = ∑a η ξ BT η , (6)η∈D d,Twhere a η ξ are <strong>the</strong> weights <strong>in</strong> formula (3).Proof The spl<strong>in</strong>e ψ ξ is <strong>the</strong> spl<strong>in</strong>e with c ξ = 1, <strong>and</strong>c β = 0 for all o<strong>the</strong>r β ∈ M.Fix a doma<strong>in</strong> po<strong>in</strong>t η <strong>in</strong> T. Thenby(3), <strong>the</strong> coefficient c η of ψ ξ is given byc η = a η ξ .⊓⊔Algorithm 1 For all T ∈△,• Compute <strong>the</strong> matrix [〈 Bα T, 〉]BT β α,β∈D d,T.• For all ξ,η ∈ M,〈ψ ξ ,ψ η 〉←〈ψ ξ ,ψ η 〉+ ∑ 〈 〉α,β∈D d,Ta α ξ aβ η BTα , BβT .


242 Numer Algor (2008) 48:237–260This algorithm works by loop<strong>in</strong>g through <strong>the</strong> triangles of △. The entries <strong>in</strong>M are obta<strong>in</strong>ed by an accumulation process. If <strong>the</strong> value r η on <strong>the</strong> right-h<strong>and</strong>side of (4) <strong>in</strong>volves an <strong>in</strong>ner-product of a given function with ψ η ,itcanbecomputed by add<strong>in</strong>g an additional accumulation step to <strong>the</strong> algorithm. We discussthis algorithm <strong>in</strong> more detail for <strong>the</strong> particular variational spl<strong>in</strong>e methodstreated below.4 M<strong>in</strong>imal energy <strong>in</strong>terpolat<strong>in</strong>g <strong>spl<strong>in</strong>es</strong>In this section we discuss <strong>the</strong> m<strong>in</strong>imal energy method for comput<strong>in</strong>g an<strong>in</strong>terpolat<strong>in</strong>g spl<strong>in</strong>e. Suppose we are given values { f i } n di=1associated with a setof n d ≥ 3 abscissae A := {(x i , y i )} n di=1<strong>in</strong> <strong>the</strong> plane. The problem is to constructa smooth function s that <strong>in</strong>terpolates this <strong>data</strong> <strong>in</strong> <strong>the</strong> sense thats(x i , y i ) = f i , i = 1,...,n d . (7)To solve this problem, suppose △ is a triangulation with vertices at <strong>the</strong> po<strong>in</strong>tsof A, <strong>and</strong> suppose S(△) is a spl<strong>in</strong>e space def<strong>in</strong>ed over △ with dimension n ≥ n d .Then <strong>the</strong> set of all <strong>spl<strong>in</strong>es</strong> <strong>in</strong> S(△) that <strong>in</strong>terpolate <strong>the</strong> <strong>data</strong> is given by( f ) ={s ∈ S(△) : s(x i , y i ) = f i , i = 1, ··· , n d }.Given a spl<strong>in</strong>e s ∈ ( f ), we measure its energy us<strong>in</strong>g <strong>the</strong> well-known th<strong>in</strong>plateenergy functional∫[E(s) = (Dxx s) 2 + 2(D xy s) 2 + (D yy s) 2] dxdy. (8)Def<strong>in</strong>ition 1 The m<strong>in</strong>imal energy (ME) <strong>in</strong>terpolat<strong>in</strong>g spl<strong>in</strong>e is <strong>the</strong> spl<strong>in</strong>e s e <strong>in</strong> such that E(s e ) = m<strong>in</strong>{E(s), s ∈ ( f )}.It follows from st<strong>and</strong>ard Hilbert space approximation results that if ( f ) isnot empty, <strong>the</strong>n <strong>the</strong>re exists a unique ME-spl<strong>in</strong>e which is characterized by <strong>the</strong>property〈s e ,ψ〉 E = 0, all ψ ∈ (0), (9)where∫〈φ,ψ〉 E = [D xx φ D xx ψ + 2D xy φ D xy ψ + D yy φ D yy ψ]dxdy.To compute <strong>the</strong> m<strong>in</strong>imal energy spl<strong>in</strong>e, we now suppose that <strong>the</strong>re exists aMDS M for S(△) such that <strong>the</strong> correspond<strong>in</strong>g M-basis {ψ i }i=1 n is stable <strong>and</strong>local. For all st<strong>and</strong>ard spl<strong>in</strong>e spaces, we may choose M to <strong>in</strong>clude <strong>the</strong> set A,


Numer Algor (2008) 48:237–260 243<strong>and</strong> <strong>in</strong> fact, can assume that <strong>the</strong> first n d po<strong>in</strong>ts <strong>in</strong> M are (x i , y i ), i = 1,...,n d .Now suppose s is written <strong>in</strong> <strong>the</strong> formn∑s = c i ψ i . (10)i=1Let c := (c 1 ,...,c nd ) T <strong>and</strong> c := (c nd +1,...,c n ) T .Theorem 1 The spl<strong>in</strong>e s is <strong>the</strong> ME <strong>in</strong>terpolat<strong>in</strong>g spl<strong>in</strong>e if <strong>and</strong> only if c =( f 1 ,..., f nd ) T ,<strong>and</strong>Mc = r, (11)whereM ij := 〈ψ nd +i,ψ nd + j〉 E , i, j = 1,...,n − n d ,r j :=∑n di=1f i 〈ψ i ,ψ nd + j〉 E , j = 1,...,n − n d .Proof By our assumptions on <strong>the</strong> M-basis, s belongs to ( f ) if <strong>and</strong> only if c =( f 1 ,..., f nd ) T .S<strong>in</strong>ceψ nd +1,...,ψ n span (0), it follows that (9) is equivalentto〈∑ nd〉c i ψ i ,ψ j = 0, j = n d + 1,...,n, (12)i=1which can immediately be rewritten as (11).EThe uniqueness of <strong>the</strong> ME spl<strong>in</strong>e <strong>in</strong>sures that <strong>the</strong> matrix M <strong>in</strong> (11) isnons<strong>in</strong>gular. Thus, to compute <strong>the</strong> coefficient vector of <strong>the</strong> ME spl<strong>in</strong>e, wesimply need to compute M <strong>and</strong> r, <strong>and</strong><strong>the</strong>nsolve(11) forc. We now discuss<strong>the</strong> assembly of M <strong>and</strong> r, which we base on <strong>the</strong> algorithm of Section 3. First,we observe that <strong>in</strong> this case <strong>the</strong> <strong>in</strong>ner-product is an <strong>in</strong>tegral, <strong>and</strong> thus clearlysatisfies (5). To carry out Algorithm 1, all we need to do is compute <strong>the</strong><strong>in</strong>ner-products 〈 Bα T, 〉BT β E . Derivatives of <strong>the</strong> BT α can be expressed <strong>in</strong> termsof Bernste<strong>in</strong> basis polynomials of lower degree, see Lemma 2.11 of [14]. But<strong>in</strong>ner-products of Bernste<strong>in</strong> basis polynomials of any degree can be computedexplicitly, see Theorem 2.34 <strong>in</strong> <strong>the</strong> book [14]. For tables of <strong>the</strong> <strong>in</strong>ner-productsfor degrees d = 1, 2, 3, see pages 46–47 of <strong>the</strong> book.⊓⊔5 Discrete least squares <strong>spl<strong>in</strong>es</strong>In this section we discuss a well-known method for fitt<strong>in</strong>g <strong>bivariate</strong> <strong>scattered</strong><strong>data</strong> <strong>in</strong> <strong>the</strong> case when <strong>the</strong> number n d of <strong>data</strong> locations is very large. We assumethat <strong>the</strong> <strong>data</strong> are <strong>the</strong> measurements { f i := f (x i , y i )} n di=1of an unknown functionf def<strong>in</strong>ed on . To create a spl<strong>in</strong>e fit, we work with a spl<strong>in</strong>e space S(△) def<strong>in</strong>edon a triangulation △ with a set V of vertices which are not necessarily at <strong>the</strong>


244 Numer Algor (2008) 48:237–260po<strong>in</strong>ts of A. Typically we choose <strong>the</strong> number of vertices to be (much) smallerthan n d .Def<strong>in</strong>ition 2 The DLSQ spl<strong>in</strong>e fit of f is <strong>the</strong> spl<strong>in</strong>e s l ∈ S(△) that m<strong>in</strong>imizesn d‖s − f ‖ 2 A := ∑[s(x j , y j ) − f j ] 2 .It is well known that if S(△) satisfies <strong>the</strong> propertyj=1s(x i , y i ) = 0, i = 1,...,n d , implies s ≡ 0, (13)<strong>the</strong>n <strong>the</strong>re is a unique DLSQ spl<strong>in</strong>e s l fitt<strong>in</strong>g <strong>the</strong> <strong>data</strong>. This requires that <strong>the</strong>number n d of <strong>data</strong> po<strong>in</strong>ts be at least equal to <strong>the</strong> dimension n of <strong>the</strong> <strong>spl<strong>in</strong>es</strong>pace. In practice n d will typically be much larger than n. However, <strong>in</strong> generalthis is not sufficient – we need <strong>the</strong> <strong>data</strong> po<strong>in</strong>ts to be reasonably well distributedamong <strong>the</strong> triangles of △ <strong>in</strong> order to make (13) hold.It follows from st<strong>and</strong>ard Hilbert space approximation results that <strong>the</strong>reexists a unique DLSQ-spl<strong>in</strong>e s l which is characterized by <strong>the</strong> propertywhere〈s l − f,ψ〉 A = 0, all ψ ∈ S(△), (14)∑n d〈φ,ψ〉 A := φ(x i , y i )ψ(x i , y i ).i=1To compute <strong>the</strong> least-squares spl<strong>in</strong>e s l , we now write it <strong>in</strong> <strong>the</strong> form (10),where {ψ i } n i=1 isastablelocalM-basis for S(△). Letc := (c 1,...,c n ) be <strong>the</strong>vector of coefficients.Theorem 2 The<strong>spl<strong>in</strong>es</strong> l is <strong>the</strong> DLSQ spl<strong>in</strong>e fit of f if <strong>and</strong> only ifMc = r, (15)whereM ij := 〈ψ i ,ψ j 〉 A ,r j := 〈 f,ψ j 〉 A,i, j = 1,...,n,j = 1,...,n.Proof S<strong>in</strong>ce ψ 1 ,...,ψ n span S(△), it follows that (14) is equivalent to〈 n∑〉c i ψ i − f,ψ j = 0, j = 1,...,n, (16)i=1which can immediately be rewritten as (15).AThe assumption (13) <strong>in</strong>sures that <strong>the</strong> matrix M <strong>in</strong> (15) is nons<strong>in</strong>gular. Thus,to compute <strong>the</strong> coefficient vector of <strong>the</strong> least-squares spl<strong>in</strong>e, we simply needto compute M <strong>and</strong> r, <strong>and</strong><strong>the</strong>nsolve(15) forc. Note that here <strong>the</strong> matrix⊓⊔


Numer Algor (2008) 48:237–260 245M is of size n × n <strong>in</strong> contrast to <strong>the</strong> m<strong>in</strong>imal-energy case where it is of size(n − n d ) × (n − n d ). For spl<strong>in</strong>e spaces S(△) with stable local MDS M, <strong>the</strong>computation of M can be done efficiently us<strong>in</strong>g Algorithm 1. To apply it, weneed to compute <strong>the</strong> <strong>in</strong>ner-products 〈 Bα T, 〉BT β . For this, we simply need <strong>the</strong>Avalues of <strong>the</strong> Bernste<strong>in</strong> basis polynomials at all of <strong>the</strong> po<strong>in</strong>ts of A that lie <strong>in</strong>T. These values can also be used to compute <strong>the</strong> vector r <strong>in</strong> (15). We give anefficient algorithm <strong>in</strong> Section 9 for comput<strong>in</strong>g <strong>the</strong> values of all Bernste<strong>in</strong>-Basispolynomials at a fixed po<strong>in</strong>t.6 PLSQ <strong>spl<strong>in</strong>es</strong>In this section we discuss a method for fitt<strong>in</strong>g <strong>bivariate</strong> <strong>scattered</strong> <strong>data</strong> which ispreferable to least-squares when <strong>the</strong> <strong>data</strong> { f i } n di=1are noisy. It is a generalizationof <strong>the</strong> least-squares fitt<strong>in</strong>g method <strong>in</strong> Section 5. Suppose A := {x i , y i } n di=1 ,<strong>and</strong>S(△) are as <strong>in</strong> <strong>the</strong> previous section. For each s ∈ S(△),letE(s) be its associatedth<strong>in</strong>-plate energy def<strong>in</strong>ed <strong>in</strong> (8).Def<strong>in</strong>ition 3 Given λ ≥ 0,<strong>the</strong>PLSQ spl<strong>in</strong>e fit of f is <strong>the</strong> spl<strong>in</strong>e s λ <strong>in</strong> S(△) thatm<strong>in</strong>imizesE λ (s) := ‖s − f ‖ A + λE(s).It is well known that if <strong>the</strong> spl<strong>in</strong>e space S(△) satisfies (13), <strong>the</strong>n <strong>the</strong>re existsa unique PLSQ-spl<strong>in</strong>e s λ . Moreover, s λ is characterized by〈s λ − f, s〉 A + λ〈s λ , s〉 E = 0, all s ∈ S(△).To compute <strong>the</strong> PLSQ spl<strong>in</strong>e s λ , we write it <strong>in</strong> <strong>the</strong> form (10), where {ψ i } n i=1 is astable local M-basis for S(△).Letc := (c 1 ,...,c n ) be <strong>the</strong> vector of coefficients.We immediately have <strong>the</strong> follow<strong>in</strong>g result.Theorem 3 The<strong>spl<strong>in</strong>es</strong> λ is <strong>the</strong> PLSQ fit of f if <strong>and</strong> only ifwhereMc = r, (17)M ij := 〈ψ i ,ψ j 〉 A + λ(ψ i ,ψ j 〉 E ,i, j = 1,...,n,<strong>and</strong> r is <strong>the</strong> vector <strong>in</strong> (15).The assumption (13) <strong>in</strong>sures that <strong>the</strong> matrix M <strong>in</strong> (17) is nons<strong>in</strong>gular. We canefficiently compute both M <strong>and</strong> r by <strong>the</strong> methods of <strong>the</strong> previous two sections.Note that when λ = 0, we get <strong>the</strong> least-squares spl<strong>in</strong>e fit.


246 Numer Algor (2008) 48:237–2607 Solution of boundary-value problemsIn this section we describe how Algorithm 1 can be used to compute Galerk<strong>in</strong>approximations to solutions of elliptic boundary-value problems.7.1 Second order problems with homogeneous boundary conditionsWe first describe <strong>the</strong> method for <strong>the</strong> simple model problem−∇·(κ∇u) = f, on ,u = 0, on ∂, (18)where f <strong>and</strong> κ are given functions on . Suppose that △ is a triangulation of,<strong>and</strong>letS(△) be a <strong>bivariate</strong> spl<strong>in</strong>e space def<strong>in</strong>ed on △ with a stable MDS M.LetU 0 := {s ∈ S(△) : s(x, y) = 0, all (x, y) ∈ ∂}.We look for an approximation s g of u <strong>in</strong> U 0 . Suppose ψ 1 ,...,ψ n is a stable localbasis for U 0 , <strong>and</strong> suppose s g is written <strong>in</strong> <strong>the</strong> form (10). Then by <strong>the</strong> Galerk<strong>in</strong>method, see [8], <strong>the</strong> coefficients of s g should be chosen to be <strong>the</strong> solution of <strong>the</strong>system of equationswhere∫M ij =〈ψ i ,ψ j 〉 G:=for i, j = 1,...,n, <strong>and</strong>∫r i =〈f,ψ i 〉 2 :=Mc = r, (19)κ(x, y)∇ψ i (x, y) ·∇ψ j (x, y)dxdy,f (x, y)ψ i (x, y)dxdy,i = 1,...,n.S<strong>in</strong>ce ∇ψ i ·∇ψ j = D x ψ i D x ψ j + D y ψ i D y ψ j , <strong>the</strong> computation of M <strong>in</strong>volvescomput<strong>in</strong>g <strong>in</strong>ner-products of first derivatives of <strong>the</strong> Bernste<strong>in</strong> basis polynomials.If κ ≡ 1, <strong>the</strong>se <strong>in</strong>ner-products can be computed explicitly. For general κ<strong>and</strong> for <strong>the</strong> computation of <strong>the</strong> vector r, we will need to use a quadrature rule.We use Gaussian quadrature, see Remark 7.We emphasize that for this problem, to use Algorithm 1 we need a stablelocal m<strong>in</strong>imal determ<strong>in</strong><strong>in</strong>g set for <strong>the</strong> subspace of <strong>spl<strong>in</strong>es</strong> U(0). Inparticular,all spl<strong>in</strong>e coefficients associated with doma<strong>in</strong> po<strong>in</strong>ts on <strong>the</strong> boundary of mustbe set to 0. Thus, for example, if <strong>the</strong> approximat<strong>in</strong>g spl<strong>in</strong>e space is S 1,25(△),<strong>the</strong>nfor each boundary vertex v whose exterior angle is less than π, only one of <strong>the</strong>doma<strong>in</strong> po<strong>in</strong>ts <strong>in</strong> <strong>the</strong> disk D 2 (v) of radius 2 around v can be <strong>in</strong>cluded <strong>in</strong> M.Recall, that for <strong>the</strong> full space, we chose six po<strong>in</strong>ts <strong>in</strong> each D 2 (v), see Fig. 1.When <strong>the</strong> exterior angle at v is equal to π, we must choose three po<strong>in</strong>ts <strong>in</strong>D 2 (v) to <strong>in</strong>clude <strong>in</strong> M.


Numer Algor (2008) 48:237–260 247.................Fig. 1 MDS for S 1,25 (△) <strong>and</strong> S 2,49 (△)7.2 Second order problems with <strong>in</strong>homogeneous boundary conditionsOnly m<strong>in</strong>or modifications are required to solve <strong>the</strong> <strong>in</strong>homogeneous boundaryvalueproblem−∇·(κ∇u) = f, on ,u = g, on ∂, (20)where f <strong>and</strong> κ are given function on , <strong>and</strong>g is a given function on ∂.Asbefore, we choose a spl<strong>in</strong>e space S(△) def<strong>in</strong>ed on a triangulation △ of with astable local M-basis {ψ i }i=1 n . As is well known, see e.g. [8], <strong>in</strong> this case we lookfor an approximation to u of <strong>the</strong> form s = s b + s h ,wheres b is a spl<strong>in</strong>e suchthat s b ≈ g on ∂,<strong>and</strong>s h is <strong>the</strong> Galerk<strong>in</strong> approximation of <strong>the</strong> solution of <strong>the</strong>boundary-value problem with homogeneous boundary conditions <strong>and</strong> righth<strong>and</strong>side f − s b .Writ<strong>in</strong>gs h <strong>in</strong> <strong>the</strong> form (10), we can compute its coefficientsfrom <strong>the</strong> equationswhere M is as <strong>in</strong> (19) <strong>and</strong>Mc = ˜r,˜r j =〈f,ψ j 〉 2−〈s b ,ψ j 〉 G,j = 1,...,n.It is straightforward to construct s b . We first choose its Bernste<strong>in</strong>–Béziercoefficients associated with doma<strong>in</strong> po<strong>in</strong>ts on <strong>the</strong> boundary edges of △ so thats b does a good job of approximat<strong>in</strong>g g on ∂. For example, we may <strong>in</strong>terpolateg at an appropriate number of po<strong>in</strong>ts on each edge of △. Thenwesetasmany rema<strong>in</strong><strong>in</strong>g coefficients to zero as possible while observ<strong>in</strong>g all smoothnessconditions.7.3 Fourth order problemsAs an example of a fourth order problem, consider <strong>the</strong> biharmonic equation△ 2 u = f, on , (21)


248 Numer Algor (2008) 48:237–260subject to <strong>the</strong> boundary conditionsu = g, on ∂,∂u= h,∂non ∂, (22)where ∂n st<strong>and</strong>s for <strong>the</strong> normal derivative to <strong>the</strong> boundary. As before, weconstruct an approximation s g := s b + s h to u by first construct<strong>in</strong>g a <strong>spl<strong>in</strong>es</strong> b that approximately satisfies <strong>the</strong> boundary conditions. We <strong>the</strong>n computes h as <strong>the</strong> Galerk<strong>in</strong> spl<strong>in</strong>e for <strong>the</strong> correspond<strong>in</strong>g problem with homogeneousboundary conditions. Start<strong>in</strong>g with a spl<strong>in</strong>e space S(△), we def<strong>in</strong>e <strong>the</strong> subspaceU 0 := {s ∈ S(△) : s satisfies <strong>the</strong> boundary conditions (22) withg ≡ h ≡ 0.}Assum<strong>in</strong>g ψ 1 ,...,ψ n is a stable local basis for U 0 , <strong>and</strong> writ<strong>in</strong>g s h <strong>in</strong> <strong>the</strong> form(10), <strong>the</strong> Galerk<strong>in</strong> method provides <strong>the</strong> follow<strong>in</strong>g l<strong>in</strong>ear system of equationsfor <strong>the</strong> coefficients of s h :where∫M ij :=Mc = r,△ψ i △ψ j dxdy,i, j = 1,...,n,<strong>and</strong>∫r j =〈f,ψ j 〉 2− △s g △ψ j dxdy, j = 1,...,n.Note that although we are allowed to use C 0 <strong>spl<strong>in</strong>es</strong> <strong>in</strong> <strong>the</strong> Galerk<strong>in</strong> methodfor solv<strong>in</strong>g second order boundary-value problems, for fourth order problems<strong>the</strong> well-known conformality conditions require that we use a space of <strong>spl<strong>in</strong>es</strong>that is C 1 at least.8 ExamplesIn this section we give several numerical examples. Given a triangulation △,we write V <strong>and</strong> E for <strong>the</strong> sets of vertices <strong>and</strong> edges of △. We also write n V , n E ,<strong>and</strong> n T for <strong>the</strong> numbers of vertices, edges, <strong>and</strong> triangles of △. Weworkwith<strong>the</strong> follow<strong>in</strong>g spl<strong>in</strong>e spaces:1) Sd 0(△). The dimension of this space is n V + (d − 1)n E + ( )d−1 nT .Astable2local MDS is given by <strong>the</strong> full set D d,△ of doma<strong>in</strong> po<strong>in</strong>ts. This spaceapproximates smooth functions up to order O(|△| d+1 ), see Remark 5.2) S 1,25(△). This space has dimension 6n V + n E , <strong>and</strong> as shown <strong>in</strong> Theorem 6.1of [14], a stable local MDS M is given by <strong>the</strong> set of doma<strong>in</strong> po<strong>in</strong>tsM := ⋃ M v ∪ ⋃ M e ,v∈Ve∈E


Numer Algor (2008) 48:237–260 249where for each vertex v of △, M v is <strong>the</strong> set of six doma<strong>in</strong> po<strong>in</strong>ts <strong>in</strong>D 2 (v) ∪ T v for some triangle attached to v. For each edge e of △, M econsists of <strong>the</strong> doma<strong>in</strong> po<strong>in</strong>t ξ T e122 for some triangle T e conta<strong>in</strong><strong>in</strong>g <strong>the</strong> edgee <strong>and</strong> with first vertex opposite e. Figure 1 (left) shows <strong>the</strong> po<strong>in</strong>ts <strong>in</strong> Mfor a typical triangulation, where po<strong>in</strong>ts <strong>in</strong> <strong>the</strong> sets M v are marked withblack dots, while those <strong>in</strong> <strong>the</strong> sets M e are marked with triangles. S<strong>in</strong>ceS 1,25(△) has a stable local basis, it approximates smooth functions up toorder O(|△| 6 ), see Remark 5.3) S 2,49(△). This space has dimension 15n V + 3n E + n T , <strong>and</strong> as shown <strong>in</strong>Theorem 7.1 of [14], a stable local MDS M is given by <strong>the</strong> set of doma<strong>in</strong>po<strong>in</strong>tsM := ⋃ v∈VM v∪ ⋃ e∈EM e ∪ ⋃ T∈△M T ,where for each vertex v, M v is <strong>the</strong> set of fifteen doma<strong>in</strong> po<strong>in</strong>ts <strong>in</strong> D 4 (v) ∪T v for some triangle attached to v. Foreachedgee of △, M e consists of<strong>the</strong> three doma<strong>in</strong> po<strong>in</strong>ts ξ T e144 ,ξT e243 ,ξT e234 for some triangle T e conta<strong>in</strong><strong>in</strong>g <strong>the</strong>edge e <strong>and</strong> with first vertex opposite e. For each triangle T, M T consists of<strong>the</strong> doma<strong>in</strong> po<strong>in</strong>t ξ333 T . Figure 1 (right) shows M for a typical triangulation.Here squares are used to mark po<strong>in</strong>ts <strong>in</strong> <strong>the</strong> set M T .S<strong>in</strong>ceS 2,49(△) has astable local basis, it approximates smooth functions up to order O(|△| 10 ),see Remark 5.8.1 M<strong>in</strong>imal energy fitExample 1 We construct a C 1 surface based on measurements of <strong>the</strong> height ofa nose cone at 803 po<strong>in</strong>ts <strong>in</strong> <strong>the</strong> doma<strong>in</strong> shown <strong>in</strong> Fig. 2. The figure shows <strong>the</strong>Delaunay triangulation △ nose associated with <strong>the</strong> <strong>data</strong> po<strong>in</strong>ts.Fig. 2 The m<strong>in</strong>imal energy fit of Example 1


250 Numer Algor (2008) 48:237–260Discussion: For this application we choose <strong>the</strong> m<strong>in</strong>imal energy <strong>in</strong>terpolat<strong>in</strong>gspl<strong>in</strong>e <strong>in</strong> <strong>the</strong> space S 1,25(△ nose ). This triangulation has n E = 2357 edges <strong>and</strong>n T = 1555 triangles. Thus, <strong>the</strong> dimension of <strong>the</strong> space is 7175, <strong>and</strong> f<strong>in</strong>d<strong>in</strong>g <strong>the</strong>m<strong>in</strong>imal energy fit requires solv<strong>in</strong>g a system of 6372 equations. The associatedmatrix is sparse with only 243,402 of <strong>the</strong> 40,602,384 entries be<strong>in</strong>g nonzero. Thecomputation took 34 seconds on a desktop, but see Remark 8. The result<strong>in</strong>gspl<strong>in</strong>e fit is shown <strong>in</strong> Fig. 2 (right).To fur<strong>the</strong>r illustrate <strong>the</strong> behavior of m<strong>in</strong>imal energy spl<strong>in</strong>e fits, we give asecond example <strong>in</strong>volv<strong>in</strong>g a known function where we can compute errors. Weuse <strong>the</strong> well-known Franke functionF(x, y) = 0.75 exp(−0.25(9x − 2) 2 − 0.25(9y − 2) 2 )+ 0.75 exp(−(9x + 1) 2 /49 − (9y + 1) 2 /10)+ 0.5exp(−0.25(9x − 7) 2 − 0.25(9y − 3) 2 )− 0.2exp(−(9x − 4) 2 − (9y − 7) 2 ) (23)def<strong>in</strong>ed on <strong>the</strong> unit square. The surface correspond<strong>in</strong>g to F is shown <strong>in</strong> Fig. 3.Example 2 We construct m<strong>in</strong>imal energy spl<strong>in</strong>e fits of F from <strong>the</strong> spacesS 1,25(△ k ) based on type-I triangulations △ k with k = 9, 25, 81, <strong>and</strong> 289 vertices.Discussion: Type-I triangulations are obta<strong>in</strong>ed by first form<strong>in</strong>g a rectangulargrid, <strong>and</strong> <strong>the</strong>n draw<strong>in</strong>g <strong>in</strong> <strong>the</strong> nor<strong>the</strong>ast diagonals. We show <strong>the</strong> results of ourcomputations <strong>in</strong> <strong>the</strong> table <strong>in</strong> Fig. 4, where <strong>the</strong> columns labelled nt <strong>and</strong> nsys give<strong>the</strong> number of triangles <strong>in</strong> △ k <strong>and</strong> <strong>the</strong> size of <strong>the</strong> l<strong>in</strong>ear system be<strong>in</strong>g solved,respectively. The columns labelled e ∞ <strong>and</strong> e 2 give <strong>the</strong> maximum error <strong>and</strong> <strong>the</strong>RMS errors measured over a grid of 640,000 po<strong>in</strong>ts. The last column conta<strong>in</strong>s<strong>the</strong> computational times <strong>in</strong> seconds. To illustrate <strong>the</strong> quality of <strong>the</strong> fits, wegive contour plots for each of <strong>the</strong> four cases. Clearly, <strong>the</strong> fit on △ 9 is not verygood, <strong>and</strong> completely misses <strong>the</strong> peaks <strong>and</strong> valley <strong>in</strong> <strong>the</strong> function. On <strong>the</strong> o<strong>the</strong>rh<strong>and</strong>, <strong>the</strong> contour plot for △ 289 is almost identical to <strong>the</strong> contour plot of fitself. In compar<strong>in</strong>g Figs. 3 <strong>and</strong> 4, note that <strong>the</strong> 3D view of F <strong>in</strong> Fig. 3 is frombeh<strong>in</strong>d <strong>the</strong> surface so that <strong>the</strong> peaks do not obscure <strong>the</strong> valley. The results hereare very comparable to those obta<strong>in</strong>ed for <strong>the</strong> space of C 2 qu<strong>in</strong>tic <strong>spl<strong>in</strong>es</strong> onFig. 3 The Franke function


Numer Algor (2008) 48:237–260 251Fig. 4 M<strong>in</strong>imal energy fits of F from S 1,25 (△ k ), see Example 2Powell-Sab<strong>in</strong> splits, see Table 3 of [11], which were computed by <strong>the</strong> Lagrangemultiplier method of [4].8.2 Least-squares fitt<strong>in</strong>gIn this section we give examples of least-squares fitt<strong>in</strong>g with <strong>spl<strong>in</strong>es</strong>. Let F be<strong>the</strong> Franke function (23) def<strong>in</strong>ed on <strong>the</strong> unit square.


252 Numer Algor (2008) 48:237–260Fig. 5 Least-squares fits of F from S 1,25 (△ k ) <strong>and</strong> S 2,49 (△ k ), see Example 3Example 3 We construct least-squares fits of F us<strong>in</strong>g <strong>the</strong> spaces S 1,25(△ n )<strong>and</strong> S 2,49(△ k ) def<strong>in</strong>ed on type-I triangulations based on measurements onrectangular grids of nd := 289, 1089 <strong>and</strong> 4225 po<strong>in</strong>ts.Discussion: The table <strong>in</strong> Fig. 5 shows <strong>the</strong> results of our computations, where<strong>the</strong> columns labelled e ∞ <strong>and</strong> e 2 give <strong>the</strong> maximum error <strong>and</strong> RMS errors on agrid of 640,000 po<strong>in</strong>ts. The column labelled nsys gives <strong>the</strong> size of <strong>the</strong> l<strong>in</strong>earsystem be<strong>in</strong>g solved. The last column conta<strong>in</strong>s <strong>the</strong> computational times <strong>in</strong>seconds. We show contour plots of <strong>the</strong> fits based on 289 <strong>data</strong> po<strong>in</strong>ts, where<strong>the</strong> plot on <strong>the</strong> left is <strong>the</strong> fit from S 1,25(△ 9 ) while <strong>the</strong> one on <strong>the</strong> right is <strong>the</strong> fitfrom S 2,49(△ 9 ).


Numer Algor (2008) 48:237–260 253Fig. 6 PLSQ fits of F with λ = .01,.005,.001, 08.3 Penalized least-squaresLet F be <strong>the</strong> Franke function (23) def<strong>in</strong>ed on <strong>the</strong> unit square. We approximateF based on measurements on a grid of 1089 po<strong>in</strong>ts. However, here we addr<strong>and</strong>om errors ε i to <strong>the</strong> measurements f i , where <strong>the</strong> ε i are uniformly distributed<strong>in</strong> [−.1,.1]. This is a ra<strong>the</strong>r significant amount of noise s<strong>in</strong>ce <strong>the</strong> values of F lie<strong>in</strong> <strong>the</strong> <strong>in</strong>terval [−.2, 1.1].Example 4 We compute <strong>the</strong> PLSQ spl<strong>in</strong>e fits s λ ∈ S 1,25(△ 25 ) for λ=.01,.005,.001 <strong>and</strong> 0.Discussion: The maximum errors for <strong>the</strong>se choices of λ were .127, .111, .08,<strong>and</strong> .10. The correspond<strong>in</strong>g surfaces are shown <strong>in</strong> Fig. 6. Clearly, <strong>the</strong> value ofλ makes a big difference. If it is too small, <strong>the</strong> fit follows <strong>the</strong> noise, <strong>and</strong> is notvery smooth. If it is too large, some of <strong>the</strong> shape is lost.


254 Numer Algor (2008) 48:237–260Fig. 7 Spl<strong>in</strong>e approximations of <strong>the</strong> BVP of Example 58.4 Solution of boundary-value problemsExample 5 Compute a solution to <strong>the</strong> boundary-value problem (20)withf (x, y) := 4cos(x 2 + y 2 ) − 4(x 2 + y 2 ) s<strong>in</strong>(x 2 + y 2 )+ 10 cos(25(x 2 + y 2 )) − 250 s<strong>in</strong>(25(x 2 + y 2 )),g(x, y) := s<strong>in</strong>(x 2 + y 2 ) + .1s<strong>in</strong>(25(x 2 + y 2 )),<strong>and</strong> κ ≡ 1 on <strong>the</strong> unit square .Discussion:In this case, <strong>the</strong> solution of <strong>the</strong> boundary-value problem (20)isu(x, y) := s<strong>in</strong>(x 2 + y 2 ) + .1s<strong>in</strong>(25(x 2 + y 2 )).


Numer Algor (2008) 48:237–260 255Table 1 Spl<strong>in</strong>e approximationsof <strong>the</strong> BVP ofExample 6k nt dim e ∞ e 2 timeS 1,25 9 8 18 3.4(−5) 1.1(−5) .0125 32 106 3.7(−8) 8.9(−9) .0781 128 498 6.1(−10) 1.3(−10) .46We computed spl<strong>in</strong>e approximations of u by <strong>the</strong> Galerk<strong>in</strong> method us<strong>in</strong>g <strong>spl<strong>in</strong>es</strong>paces def<strong>in</strong>ed on type-I triangulations △ k with k = 81, 289, 1089 <strong>and</strong> 4225vertices. The results are shown <strong>in</strong> <strong>the</strong> tables <strong>in</strong> Fig. 7, wherek <strong>and</strong> nt are <strong>the</strong>number of vertices <strong>and</strong> triangles, <strong>and</strong> dim is <strong>the</strong> dimension of <strong>the</strong> associatedspace. We give results not only for S 1,25(△ k ), but also for S 0 1 (△ k) for comparisonpurposes. As above, e ∞ <strong>and</strong> e 2 are <strong>the</strong> maximum <strong>and</strong> RMS errors on a grid of25,600 po<strong>in</strong>ts, <strong>and</strong> <strong>the</strong> last column shows <strong>the</strong> computational time <strong>in</strong> seconds.The figure on <strong>the</strong> left shows <strong>the</strong> traditional C 0 l<strong>in</strong>ear fit with k = 1089, while <strong>the</strong>one on <strong>the</strong> right shows <strong>the</strong> fit with S 1,25(△ k ) with k = 289. In addition to hav<strong>in</strong>gmuch smaller errors, it is much smoo<strong>the</strong>r. The results here can be comparedwith those <strong>in</strong> Table 13 of [4] which were computed with C 1 qu<strong>in</strong>tic <strong>spl<strong>in</strong>es</strong>, butwith f <strong>and</strong> g multiplied by 10.F<strong>in</strong>ally, we give an example <strong>in</strong>volv<strong>in</strong>g a fourth-order differential equation.Example 6 Compute a solution to <strong>the</strong> fourth-order boundary-value problem(21–22)withf (x, y) := 4exp(x + y),g(x, y) = h(x, y) := exp(x + y),on <strong>the</strong> unit square .Discussion: The solution of this boundary-value problem is u(x, y) :=exp(x + y). We computed spl<strong>in</strong>e approximations of u by <strong>the</strong> Galerk<strong>in</strong> methodus<strong>in</strong>g <strong>the</strong> space S 1,25(△ k ) def<strong>in</strong>ed on type-I triangulations with n = 9, 25, <strong>and</strong> 81vertices. The errors are shown <strong>in</strong> Table 1 along with <strong>the</strong> computational times.For a comparison with an approximation computed us<strong>in</strong>g S5 1(△ 25) us<strong>in</strong>g <strong>the</strong>Lagrange multiplier method, see Example 26 <strong>in</strong> [4].9 <strong>Comput<strong>in</strong>g</strong> Bernste<strong>in</strong> basis polynomials <strong>and</strong> <strong>the</strong>ir derivativesIn this section we describe algorithms for efficiently evaluat<strong>in</strong>g Bernste<strong>in</strong> basispolynomials of degree d <strong>and</strong> <strong>the</strong>ir derivatives. Fix a triangle T := 〈v 1 ,v 2 ,v 3 〉with vertices v i = (x i , y i ) for i = 1, 2, 3. The associated Bernste<strong>in</strong> basis polynomialsare def<strong>in</strong>ed byBijk d d !(x, y) :=i ! j ! k ! b i 1 b j 2 b k 3 , i + j + k = d, (24)


256 Numer Algor (2008) 48:237–260Fig. 8 One step ofAlgorithm 2where b 1 , b 2 , b 3 are <strong>the</strong> barycentric coord<strong>in</strong>ates of (x, y) relative to <strong>the</strong> triangleT. Specifically,∣ ∣b 1 (x, y) := 11 1 1 ∣∣∣∣∣ 1 1 1 ∣∣∣∣∣ detxx 2 x 3 , det :=x 1 x 2 x 3 , (25)∣ yy 2 y 3∣ y 1 y 2 y 3with similar def<strong>in</strong>itions for b 2 <strong>and</strong> b 3 . This shows that b 1 , b 2 , b 3 are l<strong>in</strong>earfunctions of x <strong>and</strong> y.The follow<strong>in</strong>g algorithm simultaneously computes <strong>the</strong> values of all of <strong>the</strong>Bernste<strong>in</strong> basis polynomials {B d ijk } i+ j+k=d at a fixed po<strong>in</strong>t (x, y). Suppose <strong>the</strong>barycentric coord<strong>in</strong>ates of (x, y) relative to T are b 1 , b 2 , b 3 .Algorithm 2 Computation of all Bernste<strong>in</strong> basis polynomials at a po<strong>in</strong>t (x, y).• Set B(0, 0) = 1• For k = 1 to dFor i = k to 0For j = i to 0B(i, j ) = b 1 B(i, j ) + b 2 B(i − 1, j ) + b 3 B(i − 1, j − 1)A simple <strong>in</strong>ductive proof shows that <strong>the</strong> follow<strong>in</strong>g lemma holds.Lemma 2 Algorithm 2 produces <strong>the</strong> values⎛B d ⎞d,0,0(x, y)⎜B d d−1,1,0⎝(x, y) Bd d−1,0,1(x, y)⎟··· ···⎠(x, y) Bd 0,1,d−1 (x, y) ··· Bd 0,0,d (x, y).B d 0,d,0We illustrate one step of this algorithm (k = 2) <strong>in</strong> Fig. 8. It shows how <strong>the</strong>six Bernste<strong>in</strong> basis polynomials of degree 2 are computed from <strong>the</strong> three ofdegree 1. The idea is to use <strong>the</strong> <strong>in</strong>verted triangle with b 1 , b 2 , b 3 at its verticesas a mask which is applied at six different positions to <strong>the</strong> triangular array of1st degree Bernste<strong>in</strong> basis polynomials on <strong>the</strong> left to get <strong>the</strong> triangular array ofBernste<strong>in</strong> basis polynomials of degree 2 on <strong>the</strong> right. Apply<strong>in</strong>g <strong>the</strong> mask aga<strong>in</strong>would lead to an array conta<strong>in</strong><strong>in</strong>g <strong>the</strong> 10 values of <strong>the</strong> cubic Bernste<strong>in</strong> basispolynomials, etc.


Numer Algor (2008) 48:237–260 257For <strong>the</strong> applications <strong>in</strong> Section 7, we also need an algorithm for evaluat<strong>in</strong>gderivatives of <strong>the</strong> Bernste<strong>in</strong> basis polynomials at a given po<strong>in</strong>t (x, y). We nowshow that Algorithm 2 can be easily adapted to produce <strong>the</strong> values of arbitrarydirectional derivatives of <strong>the</strong> Bernste<strong>in</strong> basis polynomials. Recall (see e.g. [14])that if u = u 1 − u 0 is a vector <strong>in</strong> IR 2 , <strong>the</strong>n its directional coord<strong>in</strong>ates (a 1 , a 2 , a 3 )relative to T are just <strong>the</strong> differences of <strong>the</strong> barycentric coord<strong>in</strong>ates of u 1 <strong>and</strong>u 0 relative to T. This implies a 1 + a 2 + a 3 = 0. The follow<strong>in</strong>g lemma showshow Algorithm 2 can be used to compute <strong>the</strong> values of <strong>the</strong> set of functions{D m u Bd ijk (x, y)} i+ j+k=d at a fixed po<strong>in</strong>t (x, y) whose barycentric coord<strong>in</strong>atesrelative to T are b 1 , b 2 , b 3 .Lemma 3 Fix 0 ≤ m ≤ d. Suppose that <strong>in</strong> carry<strong>in</strong>g out Algorithm 2, <strong>in</strong> <strong>the</strong> firstm times through <strong>the</strong> k-loop we use a 1 , a 2 , a 3 <strong>in</strong> place of b 1 , b 2 , b 3 .Then<strong>the</strong>algorithm produces (d−m) ! times <strong>the</strong> matrixd !⎛D m ⎞u Bd d,0,0(x, y)⎜D m u⎝Bd d−1,1,0 (x, y) Dm u Bd d−1,0,1(x, y)⎟··· ···⎠(x, y) Dm u Bd 0,1,d−1 (x, y) ··· Dm u Bd 0,0,d (x, y).D m u Bd 0,d,0Proof It is well known that[]D u Bijk d = d a 1 B d−1i−1, j,k + a 2 B d−1i, j−1,k + a 3 B d−1i, j,k−1,see e.g. Lemma 2.11 of [14], The result <strong>the</strong>n follows from a m<strong>in</strong>or variant of<strong>the</strong> <strong>in</strong>ductive proof of Lemma 2.⊓⊔This result can be generalized to compute arbitrary mixed directional derivatives.In particular, suppose we are given m directional vectors u 1 ,...,u mwhose direction coord<strong>in</strong>ates relative to T are a (ν) := (a (ν)1 , a(ν) 2 , a(ν) 3 ),forν =1,...,m. Then we can compute (d − m) ! /d ! times <strong>the</strong> matrix of values[D u1 ...D um Bijk d (x, y)] by runn<strong>in</strong>g Algorithm 2, but us<strong>in</strong>g a(ν) <strong>in</strong> place of(b 1 , b 2 , b 3 ) <strong>in</strong> <strong>the</strong> ν-th pass through <strong>the</strong> k-loop for ν = 1,...,m.S<strong>in</strong>ce we are <strong>in</strong>terested <strong>in</strong> comput<strong>in</strong>g <strong>the</strong> derivatives <strong>in</strong> <strong>the</strong> directions of<strong>the</strong> Cartesian axes, we now give formulae for <strong>the</strong> direction coord<strong>in</strong>ates of <strong>the</strong>special directional derivatives D x <strong>and</strong> D y .Lemma 4 Suppose T := 〈v 1 ,v 2 ,v 3 〉 where v i := (x i , y i ) for i = 1, 2, 3. Then <strong>the</strong>direction coord<strong>in</strong>ates of D x area x 1 = (y 2 − y 3 )/det, a x 2 = (y 3 − y 1 )/det, a x 3 = (y 1 − y 2 )/det, (26)while those of D y area y 1 = (x 3 − x 2 )/det, a y 2 = (x 1 − x 3 )/det, a y 3 = (x 2 − x 1 )/det, (27)where det is <strong>the</strong> determ<strong>in</strong>ant <strong>in</strong> (25).


258 Numer Algor (2008) 48:237–260These quantities are just <strong>the</strong> derivatives of <strong>the</strong> barycentric coord<strong>in</strong>atefunctions b 1 , b 2 , b 3 with respect to x <strong>and</strong> y.10 RemarksRemark 1 My first work on programs to compute m<strong>in</strong>imal energy <strong>spl<strong>in</strong>es</strong> wasdone with Ewald Quak <strong>in</strong> <strong>the</strong> mid 1980’s dur<strong>in</strong>g his stay at Texas A&M.Our programs used C 1 cubic <strong>and</strong> quartic <strong>spl<strong>in</strong>es</strong>, although even to this day<strong>the</strong> dimension of S3 1 (△) has not been determ<strong>in</strong>ed for arbitrary triangulations△. The Bernste<strong>in</strong>–Bézier representation was used, <strong>and</strong> smoothness conditionswere simply <strong>in</strong>corporated with Lagrange multipliers. The codes were not madepublic, but <strong>the</strong> details of how to compute energies were published <strong>in</strong> [15].This approach was later used <strong>in</strong> [7] <strong>in</strong> connection with <strong>the</strong> construction ofm<strong>in</strong>imal energy surfaces with C 1 cubic parametric <strong>spl<strong>in</strong>es</strong>, where <strong>in</strong> somecases certa<strong>in</strong> C 2 smoothness conditions were also <strong>in</strong>corporated via Lagrangemultipliers. The Lagrange multiplier approach was fur<strong>the</strong>r developed <strong>in</strong> [4],where <strong>the</strong> Bernste<strong>in</strong>–Bézier representation is based on <strong>the</strong> space of piecewisepolynomials ra<strong>the</strong>r than on Sd 0 (△) as <strong>in</strong> our earlier papers. A useful iterativemethod for solv<strong>in</strong>g <strong>the</strong> result<strong>in</strong>g systems of equations was also developed <strong>in</strong>[4], see also <strong>the</strong> survey [12].Remark 2 There is an extensive <strong>the</strong>ory of <strong>spl<strong>in</strong>es</strong> def<strong>in</strong>ed on spherical triangulationswhich is remarkably similar to <strong>the</strong> <strong>the</strong>ory of <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong>,see [1–3] <strong>and</strong> Chapters 13–14 of [14]. Such <strong>spl<strong>in</strong>es</strong> are piecewise sphericalharmonics. The techniques described here also work for solv<strong>in</strong>g variationalproblems <strong>in</strong>volv<strong>in</strong>g spherical spl<strong>in</strong>e spaces with stable local MDS. A numberof such spaces are described <strong>in</strong> [14]. For some computational experiments withm<strong>in</strong>imal energy spherical <strong>spl<strong>in</strong>es</strong> based on Lagrange multiplier methods, see[2] <strong>and</strong>[5].Remark 3 There has been considerable recent work on trivariate <strong>spl<strong>in</strong>es</strong>def<strong>in</strong>ed on tetrahedral partitions, see Chapters 15–18 of [14]. The methodsdescribed here can also be carried over to solve variational problems associatedwith trivariate <strong>spl<strong>in</strong>es</strong> with stable local MDS. A number of such spacesare described <strong>in</strong> [14].Remark 4 The global methods described here are not <strong>the</strong> only way to fit<strong>scattered</strong> <strong>data</strong> us<strong>in</strong>g <strong>spl<strong>in</strong>es</strong>. There are a host of local methods that work withvarious macro-element spaces. For numerical experiments with some of <strong>the</strong>semethods <strong>in</strong> <strong>the</strong> spherical case, see [2].Remark 5 It is well known, see [13] or Chap. 10 of [14], that if a spl<strong>in</strong>e spaceS(△) has a stable local basis, <strong>the</strong>n it approximates sufficiently smooth functionsto order O(|△| d+1 ),where|△| is <strong>the</strong> mesh size of △, i.e., <strong>the</strong> diameter of<strong>the</strong> largest triangle <strong>in</strong> △. However, <strong>the</strong> m<strong>in</strong>imal energy <strong>in</strong>terpolation methoddoes not atta<strong>in</strong> this optimal approximation order for d ≥ 2 s<strong>in</strong>ce it only


Numer Algor (2008) 48:237–260 259reproduces l<strong>in</strong>ear functions. Indeed, <strong>the</strong> results of [11] show that <strong>the</strong> orderof approximation us<strong>in</strong>g m<strong>in</strong>imal energy <strong>spl<strong>in</strong>es</strong> is only O(|△| 2 ). This can beseen <strong>in</strong> <strong>the</strong> table <strong>in</strong> Fig. 4, which is based on a nested sequence of type-Itriangulations whose mesh sizes decrease by a factor of .5 at each step. Forerror bounds for DLSQ <strong>and</strong> PLSQ <strong>spl<strong>in</strong>es</strong>, see [9] <strong>and</strong>[10], respectively.Remark 6 Our method can also be applied to compute m<strong>in</strong>imal energy fitsus<strong>in</strong>g <strong>the</strong> spaces Sd 0 (△). However, it doesn’t really make sense to m<strong>in</strong>imizeenergy for <strong>spl<strong>in</strong>es</strong> <strong>in</strong> C 0 spl<strong>in</strong>e spaces, s<strong>in</strong>ce m<strong>in</strong>imiz<strong>in</strong>g energy leads to <strong>spl<strong>in</strong>es</strong>which are as close to piecewise l<strong>in</strong>ear as possible. Even though Sd 0 (△) is a muchlarger space than S 1,25(△), <strong>the</strong> m<strong>in</strong>imal energy fit from Sd 0 (△) is much worse that<strong>the</strong> one from S 1,25(△).Remark 7 A Gaussian quadrature rule for approximat<strong>in</strong>g <strong>in</strong>tegrals of functionsover a triangle T is def<strong>in</strong>ed by a set of positive numbers {w k , r k , s k , t k } m k=1where r k + s k + t k = 1 for all k. Then for any function g def<strong>in</strong>ed on T, its<strong>in</strong>tegral is approximated by∫m∑g(x, y)dxdy ≈ w k g ( xk T , ) yT k , (28)Twherexk T = r kx 1 + s k x 2 + t k x 3 , yk T = r ky 1 + s k y 2 + t k y 3 .For each m, <strong>the</strong>reisad m such that <strong>the</strong> correspond<strong>in</strong>g Gaussian quadraturerule <strong>in</strong>tegrates all polynomials up to degree d m exactly. Formulae for variousvalues of m can be found <strong>in</strong> <strong>the</strong> literature. In our experiments we use rulesfrom [6] withm = 25 <strong>and</strong> m = 79 which <strong>in</strong>tegrate <strong>bivariate</strong> polynomials up todegree 10 <strong>and</strong> 20 exactly.Remark 8 The numerical experiments presented here were performed on aMac<strong>in</strong>tosh G5 computer us<strong>in</strong>g Fortran. The programs were not optimizedfor performance, <strong>and</strong> <strong>the</strong> times reported are only meant to give a generalimpression of <strong>the</strong> speed of computation <strong>and</strong> to provide a basis for compar<strong>in</strong>gdifferent methods with various parameters.Remark 9 The programs used for <strong>the</strong> experiments presented here work withspl<strong>in</strong>e spaces up to smoothness C 2 . However, it is straightforward to writesimilar programs for spl<strong>in</strong>e spaces with higher smoothness. For example, wecould work with any of <strong>the</strong> macro-element spaces discussed <strong>in</strong> [14] whicharedef<strong>in</strong>ed for arbitrary smoothness r.Remark 10 While it may appear that <strong>the</strong> practical use of global spl<strong>in</strong>e fitt<strong>in</strong>gmethods is limited by <strong>the</strong> need to solve l<strong>in</strong>ear systems of equations whichcan become very large, <strong>in</strong> Lai <strong>and</strong> Schumaker (submitted for publication) werecently described a method for decompos<strong>in</strong>g large variational spl<strong>in</strong>e problems<strong>in</strong>to smaller more manageable pieces.k=1


260 Numer Algor (2008) 48:237–260References1. Alfeld, P., Neamtu, M., Schumaker, L.L.: Bernste<strong>in</strong>–Bézier polynomials on spheres <strong>and</strong>sphere–like surfaces. Comput. Aided Geom. Des. 13, 333–349 (1996)2. Alfeld, P., Neamtu, M., Schumaker, L.L.: Fitt<strong>in</strong>g <strong>scattered</strong> <strong>data</strong> on sphere-like surfaces us<strong>in</strong>gspherical <strong>spl<strong>in</strong>es</strong>. J. Comput. Appl. Math. 73, 5–43 (1996)3. Alfeld, P., Neamtu, M., Schumaker, L.L.: Dimension <strong>and</strong> local bases of homogeneous <strong>spl<strong>in</strong>es</strong>paces. SIAM J. Math. Anal. 27, 1482–1501 (1996)4. Awanou, G., Lai, M.J., Wenston, P.: The multivariate spl<strong>in</strong>e method for <strong>scattered</strong> <strong>data</strong> fitt<strong>in</strong>g<strong>and</strong> numerical solution of partial differential equations. In: Chen, G., Lai, M.-J. (eds.) Wavelets<strong>and</strong> Spl<strong>in</strong>es: A<strong>the</strong>ns 2005, pp. 24–74. Nashboro Press, Brentwood (2006)5. Baramidze, V., Lai, M.J., Shum, C.K.: Spherical <strong>spl<strong>in</strong>es</strong> for <strong>data</strong> <strong>in</strong>terpolation <strong>and</strong> fitt<strong>in</strong>g.SIAM J. Sci. Comput. 28, 241–259 (2006)6. Dunavant, D.: High degree efficient symmetrical gaussian quadrature rules for <strong>the</strong> triangle.Int. J. Numer. Methods Eng. 21, 1129–1148 (1985)7. Fasshauer, G., Schumaker, L.L.: M<strong>in</strong>imal energy surfaces us<strong>in</strong>g parametric <strong>spl<strong>in</strong>es</strong>. Comput.Aided Geom. Des. 13, 45–79 (1996)8. Gockenbach, M.S.: Underst<strong>and</strong><strong>in</strong>g <strong>and</strong> Implement<strong>in</strong>g <strong>the</strong> F<strong>in</strong>ite Element Method. SIAM,Philadelphia (2006)9. Golitschek, M., Schumaker, L.L.: Bounds on projections onto <strong>bivariate</strong> polynomial <strong>spl<strong>in</strong>es</strong>paces with stable bases. Constr. Approx. 18, 241–254 (2002)10. Golitschek, M., Schumaker, L.L.: Penalized least squares fitt<strong>in</strong>g. Serdica Math. J. 28, 329–348(2002)11. von Golitschek, M., Lai, M.-J., Schumaker, L.L.: Error bounds for m<strong>in</strong>imal energy <strong>bivariate</strong>polynomial <strong>spl<strong>in</strong>es</strong>. Numer. Math. 93, 315–331 (2002)12. Lai, M.-J.: Multivariate <strong>spl<strong>in</strong>es</strong> for <strong>data</strong> fitt<strong>in</strong>g <strong>and</strong> approximation. In: Neamtu, M., Schumaker,L.L. (eds.) Approximation Theory XII: San Antonio 2007. Nashboro Press, Brentwood (2008,<strong>in</strong> press)13. Lai, M.J., Schumaker, L.L.: On <strong>the</strong> approximation power of <strong>bivariate</strong> <strong>spl<strong>in</strong>es</strong>. Adv. Comp.Math. 9, 251–279 (1998)14. Lai, M.J., Schumaker, L.L.: Spl<strong>in</strong>e Functions on Triangulations. Cambridge University Press,Cambridge (2007)15. Quak, E., Schumaker, L.L.: Calculation of <strong>the</strong> energy of a piecewise polynomial surface. In:Mason, J.C., Cox, M.G. (eds.) Algorithms for Approximation II, pp. 134–143. Chapman &Hall, London (1990)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!