A Practical Guide to Splines

May 6, 2018 | Author: Adam Campbell | Category: Interpolation, Spline (Mathematics), Dynamical System, Equations, Nonlinear System


Comments



Description

I..... • Applied athematical Sciences Applied Mathematical Mathematical Sciences Volume Volume 27 27 Editors Editors J.E. Marsden Marsden L. L. Sirovich Sirovich J.E. Advisors Advisers Advisors • S. Amman Antman J.K. J.K. Hale Hale S. P. Holmes Holmes T. T. Kamble Kamble J. J. Keller Keller P. 'I‘. B.J. lvlatkowsky Matkowsky C.S.. C.S. Peskin Peskin B.J. Matkowsky C.S. • ,• • \ • Spnnger Sprmger Springer • • a New York York New Berlin Berlin Heidelberg Heidelberg Barcelona Barcelona Hang Kong Kong Hong London London Milan Milan Paris Paris Singapore Singapore Tokyo Tokyo Applied Mathematical Sciences John: Partial Differential Equations, 4th ed. Sr'rovr'ch.' Techniques of Asymptotic Analysis. Hale: Theory of Functional Differential Equations, 2nd ed. Percus: Combinatorial Methods. von Miser/Friedrichs.' Fluid Dynamics. Freiberger/Grenander: A Short Course in Computational Probability and Statistics. Pipkin.' Lectures on Viscoelasticity Theory. Gr'ncngIr'n: Perturbation Methods in Non-linear Systems. Friedrich.‘ Spectral Theory of Operators in Hilbert Space. Strand: Numerical Quadrature and Solution of Ordinary Differential Equations. W'oiovr'r:h: Linear Multivariable Systems. Berkovitz: Optimal Control Theory. Biumun/Cote: Similarity Methods for Differential Equations. l"oshr'zuivn.- Stability Theory and the Existence of Periodic Solution and Almost Periodic Solutions. Brnun: Differential Equations and Their Applications, 3rd ed. Lefscherzr Applications of Algebraic Topology. Coder?/Werre rling: Optimization Problems. Grennnder: Pattern Synthesis: Lectures in Pattern Theory, Vol. I. MursderuMcCrncken.' Hopf Bifurcation and Its Applications. Driver: Ordinary and Delay Differential Equations. Conrnrn/Friedrir:hs.' Supersonic Flow and Shock Waves. Rouche/1'-Inbers/Laioy: Stability Theory by Liapunov's Direct Method. Lnmperl't': Stochastic Processes: A Survey of the Mathematical Theory. Grennnder: Pattern Analysis: Lectures in Pattern Theory, Vol. ll. Davies: Integral Transforms and Their Applications, 2nd ed. Knshner/Clark: Stochastic Approx.irnation_ Methods for Constrained and Unconstrained Systems. de Boer: A Practical Guide to Splines, Rev. ed. KeiIson.' Markov Chain Models—Rarity and E:-tponentiality. de Veubeice: A Course in Elasticity. Sninrycki: Geometric Quantization and Quantum Mechanics. Reid: Sturmian Theory for Ordinary Differential Equations. Meir/Tl/!nrkowit‘z.' Numerical Solution of Partial Grenunder: Regular Structures: Lectures in Pattern Theory, Vol. III. Kevorkinn/Coie.' Perturbation Methods in Applied Mathematics. Curr: Applications of Centre Manifold TheoryBengrs.ron/Ghr'l/Kéilién.- Dynamic Meteorology: Data Assimilation Methods. Snpersrone: Semidynamical Systems in Infinite - Dimensional Spaces. Lichrenberg/Lieberrnnn.' Regular and Chaotic Dynamics, 2nd ed. Piccini/Stnmpncchia/Vidossich.' Ordinary Differential Equations in R“. Naytor/Sam Linear Operator Theory in Engineering and Science. Sparrow.‘ The Lorenz Equations: Bifurcations, Chaos, and Strange Attractors. Guckenheimer/HoImes.' Nonlinear Oscillations, 7 Dynamical Systems, and Bifurcations of Vector Fields. 0ckendon/Tnylor.- Inviscid Fluid Flows. Pnzy: Semigroups of Linear Operators and Applications to Partial Differential Equations. GIasho_fi}’Gas!nfson.' Linear Operations and Approximation: An Introduction to the Theoretical Analysis and Numerical Treatment of SemiInfinite Programs. Wiicox.' Scattering Theory for Diffraction Gratings. Hate er at: An Introduction to Infinite Dimensional Dynamical Systems-_-—Geometric Theory. _ Murray: Asymptotic Analysis. Lndyzhenskayn: The Boundary-‘Value Problems of Mathematical Physics. WiIcox.' Sound Propagation in Stratified Fluids. Golnbirsky/Schue_fi‘er.- Bifurcation and Groups in Bifurcation Theory, Vol. I. Chipor: Variational Inequalities and Flow in Porous Media. Mnjdn: Compressible Fluid Flow and System of Conservation Laws in Several Space Variables. Wnsone Linear Turning Point Theory. l’osida: Operational Calculus: A Theory of Hyperfunctions. Chang/Howes: Nonlinear Singular Perturbation Phenomena: Theory and Applications. Reinhardt: Analysis of Apprortimation Methods for Differential and Integral Equations. Dwoyer/Hussnini/Voigt (eds): Theoretical Approaches to Turbulence. Sanders/'VerhuIs:: Averaging Methods in Nonlinear Dynamical Systems. Differential Equations. (conrinuedfoilowing index) iii‘: l Carl de Boor !1 |' A Practical Guide to Splines Revised Edition With 32 figures Springer Carl de Boor Department of Computer Sciences University of Wisconsin-Madison Madison, WI 53706-1685 USA [email protected] Editors J.E. Marsden Control and Dynamical Systems, 107-81 California Institute of Technology Pasadena, CA 91 I25 USA L. Sirovich Division of Applied Mathematics Brown University ' Providence, R1 02912 USA Mathematics Subject Classification (2000): 65D:-ix, 41A l 5 _ Library of Congress Cataloging-in-Publication Data i de Boor, Carl. _ ' A practical guide to splines I Carl de Boor. —— Rev. ed. p. cm. — (Applied mathematical sciences ; 27) Includes bibliographical references and index. ISBN 0-337-95366-3 (alk. paper) l. Spline theory. I. Title. II. Applied mathematical sciences (Springer-Verlag New York Inc.) ; v. 27 QAI .A647 vol. 27 2001 [QA224] 510s-dc2l [5llZ42] 2001049644 Printed on acid-free paper. First hardcover printing, 2001. © 2001, 1978 Springer-Verlag New York, Inc. All rights reserved. This work may not be translated or copied in whole or in part without the written permission of the publisher (Springer-Verlag New York, lnc., I75 Fifth Avenue, New York, NY 10010, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed is forbidden. The use of general descriptive names, trade names, trademarks, etc., in this publication, even if the former are not especially identified, is not to be taken as a sign that such names, as understood by the Trade Marks and Merchandise Marks Act, may accordingly be used freely by anyone. Production managed by Yong-Soon Hwang; manufacturing supervised by Jacqui Ashri. Photocomposed copy prepared from the author’s files. Printed and bound by Maple-Vail Book Manufacturing Group, York, PA. Printed in the United States of America. 9 8 7 6-5 4 3 2 I ISBN 0-337-95366-3 ‘ ' SPIN l0353l20 Springer-Verlag New York Berlin Heidelberg A member ofBertelsrnnnnSpringer Science+Bnsiness Medic GrnbH l Preface This book is a. reflection of my limited experience with calculations involving polynomial splines. It stresses the representation of splines a.s_linea.r combinations of B-splines, provides proofs for only some of the results stated but offers many Fortran programs, and presents only those parts of spline theory that I found useful in calculations. The particular literature selection offered in the bibliography shows the same bias; it contains only items to which I needed to refer in the text for a. specific result or a. proof or additional information and is clearly not meant: to be representative of the available spline literature. Also, while I have attached names to some of the results used, I have not given a. careful discussion of the historical aspects of the field. Readers are urged to consult the books listed in the bibliography (they are marked with an asterisk) if they wish to develop a. more complete and balanced picture of spline theory. The following outline should provide a. fair idea. of the intent and content of the book. e The first chapter recapitulates material needed later from the ancient theory of polynomial interpolation, in particular, divided differences. Those not familiar with divided differences may find the chapter a. bit terse. For comfort and motivation, I can only assure them that every item mentioned will actually be used later. The rudiments of polynomia.l approximation theory are given in Chapter II for later use, and to motivate the introduction of piecewise polynomial (or, pp) functions. Readers intent upon looking at the general theory may wish to skip the next four chapters, as these follow somewhat the historical development, with piecewise linear, piecewise cubic, and piecewise parabolic approximation discussed, in that order and mostly in the context of interpolation. Proofs are given for result‘s that, later on in the more general context of splines of arbitrary order, are only stated. The intent is to summarize elementary spline theory in a. practically useful yet simple settingThe general theory is taken up again starting with Chapter VII, which, along with Chapter VIII, is devoted to the computational handling of pp functions of arbitrary order. B-splines are introduced in Chapter IX. It is V vi Preface only in that chapter that a formal definition of “spline” as a linear combination of B-splines is given. Chapters X and XI are intended to familiarize the reader with B-splines. The remaining chapters contain various applications, all (with the notable exception of taut spline interpolation in Chapter XVI) involving B-splines. Chapter XII is the pp companion piece to Chapter II; it contains a discussion of how well a function can be approximated by pp functions. Chapter XIII is devoted to various aspects of spline interpolation as a particularly simple, computationally efficient yet powerful scheme for spline approximation in the presence of exact data. For noisy data, the smoothing spline and least——squares splineapprommation are offered in Chapter XIV. Just one illustration of the use of splines in solving differential equations is given, in Chapter XV, where an ordinary differential equation is solved by collocation. Chapter XVI contains an assortment of items, all loosely connected to the approximation of a curve. It is only here (and in the problems for Chapter VI) that the beautiful theory of cardinal splines, i.e., splines on a uniform knot sequence, is discussed. The final chapter deals with the simplest generalization of splines to several variables and offers a somewhat more abstract view of the various spline approximation processes discussed in this book. Each chapter has some problems attached to it, to test the reader’s "understanding of the material, to bring in additional material and to urge, at times, numerical experimentation with the programs provided. It should be understood, though, that Problem 0 in each chapter that contains programs consists of running those programs with various sample data in order to gain some first-hand practical experience with the methods espoused in the book. - u The programs occur throughout the text and are meant to be read, as part of the text. The book grew out of orientation lectures on splines delivered at Redstone Arsenal in September, 1976, and at White Sands Missile Range in October, 1977. These lectures were based on a 1973 MRC report concerning a Fortran package for calculating with B-splines, a package put together in 1971 at Los Alamos Scientific Laboratories around a routine ( now called BSPLVB) that took shape a year earlier during a workshop at Oberlin organized by Jim Daniel. I am grateful for advice received during those years, from Fred Dorr, Cleve Moler, Blair Swartz and others. During the writing of the book, I had the benefit of detailed and copious advice from John Rice who read various versions of the entire manuscript. It owes its length to his repeated pleas for further elucidation. I owe him thanks also for repeated encouragement. I am also grateful to a group at Stanford, consisting of John Bolstad, Tony Chan, William Coughra11, Jr., Alphons Demmler, Gene Golub, Michael Heath, Franklin Luk, and Marcello Pagano that, through the good oflices of Eric Grosse, gave me much welcome advice after reading an early version of the manuscript. The i"'“' J Preface vii programs in the book would still be totally unreadable but for William Coughran’s and Eric Grosse’s repeated arguments in favor of comment cards. Dennis Jespersen read the final manuscript with astonishing care and brought a great number_of mistakes to my attention. He also raised many questions, many of which found place among the problems at the end of chapters. Walter Gautschi, and Klaus Bohmer and his students, read a major part of the manuscript and uncovered further errors. I am grateful to them all. Time for writing, and computer time, were provided by the Mathematics Research Center under Contract No. DAAC-}29—75—C-0024 with the U.S. Army Research Office. Through its visitor program, the Mathematics Research Center also made possible most of the helpful contacts acknowledged earlier. I am deeply appreciative of the mathematically stimulating and free atmosphere provided by the Mathematics Research Center. Finally, I would like to thank Reinhold de Boor for the patient typing of the various drafts. Carl de Boor Madison, Wisconsin February 1978 The present version differs from the original in the following respects. The book is now typeset (in plain TEX; thank you, Don Knuthl), the For-tran programs now make use of FORTRAN 77 features, the figures have been redrawn with the aid of MATLAB (thank you, Cleve Moler and Jack Littlel), various errors have been corrected, and many more formal statements have been provided with proofs. Further, all formal statements and equations have been numbered by the same numbering system, to make it easier to find any particular item. A major change has occurred in Chapters IX—XI where the B-spline theory is now developed directly from the recurrence relations without recourse to divided differences (except for the derivation of the recurrence relations themselves). This has brought in knot insertion as a powerful tool for providing simple proofs concerning the shape-preserving properties of the B-spline series. ‘ ' I gratefully acknowledge support from the Army Research Office and from the Division of Mathematical Sciences of the National Science Foundation. Special thanks are due to Peter de Boor, Kirk I-Ialler, and S. Nam for their substantial help, and to Reinhold cle Boor for the protracted final editing of the TEX files and for all the figures. Carl de Boor Madison, Wisconsin October 2000 I .. Polynomial Interpolation Polynomial interpolation: Lagrange form Polynomial Interpolation: Divided differences and Newton form Divided difference table Example: Osculatory interpolation to the logarithm Evaluation of the Newton form KOKDOCJUJBJ Example: Computing the derivatives of a polynomial in Newton form 11 Other polynomial forms and conditions 12 Problems 15 II .Limitations of Polynomial Approximation Uniform spacing of data can have bad consequences Chebyshev sites are good Runge example with Chebyshev sites Squareroot example Interpolation at Chebyshev sites is nearly optimal 17 20 22 22 24 The distance from polynomials Problems 24 27 ix .Contents Preface v Notation xv I . and the Truncated Power Basis Example: The smoothing of a histogram by parabolic splines The space II..1.Piecewise Linear Approximation Broken line interpolation Broken line interpolation is nearly optimal Least-squares approximation by broken lines Good meshes Problems IV .._¢.x Contents III ..The Spaces l'I.A Representation for Piecewise Polynomial Functions Piecewise polynomial functions The subroutine PPVALU The subroutine INTERV Problems VIII ._-1.Piecewise Cubic Interpolation Piecewise cubic Hermite interpolation Runge example continued Piecewise cubic Bessel interpolation Akima’s interpolation Cubic spline interpolation Boundary conditions Problems V .5_.Parabolic Spline Interpolation Problems VII .... The truncated power basis for II_.=....-_.15 and 1_I.l.<_-..Best Approximation Properties of Complete Cubic Spline Interpolation and Its Error Problems VI . Example: The truncated power basis can be bad Problems ' ...5._. The B-Spline Series.¢.1.t B stands for basis Conversion from one form to the other Example: Conversion to B-form 94 96 99 101 103 Problems 106 X ..Contents xi '\-I IX .. 87 89 89 91 93 The polynomials in $i¢.t The distance of a smooth function from $1“ Example: Schoenberg’s variation-diminishing spline approximation Local schemes that provide best possible approximation order 145 148 149 Good knot placement 156 152 .The Representation of PP Functions by B-Splines Definition of a B-spline Two special knot sequences A recurrence relation for B-splines Example: A sequence of parabolic B-splines The spline space $1.. and Knot Insertion Schoenberg’s variation diminishing spline approximation 131 133 135 138 141 Problems 142 Bounding spline values in terms of “nearby” coefficients Control points and control polygon Knot insertion Variation diminution u XII .. The pp functions in $.The Stable Evaluation of B-Splines and Splines Stable evaluation of B-splines The subroutine BSPLVB Example: To plot B-splines Example: To plot the polynornials that make up a B-spline Differentiation 109 109 113 114 115 The subroutine BSPLPP Example: Computing a B-spline once again The subroutine BVALUE Example: Computing a B-Spline one more time Integration -- 117 120 121 126 127 Problems 128 XI . Control Points.Local Spline Approximation and the Distance from Splines The distance of a continuous function from $. xii ' Contents The subroutine NE1-JNOT Example: A failure for NEWNOT The distance from $;;,-,1 Example: A failure for CUBSPL Example: Knot placement works when used with a local scheme 159 161 163 165 167 Problems 169 _ XIII - Spline Interpolation 171 173 169 175 180 The Schoenberg-Whitney Theorem '35 Bandedness of the spline collocation matrix Total positivity of the spline collocation matrix The subroutine SPLINT The interplay between knots and data sites 182 Even order interpolation at knots 183 Example: A large III amplifies noise 185 Interpolation at knot averages ' 186 Example: Cubic spline interpolation at knot averages with good knots 189 Interpolation at the Chebyshev-Dernko sites Optimal interpolation Example: “Optimal” interpolation need not be “good” Osculatory spline interpolation 3* Problems 193 197 200 204 XIV - Smoothing and Least-Squares Approximation The smoothing spline of Schoenberg and Reinsch The subroutine SMOOTH and its subroutines Example: The cubic smoothing spline Least-squares approximation ' Least-squares approximation from $i,,t _ 207 211 214 220 223 The subroutine L21-IPPR (with BCHFAC/BCHSLV) L21-‘IAIN and its subroutines The use of L2APPR Example: Fewer sign changes in the error than perhaps expected Example: The noise plateau in the error 224 228 232 232 235 Example: Once more the Titanium Heat data Least-squares apprommation by splines with variable knots . Example: Approximation to the Titanium Heat data from $43 Problems ~ 237 239 239 240 I rrr" I - _ mciii Contents XV - The Numerical Solution of an Ordinary Difierential Equation by Collocation Mathematical background The almost block diagonal character of the system of collocation equations; EQBLOK, PUTIT " The subroutine BSPLVD COLLOC a11d its subroutines ' Example: A second order nonlinear two-point boundary-value problem with a boundary layer Problems 243 246 251 253 258 261 XVI - Taut Splines, Periodic Splines, Cardinal Splines and the Approximation of Curves La.ck of data “Extra.neous” inflection points Spline in tension Example: Coping with a large endslope A taut cubic spline Example: Taut cubic spline interpolation to Titanium Heat data Proper choice of parametrization Example: Choice of parametrization is important The approximation of a curve Nonlinear splines Periodic splines Cardinal splines ' Example: Conversion to ppform is cheaper when knots are uniform Example: Cubic spline interpolation at uniformly spaced sites Periodic splines on uniform meshes Example: Periodic spline interpolation to uniformly spaced data and harmonic analysis ' . Problems 263 264 264 265 266 275 276 277 279 280 282 283 284 284 285 287 289 XVII - Surface Approximation by Tensor Products An abstract linear interpolation scheme Tensor product of two linear spaces of functions Example: Evaluation of a tensor product spline. The tensor product of two linear interpolation schemes The calculation of a tensor product interpolant 291 293 297 297 299 xiv Contents Example: Tensor product spline interpolation The ppform of a tensor product spline The evaluation of a tensor product spline from its ppform Conversion from B-form to ppform Example: Tensor product spline interpolation (continued) 301 305 305 307 309 Limitations of tensor product approximation and alternatives Problems 310 311 Postscript on Things Not Covered 313 Appendix: Fortran Programs Fortran programs List of Fortran programs Listing of SOLVEBLOK Package 315 315 318 Bibliography 331 Index 34.1 qu- Notation Here is a detailed list of all the notation used in this book. Readers will have come across some of them, perhaps most of them. Still, better to bore them now than to mystify them later. , :== is the sign indicating “equal by definition”. It is asymmetric as such a sign should be (as none of the customary alternatives, such as E, or cg, ' or 2, etc., are). Its meaning: “a := b” indicates that a is the quantity to be defined or explained, and b provides the definition or explanation, and “b _: -:1” has the same meaning. {:1:, 3;, z, . . := the set comprising the elements at, y, z, . {zr E X : P(:1:) } := the set of elements of X having the property P(:r). (ac, y, . . :== the sequence whose first term is rs, whose second term is y, #5 := the number of elements (or terms) in the set (or sequence) S. ill := the empty set. IN := {1,2,3. .. ZZ := {...,—-2,—-1,0,1,2,...}. IR := the set of real numbers. C ' the set of complex numbers. I ET := the complex conjugate of the complex number z. [a . . b] := {s G IR. : a §_ :1: 5 b}, a closed interval. This leaves [a, b] free to denote a first divided difference (or, perhaps, the matrix with the two columns a and h). (a . . b) := {:11 G IR. : a < :1: < b }, an open interval. This leaves (a, b) free tc denote a particular sequence, e.g., a point in the plane (or, perhaps, the inner product of two vectors in some inner product space). Analogously, [a . . b) and (a . . b] denote half-open intervals. co11st,.,,,,____,,_, :== a constant that may depend on Cr, . . . ,w. XV r xvi Notation f :A -—-1 B: a 1-> f (1.1) describes the function f as being defined on A =: dom f (called its domain) and taking values in the set B =1 tar f (called its target), and carrying the typical element cr. G A to the element f(a) G B. For example, F:IR ——+ IR.:$ |—-> exp(:.1:) describes the exponential function. I will use at times f: a r——> f(a) if the domain and target of f are understood from the context. Thus, ‘,u.: f 1-> fol f(;1:) d:1: describes the linear functional p that takes the number fol f (:1:) dx as its value at the function f, presumably defined on [0. . 1] and integrable there. suppf := {:1: G dom f : f(:r) 75 0 }, the support of f. Note that, in Analysis, it is the closure of this set that is, by definition, the support of f. f|; := g:I --1 Bta l——> f(o.), the restriction of f to I. + ' h --1 {g_ := h approaches 0 through r n Eggglliii values. rw) == hglg, re +_ h). re-> == , 1_i_%1_ re + h). jumpnf := f(a+) — f(a'), the jump in f across a. _ . g(a:) = 0(f(:1:)) (in words,“g(:1:) is of order f(:1:)”) as :1: approaches a := lim sup | -9-E-“ill < oo. The lim sup itself is called the order constant of 1'1:-"-I'll If Z) this order relation. g(::.:) = 0(f(:r:)) (in words, “g(:1:) is of higher order than _f(:r)”) as :1: approaches 1:1 := %% =-- O. _. _f(-,y) := the function of one variable obtained from the function f:X >< Y --1 Z by holding the second variable at a fixed value y. Also, If G (-, y) dy describes the function that results when a certain integral operator is applied to the function g. (:1:)+ :--= max{:1:,O}, the truncation function. ln:1: := the natural logarithm of :1:. |_:...r] := max{ n G Z : n ii :1: }, the floor function. [ml := min{ 11 G Z : n Z :1: }, the ceiling function. 6, := a Lagrange polynomial (p. 2). (—-)” :-== := (-1)’. - , a binomial coefficient. 5,, := The Euler spline of degree n (p. 65). Boldface symbols denote sequences or vectors, the ith term or entry is denoted by the same letter in ordinary type and su bscripted by i. Thus, Notation xvii ‘T, (Ti), ("r,)"f, ('T¢)?=], (T, :1 == 1, . . . ,1-*1), and (T1, . . .,1',.,) are various ways of describing the same n-vector. m:= (m,...,'m.), for m G Z. X” := ::1:¢ G X, all Ar, := 'r,.,.1 —— 11,, the forward difference. V11 := T»; — 'r,_1, the backward difference. S“'r := number of strong sign changes in "r (p. 138). S+'r := number of weak sign changes in "r (p. 232). iqh-__ ,=,.1' T1--l-T,-_|.1-|-----I-T3, 0, ifrgs; ifr>s. -5 Z, ‘T-,-_ := 2 1",, with r and s understood from the context. '1 fa T _:: .,-_=,_ 1' T T}'lfi~f1"'7s1 HIT E131 1, if'r>s. For nondecreasing sequences or meshes 1", we use ['r| := max, Ari, the mesh size. 1141- := maxilj Ar,/Arj, the global mesh ratio. m»; := max|,_._.;|=1 AT,/Ar,-, the local mesh ratio. Ti+1/2 3=- (T-1'. +'»"-1+1)/2 ' Matrices are usually denoted by capital letters, their entries by corresponding lower_case letters doubly subscripted. A, (11,,-), (aw-)I“'”, C11] (a,J-)'§[l1;;?=1, _ £11-,1 E anal Q - ' - are various ways of describing the amn same matrix. AT := (:1,-,)_‘,)§"=1;{‘;1, the transpose of A. AH := (fifi)f,7‘=1 ; 111, the conjugate transpose or Herrnitian of A. det A := the determinant of A. 1'i=' 5,5; :- {O . 75; , the Kronecker Delta. '1 span(<,0i) := ago, : ctr, G IR}, the linear combinations of the sequence ((0,)? of elements of a linear space X. Such a sequence is a basis for its span in case it is linearly independent, that is, in case 2, C1,-_<,0i : O implies that or = 0. We note that the linear independence of such a sequence (<,0,)'i"' is almost invariably proved by exhibiting a corresponding sequence (A1)? of linear functionals on X for which the matrix (A.,<,0,) is invertible, e.g., Ago, = 55, for all i,j. In such a case, dim span(<,0,)"f‘ = n. xvi11 Notation II_.,;;,, := l'I;,_.1 := linear space of polynomials of order ls: (p. 1). 11..-;;._,_,,._~ := l'I;,_1,5 := linear space of pp functions of order k with break sequence 5 (p. 70). . Djf := jth derivative of f; for f G 1.11;-;,,5, see p. 70. 11...;-;,,,5,,, := l'I;,_1,,\;,,, := linear subspace of l'I<;,,,5 consisting of those elements that satisfy continuity conditions specified by 1/ (p. 82). $1,; := span(B,,;,,t), linear space of splines of order It with knot sequence t (p. 93). B, := B,,;,,_t :--= ith B-spline of order ls: with knot sequence t (p. 87). $k,r|. 5: L-J{f G $k,t:t1= 1239). := : tk = a1t11.+1 = 1 = tn-kk : (P11 “natural” splines of order k for the sites x (p. 207). C[a . . b] := {f: [a . . b] —> IR: f continuous ||_f[| :—— max{ |f(:r)| :11 5 :1: 5 b}, the uniform norm of f G C[a . . b]. (We we that uf + gn s ||f|| + ugu and ||-on = Ielllfll for 1.9 E <11» ~ 11 and oz G 11:(f; h) := ma.x{ lf(:1:) — f(y)| : :1:,y G [a . . b], |:1: — y| 5 h}, the modulus of continuity for f G C[a . . b] (p. 25). _ dist (g, S) :-— inf{ Hg -'—--f|| If G 5'}, the distance of g G C'[a . . b] from the subset S of C[o. . . b]. - C(”)[a . . b] := { f: [a . . b] -> IR. : f is n times continuously differentiable [11, . . . ,1",-]f := divided difference of order j ——i of f, at the sites T1, . . . ,1",(p. 3). In particular, [Ti]: f 1—+ f(T,). Special spline approfimation maps: I1, := interpolation by splines of order k (p. 182), L1, := Least-squares approximation by splines of order ls: (p. 220), V := Schoenberg’s variation diminishing spline approximation (p. 141). x) returns the number a(1)*x“(n-1) + a(2)*x“(n—2) + . degrees of freedom.. a polynomial of degree < 11. .. One uses polynomials for approximation because they can be evaluated.cson Sc Keller [1966] or Conte & de Boor [1980] for a more detailed presentation. A polynomial of order n is a function of the form Tl- (1) p($)=a1 +a3:1:+---+a.:$“_1.e. the coefiicient sequence a = [a(1) . hence in the SPLINE TOOLBOX (de Boor [199O]2). = II-[§n—-1 = Hn—1- Note that a polynomial of order n has exactly 11. denoted here by 1-[<_'11. . differentiated. starts with the highest coefficient. Note also that.. subtraction. those basic facts about polynomial interpolation and divided differences needed in subsequent chapters. mostly without proof. then the MATLAB command po1yval(a. if x is a scalar.I Polynomial Interpolation In this introductory chapter.... J'=1 i. in MATLAB. while the set of all polynomials of order n forms a linear space. we state. and integrated easily and in finitely many steps using the basic arithmetic operations of addition. The reader who is unfamiliar with some of this material is encouraged to consult textbooks such as Isaa. It turns out to be more convenient to work with the order of a polynomial than with its degree since the set of all polynomials of degree 11 fails to be a linear space. In particular.a(n)] of a polynomial of order 11._:1:”_1 =ZC1:. . + a(n—1)*x + a(n) 1 .. and multiplication. . . .function p in 11..)E. This polynomial can be written in -Lagrange form P =” ig(T'i)£i 1 i=1 with_€. 'We write this with the aid of the Kronecker delta as _ 0. -= *2. compared to other ways of writing and evaluating the interpolating polynomials. To illustrate this point.-. for arbitrary g. 1. .-_). then there exists exactly one polynomial p G l'I. ...4... since this linear system is square.-l""'-l-C1-n.g(T. . In this way..-.1) =g(T.. .T. and satisfies P('T-._(:1:) given by The Lagrange form is certainly quite lelegant. to g at T... Hence.n.. 11 = 1. Tl- P 5= E9(T-ilg-. .(:1:):= j=1 H ——-—~—~ ‘T-. . This shows that the linear system r|. a. .II—T_-.._ are distinct sites. .)? be a . that is. p = the only interpolant from 11.. we obtain. and g(-r1). ..—1_ 0.... Then 11 (2) f. we consider briefly the computational cost of evaluating the Lagrange form at a site.) are the given data. . for an arbitrary given function g. It is a polynomial of order n and vanishes at all Tjls except for ‘T-5 at which it takes the value 1. —-1). ..’l"t.-_-.. ‘i=1... .-: 1I=1 is an element of 11.?'t.1 Let 1 := (1. for which p(T. that matches it at the 11.) = g(T.).. €. has a solution for arbitrary right sides. is (3) Theorem.T..1-l—£I12T-. We denote by A an .1 -. it is far from the most efiicient. . Polynomial Interpolation Polynomial interpolation: Lagrange form sequence of n distinct sites..<..‘T.. IfT1. and.. sites ‘T1. But.. 1 g(T. this implies that the solution is unique.‘Tj 1151 is the ith Lagrange polynomial for T. .I | 2 I. . -—Tj). T.1)A + nil/I for forming (4) from the g(T. —. I prefer the following (somewhat nonconstructive) (5) Definition. ._.— 2)A+ (n. P(=1=) = <.T.@(-T) it still takes (211 -— 1)A + nlld + n. it leads to a very simple analysis of interpolation error and even allows one to discuss and use osculatory polynomial interpolation with no additional effort. ..2)M + (11._....(:. It is denoted by [T-5. i=1 11. Even if one is clever about it and computes lQ:===g(T.1.1:).1551 once and for all. and then computes p(:1:) by '1-"1. numbers £.). .)/1__[(T..+.]g. is the leading coefiicient (that is.) and the £. 10(1) == 111. . .. In addition.. the coefficient of 1:“) of the polynomial of order ls: + 1 that agrees with g at the sequence (T...T. and by M/ D a multiplication or division. .) (in the sense of Definition (12) below). -—.. ._.D per site. Straight evaluation of the Lagrange form takes (2n. It strikes me as the best compromise between ease of construction and ease of evaluation. . I prefer the Newton form. . .| Divided differences and Newton form 3 addition or subtraction.. 1l=1. The kth divided difference of a function g at the sites T. and then (11.. ..1)M for the Newton form to be discussed next.n.. . Polynomial Interpolation: Divided differences and Newton form There are many ways of defining divided differences.. . — 1)A + (n -—.(:c). compared to (211. . — 1)D for each of the 11.. And things get much worse if we want to compute derivatives! Of all the customary forms for the interpolating polynomial. that is._ (iii) [T.1119. T2.’T. . .]g is a symmetric function of its arguments 1.8. . ..T.._. agrees with g at T1... This is the Newton form...-]_g)([T. and not on the order in which they occur in the argument list.+1]g as its leading coefficient.6[T. . ' The next property is essential for the material in Chapter X.T.. If f = gh.. . Ti..._...]¢)['T. T... f(:1:) = g(:1:)h(:1:) for all 11:._1)[T1.'T.. (iv) (Leibniz"' formula)._|..T.|_1]g. .. ..-. ... .1“. .. ._.. is a polynomial of order k + 1 that vanishes at ’T1.T. .. T. .+.... 'Tsl9+ ---+(:1:——T1)---(:1:—T.. one at a time...+1 — pi... ... we know that p. observe that the function 1+1.......lh .]f = Z(['T.]h.P-n-1(1Y=)) = [T119 + (r — T1)[T1.. . _ (ii) [1-. .. that is..-_1)[‘7'. (Here. it depends only on the numbers T. . for i = k and k + 1.. .(33-T-. . we obtain l P-.. '7' Tl) ' ' ' (3: _ 7-fill?-11 ' ' '1Tk+llg- For.. .T. . ..4 I.]g + .T. TI- <1> p. ..]g is linear in g. Polynomial Interpolation This definition has the following immediate consequences._. therefore 1nust be of the form PA=+1(I) — PHI) = Cl‘-F T T1)"'(f-1? T Th) C = [T1. then pl’-?+1(I) = pl¢($) + (L. G l'I... i=1 ' for the polynomial p. if f = crg + Bh for some functions g and h and some numbers 1:1 and ....(=c> =2(a-T1)---(I-11..._1)[r1.j.. .+1) .T.]f = o:[1-. .. that agrees with g at 1'1. In this way......-lg 2(I-1-T_. .. that is. then [T.T._....+.T. 1+1 2($—-‘T-..]l'L). . .... .]g.(11=) = P1(f-")+(P2(1~") T P1(I)) + ' " + (P1411?) 1.... ..|"..' ('. T. .. of order n.7-—'l'......_.....1) ' . and has [T1.. as follows from the uniqueness of the interpolating polynomial.. [T..' .---. .+. . .<. This property shows that divided difierences can be used to build up the interpolating polynomial by adding the data sites T...T..1._. For the proof.. This is clear from the definition since the interpolating polynomial depends only on the data points and not on the order in which we write down these points. then 1+1. T. .. T219 + (1: —— T1)(I -— Tz)[T1. (i) Ifp.. ._.. As for specific values.lg=0 1601' allg E l.»(. by (7)....+. the first factor agrees with g and the second factor agrees with h there.s=i r§s T31-B Note that 2 vanishes at 1"._..|_. (or at any It + 1 sites for that matter) must be g itself.T2 if ‘T1 7'5 ‘T2 from the familiar two-point formula for the secant. .. .. . .<-_'. we have at once p [T119 = 9{1"1) Also..-.-. .T. Kammler..._.. .+. also Z must agree with rps ' rgs f at 1".l.]f.. .T.. . .+. D.I¢. . . . . . ..]g is constant as a function of 1".T..1".. 1".T. . the polynomial of order k + 1 that agrees with g at T.. then [1". But 2 is a polynomial of order k + 1.. since. every g G 171. . . . Therefore. Therefore. .+. its r§s leading coefficient which is Z(l1"=» . This..1". . . too.. then.Divided differences and Newton form I 5 n- agrees with f at 1". . has leading coefficient 0 when it is considered as a polynomial of order k + 1. ... ..—.11119) ([1. Now multiply out and split the resulting double su1n into two parts: 1+1: 2-2+2 r. for T3 —> T1.1. .. . hm i = . <9) pa) = gm) + <1 -~ 11> i(-"i»‘~‘)—T-El"? T1 — T2 But if g is continuously differentiable.... T2-""T1 T1 — T2 . In particular... In particular [7'. (I learned this particular argument from W.T...[.+. is quite clear since.. (8) [T1-.. .-‘T219 = f T1 —..1"1+i=lh) must equal [T.) ' (v) Ifg is a polynomial of order k + 1.. in this case. . ... by the uniqueness of the interpolating polynomial.. T.+. . T.1 1 1'1‘-£+klQ _ 17-i'1 .+.)‘f be a sequence of sites not necessarily distinct.. so that !| F I.] g of g is to be taken in this sense when some or all of the sites T.1.. . while [T-5. This justifies the statement that the polynomial p given by (10) agrees with g at the sites T1 and T1...¢|-1. We say that the function p agrees with the function g at -. . the definition of the first divided difference implies that 1 (11) [T1. T. g has k continuous derivatives. two-fold at T1 .11-S-117-5+1: ' ' ' 1Ti-+l¢lg ' l Ts -7-T ‘l". T-i_|_. gGC'(“).. . . we see that [T1.T1+kl9 =_ if T. g has k continuous derivatives. The precise definition is as follows.+.!-I_l'I1. (vii) If g G Cf“). . Let T :=. . [T11---. . and T. For the proof “of the following additional properties of the lcth divided difference. 5 i. Polynomial Interpolation | r -' In and the secant (9) goes over into the tangent (10) I Pl“-1) =9(’l'1)‘l'lI --T1)Ql(T1) that agrees with g in the value and slope at T1.I r' I‘ 6 I.1". that is.T2]Q=QI(T1) B“I1 -.T..-'| I-r" I" 1fT1 =Tg. .. . Also._|_. ._|_. we refer the reader to Issacson 8."'F.1‘.. coincide. p<**1>(c) = g<*"1>(<:) 1011. . (vi) [T. that is. . ..(T.. ."5!' if T. . i I .-. T. l T provided that. [Til 1 ' ' 1 Ti-+3719 = (viii) For computations.. for every site (I that occurs 1n times in the sequence T1. . . ... T2] g is a continuous function of its arguments.-.-fold at (I. . here is to be expected in view of the symmetry property (ii). . ."'... With this wording. The arbitrariness in the choice of 1-..5 Keller [1966] or to Conte 35 de Boor [1980] (although these properties could be proven directly from the definition).] g is a continuous function of its ls: + 1 arguments in case g G C'(“). . . then there exists a site (I in the smallest interval containing 1". are any two distinct sites in the sequence T. that is.uI irI1-|'InI —I I. that is. ' (12) Definition. 1| -_. .'._|_. . .. The definition of the kth divided difference [T. it is important to note that (F1) . .]g -"= (13) _ l:7-ii ' ' ' 1T'I‘—-11TT'+11 . Repeated interpolation at a site is called osculatory interpolation since it produces higher than first order contact between the function and its interpolant (osculeri means “to kiss” in Latin). .I.-1.i. p and g agree Tn.=---=T. . a'- "F"T[.]_g.(::::) of polynomial interpolation appears in the form of the “next” term for the Newton form. ..‘T*4I" -'I*-|—\. applying (17) (with T1 replaced by "r.1'1) .. .:.=Tr. .—‘lI-I‘: —'§-Y '1§-I—\I. y] g..I 'I :_1..+1 and at y. that is.... In particular.iTP:i$lg = ll:-1: ' ' . ..---1'1‘!-=. we get [7-11' ' .+1)[n=+1. But then. Note how..' :Tki Z l1-11' ' ' 1 Tk+11_?:/lg for all y 75 'r1..... as follows. for all ac.T. for y at 1'..€-J) F‘ =l I-. . If g E C("). . the continuity property (vi) shows that this equality must hold for y = T1..._-\.*r. the polynomial '1- -.~..'l. = P71-(I) + (I "_ 1-1)' ' ' (‘T — 7-fl)lT1: . for any y =.r.:. the error g(. P1=+1(I) + (1-F — T1) ' ' ' (Y-F "" Tk+1)lTk+1#£ll(lT1=. is the unique polyiiomial of Order n that agrees with g at 1'...'r..'t) — p..'£ll9'= ['1'1=+1=?Jl(l1'1.. T1 1"‘: Ta iyi 9-" ll:-'-1 '1' Ts 1 '1'J=+19 l Zl_Tk+1 *-u .é 1'1. ..... ...Divided differences and Newton form 7 (14) Theorem (Osculatory interpolation). pr. .:Tk+1lg + (‘T _ Tk+1)lTk+1:Il(lT11' ' '71-k-'1 which shows that - 9(=I-‘) = P:=+1(I) + (I . 1- . too.|.' :1-F5: $191 then. This advances the inductive hypothesis..(I — r:.+1) to ['r1... .. and 1' = (Ti)? is a sequence of n arbitrary sites (not necessarily distinct). .'r. hence its leading coefficient must equal [T1.'c]g as a function of 11:."I'—'1'..1.I]([r1. .+1. lTk+11yl(lT1i ' . 'n.Ta+1. "r. then.=Tk='l9) of order k + 2 agrees with g at 1'1. that is.. . .+1...._1)[’:1'1.. ... It also shows that. g has n continuous derivatives._|_1. One obtains (15) from its simplest (and obvious) case ' (17) _ 9(f'-Y) = 9('1'1) + (HI -— 'r1)lT1= I19 by induction on n. -]9)This implies that. If we already know that 9(3) = Pk(3-7) + (I _" 1-1)' ' ' (3: '_ 7-P:)lT1: ' ..~ with _ P-n_($) I:-" $3-T1)"'(. [T1.._|..-$l§~.-._|_1. in (15).---...1':. incidentally.]g [T'r1. -a proof for (viii) and shows explicitly how the (ks + 1)st divided difference arises as the first divided difference of a kth divided difference.. T1119 [Tn.T. (18) some (1. Divided difference table The coefficients [r1]9.. = 'r¢+. sites values T1 Q(T1) first second (11. n.. divided diff. thus explaining the name. .8 I. .. either '1'. .-.-1) [T31 1-4lg ' - ' [T11"'1T1"l--119 _ ' i1-11' .-1 9(1'1».. . diff. Polynomial Interpolation and so provides.-1. with T‘ <19) (1-*1) ('1') r- pm) = Xe T) 1 " r=1 — ' which is the standard truncated Taylor series with differential remainder (or error) term.. .'t) = p. that is.. T1:---=Tn=T.. .'1) ('1') for t = 1. ['1'1='1'2]9= [T1.'e. between '1' and ac. divided diff. I - \- . (n —.(:c) + (rt — '1')" %%-1 . divided diff. that is... ._1 = 'r¢_|. pi-f—1)(*r) = g("'. let all sites 1'1.---._|_1 = = 'rH.. .'-"sly T3 lT2:T31T4]g _ 1'4 g(*r4) 1'1». The notion that osculatory interpolation is repeated interpolation at sites is further supported by the following observation: In (15) and (16)..]Q for the Newton form (7) are efficiently computed in a divided difference table: interp... so that 1'. 1'2.]__o. ..' 1T"-lg [T2. .. == 'r. rely [r2. -— 2) nd div.—21 1'1».1)st . . on computing ['11... Tn coalesce. = 'ri_|_.. can only hold if also 1-...'ri+.-. Note that the truncated Taylor series (19) does indeed agree with g n-fold at '1'. Then we obtain the formula (using (viii) and (vii)) (11) g(.—1 i T1119 TH Q07"-) Assume that the interpolation sites are so ordered that repeated sites occur together. Then.. [T117219 1'2 9(1'2) lT1. . . div.__1 of sites.——-1 D. with P4 the cubic polynomial that agrees with g at 1. . 2. diff. T.1)1 + (. 2.-l“-"lg "_ [7-1'. - (21) Example: Osculatory interpolation to the logarithm For g{.. in value and slope at 1 and 2). The top diagonal then contains the desired coefficients of the Newton form The (arithmetic) operation count is — 1 n(n — 1)/1 + ?'—£E.".-409074 m E] Evaluation Of the NEW’EOfl form Given an arbitrary sequence 1'1.-__|_.Evaluation of the Newton form 9 in which case l1‘-. the first and third entry in the first divided difference column had to be given data. diff..'r..1)2(-306853) + (J3 .306853 693147 2 . We set up the divided difference table _ '1' g("r) 1 0 1..é 'r.5) by the number p4(1. 3.. = . by hook or by crook.5). ..]g = g("') (Ti)/Tl must be given. ' 1.5 2 593147 ' Note that. 1.':) = 0 + (1: . .1: . We read off the top diagonal of the table that - p4(.1 ' ' ' 1 Ti-l—1"—1lg 1_£+T__7_£ 1 hence can be computed from the two entries next to it in the preceding column.+.5. . This makes it possible to generate the entries of the divided difference table column by column from the given data. .1':. any polynomial p of order n can be written in exactly one way as TI.T1j + -Pl. in which case ( 20 l [T-.9 = [7-1i+11 1 ' 1 1 T'i.6931-47 113706 -193147 .1. that p4(1. =.113'r0s) and then compute... div.-... (99) P(I) = Z31? -" T1) ' ' ' (5? — ‘T1-ila-1 i=1 .'t) = ln. estimate g(1. . .. because of the coincidences in the data sites. div. diff. 2 (that is..1)2(s:'-— 2)(. 1 O —.. or else 1".5) 405465 = ln 1. T.._. . ...1-. Polynomial Interpolation for suitable coefficients a1. bk+1 = (bk ..llThis suggests the following algorithm.. 1 In words. carry i=1 ' ' useful information about p. Therefore. since p is itself such a polynomial. makes the right side of (22) into the unique polynomial of order rt that agrees with p at 1' = (‘T1 . with "r..1.. [T0. . . ._2. .n—2..'c—-'n.. for we have the important property that .. in the corresponding Newton form (22) for some p G II.. . .. . I ‘This argument brings up the important point that the algorithm may be visualized as a scheme for filling in an additional diagonal on top of the l‘. = [T1.. Moreover.. ..)(. (23) Algorithm: Nested Multiplicationl We are given the centers 1'1.*|" '-1" -1 _ (24) p(:t)= b1 + ($—-TQ)b2+ (a:——rg)(a:—'r1)b3+ + (. . hence must be p itself. .10 I.. .. we must have bi. .. an additional site. and also another site 1-0. ._1]p for all k by induction on 11:. hence... 1 b.as)/(T0 "‘ Th) so that. .1 and associated coefficients e1... . the right side of (24) is -the polynomial of order rt that agrees with p at‘ 113. . One way to prove (24) is to observe that.l"'—I-. Indeed. '1 .'ri... . . := an 2:fork="n.Tt... . .Tn--1)@-H) ' ... . we know that the particular choice CI.¢)b.-5=i_T]_..__1.do: 2/1 bk Z= (1.'t—'r. 1'1. since b1 = p('rg) and oi.. Tn). . .M) arithmetic operations since it can be written in the following nested form PCP) = '11 + (I — '1'1){@2 + (I '" '*'2)l*13+ 1+ (I -: 'Fn—2)('~'11=—1 + (I ....n be evaluated at a site in (n — 1)(2A—l. .(TU-T.-—1.. .l. 1-.._1 the Newton form for the some polynomial p but now based on the centers 1'0. from the algorithm.. .. it must agree with the right side for that choice of the oi. . We call (22) the Newton form centered at 1-1..-|...'r.. .. ._1 for p..o.--=1. . all the bi.(T9 T1'i_1)ai. . .'r. Tl- <" ' Then b1 = p(1'0) == Z (T0 —'r1) ..1-.¢_|_]_. the algorithm derives from the Newton form for p based on the centers 1'1...'ri]p for all 14:.. ... =..o.T-ilp.. ...p1—I'|"._g)b. The Newton form (22) ca.)---(rt: ~ 'r. . . The algorithm is particularly handy for the efficient calculation of derivatives of p at a site siiice pm (1') /j! appears as the (j + 1)st coefficient in any Newton form for p in which the first j + 1 centers all equal 1-._g and the coefficients b1.1."c) = 409074 + . ..+ (I —. ‘T_ 1 (n -—. . .1.-1)cnWe leave it to the reader to invent the corresponding algorithm for filling in additional diagonals on the bottom of the divided difference table. using each time the point 1. div. .b. but working from right to left as shown here. . . .-3: — 1. The last computed diagonal (see the full table on the next page) then gives the scaled derivatives of p4 at 1. starting with the sites 113. . obtaining then the coefficients c1.1. cn that fit into the diagonal on top of the bi. 1 We note in passing that this algorithm provides the most efficient (known) way to shift the origin for polynomials in the ordinary power form (1)- .5)3.5 as the new site.p4(.. diff. . interp. that is.2)nd (n — 1)st div.11'-'1 Computing the derivatives _ 11 divided difference table for p. . C1 132 T0 b1 C3 52 '1'1 (11 _ be 611.5) —— .. T3 0-s 511. that is.664721(:. diff.113106(.5)? -\- .1 32 T2 - an . for which 1>(~'»'I) = C1 + (I — 1'-1)¢2 + .1'.... .-—~ 1 bu an We can repeat the algorithm.. ln particular. . first sites second values div. the Taylor coefficients. div. and an additional site 1'_1. diff.’s. ‘H _ i (25) Example: Computing the derivatives of a polynomial in ‘NewlIOI1 form We use the algorithm to fill in three additional diagonals in the divided difference table for p4 constructed in (21)Example.1 ' 3'11.1:: —.. . diff.1'-1) ---(~11 — 'e.25(.5. -= 0.25 .306 853 .113 706 . Conte 8.5 .0 0 .12 T. all i. div. P_1(. Bi.664 7205 1. The power form which we used to define polynomials is a special case of the Newton form.5 . 2.0 1.409 0735 1. A surprisingly simple and very effective such basis is provided by the Chebyshev polynomials for which Ag =1.1r:) := 0.-=2. . Polynomial Interpolation 1' g(1') 1..0 . B.306 853 1.5 2.5 . diff. _ Evaluation of such a form (26) is efficiently accomplished by a gener- alization of the Nested Multiplication algorithm.0 .2. the Lagrange form a.2.818 147 1.1. .. Ci.409 0735 -—. .. The condition of the representation (26) in . for example.113 706 O —..nd the Newton form. C. One is tempted to use such forms in preference to the power form because of considerations.409 0735 —.3]).693 147 -—.: de Boor [1980:6.of condition.363 706 . for certain coefficients Ai 75 0. diff. Ci = 0. div. . diff. . (27) Pi+1(I) I: Pg($) := 1. with Ai =1‘ 1..693 147 2.113 706 ..0 . j=1.113 706 . There are several other forms in common use. 3.664 7205 1. Note that the Newton form (22) (although not based on orthogonal polynomials) fits this pattern. -. div.693 147 El Other polynomial forms and conditions We have mentioned so far only two polynomial forms. '1 '-'-'1 0.3. -' Bi)Pi(I) — CiPi_1($). based on the three-term recurrence (27) (see.1. Such expansions are of the form Tl- (26l P = Z6-'»1P1-1 -i=1 with (Pi) a sequence of polynomials satisfying a three-term recurrence.-=1. BQZO A.193 147 . Bi = 1-i. chiefly expansions in orthogonal polynomials. 1 .Other polynomial forms and conditions 13 terms of the basis (Pi)? for l'I.) := (. 1 = 1. the greater the possible effect of a “small” relative change of error in a on the function represented.) as large). Consequently.i-_-ii measures the possible relative change in p as a result of a unit change in the coefficient vector a = (oi)._. In constructing that representation (26). for all coefficient vectors a.||/||1||.|| s M111 1 with <29) ' m == mi11|1Z‘1iPi_. without loss of generality.-E ||2a.P. and measure the size of a polynomial p by the number llPll == fl12§%¢blP(1l3)lAlso. we are bound to make rounding errors so that. we actually produce the perturbed vector a + ba.n..P. . but the perturbed polynomial p + bp = E. M == mi»<||Zi. we consider all polynomials as functions on the interval [o.1i1.| 1=»|| .”- and is used as follows..1:/b)i‘"1. by (28). showing that a change in a of relative size ||c‘ia|| / |[a|| may result in a relative change in p as large as cond(R-_) times the relative change in a (and at least 1/ cond(P_. The larger the condition.1i<.|1= .-. . <28) m||1|| 1: | Zi. If Pi(:1. To be specific. . . The condition (number) of the representation (26) is then defined as M COHd(Pi) I= 1.b]. Now. lal 3 bi then M = I113. we_ will not have the polynomial p. we measure the size of the vector a = (oi) by the number nan == . <1 ||-=||_ _.-m||-1|| ._. and. .-e_i||/||1||. mllfilall <5 ||6p|| _. lolThen. . M||11|| M111 .-_(oi + 5o.)Pi_1. . instead of the vector a. .1(3) and nT.830...=0 "*1 (——“+b>-—%£ b—a 11 —' ' 1' "'1 <51“-59> 11-ii‘ We conclude that +3b Tn-1(%f_".1. for example. even for fixed 11. W...-1(EJb-_'fEl -— 1/1:9 + 1)'"_1 for large [:11].i_1(3). i=1 .a becomes small compared with the right end point b. it follows that the condition of the scaled power basis /b)"i')g_1 for polynomials on the interval [a . _.)/‘(IS Since T 1. Gautschi [1972]g has shown that the condition of the Chebyshev form is no larger than ‘Th/2.-)1): 1 should be used on an interval [o .-..899 By contrast.._1 the Chebyshev polynomial of degree 11.1 ( :1: ) ~ ( 1 / 2 )( :1. lP i (0)l =1‘ (1) . a local power basis (( -. Finally.(:r:) := Z |£i(:1. .-|__.-i max max If now 0 $ o < b.1(3) TL ‘Ti-i__1(3) 1-1 1 C-‘J 3. b] becomes very large.ll.851 3. 1 +3b ST1-. At the very least. the condition of the Lagrange form (4) is easily seen to be the number i|)\. with n )\.. . Rivlin [1974:p.______ llpll *1+b Q __. then. 93]) that (Q .. niI1T""’ .” I l 14 I.. .__. b].pE1'I. Polynomial Interpolation For the lower bound 1n. —. 1-1 1 to conclude that _ y 3'uP€H<111 _ | <1 (0)b‘I m_1 = 0§1_§11... 1-1 CJKDOO-l 19.____ "-111»-il b--G._.. Its condition is between T.-5%‘.243 665.363 101-1 (D-10-‘J Cfli h-MM 517 . - with T. we use the ‘identity 1" (1-1) 0 51-1 3._1(3) are F T1 ‘Ill. then it is known (see. Further.':)|.. 2 )1 1 . as the interval length b . the first few values of T.. _ i2"1ii‘.601 114. n. Thus..'r3.‘ I-u. O.. do: 1/1 for i = 1.'rg.n...... E 1 . locate in it the coefiicients for the Newton form for p using the centers (a) *r3.. 4.TAU(i+k—2)) \" nu) = p...n—1. .. see Problems 7 and II. Given the divided difference table for the polynomial E l_I.).'r5. based on the sites 1'1.. the reader should be aware of this potential source of trouble and be prepared to .n. Assume that TAU(i) = 'r. 2.'r5.--_1-.. .n+2—k. 4/1/1 D(i) := D(i) + D(i—1)*($ .n—l)(I)/(R ..'r. verify that the subsequent calculation 4 for k = 2.T2='F22... ..'Fa-. Use the error formula (15) along 1 I I" ‘I .'F5-. IIMII ~ (2/'")111"» +1 if we choose the Chebyshev sites II(9) as the sites '1'. Construct the polynomial p6 of order 6 that agrees with the function sin at O. ..-'1'3='1'2='1'1. t= 1. .n-k... 3/1 value := D(k) + va1ue*($ — TAU(k)) _ produces the value p. .$. 3. . . 1r/4.(a':) at It of the polynomial pr. . after the execution of the following statements.I nw'"'* Problems 15 As is pointed out in the next chapter. if need be.. do: 4/1 for i = 2.. that is. ..n. I. n. "| 1._switch to some better conditioned form. (d) T4..-I-.]g for i = 1. do: 1/1/1 D(i) := (D(i+1) — D(i))/(TAU(i+k) — TAU(1)) we have D('i) = ['r:. (c) 'F4>'F5.1-6. For this.. i—I'-It. do: .j{ II-I‘ H- in---I F-... .. do: i produces the coefficients in the Taylor expansion around :1: for p. for example the Chebyshev form. Nevertheless. of order n that agrees with g at 1".'r4. Still.'r1. 1r/2. Let p4 be the polynomial of order 4 that agrees with the function ln _at 1. (b) Hence.r. the easy access to derivatives it affords..... Prove that p4(::.. 1r/2. and because we do not intend to deal with polynomials of order higher than 15 or 20. |. ..3.. we will use the local power form throughout this book because of its simplicity.. D(i) = g("r.. 11'/4..1" 4.Ts. i = 1. the Lagrange form based on the Chebyshev sites is about the best conditioned polynomial form available. 3.'r1.»'1's..¢)!..___-_6.':) '> ln(:c) for 2 < :1: < 3. Problems 1. 1 for k = 1. verify that the subsequent calculation 2 value := D(1) 3 E for k = 2.'r4.'r6.lI :I|-[IIr '-1|. (a) Verify that. ‘(c) Finally. .. (b) 'r@. ).o:1. with y = y(a:) := (2:11 — (b + (1))/(b —.Tn). . See. ../I) = (-——l)"""1/('r1 . and returns the value p(X). . : '13. In other words..__-L: )i~1.--—... the divided difference of g at 1' is uniquely writeable as a weighted sum of values and certain of the derivatives of g at the '1'.. (Hint: Use Leibniz’ formula on the product (1 /a':). .. . :rJ-](..(. Write ELFUNCTIUN CHBVAL(CCDEF. _ all i. xrrssms == n + 2... .'c. ... . Tn). ._ for which pr.. .-_ are of the same sign. so that the linear functional [T1. 3. .' .. 5.rnin{j 5 2'.]f. and argument X as input. Also. and all a. 2. then the relative change ||6p||/||p|| (on [a . 8. ...-. . Prove (for example by induction) that for arbitrary nondecreasing 1' = (T1.980:p.16 I.. 10. . FUNCTION CHEB. and induction._1(y). . for example.( ‘. .. Prove: If p(s:) = a. ‘T’-nl(l.'r¢]. . .o:.] can be written [T1. . .o:. . . . . . in the interval [O . 1r / 2]. T1($) I= I."c_. T£+1(I) I: 2ITi($)—T£_1(I). 258]. there exist unique constants d1. Prove that [T1.'"'... .o) and T0($) := 1. . . . b]) caused by a change 6a in the coefficient vector a is no bigger than n|\5a|| / Conclude that the condition as defined in the text measures only the worst possible case. say.= T31}. 1 7. d. . .. . ct G IR. i=1 with :—. 0 5 :1: 5 1r/2} and compare it with the maximum error found by checking the error at 50 sites. .b. .. Prove lVIicchelli’s handy (see Problem 5) observation that a divided difference identity is valid for all (smooth enough) f if it is known to hold for all f of the form f(:r) = 1/(rr -— a).'r-. . using the three-term recurrence in the process. . The Chebyshev form for p G l'l<. . = 1. develop a theory of “condition at a point” that parallels and refines the overall condition discussed in the text. 9. .-_.) 6. is specified by the end points a and b of some interval and the coefficients 0:1. NTERM. Conte 8: de Boor []. . x) that has CCDEF = (a. Polynomial Interpolation with the divided difference Property (vii) to estimate the maximum error max{ |sin(:r:) .['r.. .':g)f = [$1.p5($)l :.). Prove lVIicchel_li’s observation that [$0. Tn] = Zd.. . .) = Z? a:T.. We stress the fact that polynomial interpolation at appropriately chosen sites (for example.n.. at 20 sites in each of the 11-1 intervals [1". i = 2. .:=(i-—1)h——1. This global dependence on local properties can be avoided when using piecewise polynomial approximants.8 and some (negative) 17 . we estimate the maximum error ||e.II .. Limitations of Polynomial . . In this and later examples.'n. .. withh:=2/(n—1). we would expect the maximum error new == _. we show that the polynomial interpolant is very sensitive to the choice of interpolation sites. Uniform spacing of data can have bad consequences We cite the (1) Runge example: Consider the polynomial pr. differs very little from the best possible approximaiit by polynomials of the same order. The function g being without apparent defect (after all. lye) — pfl(a=>| Lo decrease toward zero as nincreases.. In the program below. This allows us to illustrate the essential limitation of polynomial approximation: If the function to be approximated is badly behaved anywhere in the interval of approximation..]| by the maximum value obtained when evaluating the absolute value of g—p. g is even analytic in a neighborhood of the interval of approximation [-1 . for all practical purposes. .... then the approximation is poor everywhere._. as a function of n.-gag. |]e. 1]).. 1]: 'r.1 . ... Approximation In this chapter. i=1. the Chebyshev points) produces an approximation that. .11].|] decreases to zero like fin“ for some constant . of order n that agrees with the function g(:r:) := 1/ (1 + 251:2) at the following n uniformly spaced sites in ]——1 .. we anticipate that. GT. 1). BY NESTED HULTIPLICATIDN C C P NATX = nii) DD 29 K=2. 0(1) = (D(I+1)-D(I))/(TAU(I+K)-TAU{I)l_ __ ‘"'“"""“"'*"""“""”—""“"*""‘ ESTIMATE MAX..—1 . TAU(N) EQUALLY D0 40 N=2. NH1 = N—1 H = 2.*X)*#2) PRINT 600 600 FDRHAT(2BH N HA1. .1 DATA STEP. 2) DECAY = (ALOGER — ALGERP)/ALDG(FLOAT(N)/FLUAT(N—2)) ALCERP = ALOGER PRINT 640 .PDL. and we can estimate the decay exponent at from two errors ]]e.-1 \. 20 c c EBRHAX = 0..TAU(20)..nnx 1..N TAU(I) = FLDAT(I-1)#H — 1.II.ISTEP.E12. DD 30 I=2.. ~ (n/'m)°'. C CHOOSE INT C SPACED IN (*1 ..EHROR DECAY EXP.D(20).INTERPOLATIDN seams on (-1 .NHK. 20/ ~ G(X) ='1..2) STOP ass D l . . ERRMAX = AMAX1(ERRHAX.NH1 REAL ALOGER.then ]]e./FLUAT(NH1) .]] and ]]em]] by N 1@s(\\@nl\) —1@s(l\e-.//) DECAY = O. D(I) = G(TAU(I)) UH THE NENTDN FORM.\\) _ (2) log(n/ m) <1 d ex onent is estimated in this way from In the following program.ALDG(ERRHAX) IF (N ./(1.If ]]6 n °‘ ~ fin . 1)..+(5.ABS(G(X)-PNATX)) ALUGER . I=1.. the ecay p successive maximum errors.PNATX..2 N ERPULATIDN POINTS TAU(1).ALGERP. .ISTEP X = TA U(I—1) + FLOAT(J)#DX EVALUATE'INTERP. EUNGE EXAMPLE INTEGER I..4. AND SET D(I) = G(TAU(I))..STEP.DECAY 40 B40 FDHHAT(I3. . DU 10 I=1.G..N. CHAPTER II.DX. N I ERRHAX. Limitations of Polynomial Approximation 18 CO' 1151331113 0: .K.. 10 C CALCULATE THE DIVIDED DIFFERENCES F C ___________________________________H D0 20 KF1 NH1 max = N—K 1 no 20 I-1.N Bx = (TAU(I)-TAU(I-1))/STEP D0'30 J=1. .F11. ISTEP /20.H.20.DECAY..—..] ]/]]e .N 29 C so ‘Ii PNATX = n(x> + cx-rtu(x>>*Putr§_ ___________________________________.J.ERRMAX. g>(e>| = |Z_g<e>e<e>| e Z |g<t. .-. From the output..9 the polynomial of order n that agrees with a given g at the given rt sites of the sequence 1'. — . as ' in terms of which |<P.2099E+01 .2474E+O0 .4222E+01 O O O O O .>|:w=>| e <me=|g(e>|>2|e<e>1.2994E+O0 . we recallfrorn I(2) the Lagrange polynomials @i($) == H($ . We introduce the so-called Lebesgue function (5) >\n(~'»'I) == Z |3t(I)]-.T3‘)/(Ti r" 13). our estimates for the decay exponent become eventually positive and growing so that ||e. [I1 The following discussion provides an explanation of this disturbing situation..8573E+01 HHHHH m ewom o 20 19 DECAY EXP. We assume that the interpolation site sequence lies in some interval [ct . we have marked the divided difference calculation and the evaluation of the Newton form to stress how simple these calculations really are..5567E+OO . ..Runge example N MAX.b] by (4) -_ ' llfll == agrflb ma-X |f(I)|- Further.9615E+O0 '707OE+OO 4327E+OO .-:=1 .1069E+O1 . . b].. . wmowom weo hJLO£flUJOU‘J|-l'=H|-PO In the program listing above.|] grows with n at an ever increasing rate. contrary to expectations. In fact. We denote by (3) Pr.ERRDR _ . the interpolation error for this example actually increases with n. and we measure the size of a continuous function f on [a.. . m m#wOH O . — . we learn that. . For a proof. Turetskii. On the other hand. Powell [1967] has computed for the Chebyshev sites for various values of n .1-. .|] ~ 2"/(en ln n) (as first proved by A. ' - |])\. j=1. with Afi. If 1'1. D. are chosen as the zeros of the Chebyshev polynomial of degree n for the interval [ct . for uniformly spaced interpolation sites.. Chebyshev sites for the interval [a . for example.. Brutman [1997]). b]. see the survey article L. . The. that is. M..g may fail entirely to approximate g for the simple reason that ]]'P. 93-96]. N. and this estimate is known to be sharp.g]] gets larger and larger.. J. there exist functions g (other than the zero function) for which ]]P. then.'=’:-= (a+b—(a—b)cos( ))/2.. Since maxi ]g('r¢)] 3' ]|g]|.'n.. . Limitations of Polynomial Approximation (6) FIGURE.. this situation can be remedied if we have the freedom to choose the interpolation sites..20 II. (8) Theorem.. in 1940. that is.. Rivlin [1969:pp.. . we obtain the estimate (7) |lPa9l| 5 llaall llgll. b] are obtained by subdividing the semicircle over it into n equal arcs and then projecting the midpoint of each arc onto the interval. P. . Hence. Chebyshev sites are good Fortunately. T. the corresponding Lebesgue function. . we have _ < (2/'rr)1nn+4.. as rt gets larger. see.g]] --= |]}\n]| (see Problem 2). (9) '1-J-='rJ‘.. . .. . _ | .. .. . . .. for all n. . 35 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ ._ _ _ _ - _ _ _ _ _ I . .. . . . . _ . _ _ . ... . . . . . . . _ .|] and the smallest possible value for ]|)\n|| is never more than . | _ Q | .2" I | I . . . . . ..¢ . . . . . . .. .. . . . . . .. ..: I I . . | . . . Brutman [1978] has shown that (2/*rr)(lnn) + . ... . n _ ' i i instead. . . h .. .. \. . . ... .. .. . . . 5 _. Z J’ 4 '| .. . . : - . . .1" -e" /' _. . - J I - .201 of the smallest value for |])\. I I: . . . . ... \ . . . . .. . . .|'- . . . . . . . . IIIIIIIIIIIII|IlIlllIIIII|IIl|IlI I .-- . . /" L5 .. . I 1| (his 'u('n) equals our 1 + Figure (10) summarizes his results...:.. ]. ." ft": . . . . . .5 <1’ "'I—wqm$| —_-'—1li7-'|_-i'lI"1€"fi'_t"I1I'-I' g"l < (2/1r)(lnn) + . . ._:. . . . is within . ._:= (a+b—(a—b) )/2.. - II I a q I | a I - I I I I I I I I I I I -| 1'" 1"‘ If 1" . .."_"'. .' . . .n-F ' ' 4. .:. . . _ .]| possible by proper choice of '1'. .. .1 | H ' I I | I | | | | | 7 | | | I I I I I I I .. § I . f r \ I 1. Numerical evidence strongly suggests that the difference between |])\. . . . ... r . .- . . . . . .£. _ .-3"’ I if /"' F 1" 3 _ I _ _ _ _ _ I I I _ I I I I I I . . . . . . || 1'" ___ 2 1' 1" . . .‘i'. L. . . . 4'" I I I I I I I 3 I. ‘ . .\ _. ..73 and that. . . .02. .. . ..5 _ _ _ _ H’ _ . . . .. . . . . . I _ _ _ _ _ I _ _ I I 5 I I I . . . . .. l . \ I _ | . . .. . .. ._ ./' 2 10‘ (10) FIGURE. _ I I ..E. . ... .- . . . . .. . | | . . . . . I: I — ‘I I I . . . ...f _ . . . . . . . . . . .. ... . . .. . . .. .-' I .. . .F i 1- Chebyshev sites are good 21 | 5-5 . . . . .-"' - . | .. . . . I .. . . - . . . .... . .2. ‘ . ... ~ fr.‘E. . m N{ 20 10* 10’ The size of the Lebesgue function for the Chebyshev sites (solid) and the expanded Chebyshev sites (dashed). . . . . . . lug’-ll-Il'n-Iii-|. _ _ _ _ _ \ | | - I I I | I - .}. . . . _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ . . . . /' l. . . . . ‘T it- . . . . .?. . .. .. . . . cos(1r/ (211 j=1. . . . . .. . | . .. . . .. . It is possible to improve on this slightly by using the expanded Chebyshev sites (11) r./... . .-" II .l. . Limitations of Polynomial Approximation 22 Runge example with Chebyshev sites We change our experimental interpolation program to read in the 10—lo0p TAU(I) = COS(FLOAT(2 1 I . (Thie increase in the error for 11. 1].n estimate on ['11 . /FLOAT(NI-11) beforethe 10-loop replaced by PIUV2N = 3. from GO!) = 1.ke g(. things get even worse E g for g(.1:) := ~. t\J1-I1.40 12 . 9259+00 7503+00 5559+OO 3917+00 2692+00 1828+O0 00 .I-1I-1 CHDQAHOCHDGAHO 7925-01 3005-01 1905-01 1404-01 1114-01 9242-02 7900-02 6900-02 9425-02 1061+00 00 . 0 1234+O0 8311-01 hM*H+H*H. 1].ROR a.) If we put the singularity inside of [-1 .1) =11 PIUVQN) with the line H=2 . + x) This produces the output N MAX.1:) = 1'/]:1:] on [-1 . we modify our experimental interpolation program further by changing line 5. (12) Squareroot example We ta. This 1s due to the singularity of g at :1: = -1..06 .65 22. = 18 20 is due to roundoff.I1. we get .0 3051-PI\JO0JO>|-P~t\J 5591-01 3759-01 QO O O O O 0HnMmnoH+HDOC> -name“-marw -~1-~1o>tn1\.ll.*K)**2) to c(x) = sua'r((1. to decrease only like 11. so let’s take something tougher. see Problem 3.02 02 01 NH-I1 .ERROR DECAY EXP. . . ./1 + :1: on [-1 1] th t is.04 .] ). o 1o r=- (with MAX.98 O O O O OCJ ‘BI -1 which shows the maximum error ]]e./(1. 1'.ER.I-1 -IO .11-115926535 /FLU!-iT(2 1 11) The program now produces the output N MAK.. only 13 This is quite satisfactory.ERRDR DECAY EXP. + (5. || ~ const . . This provides the estimate (13) ' . then we would want 10'?’ = 1|a|| ..5475+O0 ... .14 million. .4402+O0 3791+O0 .-1'11.—ra)llflr§1g95¢b -]2—-. we would need 11. Z 1. I It F. decreases far too slowly if we are seeking several places of accuracy. As the output indicates.. 1'. if we wanted an error of 10-3. '-—1.5“§1g1%_.2666+00 .3083+00 ..£Q-i- Now..?)— and that this minimum is taken on when the interpolation sites are the Chebyshev sites.. . n! Indeed. | (~ -1'1) ~ 1 1 <1 . [11.R-1/2. Equareroot example "N MAK./20) a.nS'. El The following discussion might help to explain this situation. Hence.2383+00 23 DECAY EXP... ~ 1. by Property l(vii) of the divided difference. (_23s4)2106.1. ..3382+00 ..I. b] for all 11. This means that we have done already as well as possible as far as the choice of interpolation sites is concerned. — — — — 00 62 54 52 — - — 00000 U'l 1U'1U'1U'I Cl-'I-'CI -H-¥ Our complaint here is that the error..2853+O0 .1 -1 0 C1O>1I=t\J0 C1U>|-l=t~J 0 0 0 0 0 . we have for this particular g ||e.8407+00 . it so happens that <11) ' ..L _ max agqgt |9(")(C)| --——i. and :1:. in the interior of the smallest interval containing 1'1.—11)---(.)lT1*" . -"Ply = 9(“)(Ca)/H! for some Q.-1 ‘:1'—‘-$1‘-fI'-1 Il |JT'F-1 .—.="'mIl9 while. while decreasing. Recall from Theorem l(14) that the interpolation error satisfies Y @a(I) = 9(I) . E.. The difficulty in controlling the interpolation error then must lie with the second factor in (13). in our case. that is.2512+O0 rot..-.an = 2(—.(l|@a||/l|@2o||)||@2ol| e 121*-8~<1<n/20>"/2 or (11. gin) becomes infinitely large in [11 .. 5 T‘ .ERRDR . . ...P-a9(I) = (1? — 1'1) .1.T1'1. 1 c-=11 ]i9—PnQll 5 |l(.(I -. Limitations of Polynomial Approximation Interpolation at Chebyshev sites is nearly optimal Now. we might as well stick with the comparatively simple scheme of interpolation at Chebyshev sites..P1-. as I now show.24 _ II.. This implies that 9 — Pay = (9 -P) .-. by Figure (10). PHPIP I01‘ 3.. that is. to g by some other means. = 1 on l'I. and shows that we can estimate the interpolation error by lls-Pagll 5 ll9—Pll+|lPa(9-P)ll 5(1+ll)\1E1ll)ll9—Pll1 for 8-1111 E Hea- This is valid for p = p"‘. there might be some hope that we could do even better if we gave up the idea of interpolation and constructed the approximation p E lI<_._. which says that we can hope. in fact..[<-H. this won’t gain us very much. too. and therefore (15) dist (9111:-. R] .-_'_n.. that is. then‘. Also.pEl. § 20.Pasll (1 _]_ . that is. It is easy to see that the interpolation process is additive.Pll» P€l_l-1. (1 + < 4..1 gl"]|] may grow .. * _ 5 d1St(g1fi<") s llg -PH-gll 5 2 1.». Then certainly lly — 11* ll £1 ll!-1 — PaellBut. from (13). at-best.a) 5 lls — P-asll S (1 + ll)\ii1ll)di$t(91H<n)- . H9 — 1>*|| = dist (91TI<a) == min lls . as the earlier example showed..(9 -11) for all p G l'I.ll. Suppose. to cut the error by a factor of 4 by going to some other approximation scheme. " P1-1(Q-l'h) :Pn9+-Pnhi and also P.. and (15). that we choose for p the best possible p* E fl<. But this means. we then have the bounds - (16) l :-1 . (14).1 “ 11a<">\|i 4 which may go to zero very slowly or not at all because too fast with 11. But. that we won’t be able to approximate some functions very well by polynomials. for 11.. The distance from polynomials For practical purposes..-..._. within the class C("')[a . + It) 5 ta-(g. b]) ".1J e 11--1-1. and then max]g(.1:)—g('g)] = ]g(0)—g(h)] = Therefore. 1l1.'11.. but the rate at which t._.. h. that is. 1 h (17) FIGURE. 1) =..la The distance from polynomials 25 mi -_1 - .9(y)l=I.. b]. /1) = \/F Approximation theory provides rather precise statements about the rate at which dist (g. the modulus of continuity of g at h is denoted by e. It is clear that t. . h.____._.-=1 11. For g E C'[e. on the modulus of continuity of the rth derivatives. ..—+-0+ 1-' "H. h) is monotone in h and subadditive in h (that is. .1(g. b]. For g(... /1. h) 5: consth (see Problem 5). k)) and that (for a finite interval [a . yet practically useful. '1- lim :1..b]..sum 19(1) .1(g.. An appropriate classification turns out to be one based on the number of continuous derivatives a function has and.11 .) = 0. max ]g(. b] of functions having 1' continuous derivatives. that is.h) and is defined by <18) w(9.. (20) if g 6 C'(1)[a .1:) —g(y)] in a strip of width h occurs when 0 lies on the boundary of the strip. . . The following are simple. b]. h) + (4J(g.1(g. for a function g continuous on [(1 .1:) == \/E on [-11].) goes to zero for various classes of functions g. exam- F ples: The fastest possible rate for a function g that isn’t identically constant is tt1(g. This rate is achieved by all functions g withcontinuous first derivative.| (19) for all g E C'[a . ~(9.) ii ]]g']]h.t1(g. l'I. . then a1(g. a1(_g. h) approaches 0 as h -1» 0"‘ varies widely among continuous functions. . _ Our last example shows that this estimate is sharp. from (23) with 1' = 0. Limitations of Polynomial Approximation -l If. in T. := 6(3e)"/(1 + 1'). ' dist (g. the constant can be chosen as const. For g(:1. . for example. . But. for some constant K and all (positive) h.]. then (23) describes correctly how well we can approximate by polynomials of order 11. if g has or1lyf]'1' derivatives..b] that satisfy a Holder condition with exponent o1 for some or E (0 . (21) w(g. namely (well behaved) analytic functions.b] of cdntinuously differentiable functions on [a. h. A proof of this theorem can be found. then _ b— " dlgt (Q. . h) 3 hf‘ for the function g(:1:) := ]:1:]"" on [--1 A typical example for the use of this classification is (22) Jackson’s Theorem. of course.b]. For an analytic g. S C-0I'l. b. Here. thedecay exponent. b]. and 11. h.. Piecewise continuously difierentiable functions in C [11. . that is. is concerned. For instance.. An even larger class consists of those continuous functions on [e. functions that are efficiently approximated by polynomials.“ for some and all (positive) h. we have. 1'1. This means that w(g. g has 1' continuous derivatives on [ct .-. 1). The fact that (23) is sharp in general means that the only way for making ['1 -l .. w(s. that is.$t-I- .. in general. w(g. .:) = 1/]:1:] on [-1 . . > 1' + 1. h) = l9(h) — g(0)| = /11/2 and so. .) 5 K h. Ifg G C(")[e. Rivlin [1969:p.1].) 5 Kb. '51. ... 23].) = O (e_°""') for some positive cc._ L1)(g( b).26 II. (Q. y CllSt.. more generally. as far as the order of convergence. b] belong to this class which is therefore much larger than the class C (1) [-11. Hqn) 2 COIISIJ ' 'l'1—1/2 which is the rate that we observed numerically in Example (12). as already noted in (21). . then g is said to be Lipschitz continuous. There are. . while evaluation of a piecewise polynomial function of order n with I: pieces at a site involves only n coefiicients and a local basis of fixed complexity no matter how big k: might be. 1. Note that cutting [:1 ..). on each of which we then approximate g by a suitable polynomial. For these and other reasons. so that |]g—p*|| = dist (g. < Q < b. to equally spaced data. Finally. We accomplish this by letting nr increase and/or making (b —— ct) small... This best uniform approximation p"‘ is characterized by equioscillation of the error (see. .. 1'l<.¢) = constggU°)(Q) for some tr... b] in this way into k pieces or using polynomials of order kn will have the same effect on the bound (23) and corresponds either way to a ‘k-fold increase in the degrees of freedom. see the discussion of condition in Chapter I).|_1 § b for which e(:r:... . by using piecewise polynomial approximation. This is the justification for piecewise polynomial approximation. . use of polynomials of order 20 or higher requires special care in the representation of such polynomials (Chebyshev expansions or some other orthogonal expansion must be used. while use of a larger number of low order polynomial pieces is no more delicate than the use of one such polynomial. Then |}e|| = dist (g.. .|.l difierence also strongly influences the construction of approximations. b] has a (unique) best uniform approximation p“‘ from 1-1. that is.... But these degrees of freedom enter the approximation process difierently..-.k. on [a . b] in advance..l'l. .) small than to increase n. that is. This structura.. (b) Conclude that dist (g. requiring the solution of a full system in the polynomial case and usually only a banded system in the piecewise polynomial case. with constg depending on the sites at which the best approximation interpolates g. and e := g -p the error in the approximation p to g. Also.1) =1 —][e||2. we can achieve the latter only by partitioning [(1. Since we are given [a... 26]): Let p € 1'l. it is usually much more efficient to make (b — c.-_-. (a) Conclude that a best approximation to g from HQ. b] must interpolate g at k distinct sites (at least) in that interval.)e(:r. for example. Problems Every continuous function g on [a .. that is. Evaluation of a polynomial of order kn involves kn coefiicients and basis functions whose complexity increases with the order kn..l'l. in case g has is continuous derivatives. as we saw with the Runge example (1). there is one and only one p"‘ E 1'l<_-.Problems 2'7 the error small is to make (b — c... interpolation in a table.11] appropriately into small intervals. b].-5. Rivlin [1969: p. i= 1. by piecewise polynomials leads to no difiiculties. on [ct . .) if and only if there are sites a 5 11:1 < < rm.)/(n — 1) small. in contrast to what happens when just one polynomial is used. all i. := signum £. as given by (9). Limitations of Polynomial Approximation (c) Conclude that dist (g..* by y(Tf) = 'r. B. G. .(1-5?)/(T-. i== 1.e-iTi-1(:u(¢)_)= i=1 with a._.. . all i._1 are orthogonal with respect to the discrete inner product :-m... with Uji :2: g(T_?)rri—1(T_-it): an 'i'1j: am“-n. with 2/(ft) == (Qt .. 1] (see for example._..) Z (2(b — 0.1.§b[g(k)(:t)/kl]. and construct a continuous function g'on [£1 . the Chebyshev form for Pug (as defined in Problem 1.28 II.1|-mu. are related to the 'r. . . . and constant extrapolation from. NTERMS) that returns. while (T9.. b] for which /\.* := cos((2i -— 1)'rr/(211)). . The roundoff visible in the Squareroot Example (12) could be fought by a careful ordering of the interpolation points.. CCDEF.) = n/2 for i = 1.n..7).(:'E). and a FUNCTION G(X) that provides function values of g on demand.l_l. in CCOEF and NTERMS. (Hint: Pick 5:‘: in [a .m_ -1. . 11)(a) Prove that the polynomial P.g|| = 3. N.. i = 1.. T0) = n. This construction is ETeatly facilitated by the fact that the Chebyshev polynomials T0. ¢= l. B of the interval in question.Tj) = 0 for '5 7‘: j. the table ('r. b] with g(T. for instance by linear interpolation in.. This means that (T.n —. But. .g>e> = §:. i=1 (b) Developasubroutine CI-IBINT(A... Rivlin [1974]).. T.|_.m.-..m_- In 1 - <1".*.-.._|_1 == Z:g(rf)T.-n\_ n_ n_- .). g> == _S_“.T.. given the endpoints A..) (Hint: use (14) and I(1-4).)!“/4i°)Inin._) = 0. Note that the Chebyshev sites (Tc) for the interval.._5.. the number N of interpolation points to be used. Prove that the inequality (7) is sharp. . . Then choose 0'..n. .-|_ -\...(11 + 11))/(bi. Then show that HP...).. T1. f(n*)g('P£“) i=1 - based on the Chebyshev sites 'r. 2. and g“ = 1.n. Also. . 0".. for the interval [-1 ... (T. the best remedy is to construct the Chebyshev form of the interpolating polynomial.g of order n that agrees with g at the Chebyshev sites can be written 1'1 (P-... is continuous and positive.T. Note that.(i') = such a site must exist since Ar.nr. = 23... Z 5.. and 1_. h) +w(g. Note: A routine like CHBINT is very useful for the construction of the Chebyshev form of a polynomial from some other form or information. provided one has by then calculated CCUEF(i + 2) = 2(2..n }.+g has been constructed.+ Ft) ii w(g. Prove that w(g. h.) for or §_>_ 0. a good and cheap approximation to p|| is. ‘L > 2. though. w(g. (Hint: Show that then g is differentiable everywhere and g’ = O. but use CHBINT. Prove that. it) is a monotone and subadditive function of h. i = 1. Incidentally. QTJFUJ-'i_1 — ’Uj‘£_2. vii) / N. . (c) Repeat the calculations in the Squareroot Example (12) above.. ._ Also.. h. one can forget or overwrite 1. h. Prove that g is a constant in case w(g.-_.._. and CHBVAL of Problem l.1T. . . ’Uj_. Conclude that w(g. 4. h) = o(h). that is.Problems 29 one has or. must one multiply ]|p||c to ensure that p||.—_- y('F§). as soon as vi.) § w(g.7.provided by ||p||.-.. oh) § [of|w(g.) 6. := max{ :i= 1. . § :1: 5 b} is a nontrivial task. The calculation of = max{ |g(a:)| : tr. with (ff) given by By what number c.. to uncover the amount of roundoff contaminating the calculations reported there.um/N.j_. it is also possible (for certain values of N) to make use here of the Fast Fourier Transform. for p G l'l. with [oil := min{ n G Z : or <__§ n n F . Ti = 2.». Ft) for nonnegative h and Ft. . _ IIFF _I____| ___ I-I IIIII‘I III~I _ _ I_ H ___I II__II _I II__I .__ |_‘I’ __I_I-__:J|_1I. 1__|l"__I_ll ‘I1. I.I\___m_ _ l I _|_I|__I _ _I _ II 1 _IIII1' I_I__|_ I__|III___ _H I___ _II L-__I_I|-__|__1Il _|_ ll.1-_‘ I1i _I__I __I____l_ I__: I___ _|‘_r__ _II_ 11LI1 _I ILI_H_ \.I__|l_|~_i1]" __. 5' -:1: §_ r. The subscript 2 refers to the order of the polynomial pieces that make up the interpolant. .).. The interpolant is given by (1-) I29(f'1l== 9(Ti)+(1' . . small for all i. we get the error estimate |g(1')— Izg(fl1)| S (An/2)2 T=tSCS1'i+1 max |9”(C)/2| in case g has two continuous derivatives. := ('r._|_1. or even higher order. hence. . with A-r.Tt)iTi=Ti+1l9 - Since n i=1. while this increases the number of parameters needed to describe the approximating function f == Igg. f is always just a straight line..'e+1. we can make this error bound as small as we like simply by making Ar. <2) _ 1 l|9—I2g|l s . But it shows most of the essential features of piecewise polynomial approximation in a simple and easily understandable setting..Til(11? "" T£+1)lTi=Ti+1-H5191 we have. 31 . for 1-.1¢ly- Therefore.n——1. An. interpolant to g at points T1.|»r|*||g"||- Clearly. approximation.. 011 Ti S 91 S T¢+1= - §(=1=) — I29(f¢) = (Q1 — n)(1' — "e+1)['ts-. Broken line interpolation We denote the piecewise linear. it does not really increase the complexity of f locally since. with |'r| := max. -IF Ill 1 Piecewise Linear Approximation Piecewise linear approximation. . with - £1=T1'<""<Tn‘:b by Igg.'F'i+1l£7 + (9-'7 . locally.may not have the practical significance of cubic spline. n 9(fl1)= 9(i"1)+(f~'-7 — ‘?'t)['1'e.. or broken line.| ... And._|_1 — 1-. 'r. . . halve the error by going over to a best possible approximation to g from $3.-I | ._|_1]. ..] with breaks at T3..1].r.'r. .--ll/(Ti"Ti-#1): Tr-1 <11-I its -H-t(1'-'!7)I= ('1'-r+1 — IL‘)/(Tr+1 — Tr). we now discuss least-squares (or..-. . such as least=squares approximation by splines.- otherwise. I3f agrees with the straight line that interpolates f at 1'. we need a convenient basis for $3.. the error in cubic spline interpolation._.__|_1 := T. by the uniqueness of polynomial interpolation. then f itself is a straight line on ['r. we minimize the right side of the inequality over all f E $3 and so prove the second inequality in ' (5) dist (g. . Piecewise Linear Approximation Broken line interpolation is nearly optimal Let $2 denote the col- lection or linear space of all continuous broken lines on [T1 .|_1. and B-splines.. We claim that (3) I31’ = f for all f E $3. The notation “$3” reflects the fact that these are splines of order 2. .32 Ill.$z)- " This shows that we could. we observe that |lI29|l = mf»Xl(I29)(Tt)l = mf-Xl9(Ti)| Ii ||9|l therefore (4) |lI2§l| 3 llgll for all 9 G (3'[-*1--bl- We combine (3) and (4) appropriately to get y I19 — Iagll = |l(g — J’) — My — f)|| S llg — fll + lly — fll for all f G $2- Here. Least-squares approximation by broken lines In preparation for things to come.. . and 'r. . r.|.'r. and set 2 (6) (3-71. in the terminology to be introduced later.. Further.'r.1].. But if f G $3. 0. . Ti § 117 < ’T£+1-._. L3-) approximation by broken lines.__1. Let TO := TI. '2'. For this.$2) i Ilg -— Izgll £ 2<1iiSt(y. . on each interval ('1'. at best. Indeed. . therefore I3 f must be f itself on ['r.. 'r. _ . . that is. . f('r. by (3).+1 Some of the elements of the standard basis for $3. i = 1..=1 _ Let L3 g be the least-squares approximation to g from $3.. T0=¢1=T1 T2 (7) FIGURE. every broken line on [T1 . to zero. (9) f = i f(r.. 1 ‘J- H.-H.. The coordinates of a given f G $3 with respect to the basis (Hill‘ consist simply of its values (f('r1). that is.c1:. and. more learnedly. as is obvious from Figure (7)1 1..11 f e $3..-)—Zor. This shows that g(r. while.(:r)|2d:r j=1 by setting its first partial derivatives with respect to cr1. 'r.=b:'Ta-.) = 5.. .. These functions have been called hat functions or._j. that is. H.1:)H. all i. for 3.. It also implies that (H. .r._)) at the breaks..(:... chapeau functions..)‘f is a basis for $3. . .(:r)g(:1:) d:.n. . Clearly. for all i. we find aminimum of H H f|g(:r. 33 Ta 1'4 1'5 ’Tn—1 ‘Tn-.__1 can be written in exactly one way as a linear combination of the H. . = /H. G $3.)H.. 1. that is. I3g is the only element of $3 with that property.] with breaks at 1'3.’s. . This establishes the “Lagrange form" 1'1 (3) -729 = Z§(’fi)Hi i=1 for the broken line interpolant.r. '= ' H.. is an element of $3 that agrees with g at T1. I-|' l .-(:1:) d:'1ri|‘cr.. = {O aé.(T.)H. This gives the linear system (10) r/1= 1--I1. .Least-squares approximation by broken lines (1 H1 H3 K H-rt H4 L._L3 g G $3 and / lye) I ag<o|” dt I min f |§(r~:) I foal’-‘ dx f€$2 We determine L3g with the aid of the normal equations. .. . . . \ in terms of \\g\\.5 Moler (19671). 13-%=li=l35r :"(‘-1i—1A"F§—1 '1' @j+1AT:)/(AEI1 '1' 53Tr)l 5 3l15rl + lflrl ..-1-r —F ZI-"-— larl = llall == 111§~Xl@tl= -1I-'L_lI' i-‘I1 -I| i'_|-InQ-—|I then.Tt. the linear system ii An-1 ai__1+(i). and this wecan exploit as follows: If j is such that :_-._1 = An:-1 + An).)‘{‘ of the broken-line L3-approximation to g. b]. ctn+1 of no interest since Am = A'r.@._ = 0).'. ... -I »-I|—m-1 . \c:r. to a continuous function g on [a . The system has therefore exactly one solution and this solution can be obtained efficiently and stably by Gauss elimination without pivoting (see.. ...+(ééI1). :i=1 The integrals involved are easily evaluated.-F -——-'-if. Piecewise Linear Approximation for the coeficients (a.+1 -— 'r... The coefficient matrix is tridiagonal.H. since L3 is additive and L3 f -= f for all f G $3. 71 L3g =: §:cI_. We get... The L3-approximation L3g to g G C[a ..-'-‘-"'l'I. or.. 3\l9ll- Hence. =_._+. and strictly diagonally dominant. we have (14) H9 -' L29" S 4111511 (91$2)- PROOF. both sides of the ith equation in (11) by 6 / ('r..:="/~H.\(L3g)('r._. 1 '?'t+1 '-“Ti--r —_F-p ‘II H -n—| -1 (I-£.n.. 1 (11) =-. bl. we multiply.. for example. This system is strictly diagonally dominant uniformly in 1' (since 'r. from the jth equation in (15).'r. that is.) to obtain the equivalent linear system A -. for the coefilcients (or-.) of L3g. ‘Ti-1-1 -‘Tr-1 ‘. To bound \\L3g\\ max. for each i..'_._1-'i-206-.I:)g(a:)d:r i-=1. Forsythe 8. more explicitly._ T‘ A .. by elements of $3 satisfies (13) \lL29\l 5..j_|_1 ==3fi. 1.(:.1t.)\ --= max._.. (12) Theorem.. A __ llall '5 3\5rl S 3\\5\\- .1:-"=‘ l.L I I || 34 III..|_1 . (W ith (Io. and L3(f +g) = L3)‘ + L3g. equal to the degrees of freedom used. the number of interpolation points.f11)9('Tr) + (I .. But the first spline paper to employ the technique is Sharma 8.: Meir [1966] in which Theorem (12) is proved this way (modulo the identification made in Corollary V(9)).|_1.W‘. On T. Thus 15-=¢| = |. xvi for a full explanation. with [Tl := max. or g’ is not defined somewhere. for example g” might be infinite somewhere. small. for all f G $3. 1. Even if g is only continuous.‘F_|H. we have used the symbol “O (n'2)” (read “big oh of n'2”) to express the fact that the decay exponent for the beundjn (17) is at least as small as -2. In particular._1 -< :1: < r. But (14) follows from this and from the fact that L3)‘ = f. Good meshes (2) .|)/A1‘.. . for a uniform mesh. we can still make the error small by making \'r\ = max.fHt(f-Y-')9(f'1) dill 5 lHi(fl1)d$ '111&1<{|9(fF)| I ’Ti—1 5. E] The use of diagonal dominance to bound the solution of a linear system in terms of the right side has been standard in Numerical Analysis for some time. .IF.. 91 S '1'-1+1} 3 Hell- This proves that ||L3g|| 3 3||g||.. | —I —l"_. Here.l.-!‘I" _'\I-1I-.+1 and zero otherwise. § :1: ~j<_ T. with n. y fit = f so->g<1=>d1= with (16) 151-¢($) 1= (3/('1't+1 — ‘Pi--1))Hi($) positive for 'r.IE'._|_1 — :r| + |:t — r._|_1 -— :17) + (:1: — 1'. we get F‘. and I I.Ia-mi-I |. See p.'| and ((r. = (|'r. much as (5) follows from (3) and (4) (see Problem 2). Good meshes 35 On the other hand.(:t) da: =. 1 Ila -.r I-IF -I -I .))/Ar. we have 1 ' 1.-| l on i||g. |A'r.|.'1'i)9('1't+1)) /A1? -‘I-" 'i_—_"_'-I. A1".1%-I— (1'29)($) = (('1'i+1 ".Ital! S 5 |rl2||§”|l in case g G Cm and concluded that we could make the interpolation error arbitrarily small by making |'r| small. ‘We observed earlier that.an s -2- ||g’*|| = 0 (--2). = 1. Note that this theorem such theorems for arbitrary order in ap not only claims the possibility of good convergence to functions with singularities at the ends of the interval. d interpolation sites. 1 g ' ' ' tives inside the interval (a .129“ '5.b]=-[-—1. 0 2 0 2 . but it also indicates how the breaks ' ' al onvergence rate O (n"2). by II(19) . . 0] can be handled by symmetry. with 1'3 < < 'r."'* 0- For the Squareroot Example II(12). b).. .1: > O. . therefore t ‘I. We will discuss ' ' Ch ter XII..i"_'_-_. this gives and uniformly space <19) \\g. should be chosen to achieve the optim c . But.1 5'11)Hence. because we have the location of the breaks. all we have ' Hg -. we consider only (0..for simplicity. .. .f :'c'3/4 da: = 1-4t1(4 < oo.'1'-e)l9'(°1)" 9(Tt+1)\)/AR :3 _ni. that is.9('H)\-. g (:i:) --(1/4):t"3/2 . ' ‘f has two continuous deriva(20) Theorem.b). .__1 chosen so that T11 on "_ [ \g"'<=»>\””dI= b [ \g"<==->\1/id-. and I: \g”(:i:)\1/2 do: < oo.»\9(1¢) -' 9('F-=-+1)l 1 S W(9'-. . and \g”\ is monotone near a and b. we can do much better. g(:i:)=~\/l?:lon[a.an = @(--'1”) . (13) ‘ 1 H9 .1].. .I3g\\ = O (1172) .at our disposal.1I§_g_-§i+1ma1{\9($) . w(93 l"'\) -—l-.1.'*. For .. I \g”(:i:)\1/2 do: =. Piecewise Linear Approximation 36 therefore H l9(-*1) '" 129(1I=)\§ (("F1+1 -" 11'-')l9(-"1)* 9('T—1)l+(Y-'1 . then. A simple proof of this can be found in de Boor (19731. If g G C12) (a . er polynomials (except that which is no gain in the convergence rate ov ' polynonnals of order n are more complex objects than are broken lines with n pieces)..III. the interval (-—-1 .1]. H __ For the Squareroo t Ex ample II(12) . §|| obtained in the proof of Theorem (12) .. and (iii) ||P|| := sup{ : g E C[o .Pgn sgl + ||P||) d1s1=<g. 'r. ><. . Verify that broken line interpolation preserves monotonicity and convexity.1'.. E C[a . Kg .. . F I I I -I -I I 2. 3.Problems 37 . . Prove that then 1|.) = Pg + Ph for every g. ug — aw = mg».__1.s>.) (b) Show that ||g" -. . This shows that.1/=~. .. b] so that Pg = g whenever g G S. ['2']/2) for g G C'[a . for this choice of breaks. I-—11‘. as one verifies directly (see Problem 6). For g E C‘ [(1. the decay exponent is -2..@.$1) § u..1T1. I i (a) Show that dist (g. let Pg be an approximation to g in the linear subspace S of C'[o. (Note: We take here := sup{|_f(I)\ : :1: E [:1 . __t—'i fiP'P7P"*?_T? ll and even ||g" — (I3g)"|| = C7(|'r|) if g’ is Lipschitz continuous.a_)'<s.>| = 0 (W) _ 4. For this choice..1)”/2 Tn—1__I____T-n or <22) ug -.. Use the estimate ||é':|| § 3||. .1(g. (ii) P(g+ h. .J' 2. h. b] \ {'r2. Problems l. $1 is the linear space of piecewise constant functions on [o .‘-_-I_i-*_mil_‘-I_ _ Ii r p ug .... b]. . that is. .Izgll = 0 (vi-2) . b] with breaks T-3.(I2g)"|| g 2dist(g". and with '1'-|:+1/2I=('{'¢ + Ti+1)/21 I I .$1) for any continuously differentiable g. for any three times continuously differentiable g._.3 We therefore want ' 2(T-5) or 7'-5-51 5:? 5 Z:2. (c) Show that. b]. . and with the same decay exponent -1 /2 obtained in Example II(12) when approximating g by polynomials with the same number of free parameters.b]. .I2g)<=»>| s <n._1}} in order to avoid discussing what the value of an _f G $1 at a break might be._ |(g — I-. This is to be compared with the decay exponent of only -1/2 for the uniformly spaced breaks demonstrated earlier.1§. b] } is -| -I-|Il|—'I l finite. Let $1 := {f" : f E $2 }. . li 12* /“‘“‘“‘ U2)‘ 7. Use Problem 5(a) to verify (22). ./5+ (/5)... n. 5 =1. For this.-. broken line interpolation to -. 6. W ./E on [0 .1. (3.<__ b} = §(. Piecewise Linear Approximation to conclude that (11) has one and only one solution for given g.. 'r. .. . 1] has maximum absolute error in ['r. 1] from broken lines with uniformly spaced breaks goes to zero faster than n“1/2. (b) Use part (a) of this problem and (5) above to prove that the distance of g(:1:) := ».\/. i = 1. .I 38 III. . .) Show that max{ |g(:I:)—_f(:r)| = . Verify numerically that ||g — I3g|| = O (TF2) in case g{:r) = sin \/E and Ti = ((i--1)/(n-— 1))4. . 5. and let f be the straight line that interpolates g(:r) := \/E at o and b.. show that for the interpolation sites T-5 = — 1)/(n — 1))4. i = 1. ~.1] equal to |./5 on [—-1 .n.2)?/(./5. Let 0 § a < b... -.. one has to go to piecewise polynomial approximation with higher order pieces.'_-1.1 for some H G 1'I.~'1"i+1=-'Ti+1] 1. fin: g 1'.-_4.b]. .n—1. .. regardless of how we choose the free “slopes” (s.. 51 . .-. .)2[T-. that is.“'-¥.....~ '?'1:~. . . . The most popular choice continues to be a cubic approximating function.Ti) (fI7'— Ti+1)ITi-. Both for a smoother approximation and for a more efiicient approximation.. of order 4. |II l_lI i Iqw—l -I‘|—e I'f-_1-:1~'1-‘*3 "'---5:1-51'-E‘".._-. (1) _f(:r) =P. = b. In this chapter.. Given the data g(1'1). P¢('*'i+1)= 9(Te+1) P-i('Ii) = 5%: Pf(Ti+1) = 5i+1 i =1.IW..g('I'..."~'1I"'= I ll Here.. We determine its coefficients from a divided difierence table for H based on the data (2) for Pi: 39 . .. | The ith polynomial piece P.) L| s Pi('F{)-f 9(T-1).1]._ are free parameters. is continuous and has a continuous first derivative on [(1.)‘{".'r. we describe various schemes for piecewise cubic interpolation and give a program for cubic spline interpolation with various end conditions. we construct a piecewise cubic interpolant f to g as follows..n— 1..-:1 . ._) with a = T1 < . .-. s.< 'r.|.|.T-£+1lPt 2 P__ + (I13 . b].. ._ and is in C'(1)[. i-= 1. . . The resulting piecewise cubic function f agrees with g at 1'1.. In order to compute the coefiicients of the ith polynomial piece P. we use its Newton form <3) Ps(9-1') = RUE) + (I -' Ti)[Ti1Ti]P£ + (IE — ’T~s. On each interval ['r. .. ‘T.(:r) for 1". is made to satisfy the conditions (2. . "1.. CUBSPL Broken lines are neither very smooth nor very efiicient approximators... . we have f agree with some polynomial P..~:=Ti. IV Piecewise Cubic Interpolation. F. _+1].I: -. -= (b —.'§sT. Piecewise cubic Hermite interpolation Here. the decay exponent for the error in piecewise cubic Hermite interpolation is at least -4 if the function g has four continuous derivatives. = g’(*r. with \'r\ := max.-1 =‘= 02¢ C-73.e)/(n —— 1).'i. depends only on information from.-.-.~:.C4‘-.+1]g . all . From Theorem I(14).-:. that l9(-"'-Y) — J°(f»\'1)I=\(-"'3 '* Ti)2(-"'3 "..'*'@+1)2i'*'i=‘T¢= T¢+1='Ti+1=f"»'lyi < (13%/3)4 max 19(4) (Q1/4!. _ 1'-i. . This means that the ith piece P..+1lP-a — ATt(['Ti. For equally spaced sites (Ar. i fifl~ (AT5) -5‘-.11 = 91%)._. 'r. (6) H9 . or near. ‘I’ (:21-»£(:. Ari.- " (Si + $¢+1 — 3iTi=Ti-+1l§)/(13°'i)2- I Different piecewise cubic interpolation schemes differ in the choice of the slopes (s.40 IV. P£(I) Z C1._1.{!I(Ti)/6 fi ([11-_. Piecewise Cubic Interpolation LIP I HP Te 9171) [HIP I St [1-i'I1|-'I"I"1:I.Ti) -I‘ C3’-£(fB —.:_. .|"'L‘ — ‘F03 with (5) C1._.T02 -|. §_ m ~§_ 'r.-:-. for '1'. thereby making the approximation local. . 'i'i+1l9 Ti+1 9('Ti+1) /._(. all i. in terms of the shifted powers (:1: — T-QT. we get <7) ug — fH = 0 (W4) that is.)'f.+1 “ I71.). 312-l=1 T~£+1 §('7'£+1) This shows that.fli ":<_ (1/384)\Tl4l\g(4)\l in case g G CM) [:1 .. To '11-1-1.. the interval ['11. T'. We discuss the best known choices. one choosess. .__2 . .‘E5_C£1'~:+1 hence.-_ .iAT-.. 1'¢+1]9 -' 5t)/ATE '— <34. .Ti+1lPt)= l‘ “- fi i fl C431 =- P. P-1('i'r) PIW) P§'("¢)/3 St: — I’-"t1'1"t-.g *- Ti [===lP 9('i'i) St AT-5 [. we have.. DIVDF3)/DTAU (4.C(1 I))/DTAU C(2 I) + C(2 I+1) " 2 #DIVDF1 DIVDF3 C(3 I) (DIVDF1 .N. T1.C(2 I) .Runge example continued (8 Runge example continued We consider again the Runge exam- ple II 1) We interpolateg :1: = (I-I-251172 '1 —1 1 at ._]OI' changes in the program are outhned CHAPTER IJ auncc EXAMPLE wrrn CUBIC HERMITE INTERPDLATIDN INTEGER I ISTEP J N NH1 REAL ALOGER.1) = (DIVDF3/DTAU)/DTAU III --I ESTIMATE max INTERPDLATIL ERROR on (-1 ERRHAX = no so =2.N = (TAU(I)-TAU(I-1))/STEP so J=1 ISTEP H = FLUAT(J)#DX EVALUATE (I—1)ST CUBIC PIECE PNATX = c(1 I-1)+Hn(C(2 I-1)+H*(C(3 I-1)+H*C(4 I-1))) ERRMAX = AHAX1(ERRMAX ABS(G(TAU(I—1)+H)-PNATX)) ALOGER = ALDG(ERRHAX) IF (N or 2) DECAY = (ALDGER — ALGERP)/ALDG(FLUAT(N)/FLDAT(N—2)) ALGFRP = ALDGER earnr 640.C(4 20) DECAY DIVDF1 DIVDF3 DTAU ox ERRHAX c H * PNATX STEP.4 F11 2) END STOP .ERRMAX DECAY etc FDRMAT(I3 E12.2/ (n -.ALGERP.20 2 cHocsE INTERPOLATIDN POINTS TAU(1) TAU(N) EQUALLY SPACED IN (-1 1) AND SET C(1 I) G(TAU(I)) c(2 I) = GPRIME(TAU(I)) = -50 *TAU(I)*G(TAU(I))**2 I 1 H = 2 /FLDA1(NM1) 10 I=i N TAU(I) c(1 I) c(2 I) FLDAT(I—1)*H ~ 1 G(TAU(I)) -so *TAU(I)#C(1 I)u*2 CALCULATE THE COEFFICIENTS or THE PDLYNDHIAL PIECES 2 I-1 N 1 DTAU = TAU(I+1) — TAU(I) DIVDF1 (C(1 1+1) . -. = 1+ 2-1 h = .TAU(20) DATA STEP ISTEP /20 20/ c x = 1 /(1 +(5 *x)**2) PRINT soc soc FDRMA1(2BH N MAX ERROR DECAY EXP //) DECAY 40 N 2.1.1 but this time by piecewise cubic Hermite interpolation The two I11£. with h. )(.'r¢_1)(. 'ri_|_1. 0._1.|.1141+00 0. as given by (9). is a local method.. see Problem 3(e).40 -0.80 -3.51 -3. difierent from the sum of the corresponding interpolants.1244+00 0.. is only an O (\'r\2)-approximation to g"('r. one chooses s. Bessel interpolation provides only an O (l'r|3)-approximation since s.94 -1. to the right.1661-O1 0. which shows that Bessel interpolation is also a local method.) .77 "1.""' " ""' 1" I '- : -- 42 IV.— 'r. _ Piecewise cubic Bessel interpolation Here.39 -1. I had used -2 instead of -50 in the statement labeled 10 in the program.6234—01 DECAY EXP.00 -0. T-5. in general. as the slope at 11.2932-01 0.4195-02 0. only of or-der O (\'rl2).87 -3.97 II CI-‘i -lbl\J B 10 12 14 16 18 20 I'lAX.ERROR DECAY EXP.7275+00 0.63 -1.|_]_ .5407+00 0.4900+O0 0. Al(lm3'S lnt€rpOl3tl0n Akima’s interpolation was developed by Akima [1970] in order to combat wiggles in the interpolant. The output on the left came from an incorrect first run. 0.92 The resulting output is shown above. Akima chooses (10) s_ : 'wr+1l’T¢-1.3239+00 0.91 -1.7669-01 0..9640-01 0. too.22 -3. the interpolant to a sum of two func- tions is.9246+O0 0.5562-01 0.. A short calculation gives (9) Si : A’?'rl’?'-I-1i’Trly+51%-1lTrrTr+1lg I AT-1 + A'T1'_.6339—02 0.73 -3.2236+00 0. but it is not additive. As it turned out. that is.97 -1.77 -1. of the polynomial p of order 3 that agrees with g at 'r.— 'r.36 -1.90 -2. .TJ'-'11TJ'lgl' The approximation provided by this scheme is.9601+00 0. see Problems 3 and 5.1656+00 0.1)). The subroutine IQHSCU in the IMSL subroutine library [1977] embodies this scheme.69 -3. Piecewise Cubic Interpolation ii N OIIFI J 3 10 12 14 16 13 20 HAJLERRDR 0.2500+00 0. hence had computed the slopes of g incorrectly.00 -0. I knew I must have made a mistake since the output showed only O (n72) convergence in contrast to (7). see Problems 3 and 4 (or try it right now for g :== -. and I decided to include it here to show the usefulness of computing decay exponents.’TilQ -l" we-1lTr=Tr+1lQ w-£+1 -l""-U-I--1 with (11) 111:‘ == ll'Ti='Y3+1l9 __l.1000—01 0.. It. in general. ._1)g”(1'. and this solution can be found without any difiiculty by Gauss elimination without pivoting (see Forsythe 35 Moler [1967]).. But we discuss them only in tei ms of spline interpolation. ..-':_' I I -T 1. ._. = 3['r. . rt — 1... for i = 2. have been chosen somehow (see below). Pi”-1('e) = P§'('Pr) or ' or 203.__1 which is strictly row diagonally dominant.. = g’ ('r. ?r.. we now have in (12) a tridiagonal linear system of 11-2 equations for the n. s1 and sn._= _ 2. — 2 unknowns S2.. (ii) If g” is known at the end points. ... then one can force f” =..1 about to be discussed are useful for "piecewise cubic Bessel interpolation...|_1 (with To 1: T1.’..|_1 := 'r._)/2....I I"-1"‘ | Boundary conditions 43 Cubic spline interpolation I-Iere. This gives the conditions that..._.r-1ATi-i = 203._)._.v._...]g + (A'r..1 + 25.. then it is natural to choose s1 = g'('r1) F! 4 II I-_ '31 ‘T-*'=7-F...s.A.A... n II and sf._......_1 are determined from the condition that f should be twice continuously differentiable....) and has been called the complete cubic spline interpolant of g.._.----=""-"'-1- Assuming that the endslopes. r.g” at the end points by adding the equation 231-I-32 =-"3|:T1.... The resulting spline interpolant I f=I-19 I" I '- l'_ i1 I | I agrees with g at 'n. . (i) If g’ is known at 1'1 and 'r.__1._1 =) _ be I= 3(ATt[T1:-1i'i'tl9+AH-1lTtiTr+1l9)= i=2-. Akima’s interpolation scheme and similar schemes as well as for cubic spline interpolation. so that f has also a continuous second derivative. Hence the system has exactly one solution. Ari leading to the linear system ( 12 si_1-Ari + si2(A'rr_1 + Ari) + sr_|_1A'r. that is. the free slopes s2.'r.. Boundary conditions The various choices for s1 and s-. .. ..Tg]g—|—(AT1)g”(T1)/2 at the beginning of (12) and appending the corresponding equation (14) s. .-1 + 6c4. s.. ' A'rr_1 +4c. complete (both indistinguishable from f).. Here. Cubic spline interpolation to f(:r:) = cos(:r) at '5' = — 1)1r : i -—.__2 = P. periodic. (iii) So-called natural spline interpolation results from the free-end conditions (16) f”('P1)= f”('m) = 9- In spite of its positive sounding name.. The arbitrary assignment (16) produces O (|'r|2)-errors near the ends (unless also g” ('1-1) = g” (1-. Going from top to bottom at either end. the first and the last interior knots are not active).1 (that is. 5.1. Piecewise Cubic Interpolation ‘H "r xi-. This requires that f”' be continuous across ._. then one should try the not-a-knot condition (from de Boor [1966]). 3.. . free-end or natural (note the straight ends)..) —--= 0) and so dramatically reduces the overall rateof convergence of the interpolation method. . first end derivatives estimated by local cubic interpolation.44 IV. 4.. nota-knot.. one chooses s1 and sf. . the conditions used are: 1. natural spline interpolation has little to recommend it from an approximation-theoretic point of view.7) and with various end conditions... 2. so that P1 = P2 and P. (iv) If one knows nothing about the end point derivatives. match second (first) derivative at left (right) end (but don’t interpolate to second nor second-last data point). (15) FIGURE. and P{('r3) = s3.)2[IT‘I"l..$2(T3 — T1) = (17) (Ail 'l' 3(’Ta — ’T1))A"'2l1'i= ’T2l9' "l' (*5’T1)2l’T2=’Tsl9 T3 —'T1 at the beginning of (12) and appending the corresponding equation S1-|__..SnATn_2 = (18) (AIIII-!'I'.---].__3._ —i— C2‘i(I — T-. the last piece. interpolation sites and breaks need not coincide.£(fiI — T.n_ ——. 1-3] and such that P1('r.Boundary conditions 45 '1-2 and r.n and P.: Powell (see Hayes [1970:Ch. or for prescribing nothing at all. It allows for prescribing end slopes. g” or even g’” at the boundary points o.)."r.) = g('r._] and such that P.-. _ T-r'i.T. we have here the first illustration of the fact that. As with the not-a-knot condition.-_) for i = it — 2. i -= 1.3. This would change the linear system (and the notation) slightly.-_)2/2 -l. in piecewise polynomial interpolation.__1 and so means adding the equation S1A'I'2 -l. making up f on [1'. the ith polynomial piece P.-.-. similarly._3('r. in which case the not-a-knot condition is used. P.§. Interpreted this way. I There follows a FORTRAN program CUBSPL for computing the cubic spline interpolant. the resulting approximation is O (|'r|4). (see Swartz 3. .—-llg 'l' (2(T-:1.1) —l— CI3.-—2'I T-r1... with the first piece E1 agreeing with f on [1-1 .. n — 1.. end second derivatives. and b by computing the corresponding derivatives of the cubic polynomial that matches g at the four data sites nearest to the boundary point. Th-is means that we have n-— 3 polynomial pieces rather than n .._2) = s. is written here as Pr(fB) = CI1.. and.C4Ii(I — 1'. with 1'(2H_1)/2 := (Ti 'l' "I-rl+1 (vii) Note that one can freely choose to have different conditions at the two ends of the interval.. (vi) Curtis 8.__3('r.2..__..__2 . }_ (v) A somewhat diiferent technique in the absence of derivative information at the boundaiy consists in computing an estimate for g’.) = g('r.. but the resulting function f would be identical with the one constructed the earlier way.)3/6 .. and then forcing f to match that derivative value.—2) + AII11--1)A7n—-2I7n—1iTnlg Tn "" Tn-2 One may alternatively think of this boundary condition as requiring both the first and the last polynomial piece to interpolate g at an additional site that is not a break.5 Varga [1972])...3..1(T.__2) -I.-4]) have an interesting justification for the end condition (f — g)('i-3/2) = (f — g)(T5/2). We leave it to the reader to work out the requisite additional equations. In anticipation of later programs..1. 2)**2*c(4.J.IV. L = N—i. DIVDFi.. oecotoeoaoeoooeoeoeooee OUTPUT ' #######*############tttttt C(J. THE JUHP IN THE THIRD DERIVATIVE ACROSS TAU(2) IS FORCED TO ZERD.c(a. 1.. TAU(N-1). OF THE FORM C 11 C(4. GO TO 25 NOT-A—KNOT CONDITION AT LEFT END AND N .L.1PRECISELY.C.GE.3))/c(3.1)*s(1) + C(3. C(2.1) —((C(3.D.1 HEANs THAT THE SLOPE AT TAU(1) IS HADE TO EQUAL C(2.15...1) I 1. ALL I..2)*C(3. IN THE INTERVAL (TAU(I) . C(3. AssUHEDzT0 BE . HITH THE ADDITIONAL INFDR— MATION TAKEN FROM C(2.1).D.N. C c(3. J-1.I).. THE SPLINE F Is GIVEN BY F(1) . GO T0 is If .).. c(2.2. TAU IS AssUHED TO BE STRICTLY INCREASING. c(1. IBCBEG. IBCEND ) taeaoaoeeeeaoaaoaoeoueaa INPUT iitttttttttttteutnttttttttt N ..IBCEND..1. IBCBEG = 2 MEANS THAT THE SECOND DERIVATIVE AT TAU(1) IS MADE TO EQUAL c(2.1) .1))*C(4. (TAu(I).1) IF (IBCBEG—1) 11..A . IN THIS CASE.). 2.GT..1). HITH s(I) ENDING UP IN c(2. C(4.H) = TAU(N) — TAU(H—1) 10 C(4. IJE.1) .L (= N-1) = THE POLYNOHIAL COEFFICIENTS OF THE CUBIC INTERPDLATING SPLINE HITH INTERIDR KNOTS (DR JOINTS) TAU(2).4. C(3.N) =_BOUNDARY CONDITION INFDRNATIDN.N). AND K""4 . Piecewise Cubic Interpolation 46 instead of in the earlier way given in SUBROUTINE CUBSPL ( TAU. c L'=N"'1 I COHPUTE FIRST DIFFERENCES OF TAU SEQUENCE AND STORE IN C(3i. 12 C(4... TAU(I+1)). I=i.15 IF (N . AND c(2. IBCEND ...C(1.I)/3.N). I=1.NUMBER OF DATA POINTS.) IBCBEG .1) I 1. Do 1O H-2. COHPUTE FIRST DIUIDED DIFFERENCE OF DATA AND STORE IN C(4.... DR 2 HAS ANALOGOUS MEANING CONCERNING THE BDUNDART CONDITION AT TAU(N).I).) WHERE H .TAU(I)..1) . 2.N) I= ALSO.I)+H*(C(2. 15 C(4. IS GENERATED AND THEN soLVED BY GAUSS ELIMc INATION.c Coootoe A TRIDIAGONAL LINEAR SYSTEM FDR THE UNHNDHN SLOPES S(I) or c F AT TAU(I).GT..2) C .TAU(N). 2) GO TO 12 NO CONDITION AT LEFT END AND N = 2. SPECIFICALLY.1) GO TO is C SLOPE PRESCRIBED AT LEFT END.N) = AEscTssAE AND ORDINATES OF THE DATA POINTS.3) c(3.H REAL c(4.a) C(2.. IBCEND = BOUNDARY CONDITION INDICATORS.N.2) + c(a.*C(4.3)+¢(3.) ARE USED INITIALLY FOR TEMPORARY STORAGE.N c(3.I).)/2.. 0. Iacarc.DTAU. IBCBEG I O MEANS NO BOUNDARY CONDITION AT TAU(1) IS GIVEN. N. THUS THE FIRsT AND THE SECOND CUBIC PDLYNDHIAL PIECES ARE HADE TO COINCIDE.1).1) I C(3. .. THE FUNCTION PRDGRAH *PPVALU+ HAY BE USED TO EVALUATE F DR ITS DERIVATIVES FRDH TAU. SUPPLIED BY INPUT.DIVDFa.2)+2-*C(3. THE NOT—A—KNOT CONDITION IS USED. I.1)*s(2) = c(2.) AND C(4.. O OQCJQO O CJO CJOCJO CJ IO OGCI JO ‘ t INTEGER IBCBEG.I)+H*(C(3.i) .I)+H*C(4. SUPPLIED BY INPUT. I=1. _ (C(1 H) — C(1 M—1))/C(3 N) I I I CONSTRUCT FIRST EQUATION FROM THE BOUNDARY CONDITION. c(2.N—1))*S(N—1) + C(4.S c AT ITS LEFT ENDPOINT. I c(2. O) GD TD 22 c NDT—A-KNDT AND N .J) = (C(2.N) = 3. O) I GD TO 22 c NDT—A—KNDT AT RIGHT ENDPDINT AND AT LEFT ENDPOINT AND N =.*C(4.M)*S(M) + c(3.N) = 1. FRDH VALUE AND SLOPE AT ITS ENDPOINTS. D) GD TD 40 Canaan: GENERATE CUBIC COEFFICIENTS IN EACH INTERVAL.I) — c(1. ONE CAN GO DIRECTLY TD BACKSUBSTITUTION. IBcEEG ..N) = ((C(3.N)*s(H+1) = C(2.1) is IF(N .2) — C(3. J = J .N~1) A A + c<a.H+1)+C(3. AFTER WHICH THE H—TH c EDUATIDN READS C(4.N) IF SLDPE IS PRESCRIBED AT RIGHT END.N)*C(3.N) = C(3.H)*C(4.J) — c(S.N-1)—c<i.I-1) .N) c(2.H—1) + 2.N—1) C(4.N) + c(S.1) = 2.N—2))/c<a.-c(4. 29 C(4.N+1)) CONSTRUCT LAST EDUATIDN FRDN THE SEcDND EDUNDARY CONDITION.N) A GD TO so 2a G = -1.24 2e IF (IBCBEG .N-1))/G G = —G/C(4.*(C(3.H)) 2D c(4.E.I) — 2.DIVDFS)/DTAU 5O C(4.3 OR ALSD NOT—A—KNOT AT c I LEFT END POINT.I—1) + c(2. GENERATE THE CORRESP.The subroutine CUBSPL c I SECOND DERIVATIVE PRESCRIBED AT LEFT END.N) = (G¥C(2.N) = C(4. I.G = c(3. THE DERIV.J) I . DD 5O I=2. AND EITHER N.I—1) = (DIVDFS/DTAU)*<s. 3 . 16 C(4.I) DIVDFI = (C(1.30.N) CARRY OUT BACK SUESTITUTIDN so J = L 40 c(2. GD TD 2a c SECOND DERIVATIVE PRESCRIBED AT RIGHT ENDPDINT.*(C(3.AND.N-1) + C(2.i) = 3.N) = 2.GT.ED.I—1) = 2.1) = 1.2.N) c(2./c<4.GT. .ED.N-1) CDNPLETE FDRHARD PASS OF GAUSS ELININATIDN.EQ. SINCE C ARRAY HAPPENS TO BE SET UP JUST RIGHT FDR IT AT THIS POINT. 19 DO 2D H=2.1 IF (J .*C(2.GE.M) = G*C(3.#(DIVDF1 .N) = 2.*C(4.H) = G#C(2.30.N)*S(N) = C(2.N) I C(4. 24 c(2.*C(2.N) y C(4.M+1)/C(4. 3.N—1) + C(3.N)+2.J+i))/c(4.N DTAU = C(3.*DIVDF1 C(3.24 21 IF (N .N—1) c(2.I—1))/DTAU DIVDFE = c(2.N—1) GD TO 29 ' c EITHER (N=3 AND NOT-A—KNOT ALSD AT LEFT) DR (N=2 AND NOT NDT-Ac KNOT AT LEFT END POINT). OF THE FDRH c (-G*C(4.N)**2*(c<1. c(a.*G)*C(4.N+1)*C(4.2)/2.N-1) + C(4./DTAU) RETURN END .GT. 2) GD TO 25 C LF THERE ARE INTERIOR KNOTS.N)/2. GOO IF (IEcEHD—1) 21.N) = GAc(s.N))/c(4. EQUATIONS AND CAR- c RY DUT THE FDHHARD PASS OF GAUSS ELIHINATIDN.H). GD TO 2a 25 IF <IDcEND—i) 26.J)*C(2.c(2.M—1) + 3. 22 c(2.L G = —C(3.N) + C(3. 48 IV. Piecewise Cubic Interpolation Problems 1. Another popular piecewise cubic Iinterpolation scheme is based on choosing S, so that the tangent to f at T, has equal angle with the secant at T,_1,'r, and the secant at T,,'r,+1. Work out the formula for s, in terms of ['r,_1,'r,]g and [T,,T,+1]g. . 2. (The cubic Hermite basis) Prove that an arbitrary cubic polynomial p can be written uniquely as 2(2) = P(0)<P1($) + P(h)<P2($) + F’(0)<Fa(1=) + P’(h)<Fi(I) for given h =75 O, with- <F’1(11?) == 1'l'?J2(2'9"3)= 9-°2($) ?= ‘P1(h"'$)=1—‘P1($)= <F3(-I) == I(1—:u)2. <P-i(I) == -<F’3(h"$)i Hence, _: x/h III . _ P($) = 2(0) + (PU1) — P(0))a2(3 -— 22) + (P’(0)(1 — 11) — F’(h)a)=1=(1 — 2)3. (Error in piecewise cubic interpolation) (a) Use Problem 2 to Show that the error in a piecewise cubic interpolant f to g can be written H=9—f=Q—fH+E. with fH the piecewise cubic Hermite interpolant and 'Tr+i-I-1? E(ZE) It (fi"('T'.£) 93—'TIi -— @‘II(’T'-,'__|_1) ($"-Tr)('1"r+i -'11‘-F), AT- T, 5' :1: _§ 'r,+1. Note that e"(T_,) = g"('r,) — s_.,-, all 3'. 2 (b) Conclude from (a) and from (6) above that, for a sufficiently smooth 91 ll9—'fIll 3 ll9-fHll +lTl1'11@-X1 l@I('Ti)l/4= 01' 1 ug - fll = <2 (Fr) + mg»: l@I('Tr)lO (IT!)(c) Prove that, in general, piecewise cubic Bessel interpolation (with prescribed endslopes) is (9 (d) Prove that Akima’s interpolation scheme (for example, with prescribed endslopes) is O . (e) In the incorrect first run of the program for the Runge example (8) with piecewise cubic Hermite interpolation, we have max, |e' (1-,)| m 3.25 '\. Problems . 49 regardless of T, hence (b) would allow only the conclusion that = O (|T|), yet the numbers showed = (9 Explain! (Hint: Show by additional printout that, for the range of Ti. considered, the maximum error occurs in the middle interval that is centered around zero, then Show that |]E]| = (9 (Ih2) on that interval [—h/2 .. h/2], because of the Systematic nature of the error in the slopes). 4. Adapt the experimental program in Example (8) to ca.rry out piecewise cubic Bessel interpolation (with prescribed endslopes). Then verify that the error in Bessel interpolation is in general no better than O (|T|3) by interpolating g(:r:) = :1;-3 on [0 .. 1] on a mesh T that is uniform except for one site, say the first interior site, that is twice as far from its left neighbor than from its right. _ 5. Adapt the experimental program in Example (8) to carry out Akima’s interpolation (with s1 = ]’T'[3,’T1]g = g"(T1) and s,, = [T,,,T,,+1]g = g"(T,,_)). Then verify that Akima’s scheme is, in general, no better than O (ITI2) by applying it to g(:i:) = 2:2 on [O . . 1] for a uniform T. Also, appreciate the effect of a nonuniform T by interpolating g(T) = £132 on ]O. . 1] on a mesh derived from aI, uniform one by moving every other site halfway toward its neighbor on the right. Look at the error! 6. A common approach to cubicispline interpolation expresses the cubic piece P, in terms of its values at 'T',;I and ‘T’-,-;_|_1 and its second derivative, m, and m,+1 at T, and 'T,;_|_1, respectively. The free parameters m1,. . . , m,, are then determined so that P§'__'1(T,) = P.,-_’(T,), i = 2,. . . , T1 — 1. (a) Derive the formula corresponding to (4) and (5) for this approach. (b) Determine the linear system for the m,’s. (Remark: I have given preference to the approach in the text because it relates cubic spline interpolation explicitly to a host of other piecewise cubic interpolation schemes.) 7. (Convergence of complete cubic spline interpolation) (a) Use the techniques of Chapter III to show that the solution (s,);"1 of (12) for given S1, 3,, satisfies maxlsrl S I11='1X{l$1l= "PS1 lbrl/("fi1+1'T-=I—1)=l$r=l}1 1--'.._1.<11. (b) Conclude that the complete cubic spline interpolant satisfies ll (I-i9)Ill S 3-75 U1_};1f§nllTr=T¢+1l9l(Hint: show that (lI4Q)'II('T,_|_1/2) = -%[T,, T,_|_1]g—-— (s,+s,_|_1)/4, with T,;_|_1/2 := (T, + T-,_|_1)/2. Then use the fact that, for p E 1I<3, max{ |p(:r:)| : a 3 :1: 5 b} § (5/4)max{ |p(o)], |p(£l-'-‘II1)],|p(b)| }; see Problem II.4). (c) Deduce from (b) and from Problem III.2 that Ila’ - (I49)’|| 5 4-75 dist (93 $3). J 50 I IV. Piecewise Cubic Interpolation In l '1' I with $3 I= E C(1) [T1 . . Tn] I fl],-i___1-‘+11 E I1.-Q3, " ' (d) Deduce from (c) that ]]g-I4g]] Q (19/8)]T]]]g ]], in case g has a bounded first derivative. l 8. Derive (17) from (2), (3), and P{”(Tg) == P§”(Tg), then derive (18) from (17) by an appropriate change of variables. i 9. Here is the cumulative distribution N = N (age), i.e., as a function of ' ' ' ' ' t vals age, of Bulgarian women giving birth, tabulated in five-year in er age 15 20 25 80 85 40 45 50 _ N 0 7,442 25,703 41,088 47,535 49,758 50,209 50,268 Fit these data with. a cubic spline, using CUBSPL and the end conditions ' ' h h' to ram f"(15) = f'(50) = 0. Then draw f’ on _]15. .50], and also draw t e is g or piecewise constant function that, on ]_T, . .’T',;_|_1], has the value (N ('T',_|_1) N(T,))/5, with T, := 10 + 5i, i = 1, . . I. , 8. Compare with Figure VIII(2). This example is taken from L. I. Boneva, D. C. Kendall & I. Stefanov [1971]' I . , it i. .l FF‘ V Best Approximation Properties of Complete Cubic Spline Interpolation and Its Error We show that the complete cubic spline interpolant f =' I4 g to g, constructed in the preceding chapter, minimizes _fIIII(1I'£)]2 dzr over all twice differentiable functions f that agree with g at TU, . . . ,T,,+1. This is the property that gave rise to the name “spline”. We also show that the error H9—hmUS@UflH- Consider again the data sites ' a=T@=T1<---<T,,=T,,+1=b. In the preceding chapter, we constructed for the given g its complete cubic spline interpolant I4g for those data sites. To recall, I4g agrees with g at (T,)E‘+1 (in particular, (I4g)" = g’ at ‘T1 and T,, since ‘T9 = ‘T1 and T,,+1- = T,,), and is a cubic spline on [rt . . b] with interior knots T2, . . . , T,,_1, that is a twice continuously differentiable, piecewise cubic function on [D . . b] with breaks ‘T2, . . . , ‘T’,-,__1. We denote the class or linear space of all cubic splines on ]a. . . b] with interior knots at T2, . . . , T,-,_1 by I ‘ $4. We derive the various best approximation properties of the complete cubic spline interpolant from the following simple lemma which relates the interpolant to least-squares approximation to its second derivative from $3, the linear space of continuous broken lines on ]a. .b] with breaks T2, . . . , T,.,_.1 as introduced in Chapter III. (1) Lemma. If g is twice differentiable, then the second derivative of the interpolation error e := g -— I4g is orthogonal to $2, that is, 5 (2) /I e”(:i:)<,o(:r:) d:r: = 0 for all rp E $2. I PROOF. The customary proof of this lemma uses nothing more than integration by parts and can therefore be supplied directly by the reader. 51 .41 52 V. Complete Cubic Spline Interpolation t (3) FIGURE. I II_I_I__—I>IIII The function f (:r:) = (:1: -— t)+ In anticipation of material in subsequent chapters, I prefer to prove the lemma via the integral representation for the second divided difference, as follows. From Taylor’s expansion with integral remainder, we have _ h(:i:) ‘= h(a) + (:1: — a)h"(a) + /IIII (:1: — t)h”(t) dt for any twice difierentiable function h. Since the second divided difference of any straight line is zero, we obtain I <4) Il’Tt-1,’?"r,’Tt+1]h' = A-,_,.»»~.=.»i-5.11 / (A - t)h”(r)d1f, ‘where the divided difference on theright is taken of the function of :1: defined by the integral. Note that the independent variable :1: appears in two places there. In order to simplify things and take the divided difference inside of the integral, we introduce the truncated function (:1: —— t)+ := max{O,:r: —— t}, depicted in Figure With this function, we can write :1: b j (:1: — t)h”(t) dt = j (:1: — t)+h”(t) dt, for a _<_i :1: § b, and so may rewrite (4) as 5 5 __ ['I-»;‘_._.]_, ’T,j,7',j_|_1]h -'= _/I ]T,;._]_, T5, 7'-,;+1](f.II -" fI)_|_hIIII(t) Zf where H, is the piecewise linear “hat” function III(16); that is, I:-r£(t) 1: .2l’T-i-1-.-‘T-r.,'T~i+1](113 T ?5)+ 2 - (P3 T T‘I—l.)/AII'III‘I—l.$ Ti-1 <13 S To = I‘+ 1 "1 ('T,;_|_1 —- 1'2)/A’T'{, ‘T’, _‘§ ll ‘C ‘T-5+1, O, otherwise, Smoothest interpolation property 53 is twice a second divided difference of (:1: -—-t)+ for each fixed t as a function of zt. Now, since the interpolation error e = 9 — I49 vanishes at all the 1-.;’s, its second divided differences at these sites are therefore also zero, that 1s, b 0"-: ['7'-;;_1,’T'4;,’T'-_g_|_1:l€ Ff A Hi(t)6:!(t) Cit, = 1,...,1’1-. Cl- This shows e” to be orthogonal to each of the n functions I:I1, . . . , Ill“, and, since these span $2, the lemma follows. El (5) Theorem. (Pythagoras) For every twice continuously differentiable function 9 on [a . . b], b <6) b f [g"<w>1”¢1== f [(I49)”(=v)]2d1=+J/b[(g—I4g)”(:1=)l2d1=~ PROOF. s ~ We have b _ f [g”(¢)l2<1¢=/ [(I49)”(*)+@”(¢)l2d* = f [<I.1.g>'*<¢>12d¢+2/ <I4g>"<t>@’*<¢>d¢+ f [@"<¢>1='*d1r_ H ab b b But f:(I49)”(t)e”(t) dt = O by Lemma (1), since (I49)” E $2. El (7) Corollary. Among all functions f with two continuous derivatives that agree with the function 9 at the sites rb,...,r,,+1, the particular t function I49 uniquely minimizes fa [f”(t)]2 dt. PROOF. For any such function f , we must have I4 f = I49, therefore, from Theorem (5), . b b b / [r**<t>12d¢= f [<I4g>”<¢>12d¢+ / u*'<t>—<I4g>"<t>12dt U U L1 4» Z fbl(I49)”(l5)l2d'5= and the inequality becomes equality if and only if f” = (I49)”, which U because of the interpolation conditions, is equivalent to f = I49. Z}-I“ - .. I1 - ,_._.._-_-n._iI- 54 V. Complete Cubic Spline Interpolation T1113 iS the smoothest interpolation property of cubicl spline inter1 the strain polation. The function f = I49 minimizes (approximately 011 y.) energy “ [f”(¢)]2 L [1 + (r~'(t>>215/2 over all function curves passing through the given data. In this 3sense I4 9 s spline approximates th e p osition of a flexible thin beam or draftrnan _ forced through the given data. This is the reason ' ‘H behind Schoenberg’s [1946] choice of the words ‘?spline” curve and “splme function. (9) Corollary. The second derivative of the complete cubic spline inter- polant to the function 9 is the least-squares approximation from the space $2 of broken lines to the second derivative of 9, that is, U49)” == L2(9”)PROOF. Let s E $2, a.nd take h(:r:) := f:(:t -— t)4.s(t) dt. Then h” == s, and h E $4, consequently I4h = h and so (I4h)” = la.” = s and h — I4h = 0. Therefore, substitution of 9 —- h for gilin Theorem (5) g1ves b b tr f [9”(==)—s(==)12 d1== f [<<Ilg>"—s>e~>12d@:+f Kg-Ilg>”<a=>12d:= 2 /blg*'r(9-F) -' (I49)”($)l2 C11’ with equality if and only if (I49)” = s. Hence L_-;(9”) -—-= I49”. TlAn alternative proof is based directly on Lemma (1). We know by that lemma that there are coefficients (a4)? so that (I49)” = E1 ax,-H5; and f:(9” —— za4Hj)H4 = O for i = 1,...,n (with Hj given by lIl(6)). But these last orthogonality conditions can also be written }:(]H4Hj)aj =‘/‘Iii.-,_=_g”, ‘Ii.-=l,...,TL, :i=1 e" which, on comparing with III(10), we recognize as the normal equations for the determination of the least-squares approximation L29” =- Z3, 0:, H_.El, t0 Q” fI‘0H1 $2. _ The corollary comprises the best approximation property of comolation. As a bonus, we obtain at once from plete cubic spline interp Theorem lll(12) that \\(I4Q)"\\ S 3\\Q”\\ and that, for a function 9 with four continuous derivatives, \\@"\\ = ug" — <I4g>"\\ ;<. 4 die <9". $2) :.<. Q-\T\2 \\g'1*> \ » i-r u-|—u Thus \|e|| §_ %|'r|2||€”ll . we then have |@<1=>| 5 (AT. Actually. _ ||9 — I-=19|| 5 "ér |'Tl d1$t(9'=$s) in case 9 is differentiable. in (T4 . (11) ug .5(c)).g|| s R-|T|"'*||g<“>|| in case 9 has four continuous derivatives.$2> s 5 |T|"||g“”||- Actually. we recall from Problem lV. PT-3 g I g ‘T-5+1.7 that 19 (14) .1.g>"|| s 4 d1st(g”.1"-¢+1)e”(C. Therefore.8.-.an 5 ~.$g). t-l1E-‘I1 6(5) = ell?) + (I1? -' 7-i)lTi:7'i+1l€ ‘l’ (1'17-.1).' Best approximation property 55 From this. as proved by Hall [1968].. For a twice continuously differentiable function 9. which proves (10) Corollary. 'r44. for completeness.‘§ %|'r|24 dist (9”.'»"t+1=-iiile = 0 + 0 + (I — 'e)(=r —.1@'*(c>|/2.>.$-. Finally... I 4 Cubic spline interpolation also provides acceptable approximations to derivatives and is therefore a popular means for numerical difiemntiatioa.45+. 5 < _ < 1 3) ug .’Ti)($ — ’1"i+1)l'*"i~. we obtain a bound on the maximum interpolation error ||e|| as fOllOWS. 1 2 - nr Therefore._. We saw ‘already that (15) 1 ng” — <I.-. and the constant (5/ 384) is best possible.911 _ ./2>2 £11.+r| 4 ug (4) u. . |»»~| ds (9 . as proved by Hall & Meyer [1976] (see Problem 2(c) and Problem Vl. Hall & Meyer [1976] proved that (16) rr or 3 I 2 "9 —(I-<19) ll S §l'*"| |l9 (4) ||- . 1 <12) s llg-r. from equation III(2).~=)/2 for some Q. 1 = 2._.-. then minimize over s.QKT-5/(‘T-1+1 -. (a) Prove that (ei) satisfies the equation 64e§___1 + 2e’.. see Hall 8-: Meyer [1976].5. with h(:1:) := s(t) dt and s E $3 arbitrary.__1).5)..) 2. <17) Hg’ — <I._1 .56 V. (Hint: By IV(12). one order higher._1 = L34 With 5-.~\»r|**|\g<="*>1\..1. (Proof of (13)) Let ei := e"(¢4).(I49)(3)ll 5 §(M1' + 1/MT)lTl|l9(4)ll= with the global mesh ratio MT given by (22) MT := __1min 1... and assume that 9 has four continuous derivatives. Problems 1. Derive (14) from Problem IV.=-“...»<\g’<»~>.-11-|"':|g<4>l\ and. Complete Cubic Spline Interpolation Also... + (1 — 54)e§_.. quality of approximation to the third h derivative y may depend on the spacmg of 'r. the. Finally. (Hint: in Problem IV. from Problem lV.2.g.—1 Ari. L-L == la.a>'|\ s § d1st<g’.6-£)(At)3g“’ (<. that is.'.‘")1/24. I..‘" e [1-..‘T-.(-Aa-1)3g<4>(c:> + (1 . Somewhat more effort shows that 1 (20) ll?’ — (I-49)ill 5 52 lTl3ll9(4) ll an d th at this estimate is best possible (see Problem V1. ri4e‘§__1 + . substitute 9 — h for 9.fl.n .(I-¢. all i. <18) ' m. for a uniform 1'. even <19) m§w<l9'(e) .-r4+1]. and g..$3> while. with e := 9 — I49.<I4g>*<e>1 s -.I=Q)’(T-il s §.7(d).7 and Problem lIl.7(d). from Problem 2. by Problem 5.. Hall 8:: Meyer [1976] show t at 1 (21) H96) .. t=1.)9'('e+1)— 3(5i['e-1W-:19 + (1 -. as introduced in lIl(8).-.=. Then use this expansion to show that.. h]F’-:..) 2F’(O) + F’(h) -. then use the mean value theorem for integrals and the fact that [0.3[0. even maxi |e§] 5 |*r|4||9(5)||/60.1. 6. 5.r2+[0.. . h.. h]F = 5 F”(0) + 1 F<4>(0} + 5F<5>(g) _ 2 24 60 for some Q between O and h. Now .)) (b) Use the considerations of Problem lV. Prove that. prove that ' 3 - 4 2F’(0) + F’(h) .Problems 57 2812 + (1 — 51)@E+1 = 5i9’('e-1)+ 29’('e) + (1 — 5-i.(for example.54) [r.g F”(0) + (ha/24)F(“)(§) for some Q between O and h.n. 'ri+1]9).n.. 3. .3[0.._ = b.. for a uniform 1"._. _ (b) Conclude that e is the error in the complete cubic spline interpolant to $4. Derive the identity (e) in Problem 2(a) above in the following way: Integrate the identity F"(:x:) = F"(0) +F”(O):r+ [0. Carry the expansion (=1=) in Problem 2(a) one step further. for every piecewise continuously differentiable function 9. complete cubic spline interpolation at uniformly spaced data sites gives O (n"4) approximation even to the slopes at the data sites. b b b f [g'a>12d¢= f [<sg>'<1->12d=r+ f [<g-r-. Letn:=(i—-1)/(n—l). that is. h..6(b). at the sites a = T1 < .+1. |e£| = O (n"4).:r:]F" = i(F’)’”(§)/3! for some Q between O and h (if :1: is in that interval).0. (a) Show that the function e(:1:) := (:1: — r4)2(:t — r..verify.f for some f E $4'is called a monospline of degree 4. is ofthe form :r4—f(:r) for some f6 $4.. the fact that...i==l. all i.g>*<=1=>12d=1=- .-. O.. Identify the linear system lll(11) or Ill(15) with the linear system derived in Problem lV. :r:]F’$2 (:1: — h) (obtained from Theorem l(14)) from 0 to h. Let I29 be the broken line interpolant to 9.*O._1)2. 4. A function of the form 11:4 ——. h]F = ..< T.. by Taylor expansion or by Problem 3). In words. 1'4 jg :1: 5 'r.3(b). (This fixes a flaw in the argument for (13) given in Hall [1968]. 7. and then use.7(a) to conclude from (a) that m-as lezl s lrI3l|g“"|I/24- (c) Prove (13) from (b) using Problem lV. Then conclude that the overall error in f’ as an approximation of 9’ (with 9($) = 9:4 in this example) is no better than O (n‘3) even though max.. for a sufficiently smooth function F. (1. i 1 -| I ..I l-1-! _ I = " .53 V. b] $1 '= '' ' -1th breaks ‘T2 T '1s line interpolation Conclude also that brfiken TH--1 “smoothest 1n the sense that fa[( 2 _ _ . Complete Cubic Spline lnterPDl3-HQ“ -. ‘I l 1.iSe constant functions on [a . ' th ta eewith9at Tp1ecew1se continuously differentiable f 3. frOII1 ConclFdFJ:hat (I22) $ }L1£9gl1W. 'th L least-squares approximation.gr w ~.ieceV.-= ~ 2 ' t 2 Ig>*e>1 dw 5 " * )]2<1@.= for an Lb‘ (I l '|' I I l. which leaves one degree of freedom for each piece still to be determined. In the process.43.-. so as to make the interpolating function f a parabolic spline. We take this degree of freedom in the form (2) Pi(’F¢+1/2) = 'vt+1-. i -= 1. The reader is familiar with the resulting interpolation scheme in a somewhat disguised form: If we integrate the resulting piecewise parabolic interpolant f for 9. we discuss briefly interpolation by parabolic splines in order to make the point that. . Another idea is to determine '04. . Suppose first that we proceed exactly as in the construction of a piecewise cubic interpolant in Chapter IV.. .n. — 1..1 == 9(r4+1/2) if the latter numbers are available. In order to derive the resulting linear system 59 . i = 2.n.n. We‘ choose the interpolant f to 9 to consist of parabolic pieces.- with Tt+1/2 3: (Ti +'Ti+1)/2: and now look for ways of choosing these numbers '02.. .14. 9(r. Then (1) - Pi(Ti) = Q(Ti)=- P1:('Fi. it might be advantageous at times to interpolate at sites other than the breaks. We could determine these additional parameters from some local considerations. .-. . . that is. we could choose 1. i = 2. in piecewise polynomial interpolation. . . . . 1144.. we comeupon the exponential decay of certain influence functions. f(:r) = P4(:r:) on 1'4 5' a: §_ 'r4+1 for some P4 € 11. . we obtain a general form of Si1npson"s rule for ff 9(a) daz. We begin again with given data 9('r1). and expand on this in the problems. as well. so as to make the function f continuously differentiable.+1) : 9('Ti+1). . .4. thus interpolating 9 at the sites 'r4+1/2.4 = b. For instance...) at data sites a = T1 < .VI Parabolic Spline Interpolation In this chapter.< r-. "' Si:-1)/2 The continuity of the first derivative of f is therefore ensured if1 for i = I 2. of 11-2 equations in the n— 1 unknowns '02.-"+1 "' 5i'l/A71 with the abbreviations ‘ SI 1 = lTi1'Tt+1/2lPi = ('Ui+1 *. . n — 1. . 'T1'.T4 _ i—'L-m.'l't — -—-—u m.. Further.+1)/2- A reordering of the terms produces the linear system 4'04. . .__1 and vanishes also at a and at b.(AT4'_/A’T'4.. .-1- In order to understand the one remaining degree of freedom better. .._]_)'U4'_. . We abbreviate the right side of the ith equation of (3) to b4. and then obtain simply _ ’U-5+1 1-"' '... .. then the system (3) is uniquely solvable for 113.9('l'i)l/(A'-"i/2): "'--a. Pl_1('Ti) = P{('a) mu-— m- or (35... Z 2. .-—um . .*v. consider twointerpolating parabolic splines f and f determined by (3) from the same data. . .-.— -1—m -—un |-mr (3) = (3Q('?'i) + 9('Fi—1)l//51%-1 + (39('?'i) + 9('?'i+1))/15%» i=2.'n—l.'Ti)($ "' t-. b] that vanishes at its breaks '1-2.+1 i: l'7'i+1/2="'i+1lPi = (9('-"i+1) " 'Ui+1)/(A'*"i/2)- Then Pi("'i) = Si + (‘Ti + "'i+1/2)($-1-|-1 " Si‘)/A73 = (35: “‘ 5+1)/2= Pi-1('Ti) = $1.. . r4. .r + (I1? .+1/§)(s. .m? .4'0-4+1/A. " $El_1)//5"?--1 = (35.BU VI. 'Ti+1/2lP. . Their difference d=r—f is then a parabolic spline on [a . d(Ti+1/2) = “(AW/ATi-1)d(Ti—1/2) = (-li-1(A'*'i/A'-"1)d('T3/2)- . . explicitly by some additional condition."i3"-"iI-iLiw-—-1-u—u-rmI-I- *'3.+1l-Pi = Pi('T=-1)+ (11? " Tilsir + (91 .'Tr)(I1? "r ‘T-1+1/2)['Ta ’Ti+1/2. Parabolic Spline Interpolation for the numbers v4./AT-t—1 -l.rm— -1-$_-. from (4). _ 5i‘-1)/2 = (3-iii _ 3.-4.4. . we write P4 in Newton form Pt(I17) = P-£('7'1:)+(fl3 — Tt)l’7't~. 112. .'v. .1 + (‘Ti v ‘R-1 + Ti r" ‘T1-1/2)(~‘-‘F. If we now determine one of the unknowns. but with different choices for the parameter '02. for example. Instead.n.4. Of course. '01.4"-1 which then pins down each piece and makes the resulting f continuous. then we are back to the scheme connected with Simpsonis rule mentioned earlier. all i. . for uniformly spaced data.'i (5) f($)—J€(11‘=)=lJ'("’s/2)xJ?(Ts/2)l(—)£'1P(($—'»'"i)/71) 011 ‘Ti 5.1: § §4+1. with the breaks £1.._|_1 chosen so that 51 Sf1='»"1<§2 <'="s<§s<'Ts<'-'<'F-a-1 <§-a<'?"a=b$§-a+1For instance.1)h. by Subbotin [1967]) choose the breaks midway between the data sites. .1.1:) = H(a:) o11 £4 § . that is.§. . . . .f(:r) due to different choices of the one remaining degree of freedom also reflects the fact that the linear system (3) fails to be strictly diagonally dominant regardless of how we pick the required additional condition. We choose the conditions (7) Pt(§i) = vi: H(§i+1)= 'vi+1i 5-='—' 1-1 . for 1-4 = a + with h := (b — a)/(n -1).'v4. . . i = 1. . that is. ..IF 5 Ti+1 with p(:1:) := 4:1':(1 — :13). we do assume now that E1 < a and b < 5444. .1 by interpolation. -i . . . for some P4 E 114-3. - - £4: =1?-1/2 :('Ti +11-1)/2. we might (as first proposed. v4 = 9(§4). . we have 61 .---4"- The interpolation conditions impose just one condition on each polynomial piece. 'v-44. we chose '02.1. .Parabolic spline inteiipolation at knot averages Therefore. 11444. This behavior of the difference f(a:) —. . . are chosen. regardless of how these additional parameters. 'Pl3(T'-'1) =g(T'i)1 1-1"'1n' We are therefore free to choose two additional parameters per polynomial piece.. . If we choose the parameters '01. . . This shows that the choice of '02 affects the resulting interpolant f more or less equally in the entire interval and should therefore probably not be based on some local datum such as the ___value of 9 at some additional site. all i. i=2. in the case of uniformly spaced data sites. I . We do not encounter such difficulties if we construct the interpolant instead in the form f(:.._ to make f again a . We derive the requi. we get the divided diiference table for P4. after collecting terms.§i)C2. Pi(§i) = Pi-1(€i) or 5'-ii + (£11 -' 7'i)(3-l'—+1 _ 5-ii-)/Aft = or.ass‘ + (I .1 where (9) 01. n. §i—1'-=1 —iE'I"Si"'(1 + "Ki-'.t>o:.+(1 * sol + §i—’Ti _ ___O -* . for i =-= 2.1)-" W)/(Tl -" fill. $111 *=' lTi=€i+1lPi = ('*»'i+1 — 9('Ti))/(§i+1 -" Ti). in terms of which (8) Pi(5i-7) - + o .. —.1: = 5-ii -I-(£1: — 7-'£)c3.-i = vi: 62.1: = (5-._+1 _ Si‘)/55+ .'.-.G2 VI.'I'-I f-13. . 5i"-‘Ti-1 6i—’Ti-1 -l" (‘Si * Ti—1)(3-I _ Si-1)/Agi-1 A . so as to make f’ continuous. . From (8) and (9).t + (11? — §t)2<-13.. we obtain " P-i(§i) = Si + (Q — '1'-:)(5f+1 "' Si)/A51 and _ Pi-1(§-i) = Si--1 + (5% "' 5-i--1 + 5-=1 4 Ti——-'1)(5l_ *“ sir-1)/A£i—1 = 5? + (511 -" Ti-1)($-I " $i-1)/A§i-'-1The continuity of f’ is therefore ensured if.as .Tl . Pi($) = + (:3 _' €i)l€i1TilPi + (3: _ — T1‘-)l£i17-‘ii S-i-+1lPi' From the data (6) and (7). Write P4 in Newton form. that is. .site equations for the 'u4’s as follows.-i + (11? .5:‘)/as = C1. . §i '01: ‘ Ti 9('T¢) ‘ 82“ _ ($i+1 '" Sir)/Afii Si+1 5+1 '11-1+1 with the abbreviations 5-I == l€a'T-ilpi = (9('1'-. Parabolic Spline Interpolation parabolic spline. _+1 and decays exponentially as :1: decreases away from b. that is. and vanishes at 1-1. that is.. .. One verifies directly that..and 1 . § :1: 5 §.\/§ = -5.- i= 21---1'-*1.'r. b].§. p(:r) := 2(/\ + 1):r2 — (3.=a+(z—1)h.. the function d1. 'r. . but has the value 1 at §. . hence safely solvable for TU2...+1 . .+1 -"' Ti)- Note that (10) isstrictly column diagonally dominant. The function d. Also. _ is a parabolic spline with breaks £2. is then also a parabolic spline with breaks §2._. w1thh:= (b—a)/(11-1). EH1). we now consider the effect of a particular choice for '01 and 'v. .~ all i. ... 3 §. and choose the breaks midway between the data sites. A := -3 . on by Gauss elimination without pivoting once we prescribe the two free parameters.£-H. then their difierence is necessarily of the form *1-‘ Ifiq-q_4rt. '01 and v.828427 .)/h)//\i"‘1 on (E...31 — 'Af5". .-.. with A the absolutely larger solution of A2 + 6/\ + 1 = O..Parabolic spline interpolation at knot averages 63 After appropriate reordering of terms. dn-F1 == P((€-1+1 — $)/h)//\“+1_i 011 £1 S I 5 €¢+1-. . . on [cc . all i.+1. . d1 decays exponentially as :1: increases. .=.. If now f and )3 are two interpolating parabolic splines obtained from (10) from the same data but with possibly different choices for '01 and 'u._+1. ...'1-.. obtained by reflecting d1 across the midpoint (a + b) / 2. For this.6-£ I= 1/(5-.. . . .')’1Ji + (. this gives the linear system <10) 1 (01?-1.:-1 + 1 1 1 + I31-1-1-<11 + E.§.6dn+1 .Z-g:1")'v-. where we have used the abbreviations OH i= 1/(‘T1 — Q)» .=o+(z—-§)h. that vanishes at all the data sites 1'1.+1 on the interpolant from (10). .\ + 1):1': + .\..31-1)9(Ti-1) + (fit + !3i)Q('»"i)-.+1.. by a factor of almost 1 / 6 per interval (5. In order to demonstrate the promised contrast to the earlier scheme of parabolic spline interpolation at breaks. all 2.. we choose the data sites again equally spaced. _+_ f_f=ad1+. and has value 1 at £1. given by (11) d1(:1:) = p((:1: -—.)'v‘f+1 =(CIi-1 + . .|-T4 I 1... ?:=2. Problems 1. and d-n..+1(§1) = d1(§-n+1) = 1//Vi.g+]_ —"£»i. <21 = 1.__'H arbitrary.8 satisfying -:»d1(a) + ._]_). f <1d1(§a+1) "1" J3da+1(§a+1) = 5'va+1 I: f(E-n+1) _ . one might choose 111 as the value of g at £1.lF(£n+1)Since d1(§1) = d-n.. was introduced and thoroughly studied by Marsden [1974] from which all but (d) below are taken. with appropriate changes.-.~ I (A€i)2f($) = 2(I . too.‘Til/Afii + l9('Fi)|4l$ "" €i|l€@+1 — I-'1'=i/(A€~s)2 3 2\|9||-) (d) Deduce from (c) and from V(21) that 1 s llg — Iayll S gl-‘El “Q (3) ||—|. i=' Ar:-5/(€. and denote the resulting parabolic spline interpolant (with v1 = g(§1}. Let 1-.64 VI. in which case one ends up interpolating to g in value and slope at a = 1-1. Typically. respectively. that is..+1(§a+1) = 1.8 m 5'0. We conclude that o: m 6'01 and .@d.'F—i)('*»'¢($ — 5+1) + '¢»'i+1(I_.—u—-I—-_ .+1(a> = 5111 := r(a)—f(a). Parabolic Spline Interpolation with o: and .. with £1 < < E. that |J°(1"*~Y)|‘£(1'11f~Xl'va'|)2\-'1-‘F . using (b). for §¢ £5-17§£i+1-.+1 only affects the interpolant f “near” a and b. show that. every one of the ways of choosing the additional boundary conditions in cubic spline interpolation discussed in Chapter IV is. for uniformly spaced data..n. applicable here. This one might do even in the limiting case when £1 approaches a == 1'1. then infer. However.. 'Un. at sites halfway between breaks.. the idea and the analysis go back at least to Subbotin [1967].-. = (5. Parabolic spline interpolation at midpoints.. In fact...TL—' (b) Use the diagonal dominance of the linearsystem in (a) to conclude that maxi ivil 5 21113951 l9("'£)| (With To = E1» '*"n+1 = §a+1)(c) Conclude that even ||I3g|| 5 (Hint: With_-f := I39.+1 : g(€n+1))t0 g by I39- (a) Verify that (10) simplifies to 51111-1 + 3% + (1 — 51:)'U11+1 = 4(5-i9('T:'.—in—u—\_-—. This shows that the choice of '01 and v.. It therefore makes sense to derive these parameters from local considerations.50) +9('Ti)4($ — €i)(§i+1 '" 11?) (recall the Lagrange forml).1.-1) -1' (1 — 5i)Q('*"i))1 51..|. + 5+1)/2. _(.7. that is. 1] to all of IR via the functional equation E. .)" = Ef__1 and <p.. Verify that E1(:1:) == :1: — 1/2._(a: -I..4. are characterized by the fact that E3‘ (:r:) = 1.-.. .(:r:) vanishes at -%. E2(:'t:) = 2:2/2 -— :1?/2.1 = 'r.— for even n. IE I _ lEn(O)l-.‘F. rt. é-“+1 = Tn. real or complex.._.. (c) Verify (by induction on n) that E.. E2. is a close cousin of Scho_enberg’s Euler spline £.f. ..(-é-)]..... ._ = E. + 'r.. for example. (Euler splines) The parabolic spline (5) is an example of a (scaled and shifted) Euler spline (see. . . .|.VJ'1th £1 I ‘T1. ELIICI fl’ = Q1 3.) 3.. and determine an appropriate const. - 4. (Hint: V»/ith f = fgg.-. 1] to all of IR by the functional equation E.1111)- .TL '-1.(:1: + 1) = )\E. Let Abe the extension of Ei‘. establish the tridiagonal linear system for the quantities si := f’(§.. Schoenberg [1973:Lecture .. Conclude that En is strictly monotone between its extreme values that occur at the integers if n is odd and at the half integers if n is even. = E. Schoenberg [1973:Lecture Let A 75 1 be a number.._ has n — 1 continuous derivatives. be the extension of E.‘. Thus. = (Ei +§£+1)/2. if E. for n > 0. What does that imply about the scheme in Problem 1? (b) Simplify (10) for the case when 5. i = 1. Ei‘..if n is odd and at 0 if n is even (and positive) and nowhere else in [0 .\ = -1.)\E. are characterized by the fact that E0(:r) = 1 and. for . A Er./E. gfor example. EL. neven. ..-.. E3(:z:) = $3/6 —:r:2/4 + 1/24. = ET. and construct E4. .) := (E-n(1)+E..($ .t=(E). Ploblems I 65 2.'|._ on [0 .. (b) Let Ea._ can be generated as En = E — <.<:=> == (—)l=1E..1)/2. and for n > O. E1 .-ll ‘T1 ELHC1 Tn.§. Prove that E. .._..= fa“ E.(O))/(1 — A) = 0. EQ.(f*1) == /\mE§._(O))/2 = O.. (E.(:1:)._) := . 8.(O) for odd n. . In particular. E. .(E. Precisely. then E.. The parabolic spline (11) is an example of ai (scaled and shifted) exponential Euler spline (see. .<$ . (c) Prove that ||g —— 1139]] § const]'r|||g’ I].-. i = 1. on [O .+1/2 := (T.-._1 and <p(E._1(t) dt.. f r 1 I _. Thus.. I "IT |E.".__1 is already known. .).(:1:). 1). then proceed as in Problem IV. with E(:t) . (a) Give a sequence 1" for which there does-not exist E so that 1'.-. all i.~ Tl-Odd. we get again the Euler polynomials of Problem 3.i‘. 13-“. The /X-Euler polynomials E3‘. that is.1) =_--E. and 5'. Call the resulting interpolant fgg.Ls).— (a) The Euler polynomials E0. (a) Construct C1 (for example. on [r .+1 = Ea at 1 and n. Consider complete cubic spline interpo- lation at the sites T-5 = t. .1 continuous derivatives. n (with T9 = 1.-.:r)3.. 6. Verify that. for large n. then determine A so that = 0 and compare the resulting exponential Eulerspline with the function d1 in (11). i = 1. 9-I49=E4+O()‘i)1 while ||s. and E2“ is the exponential Euler spline determined in Problem 4.. has exactly one solution and that. .._. and for g = E4.1 the Euler spline of Problem 3. 1 < :13. . A (b) Construct E3 in general.-= E5.. Infer (by letting a -a oo) that the constants in A/(13) and A/(21) are best possible. n and C0. - O § :1: £ 1. r + 1]. the cubic spline that vanishes at 'r_. A1 and A2. 1: = 1. for all j at i and has the value 1 at 'r-1. (a) . C'(—:r:). In particular._+1(:r) := —-do ('n. = n).(h) at 0.__. 11._+.($) % — with h := |1‘] and C the cubic spline with breaks at the integers and of the form C(1?-7):: (. 5.'. verify that the function C is a cubic spline.84 aha ||s1||/||s¢. Let do 1.@d:.. .<1>/da<1>(b) Conclude that I..+ 1 — zr).Verify that da.-1+1 analogously defined.1‘IEg1($). .] I49 = 9’("'1)C0 + Z 9(T1'-lci + 9'(Tn-)0-n+1= ‘i=1 with C. - Here. d. Conclude that. . + . (c) Construct also Eg‘ in general. then determine A so that EQ (O) = O. dg(n) = r1.. rt . the system ad.|| = 1/24. . _ (c) Let n = 21-. . with E. (V(13) and V(21) are sharp). crE§‘(:r) + (1 —..+1 e $4 and that 113(1) = _d:.+1(1) = dB(1)A'i""'1. C’. A <—>"-ls = Q s E:. r < O. Parabolic Spline interpolation (a) Prove that has n .||/||sg?>|| = 5/2.1.66 VI.) = ado + otz.. 0: := 3/ (EQ‘)!(0). by CUBSPL) for a uniform 1' and verify numerically that C.. There should be two solutions.. Wflte the complete cubic spline interpolant in Lagrange form. with A2 < -1 < A1 and A1 = 1/Ag.(E.“ (with A1 as determined in Problem 4(c)) and set d. . -= E g('r. 7.gives about 1% accuracy. Specifically.=+1. ‘ . a piecewise cubic function with two continuous derivatives.)C(£7+'§). show that r é 4.. for Tj _-_'§ x g T.Problems 67 that is. (b) Conclude that a satisfactory approximation to the cubic spline interpolant L1g at a uniform T can be obtained by the local scheme (fificg) (r) :. Develop such a local scheme for parabolic spline interpolation of Problem 1. J‘-'F<'iSJ‘+"‘ (see Buneman [1973]). I-l II‘I_FH\|I-__lI|i“._llrlIli-_.|\-_Il1 I. I‘III _li\r1|l_r‘|l_.___fl_I| I _l___-I -__1I_.l_-P|l_1.|r‘I _rl|_1r-1‘JI‘I .Il1|____Ill.1|_W. :.. We retain these two points nevertheless as part of the specification of a pp function since they specify the interval on which such a pp function is originally defined. as extended by (2). PPVALU . The points £1 are called the breaks (or. and the pp function f could be defined without any reference to them. strictly speaking. Also. Piecewise polynomial functions Let E := (§.<f. f .€1'1 1f€l+1§$- With this.+1].P1 is any sequence of l polynomials.+1 be a strictly in- creasing sequence of points. that is. away from the original interval [£1 .. . may reflect 69 . and let k be a positive integer. If P1.)l. . and which we will refer to as the basic interval for that pp function. . fl and <f1+1 are.l. we discuss in this chapter ways to represent piecewise polynomial functions of arbitrary order in a computer. For this reason. each of order k (that is. It should be noted that (2) amounts to extrapolation. Therefore. ._last piece. we think of such a function f as defined on the whole real line IR. Whenever convenient. INTERV Experience has shown that piecewise polynomial functions of order higher than four supply at times much more efficient approximations than do piecewise parabolic or piecewise cubic functions. we use the point §1 in the “ppform H to be described below... especially when the breaks are chosen properly. i=1..<rr<¢f1+1. not breaks. of degree < 1:). then we define the corresponding piecewise polynomial or pp function f of order ll: by the prescription (1) f(:::) := P1(1:) if<f. 2 ( ) 1 := P1 1 {F10-17): _ :1: < . by extension of the first and the. .VII A Representation for Piecewise Polynomial Functions. We begin with a formal definition. breakpoints) of f. For definiteness and in order to obtain a (single-valued) function..._-11.. we use (2) for convenience and not because of any inherent quality or truth..70 \- \ VII.. . some derivative of f is discontinuous and is a pp function so that this point has to be discussed and settled in any case.. with l = 7._1(§1) it gets from the left piece and the value ffif) = it gets from the righ. namely the value f) = P. At the (interior) breaks £2.t). . (4) f(g. In a sense. . Of course.§1. .f a ‘I .z. A Representation for PP Functions S‘ P1 ' 1'" 1' £1 l 52 £3 l |'*'lP2 (3) FIGURE..t piece. Its dimension is kl since each of its elements consists of l polynomial pieces and each polynomial piece has k freely choosable polynomial coefficients (see Problem 4). the function f is as yet undefined. e PI 5: §z+1 P4 A pp function of some order._. the original intent of its construction as badly as would the product of any other extrapolationtechnique. unless f consists of just one polynomial. To reiterate. but we will nevertheless think of them as being the same pp function. moot point in case the function f is continuous. broken at the same sites.5 is a linear space. We denote the collection of all such pp functions of order lt with break sequence £ = (§1)f]+1 by H<1.9. It is clear that l'l. As already implied by an earlier remark. that is.) ._. Abstractly..<. if one is made right-continuous and the other left-continuous. ..= j(g. then they may not agree at the breaks.£. this becomes a. fort: 2. the pp function f has two values at such a site. We will continue nevertheless to think of the pp function f as having two values at each break. Of course..5 is the direct sum of l copies of Il<1. It follows that two pp functions agree iii’ they consist of the same polynomial pieces. But. II.. the programs below arbitrarily choose to make f continuous from the right. we consider the jth derivative A D5. 51. in part because...1§.-4.c. l'~i..+1...==oH. \ A pp function can be represented in a computer in a variety of-ways. the definition has to be treated with care in the context of the fundamental theorem of calculus.+1 or :'i==l and§1§:. The pp function f satisfies _f(:..t).r:) — f(a) =f dt for all :1‘: H if and only if f is a continuous function.. say).. To be sure. that is. In return. for example. The ppform for f G 1'1. respectively. . (5) Proposition.1 of its breaks. The first derivative Df of a piecewise constant function f. the value of the jth derivative D9 f of f at a site :1: is found (in PPVALU) as (7) ' Di f($) = ftii i Qm. the ppform in the SPLINE TOOLBOX (de Boor [199O]2) stores differently normalized coefficients and stores them differently.551. as mentioned at the beginning of Chapter I.fc<§-_. .=1.?=1 .. . . the strictly increasing sequence £1. giving order and number of its pieces.(g. j=1.4. and the matrix C = (Cj.l::.3' with the same break sequence and put together from the jth derivatives of the polynomial E pieces that make up f.i($ '.£i)m—j/(Tn — where (with the earlier conventions) i is the integer such that (8) either: i=1 and :1‘: < E9 or :1-<i<land§.. I 1- ' I In_ terms of these numbers. This definition avoids a lot of fancy mathematical footwork when it comes to a discussion of the derivatives of a pp function at a break... i=1 of its right derivatives at the breaks.I Piecewise polynomial functions 71 of the pp function f to be the pp function of order k -. therefore equal to the usual derivative of the function f if and only if f is actually a constant function.1):.1. then the following representation seems most convenient and efficient: (6) (i) (ii) (iii) Definition. .-. Q-. If such a function f and some of its derivatives are to be evaluated at many sites (for graphing purposes.ATLAB stores poly- .z. is identically zero by our definition. the numbers c. consists of the integers it and Z. THE FORMULA ABOVE FOR THE JDERIV—TH DERIVATIVE OF F IS THEN EVALUATED (BY NESTED HULTIPLICATION)..K. cuss.COEF(K.. I. FHHJDR = K .X.CDEF(J+1. K.. 501' 51 S 1* < €t+1- i=1 The following MATLAB statement would convert such an array c into the corresponding array C needed in this book’s ppform: C = (c(:. x. SPECIFICALLY.) co T0 as . 1 X.I)/(K-3-1))/(K—J—2) .JDERIV DERIVATIVES OF ORDER K OR HIGHER ARE IDEHTICALLY ZERO.. A S S U H E D TO BE ZERO OR POSITIVE.k:—1:1). JDERIV ) ' CALLS INTERV CALCULATES vatus AT x or JDERIV—TH DERIVATIVE or PP FCT FROM PP—REPR C Canasta I H P U T eases: C BREAK COEF L. some one-dimensional array BREAK containing § and some two-dimensional array CDEF containing the matrix C.l). if c is the coefficient array in the ppform of some pp function f of order lc generated in the SPLINE‘. TOOLBOX (de Boor ]l.. FHHJDR. (CUEF(K—1. for the evaluation of a pp function or its derivatives according to REAL FUNCTION PPVALU (BREAK. I ...I) + H*( ....LE. IS FOUND THROUGH A CALL TO IHTERV . L. nax( J .arepmat(cumprod([1 1:k—1]). APPROPRIATE FOR F AT X.NDUHHY REAL BREAK(L+1).I) + + H*CUEF(K.THE POINT AT WHICH TO EVALUATE... The subroutine PPVALU It follows that a FORTRAN program for the evaluation of a pp function requires as input the integers lc and l. res J—TH DERIVATIVE or F IS crvss BY F (D**J)F(K) . Explicitly.. 0. J .1.. 1 . K. JDERIV.BREAK(I).M.’. ' eases U U T P U T senate _ PPVALU.L)..990]g) and with break sequence E.LE. AND BREAK(J) .LE.72 VII.INTEGER GIVING THE ORDER OF THE DERIVATIVE TO BE EVALUATED. 1 . )/2)/1 WITH H .. x .I) + H*(CUEF(J+2.x ..LE. then k flit) = Z °(i=J')(1‘-‘F -* ftlkfija.L..THE VALUE OF THE (JDERIV)-TH DERIVATIVE OF ' seen: M E T H U D assess THE INTERVAL INDEX I . Here is such a function subprogram.H PPVALU = O. L ) )..FORHS THE PP—REPRESENTATIOH OF THE FUNCTION '10 BEIEVALUATED.’). I = HAX( 1 . A Representation for PP Functions nomial coefficients in order from highest to lowest. Oflflfitzfi fizfiflfifl fi fifl fi fl C c INTEGER JDERIV.. IF (FMMJDR . . then it would be more efficient to have-available the polynomial coefficients cji since this would avoid the formation of. the 10-loop in PPVALU would have to be changed to something like the following: ' DD 10 M=K. DU 11 M=2.m+11. I.I) i I II and these would be special cases.I) 10 FMMJD = FMMJD — 1.-1 := Dj“1f({-3')/(j — 1)! in the ppform allows for a uniform treatment of the function f and all its derivatives during evaluation. I) = c3-J simply by DD 8 8 M=K. .. given below.JDERIV+1.1.(:1: — {fi)'"""3'm!/(m — j)!.I) H=M-1 FHMJDR = FMMJDR . Fitir the general case of computing DJDER“f(X) for JDERIV > 1. and division by. Some people have objected to the use of IN‘I‘E‘. 51 :1": < §H.GT. . X.I) and the value of the first clerivativeT‘Df of f by no 9 M=K—1. .1. evaluation of the jth derivative for j > O would become much trickier since D-'*"f(1:) = 5M1‘ {'21 . for 5. L+1.The subroutine PPVALU C C c 9 es 73 FIND INDEX I OF LARGEST BREAKPUINT TU THE LEFT OF CALL INTEHV ( BREAK.1. EVALUATE JDERIv-TH DERIVATIFE OF H = x — BREAK(I) X .) - GU TU 9 RETURN END The choice of the derivatives Cfi = D7"1f) rather than the usual polynomial coeflicients cs. to place the argument X within the break sequence.1.—1 9 “ PPVALU = PPVALU*H + FLDAT(M)*CSMALL(M+1. If one is merely interested in values of f.—1 PPVALU = (PPVALU/FMMJD)#FLUAT(M)#H + CSMALL(M. H==K I—TH PULYHUHIAL PIECE AT _ PPUALU = (PPVALU/FMMJDR)*H + CUEF(H. On the other hand. IF (FMHJDR .—1 PPVALU = PPVALU#H + CSMALL(M. 0. contending that the added efliciency achieved is not worth being 1 .JDERIV 11 PPVALU = PPVALU#FLDAT(M) PPVALU uses a subroutine INTERV. the numbers 1. One would compute the value of f from the coeflicients CSMALL( j .1: — 1 when evaluating the function f at a site (thus cutting the work in two). . NDUHHY ) I .RV in PPVALU. xT(ILn+1>.BUTH IHTEGERS.. IT(I+1) . AFTER HRIGH UE USE BISECTIDH TD GET IN ADDITION ILU+1 = IHI ..LT.. MFLAG ) CUHPUTES LEFT . ASSUMED TU BE NUNDECREASING LXT..as long as it is effieient. DTHERHISE.xT(LxT). X. THEN.AND. instead. T . It may happen. ' ’ O O OGO DOGO GOLEO O O O GO O O O CIO . . THE FIRET GUESS FGR |LEFT' Es THEREFORE TAKEN T0 BE THE vALUE RETURNED AT THE PRETIGUE GALL AND STORED IN THE L 0 c A L vARIABLE ILU . xT(LxT) .LE.EQ. I have nevertheless kepti‘. . X . 0 INDICATES THAT X LIES OUTSIDE THE CLOSED IRTERFAL xT(1) .NE.HUHBER DF TERMS IN THE SEQUENCE KT .LE.LT. RE SET LEFT = ILU AND ARE nous AFTER JUST THREE COMPARISONS. ##1##: H 5 D U T P U T MFLAG. XT(I+1) .LE. xT(I) . XT(LXT) . A FIRET CHECK ASCERTAINS TRAT ILG . X IN PARTICULAR. LIT.LT. XT(I+1) . x .LT.LT.LT. LEFT .LT. though. xT<LxT) . THIS HILL HAPPEN. RITE x TARER FROM AN INCREASING UR nEcREASING SEQUENCE.LE.EAK(I + going into the binary search only if this test fails. XT(LIT} .A REAL SEQUENCE.LT.LE..EQ. THE ASYHHETRIC TREATMENT GF THE INTERVALS IS DUE Tc THE DECISION TD MAKE ALL PP FUNCTIONS CONTIHUDUS FROM THE RIGHT.INTERV ( KT.. A possible alternative would be to carry out bisection (or.. binary search) directly in PPVALU. ##### H E T H U D ###### THE PHUGRAH IS DESIGNED TU BE EFFICIENT IN THE COMMON SITUATION THAT IT Is CALLED REPEATEDLY.-jINTERV since the problem it solves comes up repeatedly later on and since I cannot see how its complexity could be of any concern to the user.EQ.74 VII.ILD Is THEN RETURNED...THE POINT WHOSE LOCATION WITH RESPECT TU THE SEQUENCE KT I5 TD BE DETERMINED. C###### I H P U T ##1##: C XT. A Representation for PP Functions saddled with a routine as complex as INTERV appears to be. BUT.. The subroutine INTERV Here is airoutine for determining the interval index I for X with respect to the break sequence <f.MAx( 1 = C xT(I) .LT. E.. SUBRDUTIHE.Gi.. X . in which cii-Ase I would make use of the routine PVALUE. LEFT.. UF LENGTH LXT .EAK(I) '5 X < BR. discussed in Problem 1. HHEN A PP FUNCTION Is TU BE GRAPHED.TLG URILE ALsU RGFIRG ILU AND IHI IN THE DIRECTION GF x . XT(I) KT(I) KT(I) XT(1) . MFLAG . THERE Is THE OPTION 0F RAvIRG THE COMPUTED PP FUNCTION GURTIRUUUG FROM THE LEFT AT xT(LxT) . One could even bring in one of the features of INTERV. x ) . x . BY RETURNING MFLAG = 0 EVEN IF 1 . namely retain the interval index I fiom one call to the next and first test whether I < L and BR. MFLAG = 0 Is THE ’USUAL' cAsE. LXT (THIS IS HECEssART SINCE THE PRESENT GALL HAY HAVE NOTHING T0 no UITR THE PREvIDUS CALL).. HHUSE VALUE IS — -l4r4h1H- ###*## IF P*C}QJ* IF IF IF X . xT(TRI) . UNTIL xT(IL0) . IF xT(ILc) . that the interval index I appropriate for a given I is obvious from the context. HE REPEATEDLY DOUBLE THE DIFFERENCE ISTEP = IHI .LE. IF (X . IT(LIT)) MFLAG = 0 LEFT = LIT 111 IF (LEFT .LE. XT(1)) **** NOW X .GE.MFLAG.LT. C C xT(IRI)) xT(ILU)) GO TO 40 GO TO 100 sass NON I .GE . xT(ILU)) ISTEP = ISTEP*2 35 ILO = 1 IF (X . XT(ILO) IHI = ILO ILO = IHI . 1) IF (X . xT(LxT)) IF (Lx T . TOOLBOX (de Boor [1990]g). LT.ISTEP.GE . RETURN xT(LxT)) RETURN GO TO 111 END The problem of locating a site within an increasing sequence of sites is solved quite differently in the SPLINE‘.GE.LT.The subroutine INTERV INTEGER LEFT.IT (LIT) DATA ILO 11/ sAvE ILO IHI = ILG + 1 IF (IHI . X . ILO)" ILO+1 NOTE.GE.EQ .GE. 1) GO TO 20 GO TO 11O GO TO 90 ILn = LXT — 1 IHI = LXT C 2O IF (X .LT .ISTEP IF (IL O . REAL K. LXT) IF (X . 90 HFLAG = — 1 LEFT = 1 RETURN - 100 HFLAG = 0 LEFT = IL O RETURN 110 MFLAG = 1 IF (X .LXT. xT(IHI)) .LT.LT . IT IS ASSUMED THAT MIDDLE = ILO IN CASE IHI IF (X .EQ. IHI = LIT C ILO TO CAPTURE X IHI TO CAPTURE X ISTEP = 1 31 C C DECREASE xT(LxT)) GO TO 35 GO TO 50 GO TO 31 GO TO 90 GO TO 50 INCREASE GO TO 45 GO TO 50 GD TO 41 GO TD 110 RARRUU THE INTERVAL **** NOW XT(ILO) .LE. KTCIHI) C 40 ISTEP = 1 ILO = IHI 41 IHI = ILO + ISTEP IF (IHI .LE.GE . xT(MIDDLE)) ILO = MIDDLE 53 IHI = MIDDLE GO TU 53 GU TO so GO TO 50 Cast: SET OUTPUT AND RETURN.LT. 1) LEFT = LEFT — 1 IF (IT (LEFT) . LAT) IHI.EQ. in .HIDDLE IF (X . ISTEP = ISTEP*2 45 IF (X .ILO. xT(IHI) 50 MIDDLE = (ILO + IHI)/2 GO TO IOO IF (MIDDLE . . 1 ). then the above command produces index = 4 1 5_ 2 6 3 7 8 Since XI(1:L) comes first in 3. produces the desired I = 1 1 2 3 3. for our example. we know that. in index. the numbers 1. I = max(find(index>L) — (1:1ength(X)) . X(1) < XI(1). the MATLAB command j=:E ind(index>L) returns the positions in the sorted sequence of the entries from X. Hence. which.X) in nondecreasing order. in the sequence index.L refer to entries of XI. and we can achieve that using the max function to ensure that we get at least the value 1.index] = sort([XI(1:L) X1).3. Therefore. For example.2. . which is exactly the sequence we want for this example. j (i)-i. XI (j (i)—-i) is the breakpoint closest to X(i) from the left. In our example. This therefore requires the determination of the correct-index sequence I for given site sequence X with respect to the brealc sequence XI.4).1. if XI (1 :L) = (1. This is accomplished (in sorted) by computing first [ignored. — except for that initial 0 which tel-ls us that there are O entries of XI(1:L) to the left of 11(1).index] = sort([XI(1:L) X1). equals the number of entries from XI to the left of it. ignored = s(inde1-T}. while the numbers greater than L refer to entries of X. . Altogether.3) while X = (O. . which supplies. it supplies. hence encourages the ‘simultaneous’ evaluation of a function at all the sites in a given sequence (or matrix). the information of how to reorder the sequence s to obtain that nondecreasing sequence ignored. the entries of the concatenated sequence s :=(XI(1:L).76 VII. the corresponding calculation I = find(index>L) ‘ (1:1ength(X)). the only reason why X(i) would not occur in position 1 in the sorted sequence is because there are entries from XI to the left of it. that is. the difference. this gives the simple command sequence [ignored. assuming X itself to be ordered. we want to use the first break interval. A Representation for PP Functions part because there one wants to talce advantage of the fact that MATLAB provides vector arithmetic. . So. hence j(1)—i is the index we are looking for. in ignored. of the position of 11(1) in the sorted sequence and i.. More importantly. Precisely. gives I = 0 1 2 3 3.2. In fact. For such 1(1). K. FUNCTION PCVALU -I BREAK. Write an abbreviated version FUNCTION PVALUE( XLEFT. JDERIV ) with PVALUE as constructed in Problem 1.X $ l(T(j) } }. a modified version of PPVALU that we will call. in case you know already the interval index I appropriate for rs‘? 2. given that a pp function is to be considered. COEF. and use it in PPVALU in place of INTERV. X ) that would use Problem I. 3. K. K.Problems 77 Pré blenis 1. m=1 I-Iow would you use it in place of PPVALU to evaluate a pp function at some 1:. L.I). K. L. X. Consider the problem of making pp functions continuous from the left. perhaps.. L. K. alternatives of your own.min{j : 1 5 j 5 LXT. contained in BREA-it. X. given the ppform for f in BREAK. Possible solutions: (i) Write a subprogram SUBROUTINE INTRVL ( KT. and PPVLLC altogether. MFLAG ) FX = PvALUE (BREAK(1).1- I (iii) Give up on PPVALU. JDERIV ) of PPVALU that returns the J DERIV-th derivative at X of the function f given by f(:r) := COEF(m)(:z: — XLEFT)m"1/(m — 1)! . K. FUNCTION PPVLLC ( BREAK. but decrease I by one in case X == BREAK(I) and I § 2.) I-Iow would you construct the more .7 to evaluate a pp function from its piecewise Chebyshev fo-r"m. E- Both and (ii) require. MFLAG ) that returns LEFT = n1in{LXT. COEF. and IOFX equal to INTERV or INTRVL depending on what is wanted. (This corresponds to the ppform for f except that now COEF(-. CUEF.I) contains the Chebyshev coefficients for the I-th polynomial piece. X. LEFT. at times left-continuous and at times right-continuous. Write a . ' Discuss the relative advantages and disadvantages of these approaches and propose. but evaluate f by two subroutine calls: cALL IOFX ( BREAK. L. COEF. LXT. (ii) Continue to use INTERV in PPVALU. for later reference. in the some program. COEF(1. CDEF. X. in effect. JDERIv ) . L. I. K. .. (f+Q)(f-'3) 1= f(:i:)+g(:r:).5 is nonempty and is closed under addition and scalar multiplication: f. Such linear independence is invariably shown by exhibiting a corresponding sequence A1. with the property that every f in II_. that is linearly independent... (You may take as given thatf .. aigo.5 is a linear space . that is.) (b) Verify that dim l'I<. This is not really a problem for anyone familiar with basic linear algebra.._._ = O.. for some (P1 ii ' 1 ..-. that is.. For hand._ of linear functionals for which the matrix (}t_.....i. A Representation for PP Functions general routine that would also return the value of some derivative if desired? 4. for which Z cap.< EH1.-_. the7‘ pase + at invertible that is.._.-5 is a linear space of dimension n := kl. the -collection IRE of all real-valued functions on IR is a linear space i ' ' ' ' ' that is. g E l_I<. . vector addition and scalar multiplication are defined point-wise.= f (If. that is. 1'I. ..o. all or E IR. The proof requires the following (standard) steps: (3) VBIify that TI 4: 1.0fl-1 all in l'I.. = O is possible only if oi. (0) Verify that dim1'I<. Then it is only necessary to show that II.i:.5. that is both generating‘ and linearly independent. .-.<. . you must exhibit functions (. ozf E l_I. is triangular with nonzero diagonal terms. (This requires you to show that l_I<... or GIR implies f + g. .r(f(:. Prove Proposition * I ._-5... f = E. .5 consists of exactly all possible linear combinations of certain n functions.. that is._5 2-_ n.) Note: it is possible to combine (a) and (b) by showing that l'I.. = .i:))._. a sequence cpl.5._¢.. .¢i. (This requires you to exhibit a function sequence Q01. you might consider the linear functionals A given by A] .... l'I.L 1' I ii 78 - VII. j = 1.._-5 can be written as a linear combination of them. The bonus of all this work is a basis for the space.. .5 is generated by n (or fewer) functions. all functions _f...oi.-. (o:f)(:r:) := c.1 suitable coeficients (o:. IR. 5... Prove that.¢..: 11..i. ...-... with E1 < . Jk... all :2: £1.== c.. .). . that is.5 is a subspace of IRE.g..<..5 _§ n = kl..n) is obviously ' ' ‘ . . ...<p. . Parabolic “area matching” spline approximation to a histogram..5 that satisfies the same conditions g is known to satisfy (see Chapter XIII— XVII for exam—ples).. and the Truncated Power Basis The typical computational problem involving pp functions can be stated as follows: We are given som._-...5. the function f is to have a certain number of continuous derivatives... homogeneous conditions leads to the subspaces 1'I<_.. In this chapter.5.... In addition.VIII The Spaces II<. and point out its failings..-_'. We begin with an example.5. A (1) Example: The smoothing of a histogram by parabolic splines (2) FIGURE..__-5.e information about a certain function g and are required to construct a particular function f in l'I<i.. of II. Formalization of these latter... Some people object to histograms or bar graphs and would draw a smooth 79 . we introduce the somewhat popular truncated power basis for the space 1'I<.. and computational efficiency demands the construction of a convenient basis for these subspaces. .-..-.f(Tn+1)=0- _ This gives altogether n + 2 interpolation conditions and 2(n — 1) homogeneous conditions. for a total of 3n conditions on the 3n polynomial 3 1" coefficients ( C5. . 1'3 . a continuous pp function of order 3 .. But. that is. then we would have g(-i)(T1) = g(J)('i'. The Spaces II.1].C22 _= continuity ofUD f across 1-Q '2 C712 + C22 9231 + C32 fig-3' = ii-2 area matching on [T2 . := 'i'....1 = area matching on [T1 .AT. The usual interpretation of these numbers is that MAT. So we impose the additional interpolation conditions .-_. This means that we are given sites A 'r1<T2<---<T. ..Tt....-. 1..f(T1):..-=1. the height over the open interval ('i'. and choose the break sequence E to coincide with the sequence 7'... .+1 A and (usually nonnegative) numbers hl. .). One can argue the P oint whether anything (other than msthetic satisfaction) is gained by the procedure...i1..80 VIII.’I'. .3-----= U _ continuity of _f across 1'3 C22 + C32-QT: l = U continuity of D f across 1'3 --ti ---Etc_ ' El ._.. 1'3 2 C'12+C22-4312 +C'32£.. and the Truncated Power Basis curve through them as a more satisfying representation of the underlying distribution g whose sampling produces the histogram.+1) = O for j = O.with a continuous first derivative..-._I<3. is (approximately) equal to the integral of the underlying distribution g over the interval [T. suppose we are given such a histogram and wish to smooth it._|_1 -— 1"._.. If the underlying distribution g is smooth and vanishes outside the interval [T1 .. ’l=I. : 0 interpolation at -r1 a 2 C11 + C21 9% + C31 —-. .. It therefore makes sense to demand of our smooth version f that it satisfy the “interpolation” conditions f T-i+'1 f(ar:)dG::=h. all 21. with h. h2. 'r. to.. ...).£ Fl C(1). 1'._|_1). = U 2 C11 + C215-Ti + C31 9-$1 — C712 C21 + C311-5T1 hi continuity of f across 1-Q —....=1 1'n the pp form for the function f (recall that C._. y We choose the function f to be a parabolic spline. f G I. := D9"1 f <3) C11 The resulting linear system has the following appearance.the extent of the smoothness of the distribution g.._|..1] (recall that AT. Incidentally. This means that two-thirds of the equations that make up (3) could be solved once and for all. ‘ There is really no objection to determining the solution of such problems by solving liiiear systems such as (3). except for the fact that such systems contain many homogeneous equations..'1 Almost block diagonal linear systems 81 Schematically._. We identify the subspaces of interest first.0g. and each satisfying all the homogeneous conditions.. this linear system has the following almost block diagonal form (all nonzero matrix entries are indicated by a ><): -.01. One accomplishes this reduction by constructing a linearly independent function sequence (.. .<_ X XX X X XXX XXXX XX X XXX XXXX XX X The package SOLVEBLOK given in the Appendix is designed to solve such systems efficiently. andfthe above construction amounts to finding some basis for that subspace.. .__-5 satisfying these homogeneous conditions). In effect. iX.(. For instance. Z “TWA Ii with the coefficients (oi._. .: Laurent [1969] and Munteanu Sc Schumaker [1973] for such systems also use Gauss elimination with partial pivoting._¢ (namely the subspace of all functions in 1'I.XX X _____. and then give a basis for each of them.. is two-thirds homogeneous. the factorization methods of Carasso 3. by Gauss elimination with partial pivoting. .. the homogeneous conditions tell us that f is to belong to some subspace of 1'I<. Our function f is then found iii the form .<_..-) determined from the information about g. but in so cleverly disguised a form that probably even their originators didn’t notice this. leaving a much smaller system (onethird the size of to be solved for any particular g. with as many entries as there are interpolation conditions. x{:Ir -— t. Recall from V(3) the definition (G: — t)+ := ma..¢ satisfying (4) for a given vector :1 is a linear subspace of l'I<.. . and is continuous at § in case r > 0...e 1. and I "'4 J‘ 'i=2. (pg.. As the conditions (4) are linear and homogeneous... and the Truncated Power Basis The space lT< 1... .._. we need a sequence (pl. The reader should verify this fact if it seems unfamiliar._Dj-1f=O for j=1. 1 The function _f(:1":) := (:1: -— §)'j'._‘"1..32 VIII. We denote this subspace by I A H<k!£Iy ' In this notation. all in l'I<. that is. while._ is a piecewise polynomial.£..— .¢. O}. 7' = O.i/.£_.. for r = 0. Since D(. of size rl. at 5. with a jump in the rth derivative across §...... can be written in one and only one way as a linear combination 2 Ob‘ ‘Pi _ :i of the sequence (pl.€. ._<i... .. we need a bests for it....5. In particular._.. and such that every element f of l'I_. of order r + 1 with just one (active) break.. in computations.i:)T...l.. .5.k. we see that — has 1' — 1 continiious derivatives._..2)..E. of siz. q We now have a convenient notation for the set of all pp functions satisfying certain common homogeneous conditions. ‘ The truncated power basis for lI<.§ and lI_. the site o-". for some vector 11 := (i/. . certain number of - continuous derivatives... .)g of nonnegativeiintegers.5..— §)"f.. ..§)"f. Here. The typical homogeneous conditions require that the pp function f E I[.. = O means that we impose no continuity condition whatever at 5. We write these conditions in the form (4) jump¢. it has a jump across 5... if we are to make use of this space II. i .. we are using here the abbreviation (or linear functional) (5) iumpaf == f(01+) — f(e_) which is read “the: jump of the functioili f at.. . . Further.. 2.-_-_.r:+)". But. ix.. . of functions. counts the number of continuity conditions required at §.¢ be constructed to have a..3..... with 1/ = 2 := (2..5._._ = r(.._ := (:. (pg. 1/. the subset of all f E II. The Spaces 1'1. the set of parabolic splines needed in the smoothing of a histogram earlier becomes the set II... or across. 1. . in terms of which we define the truncated power function (:. i=1.: — §)}./jg.__|.. It is clear that each function (p.i'_ = O for :1‘: < O.. in general. A Thus.|I -m. In particular. lilo” H if is T O ift='rai'1dj=s. = 1 for r > 0.~ by _ . .5. as proved in . Also. is in l'I. _ .m:_ lPi"‘|- 1 -_ (6) FIGURE._ = 1.5_. That being so._. = 0. it has._£ and I'. = (0+)9. we are free to define it...-) is linearly independent.. (fl-"—§ilj/3'1. . (8) A ___66 _{1. i= =5: l\'Jl—'* 'li. T S3 ..The truncated power basis for I'I. If it is evaluated in PPVALU. but for :1: 5 0 we would need to know the value of O0. while PPVLLC would give (0)1 = (0-)9. What about (:r)P.lDjf. .._ is a pp function of :1: even for r == 0 and...... _ 503'. Now define the linear functionals }\. §)f. . (1: — §)'['. (:r)'§. . 6(:i.. and corresponding functions (p._.._. as follows: 0°==0.5 has dimension kl.._. With this. is determined by its polynomial pieces and break(s). from what has been said already. _|_."'I-u-| for j = O._ Dj"(€ ). two values at its sole break.[_. lo -1._5.. ._.) consists of kl functions and II<i. 'i= 2._..Z. then (0)9. we have (3)9. Piaf '_ {jui'iip. something undefined. Since ((p. <Po'($) -= {(3. otherwise This shows that the double sequence ((p.._. (7) . as a pp function. In I The functions 6(:I: — §)g'_. . as evidenced by the fact that each is the derivative of its neighbor to the right. . . U1 " -—-—-—--R :1: —-+-e EFF‘)- U"Y"|-A--m{---I-. 3(:i: —. ._._. (:1: — Note the increasing smoothness across :1: == §._'? Since do = 1 for any nonzero a. .. and £-=2.. l'inearly de p endent on the others.i- m m m m for our problems involvAt first gl an ce .l jumP€iD f '- ¢—_i_‘ -. by (7) and (8). we ave s » 1 .-1 m——-1.. The Spaces Il. t.<.D~'*r>(I £. that every f G II._.|..<.)"l.. of the various derivatives of the func- Now note that the jumps ' l' 'tl as coefficients in the f across the various breaks appear exp zcz y tion representation for f.. 12ff) of the truncated ' will ' also result in ' b adly conditioned linear systems (analogous power basis ' ' h s ect to the truncated to the system (3)) for the coeflicients of f wit power basis. two complaints come to mi (9) wit l ' (i) The value of f at a site r can involve considerably more than just it l o f the coefficients if Z is “large”..) . This makes the enforcement of the constraints 10) ="-1 -0 forj=1.. ..j<k Z r<i><a>(@: .. the basis ((p..VIII......'¢... Here..<._-5 has a unique representation of the form ' f = Z:(>v:'f)<Po iii and that.. .i/..) _ . ' 'nd: ' h th e pp form VII(6) .. 4 .. This possible bad clondttton (see pp. can be written in exactly one way in t e orm I I I h f '4 | I = EM.=<Pi_-. some of the basis functions (p. .-... function f in II. -— -m mm- ' t attention to those functions f of the form (9) very easy: We simply restric _ ' h d uble sequence for which t hese coefficients are zero.5./J' ! i=2j<k E m——-..or/ii + Z §j(iump. ficients might produce much smaller or much larger changes in the func ion represented.become y (ii) ll charges in thenear coef.7 "' 1.1:-1 and t==2..... this repr esent ation can be written quite explicitly I (9) re) .. every is a basis for II._-....M- Q t_..seems tailormade _ h s But in comparing the representation ing pp functions of some smoot nes .. " For very nonum'form § .. mu-Ln.l _ __ h et If ‘== O In other words...1"‘ . This means that t e o or set) (Fiji '--ix-F ... and the Truncated Power Basis is a basis for II.5. re p I mmrm . This means that sma . we conclude that ((p-. This means Problem V II ._-. and 0:. If. ' - . )6 = O.3. . .3H4(:I:) + 2..1 9... El For this example. then we obtain o: =1. This leads to loss of significance in the evaluation of the function f. .8 = _f"(§1)= O.I<2..4H5(:i':) + . .1 instead of the correct 1. 1). such that f(<f. the remedy is obvious: Use the hat functions III(6).4 and f(<f.+ 1.4 85 " 1. ifs S 93 <1 §i+1i otherwise. As h := A55 becomes small. we get (:1:-—§5). We choose the breaks (£1)? as indicated in Figure (12).5 and £6 = 4. and. I-Iere.. . Now l PM _f(r) = 1.5 £1 and som..1 (12) FIGURE. C156 = 8. o:5 = -8. o:7) = (1. 1. -2.85.~ +1 '-' 11'?)/Afr.79..) = 1.1. Therefore _ I ' re) = A + so .3.3 '= - 02 .1/A54.’s are zero. (13) Example. ‘we choose 55 = 4. so that h = . we use some 50.1/Age + 2. we get the value 2. with :1 = (1. CB7 = —.8.£1) + Zoo .5..- .3..1 3._.2. . H.~ . while all other or.e £12 2-_ £11.-.2. that is. ~ (:1: --§.on 2 ‘I and 0-: = 1. all t. -1. ——cc5 ~ O65 >> 1... and we use two significant decimal digit arithmetic (with rounding. . .(:r) = 9*@"i3. a tie going to the__neai'est even number). The truncated power basis can be bad Construct the function f as a broken line.1/A55).2/h. .3.2H5(:.r:) + 1. f G I. .. except that f(<f5) == 2. given by the rule "T ‘ft-1/Afr-1-. = O except that (or. correspondingly.Example: The truncated power basis can be bad _ 2.) -= .€ |"lC(°)._. ‘fr 510 IT: 6. - 52 <54 I 1. If we then evaluate f at :1": = 9.2. “We have f G lT_.3H1(:i:) + ."‘ l 51-1 < fl? S Er.)_.1/A54.1 ‘ A broken line that causes difficulties for the truncated power basis. 0:4 = .3. for example..3H7(:T:) + .2/h — 1. . £3]? (d) Use (c) to get a basis for II.. Show that II<_3.9) + 1..£..£. HI!’ . 3..9. with 2 := (2.2).. 1. with 1...5_3 ( you might need Problem 3 to show that you have gotten a basis for II... we find f(9.5.-) is an m >< n matrix whose in rows form a linearly independent sequence..s) = 1. .. (p. . both objections to the truncated power basis mentioned earlier can be overcome (at least for moderate lo) by a generalization of the “hat” functions.4).56 -= .. and that I'l. .nC(2l }. .)? repla([:. Problems 1.._¢_4.bd by (T..). the so called B-splines..5.. .-fiC'(1) = {DF 1 F e II. Prove: Ifcpl. . 51? .. with (T.g.s/. as described in the next chapter.___. 4.__~...4.3 .D2f=0... := Z a... .(p_..)?+1).l._= 0) and F’(rl) = F"(:r. fg-to be nonnegative on [fl .-...(p.AT_.| | in terms o_f the coordinates for f with respect to the basis (cplf) found in (a). F(Tl)..l.. Prove that II. fl) is linearly independent. t=2.. These are obtained by forming analytically certain linear combinations of the truncated power functions to obtain anew basis for II<_i...9) = 1..._¢.. The Spaces H.E. I .. (a) Use Problem IV...4.ff) both with continuous second derivatives and so that (fl.86 VIII. ‘l = 1._... then the sequence tbl. 2. ._£.._.£ (see Problem VII. all t.4/.l”(£-1)‘: f(£2)? .. " .) =.h_.2 to construct a basis (<pj” for II.g.l.f(£l+1)i . and the Truncated Power Basis and. is linearly independent and A := (a... one could even let h = A55 apgroach 0 and still have the function f well represented by the basis functions (H. . fl as linear combinations of .b._..3 -‘. again with 2 decimal digit arithmetic.. Hence identify Figure (2) with the resiilts of Problem IV.3(.-. Where have you seen these equations before? (c) Construct fl.n -l-_1 (in particular..3(. is also linearly independent. whose elements each vanish outside a “small” interval.57 + .... ._. Can you choose fl.. ..3 with respect to this basis are ...b..._.3)..-O Cm = $4 (of p.. is a linear subspace of l'I<.3 to $4 on p. What is the relationship of II.. I 1 |.lfl(£3)i ' . in such a way that the coordinates for f € II. $- . .-..lH(£l-l-1)): (b) Express the homogeneous conditions jump.. Conclude that the approximation f to the distribution giin Example (1) can be constructed as the derivative f = DF of F € $4 for which F(r... .73 = 1.33~ .. 51.44 + 1.... In the general case.-i . 1 In fact._l) = 0._... 1.l. The resulting number depends.|."Itj+k"1l(' *. . (3) B.r.(II'I) Z:--"' (t_».I-=.. Of B3'. in hopes of making it thereby as familiar and real an object for the reader as....l(' -—.. by I(J.].. I-Iere is the definition of a B-spline as originally given by Curry & Schoenberg [1947] (though with a different normalization)... we define kth order B-splines as appropriately scaled kth divided differences of the truncated power function and prove that every space II. and is defined by the rule I Bj. the first edition of this book) be derived directly from the above definition with the aid of the various di87 . of 11:. that is.I)::_-1..3). -' tj)[li_-I‘. the resulting number varies as we vary :i:. All these properties could (see.I 77"- IX The Representation of PP Functions by B-Splines In this chapter.g.=*-=(='-Y) :_lt.|...]. This gives rise to the B-form for a pp function.-r= . .i. (1) Definition.f+11"‘1tj+kl('“ =1-'=)l_1 '" l'5. lI1SlI-E1!-3-Cl. . The jth (normalized) B-spline of order k for the knot sequence t is denoted by B... Let t := (t_. as long as the I: and the t can be inferred from the context.l..-) be a nondecreasing sequence (which may be finite..5.. of course.. OI‘ Bjk = BL}. say. ... the sine function.l. we will record various properties of the B-spline. e._. on the particular value of :1: we choose.. and so we obtain eventually the function B_.t3'. infinite or biinfinite).. has a basis consisting of such basis splines or B-splines. We will usually write _ B5... In this chapter and in the next two.Ill”!- The “placeholder” notation is used to indicate that the kth divided difference of the function (t — £1'I)§__1 of the two variables t and :1: is to be taken by fixing :1: and considering (t —:i:)l_[__1 as a function of t alone. 3-ll I E Note that... -+. It is even possible (see (41)) to derive the equality (2) from the recurrence relation. J T‘ that is... ' .. t. if :1: ¢ [tj . has small support in the sense that (4) B_. . . bl) (6) [t_.-..+. ._._...]_f = /IR M..] and therefore..... the Curry-Schoenberg B-spline k Mjiklt :: f:i+k -' tr I Bu?-‘kit is differently normalized. at least for t.. is the Peano kernel for the divided difference.t.g = 1... .. on (t.. f = 2:D"f(<1) (. is quite common..k...... ..]..D“f/lcl..... . ... t. It arises naturally when one applies the divided difference to both sides of the Taylor identity ._l . IR The notation N_.-. t... ..(:i:) = 0 for :1: d [t_...-. . . The Curry-Schoenberg definition was based on the observation that..-.<2 t_. though this may leave open the question of how one would come up with the recurrence relation in the first place. we have [t. it turns out (see de Boor & I-Iicillig [1987] and de Boor [1993]) to be just as efficient (and less hard on readers not familiar with divided differences) to establish just one property...t.. are so normalized that ' (8) 23.. t_.— -or/ri + /it .. The B. .]. namely the B-spline recurrence relation. hence also in the (one-sided) limit at the endpoints of this interval.... Further. .+. The Representation of PP Functions by B-Splines _ vided difference properties recorded in Chapter I..sift‘ Dir as/A! 1"-rik ‘ to obtain (under the assumption that t_._. the function defined in (2) is obviously pp of order it and. . .... thus making it possible to start B-spline theory with the recurrence relations..].]g = 0... by I(v). in any case.-l. .. For. In particular... ..88 IX... ... However. _ I Mj. then g := — :i:)§_"1 is a polynomial of order it on [t. G [a . in distinction to Mj..-+..+l). = 1 on [tj-.. with _f(:i:) = 0:”.. showing that M_._. and then derive everyth'ing else from this without recourse to divided differences . for B... <1 . t. . t_. see (36). O and 1. = 1.1. . t = Z = . = lZ3'. . Rivlin [1969:p.i=O of order It for the function f.g. The other is the knot sequence IB := (. giving rise to the Bernstein-Bézier form. .....1.(e)=[ i f i—. —1.(' —*i)3is the characteristic function of the jth knot interval.. .. . . that is..nirl/(A — 1)!-.. the various details to follow simplify significantly.A recurrence relation for B-splines Two special knot sequences 89 For two frequently used knot sequences.. " A recurrence relation for B-splines Directly from the definition. Other choices could have been made. ' * = J O otherwise. but both with infinite multiplicity. For a given k. The only constraint is that these B_.. One is the uniform knot sequence.A .. . in conformity with the convention adopted in Chapter VII. 1] of the polynomials k — 1 b.0. 2.7 =01"'ik_'1i familiar from the Bernstein polynomial (see.0.. there are just It nontrivial B-splines of order k.i-=—1 _. these cardinal B-splines are integer translates of each other since (see Problem 2) A: <9) BJ.1: -— 1) is a basis for H<. one may construct higher-order B-splines with the aid of the following ‘I | .0. much used in CAGD.. — Note that. The corresponding B-splines are called cardinal.. that is. B11-= (' —t:i+1)?|. In particular. 125.S'-nit--1(I) ::( )$k—1—J(1_I)3I _ .should form a partition of unity. The sequence (b_.1.0. .) which has just the two knots. . 12]) k--1 (19) i f( 'E'i"'i' )3’. namely the restriction to [O ..|. For this knot sequence. .. (12) 23. (11) B-. .‘> Bjl = 0.. these functions are continuous from the right. 1. 'r'=O thus greatly simplifying their study. Starting with these first-order B-splines. e.1 . _ It is very-instructive to specialize the various discussions to follow to these particular two knot sequences..a(=1=> = Z(--)“"" - (A .-r. or BBform..l._l : j = 0.. .. For this reason.:) := _ '7:.1= . (14) B51..i-=-1.-Ill“! = (16) j (ti ._. but is still continuous at t... is (14). (16) can also be stated as (17) _ [til---=*i+tl(--Ilffl = t. J J ' *1 I Therefore. — t_.1 = hence consists.. ‘°-2 -----W t- t.. [t_. Apply Leibniz‘ formula a product to the particular product for the kth divided difference of ' (A -=1-=>i" = (A -—I)(¢--=i1=)’i'2This gives l*:=~--=*i+tl(.i3Bi2 + (1 '. Now.[t_.t. after multiplication by (t._ ”_t-"‘ - -.i3°~". .3)B.1--of"? and this..2 = °'-".-2 is also called a linear B-spline.k—1 -l" (1 .(:i.— :i:) = O for 1* > j + 1.t. .....t..t_. 1 Bra = ""':i2Bj1 + (1 r" °-".1-l-1.. = t.l.=....F+»‘~j*_—-1 "' fa‘ PROOF. with IE-' tj (15) w_. H ['1 t. (1...Illlrl .](:t') = (t_.3)°~".:‘3(1 "' ¢~‘i+1.._l](.°"'J'+1.Ill-i-2 + 1lt.2)B.—. .. B..i+2. . for example t_. however.|_l.%=+1. then B52 consists of only one nontrivial linear piece.:)[t. in general. has a jump at t.1”j+kl(' . The Representation of PP Functions by B-Splines (13) B-spline Property (i): Recurrence relation.t.2)BJ'+1.2) + (1 .i+1. Thus....-. = °~'jkBj.1 + (1 '"" °"'. The third-order B-spline is given by (13) B:i3 = °~’...-[(.-... the second-order B-spline is given by A El .._.-all .._l._.90 IX..¢~'_.-.it‘).. If.3)(1 '— ¢~‘. -a. of two nontrivial linear pieces which join continuously to form a piecewise linear function that vanishes outside the interval [t. while [t.l)._.] = tik __”t_ ([t.=+1.2)Bs‘+1. .-).. t.:'+1.i+2._l]).A=)B_r+i.:11) = 1..i+1. —. . For 1: '> 1.3l+11"':t1l+kl(' "" Ill-2 since [t_.:'2B:i1 + (°"'. ..|.... t_.Example: A sequence of parabolic B-splines 91 hence. . _ The actual smoothness of B.. 6. we‘ obtain 135.1.. . For this reason. the sum is not equal to 1...) on (t_. Property (ii) is clearly indicated.) implies with (14) that (21) also holds for it = 1". hence made up of at most k nontrivial polynomial pieces.I¢) is also quite common. a polynomial of order ls (as the sum of products of k — 1 linear polynomials. . consists of three (nontrivial) parabolic pieces that join to form a C(1) function that vanishes outside [tj ... Assuming (21) to hold for k < 1". . vanishes outside _the interval [tj ._|..-(at) = 1 only on [tk .1.1. .+. 6).. This establishes most of the following: In (20) B-spline Property (ii): Support and positivity. Z? B.). (24) Example: A sequence of parabolic B-splines Figure (25) shows the five parabolic B-splines for the knot sequence (O. ..-. [:1 The B-spline B5..t_. . t_. 1)."> B31. .-. the positivity of both w_. 'r'=3' with each of the k b.+k T-——‘. ts-+2)..-4. B.+1). (I5.. Bj. . depends on the multiplicity with which the break Er appears in the knot sequence (ta-. . see (49)... each b. . t_. In particular.. = Z b. 1.-.-.. Certainly Bil is positive on (tj .+..)..t.. and is positive on the interior of that interval. The B-spline B_. . = PROOF. t. 6. in fact..t. After ls: — 1 applications of the recurrence.. 1.-‘gt depends only on the k + 1 knots tj. in conformity with (8). 4. In the form j+k—1 (19).|..B...-. in general.-‘M. .kIt(I) > O. that is.6]. the alternative notation ~ xx Bjikit =Z B('|t3'. is pp of order k with breaks t_.. .~. Note that. and (1 — uJ_. 3. . on [0 . in (19) is of degree k — 1). Only (21) still needs proof. .11. < II-' < Iij+k while = t_:_. where function values are given numerically.-.. .1] = [1 ._|_.. .. Also (8) is illustrated at a few sites. 1I_1'+.. t_. and B4 at 6. 3.-_.-. 4. at 1. . 6). t5+3) = (0. of knots involved in the definition of Bj for j = 1.. corresponding to the fact that the number 1 appears tfwice 1n the sequence t_. namely B5. 1.92 IX. . .-+1.. The parabolic B-splines for the knot sequence (t1.11 Z 3 ___ 1* B5 h A ‘I (25) FIGURE.. involved in the definition of B5. ..is piecewise parabolic. The Representation of PP Functions by B-Splines B1‘ L La. . Each B_.-. 6. . . . . 1 . Only one of the Bsplines appears to be discontinuous. . 4. 2. corresponding to the fact that the number 6 appears three times in the knot sequence t_. . Only three Bsplines appear 130 have a discontinuous first derivative. and the breaks are clearly visible as places of discontinuity in the B-spline or one of its derivatives. 6. . Note the connection between knot multiplicity and smoothness.. B3 . t_.. namely B1 and B2. 1. . with a jump discontinuity at 6. 6). ts) = (1. E.B-gikit ICI-5 TBGZ.-+1)... Note that Bi. exactly what kind of functions make up $1“. then the infinite sum in this definition is meant to be taken pointwise. In symbols. A spline function of order k with knot sequence t is any linear combination of B-splines of order it for the knot sequence t. a discontinuity in the second derivative.. But. 4. o:. before discussing it. 3]. o:. $1. it is concave downward. appears to have a continuous first derivative at 1.i+1-k (27) FIGURE.. B3 is a parabola. 6. we take up the more fundamental question of what exactly splines..-_(:1':) which makes good sense since the latter sum has at most I: nonzero terms. its defining knot sequence.jt (26) Definition.-. 3. all I F We will have little occasion in this book to consider infinite or biinfinite knot sequences. 6) corresponding to B4. the functions B3‘ have. the value of the function Z. 4.B. At all other breaks. so jump3D2B3 < O. Q II-<I'l‘C.I..=+1 t. 93 with 6 appearing twice in the knot sequence (3.t_. El 1. The collection of all such functions denoted by $1“. (t3. that is. hence has a positive (constant) second derivative there. The reader may further protest that Chapters III--VI already contain definitions of such things as cubic splines or parabolic splines and that those definitions do not jibe completely with the above definition.e.. 4]. while. according to the Definition (26). tj If T5.-.The spline space $1“. t4. ' This definition of “spline function” may leave the reader in doubt as to what exactly spline functions “are”. The spline space $.‘. “are”. . |. This latter objection is justified.g.B. contains the number 1 only once. on [1 . t.: . But if t is infinite or biinfinite. concave upward.'+1-= Support of the leftmost and the rightmost B-spline of order k that is nonzero on (tj . t5. by B-spline Property (ii). i. on [3 . It is obvious from B-spline Property (ii) that $16. at worst..-at I: {XCI-|. at the site is is simply the value of the sum 2.. This connection between knot multiplicity and smoothness is basic to the use of B-splines and will be explored further below. see (27). and this is fine for the left endpoint.k—1. ~ $k. having both a first and a last knot. t it ___ {t-n__|. hence also increases the spline space. (The first edition of this book failed to do this..t We now use (28) to show that $. However.]..lZ-n_+k)._. with this equality only holding on the “basic interval" associated with the knot sequence t.}. “This last caveat is related to the difficulty that already occurs when we want to make use of the following immediate consequence of the recurrence relation (14): (28) Z@:B§k = Z (weer 4E.t = II<:-=.(1 — %w-=)%=—1)B. to be quite certain that none of the additional knots or B-splines matter.t con- tains all polynomials of order k.. is finite. + "_ - sup. then the sum on the left in (28) starts with j = 1. .. first knot.1 ‘ If t has a..94 IX..... the knot sequence. tj.. Since we are still only interested in our original spline space. ' '_ inf5. To circumvent this difficulty we agree in this case (and in the corresponding case when t has a last entry) to extend t to a biinfinite knot sequence in any way whatsoever. we further agree to choose the additional B-spline coeficients to be zero. we restrict attention to the largest interval not intersected by the interior of the support of any of the additional B-splines. 1ft:-(. denoting the extension again by t..._1. unfortunately. ..§. We call this the basic interval for $3. and even give a formula for the B-spline coefiicients for p G IL-. . tg. and denote it (29) Iklt = (‘II-___ . to the effect that . otherwise. tj. lft=(t1.. In this case.). for this to work properly at the right endpoint. .1 .. with t J ___{tj. In practice.. this increases the number of available B-splines. ...~_ to be closed.. But. The Representation of PP Functions by B-Splines but it takes some work to prove the Curry-Schoenberg Theorem (44) below. that is. since we have long agreed to make all pp functions right- continuous. 13+). However. otherwise.. but the sum on the right can only start with j = 2 since it contains the term cx_.t- for some break sequence E and some sequence 1/.).) ' The polynomials in $.. t = (t1.1. we modify the above B-spline definition to make each B-spline left-continuous at the right endpoint of the basic interval. one chooses I. -'1('l')B_.T) since._1. 1»-1. as follows. we can easily obtain an explicit expression in terms of the Bjk for any p E IL. hence equals 1 by definition.. from the definition (32).-.-_ 95 (30) B-spline Property (iii): Marsden’s Identity.... Divide (31) by (k — 1)!. by induction._ _ _ i T 0*-"rm.-. 1/>0...i1= and the last sum equals 1. .< tj_|... it follows (see Problem 11) that $1..»_. The following two special cases of (34) deserve special attention. to conclude that (34) P = Z /\_-. by (12).e=P Ba.b_.1 = 1.e.1=)(i.E- Now use this identity in the Taylor formula k _ k-11 P = pg Dk_”P('1')= valid for any p E I'l_. i.+. since '¢.. To be sure.... For any ‘T G IR.. P € Flea Ii with the linear functional )\_.=:~=f(1. Consider (28) for the special sequence '-'11. I3 To“ be sure..The polynomials in $.¢*+r~=-1) + (1 .-._1. hence must equal f if.1. . for any f..__.'r-=('1')B_§a = (' "-" T)k'_1 23¢.?‘ = 1._1<»r><-. contains all polynomials of order k.. as that is the definition appropriate in inductive arguments such as the one just given.-_-. J (32) ' ¢’_iI=(T) 1: (t_i+1 '" T) ' ' ' (1a‘+k-1 — T)- PROO-F.. f is itself a straight line. then differentiate it 1/ — 1 times with respect to 1' to obtain (33)§ = Z B. ' Z:'¢’._1 75 0. (34) holds only on the basic interval I..%1<)f(1.) is the unique straight line that agrees with f at tj and t_.-'1=(’F). Therefore. water + (1 ' 1%‘-=)%=-1 = %.. . for B_... given by the rule it <35) mi := Z u=1 ..9.k.. <31) 1 <~ — --W‘ = Zea->Bj»@ with. 4113'- Then.... More than that. as is the case for us here. 1. for t_. Since "r in (31) is arbitrary.03-1 is the product of no factors. —~ ”F)) 1 ‘ = 1/».I-=-1(’»')(<-*-be (¢_1+r-=-1 -r T) + (1 -" 1*-’._1. -_—1-rIi_. . Since t_. This implies that _ _ k—u ' __ = .-. _ 0<U§#ti. is positive on (t_i .< ti < tiiii implies D”’_1¢_ii.—_.(ti) = 0 for 1/ § #ti.-.].11. The Representation of PP Functions by B-Splinm (36) B-spline Property (iv): (positive and local) partition of unity. E i.Lg.Q6 IX. For ls: > 1 and any E 6 I142: E = E-€(t.L'_. the SPLINE TOOLBOX (de Boor [1990]g) contains the command aveknt (t . is zero oii"[t_.1. and (37) Z3. . El By choosing p E II<g (and choosing it > 1).) provides a positive and local partition of unity.-—1.Tk.-u31-1. Only the last assertion needs proof...1. since D“°'21.. we obtain from (34) (38) B-spline Property (v): Knot averages.t_.1.L1-. —.-. with #ti I: #{T I if = ti} - .k) which supplies them. . (41) Remark Equation (40) provides all the information needed to deduce the equation (2) which is traditionally used to define the B-spline. the assertion follows from (34)._i.. ' the multiplicity of ti in the knot sequence t.). The sequence (B_ii. . Indeed..-_._. each B_ii.‘Ii —-u1.k) B3-ii ' Ii with tgfk the Greville sites: (39) ii.ii. 1T'i i- Ii PROOF.ni. 'T=t-g. L-i-n—r——-Z-n—iu |-i—raj-mu-i. because of the following simple observation.= :0: _ t' 1+"'+t'+k—1 8.-—. that is.. the choice "r = ti in (33) leaves as possibly nonzero terms in that sum only terms with support either entirely to the left of ti or else entirely to the right of ti. is a linear polynomial that vanishes at t..1-ju1-1. It follows at once from (34) with the choice p = 1. = 1 on Iii.. ._n. .-.t_i+i. _ T Bjk.1'—i-I _ The pp functions in $kIt Marsden’s identity (31) even provides a B-spline expansion for certain truncated powers. i I3 Because of the importance of these knot averages. PROOF. ..ii 11. . set J1-.(»r)B.. . that (1i+r<.. . it follows that [ti.-_. T e 1..}: = 0 for 3' 7511.t for 1 S 1/ 3 #ii (on Iigi). Therefore. .05. (Curry and Schoenberg) For a given strictly increasing sequence §' = (£i)i.05. _ ».-=){.-1 = (.._ Q.The pp functions in $ii. B-. applying [t. .i. Since both 1.)§ with 1/i 5 k.. The function 1. II-i+].: i=2 i i=2 and let t := (ti)’f'H“ be the nondecreasing sequence obtained from § by the .._. n :=k+\ (k—-1/i) =kZ—Zi/i =dimII. all i. .ii)?” € $k:. and agrees with the zero polynomial at (ti : i. and a given nonnegative integer sequence 1/ = (1/. Indeed. ti+k]'l.=. once again. by defining _ i: (t1i+1 ')-l. follows from (40) that (43) (.]1/1.ti_|.i+k—1 — i)-l-a . .-)f. L. . . 1i11+k — it ti+lF ".'k(iI'I).i 97 thus closing the loop that has led us from that definition to the recurrence relation and thence.*. we find that (ti....) with the kth degree polynomial __ti ...('r) = —§-—)——— Tk + lower order terms. .i. _ k--1 1‘ |—> -1-1-———l ¢ii.)§. agrees with qbjii at (ti : t < j + k).it-s+kl(' _ 9-")ii-*1 = Bo¢(5-'3)- :1 11._. with (—)i°'"1(:r ._.. 3' in which the summation is. ..i(iI7 — ')§__l = it-5.l/Eli.1 = Z:itj"..7‘:- we are entitled to write (40) (for the “case 1/ = 1) as (42) (.5. . ..ti+i. Since agrees at (ti. and so implies the major part of the following basic theorem. over all j. follows.i ' i (t.iii. ti+i. via l\/larsden’s identity. > 5'). (44) Theorem..+1.. .-ii and 0 are polynomials of _order k.-1. to (40). .] to both sides of (42) as functions of 1'.— 17:-'I)lti1 . fn).('—ie)il_“=l1=1. II A different proof can be found in the original paper. ..-l.t2 S St!-= $151 and €l+1 $. . the space $ii. in addition. in the recurrence l 14 )mus t be exactly right to cancel . Then.».b] := [ti. and any interval I = [a .. .. and..---. with § the strictly increasing sequence containing a.1.—.i...t|. Note the following remarkable consequence of this theorem: B_ii..e|1 7'5 0) is a basis for II.£. .---=#¢i. that n = m.i___i. i = j . . (fl. and (1 — to..k.).l 1B_i. of B-splines of order in for the knot sequence t is a basis for 1'I<.lc- Then.5_.. .. .t.<i. the sequence B 1= (Bj.. By its very definition. from Chapter VIII.5 n= dimF $d. (46) Remark The argument from Linear Algebra used in the proof of the Curry-Schoenberg theorem is the following: Suppose that we know a basis.:PROOF The proof is basic Linear Algebra..tn+1 S S tn+.98 IX. . then $k.... .+1].i is spanned by the 1'1-sequence (Bi : j = 1.£.k. G.-+1. hence the sequence (gi .i..ii_. . B_i.+1] be the basic interval for $.vi times in t. . . 1. contains each of the fi.lJ~=1.n. t1 $. .1.1 and B_i. ..i.| 1. j + it . ..t. is known to be a basis for II. . Moreover.<i. . by (40)..=k+*Z(2. .imG _-§ m. then necessarily dim G = n. it must be linearly I] independent. In symbols. If we now know. of course.1 Of i 1=+ Z #n. (47) B-spline Property (vi): Local linear independence. F Q G and so If. b] Q l. the two weights. hence. G-{t-i-Cb .). .. Curry 85 Schoenberg [1966].t =1'1<:-=. _|_1 . In particular. . gm) whose span. contains the sequence (45) ('"-*'-'1-)'°"“. at each t. For any knot sequence t.. Let I = [a.. . . .5_.k..-i.)=n .fnr¢1~1‘ii <5. . considered as functions on Iii = [ti . for the linear subspace F and that we further know a sequence (gi. the number fii occurs exactly k . The Representation of PP Functions by B-Splines following two requirements: (1') for ‘E = 2. . the sequence B1. .. the reation( jump discontinuities in a certain derivative of the two lower-order B-splines._1.. am. has one more continuous derivative than do the two functions. gii) must be a basis for G since it is minimally spanning.|. Bi. ._i containing finitely many of the ti. . then necessarily F = G. 1'-=2 terms which.p= 011 -71-=..-.. This will only remove B-splines that are 0. In particular. in such a way that always (49) number of continuity conditions at {Q + number of knots at E = ls. hence will not change the sequence B.. E] B "stands fOl' bElSiS The Curry-Schoenberg Theorem enables the construction of a B-spline basis for any particular pp space II. the coefiicients in (34) are uniquely determined. = {fi}).ii-p) = 0.. U (48) Corollary. by using I/1 = 0 = I/:+1- - In a way. Di(}\_. If t contains any knot of multiplicity > it. that is. occurring exactly it -— 1/i times in t.. This.|_1].. there are it initial and k final knots that are arbitrary except that they must not lie in the interior of the basic interval [£1 . At this point.|.. Since the B-spline sequence (B. with each interior break 5. £_.i. on the other extreme. will not change B. we impose no continuity conditions at the endpoints £1 and £_fi. and vi := k—min(k. Thus a ls:-fold knot at a site corresponds to no continuity conditions whatever at that site while.-ii) is linearly independent.5 t. too. In particular. they cannot depend on the free parameter T that appears in the Definition (35) of }\_iii. hence Theorem (44) finishes the proof. This choice of t translates the desired amount of smoothness at a break (as specified by 1/) into a corresponcling_number of knots at that site. #{r : t.. with fewer knots corresponding to more continuity conditions. reduce its multiplicity to k.. B consists of the restriction to I of all B-splines of order ls: for the knot sequence t._ B stands for basis 99 b. Further. In addition to these — 1/i) (interior) knots E2 §_ t. the two polynomial pieces meeting there must agree identically (by Theorem I(14))..'i. as well as every ti E I..i . PROOF. no knot at a site enforces k continuity conditions there. g £. " PROOF. A convenient choice is 151="'=tk=§1= tn+1="'=1-n+k='-§l+1 which then allows one to include the choice of these knots under the same pattern as the choice of the other knots....|_1 5 -.. omit from t any ti for which neither Bi nor Bi_ii has support in I. For all p G II<. by providing a recipe for an appropriate knot sequence t. B is linearly independent.<ii.5. The theorem leaves open the choice of the first k and of the last k knots.‘i. -2-vi "' i in (50) FIGURE.n}.. if t_i § :1: _*§ t3-+1 for some j G {k. . . it makes the basic interval for $k.[. The B-form for f G II.._5_. giving the order of f a pp function) and the number of linear parameters (that is.-1+1 = 0 F:--vi I:--ui+1=k ' 1n+1 in ti-1+1: conditions corrmp.).. *i.. respectively.. knot . consists of (i) the integers k and n..='i--k+. of continuity €1 £2 £3 --- £1 51+ 1 1:1 = 0 1/2 1»-3 --- vi 1..g. only on the interval [tii . the value of f at a site :1": in [ti . on the knot sequence t. 1/) .nd the integer sequence 1/ = (1/i)i1+1 is carried out in the SPLINE TOOLBOX (de Boor [I9Q0]g) by the command t = augknt (§ .<ii.100 ' IX..... . that is.. then J f(s:)= Z o:iBi(:r). v i ..t.<i.___5. 1l=+1 - Converting breaks and continuity conditions into knots of appropriate multiplicity. (ii) the vector t = (ti)‘[‘+k containing the knots (possibly partially coincident and constructed from E and v as in Theorem (44)) in increasing order. (51) Definition.. n = kl — zi 1/i = dim l'.i. for II. This is consistent with the fact that the B-spline basis provides a valid representation for elements of l'l..ii.In terms of these quantities.. .'l l .+1].i..- multiplicity lc-—u1=lc k—:/3 lc—u3 _ $1 resulting knots tzk-I-*2 +1 t2k—l-"2 tan-r. . 1'- i=1 In particular..+1] is given by (52) f(¢1:) = ZaiB-(e).-.... Theorem (44) allows us to represent (pp functions in terms of B-splines and so gives rise to the B-form for a pp function.i coincide with the basic interval for l'I. . With this choice for the end knots.i. the construction of the knot sequence t = (ti)?+k from the break sequence §' = (§i)i+1 a.. The Representation of PP Functions by B-Splines of the interval of interest. bfflfl-kfi no. t..£. and i (iii) the vectoro: = (o:i)"f of the coefficients of f with respect to the B-spline Tlbasis (Bi). this can be visualized as in the following diagram.. . ._. If f is so representable. | Conversion from one form to the other Conversion from a B-form to the ppform for _f is easily accomplished if one knows how to evaluate and differentiate (52) stably and efliciently: the l + 1 distinct sites among the numbers tii.. t. for i = 1. then._|..+k]. . . .... then the sites r_. .+ii] of interest.l.. in fact. r =.'i so that the required derivatives can be read off directly from the ppform of f.-i. t..ii on the interval [a.represent f as a spline function._.i. in finite precision arithmetic.1) knots. having.. about the (minimal) knot multiplicity necessary to. for every p G $1“.that appear (implicitly) in that formula can always be chosen to be one of the breaks £_-. we may end up with as many as n + ls — 1 polynomial pieces. If now ti <1 tg and t._l' means that D"""1_f(r) = lim. b] = [ti .4). But. ... But if f is.b] —.. The additional knots derive from those arbitrary additional k -— 1 knots at each end.-.{_fi_|_1 in increasing order and.. + is knots t1.. We discuss the subroutine BSPLPP which accomplishes this conversion in the next chapter after we have described how to evaluate B-splines stably and efficiently. from the ppform... . for example. . with some care. . This is exactly what is done. if all computations have been carried out exactly (that is. because of the linear independence of the B-spline sequence (see Problem X.._1 are found (with l determined by such a search) and 1. for a certain 1/. known to lie in l'l.@+ D"’_1_f(t_. . . in the conversion command fn2fI11(pp. by some means.. If we construct the ppform (see Definition VlI(6)) for a spline of order k with the n.£..+ii..Conversion from one form to the other 101 This means that we have recaptrued an important feature of the ppform. . t. .[ti .-.i.. the number D-'l_1f(§. is chosen fron1 the interval . . namely that the value at a site depends only on It of the coefficients.+ h).f") is computed and stored -in Ci. By contrast.’B—’) in the SPLINE TOOLBOX (de Boor [1990]2). .t. then we would find that the first k— 1 and the last k—. that is.1 < t. j = 1... .t. that is.k. a spline function of order la may have as few as It + 1 knots (but not fewer). Note that the'B-form for a pp function of order k involves at least 2k knots (and usually more). Here.1 B-spline coefficients in the Bform obtained are zero as they must be. The conversion from the ppform to a B-for1n for _f is more difficult because the ppform contains no explicit information about the smoothness of f at breaks. ._. The formula (55) is based on the observation that (34) holds. tiiiii]... . ‘-I stored in $1. on constructing the B-form for this pp function on [a . . without rounding errors). we obtain a spline with n+ k+ 2(k —. provided that the point r appearing in the Definition (35) of /\_. then the appropriate knot sequence t can be constructed from § and 1/ as in Theorem (44) and the corresponding coefficient sequence or can_be obtained from (55) below. nor could such information be derived reliably numerically.i. all ‘Ii. This forces Aiiipi (= )\ii. all j. Bjki ii l l wi th 'i it _l. . 4-|- (56) ._1]. t.i'+k.i I 1 ... by the local linear D independence (47) of the B-splines.Bi) to equal 5-ii. let pi be the polynomial of order k that agrees with Bi on [tr e 1 ti-_|_.!' 5. f = Exit. Hence l l I‘ )\-ik(ECIi: -"_— CI-5. 1’ ... assume that Ti G [t.i_j) T ‘I! =1 ' l a.-iii) or.]_].In-..-—rq|_|-.. l—\. It is suficient to prove that... by (34) (since (34) shows that the k-sequence (pi : s G J) spans the lc-dimensional space l'I. i ii . _ _ Ajk).'| . PROOF. )\iiiBi = 5-ii‘.. I r -|_n_ -1l.. Ti 5 t_'. . t." ...I ii |. hence must be a basis for l'I.r}==:J. := E L Du—l-f(.ii. For j G J... for any i.. more directly. since the sequence (pi : s G J) is linearly independent.. The Representation of PP Functions by B-Splines In . all ‘l For this.T_.= = /\u=Pj- -_—n--um! 5 On the other hand.nd't. (de Boor & Fix [1973]) For any f G $i. every '1 _ jG’{r—k+1.t.-I I I (57) Pj = E(Askpj )Ps: sGJ since this holds on [t.i. (53) B-spline Property (vii): Dual functionals. Then )\u=B_-. . 5 .+k[. Then (56) is trivially satisfied for urn-| I. .+1] by (34).102 IX.l l J '5 It is remarkable that Ti can be chosen arbitrarily in the interval The reason behind this is Corollary (48). _...f (1i. :1: 9 f(:r) 1. . we find the truncated Taylor expansion for f around 0. Starting from the boldfaced diagonal. finally.162 " I -162 0 . from its Newton form (59) by the Nested Multiplication Algorithm I(23). . . 1. f"(tii. 9.=+2—Ati+1)f (¢_i*+2)v § A1i_i+1Atj+2.i+1 'l' ' ' ' '1' t. .. 3/2. 0 18 99 99 0 -3 -9 -18 1 1 1 1 This shows that f_(:Ir) = -162 + :r:(99 + a:(—18 + The program below uses nested multiplication to find from this the numbers f(ti+g)..d. and. see Figure (62).i+k—1)/(k " 1) =3 TiwE(.=+2)/2I- | By way of an exercise. . 2.. that is the numbers Dif(0)/il.g) and f"'‘(ti +9) /2 and then calculates czi by (60). . .|_1 = =t.d. 3. 19/2 as interior knots. in which case the formula specializes to 1 F 1 If (60) CI.d. = f(t_i+2)'l' 3. using the points 1/2. In (54).9) on [0.)‘ (At. i = 1.9. 4.. .).d .d. The program also computes the value of f at the Greville sites ' (61) tile = (t. we choose ri = ti+g.'l) from (39) in order to bring out the important point that o:i ~ f(t.. . 9. Then t1 = =t4 =0. all j. We pick up on this very important point in Chapter XI. t4+i=ifori== 1. t. 10] as a cubic spline with simple interior knots 1. this produces the next three diagonals in a divided difference table for f as follows. This becomes even more striking when we increase the number of knots._+4 = 10 with it = 4 and n = 13.?.. 6 - 9 0 0 -162 0 -.Example: Conversion to B-form (58) Example: Conversion to B-form (59) 103 Find the B-form of f(I) = (Iv ~— 3)(I — 6)(11= .. 3. 2.d 2. . I=1.4 C C 20 D AT D(J) = n0(J) no 21 J=1. 00000 00000 15.. 00000 -129. KNOT AVERAGE TAVE(I) = (T(I+1) + T(I+2) + T(I+3))/3.1 D(ID) = D(ID) + D(ID+1)*T(I+2) 21 C C COHPUTE B-SPLINE COEFFICIENTS BY FORMULA (9).2F16.IX.1 THE TAYLOR COEFFICIENTS AT DATA DO /-162. 00000 00000 00000 00000 10.N) sso FURHAT(45H I TnVE(I) F AT TAVE(I) c (I3. I = TAVE(I) 50 C F(I) = D0(1) + X*(D0(2) + I#(D0(3) + I*D0(4))) PRINT sso.99.4 T(I )==0 5 T(N+I) = 10. DTIP1 = T(I+2) . (I. 00000 75. 00000 00000 1 .JJ...NH4 REAL BcuEF(23).(nhMe{>¢HD~4UHm4>UHOh* TAVE(I) I-* CHD¢Hfi*4UHfl#5UHOP*CHD 00000 33333 00000 00000 00000 00000 00000 00000 00000 00000 00000 66667 00000 F AT TAVE(I) -162.F10.3 ID== ID.J. NM4 = N-4 DO 6 I=1.N USE NESTED HULTIPLICATION TO GET TAYLOR COEFFICIENTS T(I+2) FROM THOSE AT 0 DO 20 J=1. F(I).NH4 6 T(I+4) ' FLOAT(I) C DO 50 I#1. F WITH C INTEGER I.5)) BCOEF(I)// STOP END I h*Hweh.D(4).TAVE(I). 96297 80.N.. BCOEF(I). 00000 00000 00000 00000 12. The Representation of PP Functions by B-Splines 104 CHAPTER IX. 00000 28. 00000 .1.T(27).3 ID = 4 DO 21 JJ=J. 00000 28.TAvs(2a). 00000 00000 10.D0(4).F(23)./ C C C O FOR THE POLYNOHIAL SET UP KNOT SEQUENCE IN THE ARRAY F ARE T N = 13 DO 5 I=1. 29628 28 00000 BCOEF(I) -162. 00000 24. 00000 00000 12. 00000 -130.DTIP1.T(I+1) DTIP2 = T(I+3) T(I+2) BCOEF(I) = D(1) + (D(2)*(DTIP2-DTIP1)-D(3)*DTIP1*DTIP2)/3 C C EVALUATE F AT CORRESP . EXAMPLE COHPARING THE B—REPRESENTATION OF A CUBIC C ITS VALUES AT KNOT AVERAGES.18.nTIP2.ID.5. 10. a spline function of order k was defined to be a pp function of order k on some (finite or infinite) interval with ls: --2 continuous derivatives there.__. those marked G) from the finer uniform knot sequence 0. piecewise cubic Hermite interpolation or piecewise cubic Bessel interpolation is at times preferred to cubic spline interpolation. Rather. and in the early history of spline theory (see.-:- What is a spline’? 105 I. . -1' . for example. I call such functions splines with multiple knots since . ‘-. In these earlier chapters. 10] and its B-spline coefficients (cri) plotted to show that ozi ~ f(t. For instance.. .. / -:| 5 -10 I '- . 1 / 2.___. El We now return to the objection voiced earlier that our Definition ( 26) of a spline function docs not completely jibe with the definition of a cubic spline or a parabolic spline given in Chapter III—VI. But it was soon found that pp functions of less than this maximum smoothness were also quite interesting and useful./ 10 . -20 (62) FIGURE. I will not use ‘this term here since it contains a value judgement for which I have no justification. /' \_. In other words. . “spline function” meant a pp function that was as smooth as it could be without simply reducing to a polynomial.-. Some people have called such pp functions with less than maximum (nontrivial) smoothness deficient splines. The points marked >< come from the uniform knot sequence 0. . - B-spline coefficients model the function they represent. .?k). . Schoenberg [1946]). . l 20 ' 10 ox‘ ri ' ii \. A cubic polynomial f on [0 . 10. . 1. all pp functions become splines."=_. The formation of a double knot.. . ... ii | ll _ I --. . =_ 106 IX. This is so because a B-spline doesn’t ls: 1 k ts a little bit Therefore. I . 15. . if one has change much if one changes its + no . l But I with this extension of the word “spline”. one of the original splines) by letting some knots coalesce. Verify the numerical values given in Figure (25) by constructing the appropriate divided difierence tables. ' Figure ' ' ' ' ise linear This is illustrated 1n (63). r II. n]f = A"f(0) := Z‘_. 2. . The Representation of PP Functions by B-Splines _ i 1 I‘ )>'~ i t T II . (I-lint’. and one wonders why one should bother with the term “spline” ' some special ' ' for the word at all. 1-H _||I.-I we can think of them as having been obtained from a spline with simple knots (that is.. 2 . . the notion 9f “s Pline" is simply a particular way of looking at pp . In order to retain and useful meaning “ 5P li11 e" 1 I have adopted the definition of spline function. ( ny problems?) . t (a) P rove for mula (9) for the cardinal B-splir-e . g1ven earlier in this chapter. III _____--l——l—HI—+—\-—‘ (63) FIGURE. as linear combination of B-splines. functions.?=0(—)"“i(°:)f(i). where a discontinuous piecew function is shown as the limit of a linear spline with simple knots as two knots coalesce.'--. . _= Problems 1. This way makes it particularly easy to see the nearby splines with simple knots when looking at a particular pp function. then 1t almost l'k 1 e it w ith _ simple knots: Simply replace each knot of multiplicity r > 1 by r simple knots nearby. Verify._ . the formula n![O. 10. 1. ' 1s ' very easy to findA a B-sphne ' multiple knots. ' i _ _ ' I J‘ ll .) 0 A (b) Use the formula in a program to graph Bi for it = 5. In this way. by induc- tion on n. €.<..u.. Consider the linear functional A. Prove: If f E $1.... Verify that the spline approximation Ag := E.r and jump. assuming t is derived from {f and 1/ as in Theorem (44).Q(ti+2))/2.-'= 5...-_.F’ Problems 3. of (53) as a function of 1". for any 1'1 < 1. are nonnegative and form a partition of unity...t. (a) Verify that p. with p $17 . also use Problem III. t arbitrary.t is local and satisfies Ag --= g for a.1'.5_.. 4... 11.t.l'1()—-——--i—— r(-r "7)+ (k:—1—m(r)) for certain weights d.-.._.. . = t...g)B...4-.) ‘T. dt—.(A£g)Bi. half of the B-coefficients marked G) seem to lie on the broken line defined by the B-coefficients marked ><..j+l:.. consider the function a Am == Zj<-)’r*"¢§:"”(T>Dv‘r<»r>~ -r=1 (a) Prove that AI-(1') does not depend on T in case f E H<.. then f=q=p.}. 107 Prove: If f is pp of order k.. (Hint: Use (53).|.2... (Because of (a). P 8. for ls: = 3. (Hint: Use the fact that the B. I>_T: p:qG1_-[<k-. Use Problem I..) (c) Prove that the -approximation scheme in (b) is local.). this only requires showing that jump¢___. Verify the assertion in Theorem (44) that dim Il<.) - 6.8 to obtain the following truncated-power representation of the B-spline: .Af = O for t_.|_..._..¢B. and calculate (b) Prove directly. 9. Conclude that B-splines are splines of minimal support. and f E H...). then f = O.ll g E $. the sequence —.t satisfies ||g —Ag]| _<_ 4dist (Q1 $.(.). that is.i+F= '— -—-TTI.k) is a basis for H<.-D5"f=0forj =O. Prove that this is no accident.. < rk..in (ti .1. r=j. 5.. with '7¢+3/2 5: (t¢+1 + t-£+2)/_2(b) Verify that the approximation Ag := z.. ts] for some 1' < s_ < r + k. 10.. that is.. that A_+~('r) does not depend on 1' in case ti < T < t. (Hint: Prove that Af E H<. .. without recourse to Theorem (44) or (53).-..and with m(*r) := ma:x{s : r —. 1'" _ BI3(3) =t-—(J+*= ta).3... vanishes outside the interval [tr .s Z j. t... = k+Z:g(k—-I/. Prove that. :17 < T ' f($)={qExg......k--1.... In Figure (62). and ' M9 3: (—Q(t¢+1) + 4Q(t1+3/2).....-)""“1 : j = . I__|_II ‘_II____I II_.‘I-I l _-I1_l‘|?f.I__|‘I._I‘_1_I_ I _IIIIII __ 1I__|1__‘ IIIII___I__‘_ _I_ i ._|III_:IlLI.lL_1IIIFI. instead of BF to keep the table simple). linear combinations of B-splines or the B-spline series. The values of all B-splines not automatically zero at :1: fit into a triangular array as follows (we write Bf. we continue our diticussion of the properties of B-splines.. Suppose r‘. therefore. Stable evaluation of B-splines The direct evaluation of the B-spline Bi from its definition IX(2) as a divided difference has to be carried out with caution because of the possible loss of significance during the computation of the various difference quotients (Problem IX. special provisions have to be made in the case. we can convert from B-form to ppform as outlined in the preceding chapter. BVALUE . 109 . < t.: The Stable Evaluation of B-Splines and Splines. that is.1). We concentrate on the differentiation and integration of splines and on their stable evaluation with the aid of the recurrence relation.. be beset with precisely the difficulties that we hoped to avoid by introducing the B-spline basis in the first place. in fact. once we are able to evaluate a spline and its derivatives safely.of repeated or multiple knots (Problem lX. Also. The subroutine BSPLVB The-recurrence relation lX(1-4) leads directly to an algorithm for the simultaneous generation of the values at :1: of the k B-splines of order k that are possibly not zero there. BSPLPP In this chapter. Also. B-splines became a viable computational tool only after the discovery (e.X 1.g. it is possible to evaluate B-splines with the aid of the recurrence relation IX(14)i which requires no special arrangement for multiple knots and does not suffer (unnecessary) loss of significance (see Cox [1972] for a rounding error analysis of the process). Such a calculation would. de Boor [1971]. albeit in terms of splines. Cox [1972]) of these recurrence relations.2).. BSPLVB .-+1]. Fortunately. amount to evaluating Bi from its representation in terms of the truncated power basis (see Problem"IX.10) and would.+1 and I G [ti Ht. _i (m).+1(:l:). 6:-'_. by IX(1-4).3. . .I<:-1 0 B-1-t+2.3 Bi--t=+3. .1.—1.I (2) b bi = (<11 -' 13-i—. ti.-1k:__1.. and can compute each entry in a subsequent column by IX(14). Suppose we have already computed the j numbers B-i. Bi.7 + . .— I) ?5i+r — Tit-5—"—" +1..1].:¢-1 - B-i—1.I_i.‘-. Of course.3 ' B-:2 ' 9 Bis 0 Bi-1. since we know the first column by IX('11).k 0 B1E—k+2. The Stable Evaluation of B-Splines and Splines h 0 U Bi—k+1. 110 x. . .+1~—1) t-i+r-1 -"T ti—j 1 +r—1 +(*»:+1.1.t-1 " Bi-1. Introduce the quantities E.|. . . It is clear that we can generate this tliiangular table column by column. The triangular array of B-splines of order g it that are nonzero on [ti . Bi. Then we can write (2) in the form ( 3) b_ b’ =5‘-'~r—1.. . ' The boundary of O’s in this table is a reminder of the fact that all other B-splines (of order k or less) not mentioned explicitly in the table vanish at 21:. .j + 1 and with be :-= b_i.){._i+1(:l:) of the next column in that ordel. (:1:) and have stored them in the vector b := (b. b .~.){+1 is to contain the j + 1 numbers Bi__i. we use the fact that one of their neighbors to the left is zero.__:= O. . then. .r= 0 B-i—2.2 B111 B1:-t+s.1‘: 0 Bat-1 Bat 0 0 (1) FIGURE.t B-i.|.1 ii. in the computation of the first and the last nonzero entry in a column.|.P for r = 1.—1‘j'" +5581 1 ‘T b + 5R_-_-l-r 1 7 ~= 1 * 11 1. If the vector b’ := (bi._-. 3:1. JHICH IS GENERATED . .2.. INDEX IS USED TO AVOID RECALCULATIONS WHEN SEVERAL COLUMNS OF THE TRIANGULAR ARRAY OF B-SPLINE VALUES ARE NEE- DED (E._|_1 := 5__f‘+1_r-term Here. := saved + 5:2-term 2/4/3 saved := 5§‘_|_1__...k—-1. (J-+1):-(INDEIII-1) ) _ T . . in fact...LT..ii (rs). repetition of the 2 /4-loop for j = 1. IN Ofifl fl fi fi fi fl-Efiflfi fl BSPLPP UR IN IF INDEX == 1 .. PRECISELY.do: 2/4/1 term == bi/(5._. . as BUUR cntcutarss THE VALUE or ALL POSSIBLY nouzsao B—SPLINES AT x or oansa ITOUT == WITH KNOT SEQUENCE MAX( JHICH ... . INDEX. . OF LENGTH LEFT + JOUT ..5) bi. l 1 -b1I== I 2 for j=1. Note also that L __ .+_j -‘SC I: I "— II-i'_I|I]__J‘ (4) 2/3 saved := O _ 2/4 forr=1./2 2/4/3 r= 1._...j. . With conveniently independent of j... ASSUMED TO BE NONDECREASING. do: 2/1 I= II-i'.../(5..l The subroutine BSPLVB 111 Notethat our assumption ti < ti_|_1 ensures that none of the denominators in (3) vanishes.?+.....KNCT SEQUENCE. LEFT. Starting with j = 1...Iii_i_1. it is possible to store b’ over b by using an additional word of temporary storage.. THE CALCULATION STARTS FROM SCRATCH AND THE ENTIRE TRIANGULAR ARRAY OF B-SPLINE VALUES OF ORDERS 1. (J+1)*(INDEI-1)) OF THE B—SPLINES WHOSE VALUES AT I ARE TO BE RETURNED. Biii (rs).1: — 1 produces eventually in b the desired vector of it numbers Bi.-_|_1:= saved This algorithm is carried out in the following subprogram BSPLVB.INTEGERS WHICH DETERMINE THE ORDER JOUT = MAX(JHIGH. noose I H P U T fours: T. . BIATX ) c FROM * A PRACTICAL euros TD SPLINES t er c. .. _ a§.{*+5. SUBRDUTINE BSPLVB ( T. . . . .) 2/4/2 bi. 2/3 2/4 bi.. BSPLVD ).-term 2/5 b_._ + 5.j. .. x.i‘+1_. := bi + 5. do: term := bi. o I v I s I o N B Y z E R 0 HILL RESULT IF T(LEFT) = T(LEFT+1) INDEX. 5. as follows. they are all at least as big as Ati.?-term b§. T(LEFT) . T(LEFT + 1) .G.. JHIGH. A S S U M P T I O N . . := O for 2/4/1 2/4. The computation of and (bi-) as in (3) can be arranged as follows. . in which case b has the single entry bi = 1. .I oELTAL(J) = I .E(LEFT. . WITH BIATX(I) CONTAINING THE VALUE AT X OF THE POLYNOMIAL OF ORDER JOUT WHICH AGREES WITH THE B—SPLINE B(LEFT—JOUT+I. 1. Q O fi fi flfifzflfiiflfi flC'J ("J'CJ 'CJ '(JC'("J INTEGER INDEI. JHIGH) C 20 26 co TO (10. TERH = BIATXII)/(nELTAR(I) + DELTAL(JP1—I)) EIATx(I) = SAVED + DELTAR(I)*TERH SAVED .. W A R N I N G . DELTAR ARE.LT.JHIGH.... THE FACTS THAT B(I.11 2 X.JOUT.DELTAL.. THE ASSUHPTION BEING THAT BIATX . x.AN INTEGER CHOSEN (USUALLY) so THAT T(LEFT) . JHIGH.LEFT.JHAx... STORING THE NEW VALUES IN BIATK ovER THE OLD...THE POINT AT WHICH THE B—SPLINES ARE TO BE EVALUATED. J . JUST THE NEXT COLUMN or B—SPLINE VALUES Is GENERATED. LEFT. ' IN PARTICULAR.GE. .J+1)(I). x .. I. IF JHIGH = 0.. I E. THE PARTICULAR ORGANIZATION or THE CALCULATIONS FOLLOWS ALGOHITHM (9) IN CHAPTER x or THE 1993 TEXT. x ..E.J)(x) + -------------—-B(I+1..J)(x) = o UNLESS T(I) .J)(x).oELTAR(JHAx). IF (J . JMAX (= 20) IS IMPOSED ARBITRARILY BY THE DIMENSION STATEMENT FOR DELTAL AND DELTAR BELOW. .T) _ON THE INTERVAL (T(LEFT). . COLUMN BY COLUM .LE.. ONLY THE B-SPLINE VALUES or ORDER J+1.LE. J+2. onent M E T H D Q matte: THE RECURRENCE RELATION B(I. T(LEFT+1)) .20).JP1 PARAMETER (JHAX = 20) HEAL E1ATx. DELTAL .1) = 1 IF T(I) . THEN JOUT = 3+1.LE.J)(X) T(I+J)—T(I) T(I+J+1)-T(I+1) IS USED (REPEATEDLY) TO GENERATE THE (J+1)-vEcToR B(LErT-J. The Stable Evaluation of B-Splines and Splines ORDER BY ORDER . T(I+1) AND THAT B(I.LE.ARRAY OF LENGTH JOUT . IF INDEX = 2 .LEu I . no 2s I-1..J)(x)...DELTAR C 1o J = 1 EIATx(1) = 1. T(LEFT+1) . T(LEFT+JOUT) DATA J/1/ ‘ sAvE J.. .T... T(I+J) ARE usso. THE RESTRICTION JOUT . INDEX so TO as JP1 = J + 1 DELTAR(J) = T(LEFT+J) . E(LEFT. on ENTRY. JOUT ARE GENERATED.x..J+1)(x) FROM THE J-vEcToR B(LErT-J+1.DELTAL(JP1—I)*TERH EIATx(JP1) .. JHIGH) J: C as END G0 T0 20 RETURH ...J+1)(x) X — T(I) T(I+J+1) .J. BUT IS N O W H E R E C H E C K E D FOR .LT.SAVED JP1 IF (J .T(LEFT+1—J) SAVED .TERH DIMENSION E1ATx(JouT). As THEY WERE on ETIT AT THE PREVIOUS CALL. seer: U U T P U T stereo BIATK.0.3 .I = -—————————-B(I.sAvEn.LT. oELTAL(JHAx). LEFTHH. . IHTERT INTEGER 1.a.. For this reason.5) ‘ c soo FORMAT(’1 X’..3.N . _ 10 . R(LEFT..E)(x) IN vALuEs(I) ... we recommend the function BVALUE discussed later in this chapter. R(LEFT-x+1. PLDTTING sous E1sFL1HEs CALLS BSPLVB.. DATA VALUES f7*o.5(’B’. CALL 1HTERv ( T. we supply here a sample program that uses BSPLVB in order to plot all the B-splines of a given order for a given knot sequence.I=1. 1. (vALuEs(J). Do 1o J=1..x)(x)..R.7) s10 C . I=1.Example: To Plot B-splines.. ALL oTHERs ARE KNOWN TO BE zERo A FRIGRI./. x..THE vALuEs JUST COMPUTED IN PREPARATION FoR NEXT EVALUATION POINT .H)(x).. EXAMPLE_1..J=a.vALUEs(?).. 113 (5) Example: T0 plot B-splines We should like to encourage the reader to look at kth order B-splines for various values of 1:: and various choices of knots.4.. n+1. ARE SUPPLIED BY BSPLVB .J. KL = T(K) Dx = (T(N+1)~T(H))/FLoAT(HPoINT—1) c PRINT 600.?) FORHAT(F7. viz.a*s. LEFT. LEFT. CHAPTER x. c c zERo OUT. T /s*o.x.LEFT. For the plotting of a single B-spline..5F12.xL c DIMENSION. CALL EsFLvR ( T. NUMBER oF EVALUATION POINTS.2*1.I1.HvALUEs(LEFTHx+J) = 0..BK. It happens to be set up to supply the data necessary to plot the parabolic B-splines in Figure IX(25). NPDINT /a1/ c sET LEFTHosT EVALUATION POINT xL . K.K /7.NPOINT x = xL + FLOAT(I—1)*DK LOCATE x WITH REsPEcT TO KNOT ARRAY T .T(1o). AND SPACING DT TO BE USED. x. DATA N. HFLAG ) LEFTMK = LEFT — K GET E(I.’(I)’. STOP END I 1:: .HFLAG.(I....HFoIHT REAL Dx. oRDER AND KNOT SEQUENCE FDR SPLINE sFAcE ARE SPECIFIED. T. vALuEs(LEFTH1<+1) ) c c c c c PRINT s10./ c R-sFL1HE VALUES ARE INITIALIZED TO 0.7X)) DO 10 I=1. q I. K OF THESE. but is easily changed.3/.H. that the algorithm (4) generates the value at :1: ofcertain k polynomials. The data for Figure (6) were obtained from BSPLVB with the aid of the following program. The first condition is absolutely necessary to avoid division by zero.ii. and so permits us to illustrate how a function as smooth as a cubic B-spline is put together from polynomial pieces. .—-1‘(-T) = Bi-r.1.|. regardless of any relationship that the specific value st might have to the (fixed) index i. .ows that the algorithm (4) generates. it foll. / ~_ . .Biii if we choose ti -5 :1: _'§ ti_|.1. . but what if the second condition is violated? A check of equation (2) assures us. for given 51:. . . by induction on j.Iii+1. each of order k. .pi of order it for which Pi. .ii. (T) Example: To plot the polynomials that make up a B-spline The input parameter LEFT for BSPLVB is to be chosen so that T(LEFT) < T(LEFT + 1) and so that " T(LEFT) 5 x 5 l§‘{_LEFT + 1). The Stable Evaluation of B-Splines and Splines 1 i l it II?’ I H I (6) FIGURE.l<:(3:) for ti S :1: 5 t'i+11 T 2: 01' ' ' 1 k _ This observation allows us to compute these polynomials. _ The four cubic polynomials that make up a certain cubic B-spline. . .. the value at :1: of the it polynomials pi_.I I 114 X. Since the process (4) does give us the value at :1: of the B-splines Bi. .1. DO 1O LEFT=4.T) .4F20. . VALUES 620 FORMAT(F10. BIATK(8-LEFT) NOW CONTAINS VALUE OF THAT POLYNOMIAL FOR BCLEFT-4 +(B—LEFT) .-.1:-1(-'5) + t1+R — ?3£+1 -1. 'PLoTTING THE PoL.t-. _f~.8) STOP END El DIFFEFEHIIBIIOH The fact that the first derivative D$(t — :1:)i_T__1 with respect to :1: of the pp function g(a:) = (‘t ... . BIATK ) C ' ACCORDING TO BSPLVB LISTING. ’.X KNOT SEQUENCE SET HERE..-. DATA T / 4*O. . . we now prove (8) with the aid of the dual functionals IX(5-4) and via the B-spline series.T(LEFT+1) ) WITH THE B-SPLINE B(LEFT—4 + .. 4..]DI(.3.— :r)‘if|_"1 (for example via Problem IX. flfiflfi flfi fi-Cl 1O VALUES(LEFT-3) = BIATK(3-LEFT) 2O PRINT 620.4.-r—1~_. ..1... — :c)f_*‘1 = [.t} = $A=-1.4..-(I): (iii.T) . EXAMPLE 2.L)B-5.. We begin with the observation that D$k.SINCE THIS B—SPLINE HAS SUPPORT (T(4).I Baa-1(I) )1 t-1Z+k—1 — it though this requires justification of the interchange Di. . t. .7. IT MAKES SENSE TO RUN LEFT = 4..) NOW CONTAINS VALUE AT X OF POLYNOMIAL WHICH AGREES ON THE INTERVAL ( T(LEFT) .T(11)-VALUES(4).1._|_1.-='5t+t-1l)(" T Y~'1)ii-_2 : (k ___ 1)( —Bt-_|-1. STORING THE RESULTING VALUES IN VALUES(1). .1.4.I)I(' — $'):__1 (8) = —(l° "* 1)(l'5i+1= . X.t = {DI I I G $t.’_"1 is given by D10: — iv)?‘ == -—(k — 1)(t — T)?“ may be used to conclude from IX(3) that I-. . 1.I I - r" Differentiation 1 15 CHAPTER X.Ii_]_D. .. .. In accordance with our promise to develop the entire B-spline theory directly from the recurrence relation. ..4*6I / DO 2O IA=1. '7r+A=l ". II-ij+.7 CALL BSPLVB C T.T(B)).. . BIATK(.4. without recourse to divided difierences.:c)l_‘.:-‘Ti!-510. L .._. HENCE.£_|_kl — it-5. K..S' WHICH MAKE UP A B—SPLINE CALLS BSPLvB c INTEGER IA.LEFT REAL BIATK(4). ..[to .4O X = FLOAT(IA)/5. LEFT. VALUES(4) FOR LATER PRINTING.10). ..T) = B(4. Since (t§+n=-1 — ')¢§.-: — ')¢j.- .51:-1-' J This shows that the first derivative of a spline function zj czjBJ-k can be found simply by differencing its B-spline coefficients. (12) .-_1Df = Z(—D)’*1¢.I=-1 = ¢. 1 (19) )\j'k_1D = A~_.J — 2 Bj1k_1. 1 15'-pk-1 " 1 I‘?- Z_-T . for any f G $. -r=1 in the B-spline expansion f = Zj A3-k f Bjk for f. .1.k—1 = Ifijk . .-M('r)D"‘"‘""Df('r)/(k -— 2.I=-» Therefore. by IX(53).1==» subtracting the latter from the former gives (*§+k-1 " *J')¢5.$1-1.i»'= ('3. Ajtr = 2("'-D)r—1¢jk(T)Dk—rf(T)/(k -— 1)1.D(2Ck_-jB_-jig) = . with ic—1 An. a spline of one order lower. Therefore.= .1!.. The precise formulation is T s ! (12) 3+1 _ __ an D(Z:a_. (k_1) _ *§+k—1-*1 This proves (11) B-spline Property (viii): Differentiation..¢_t.. . a111.116 X.11 r=1 Compare th.= -..¢.k—1 = ¢§—1... thereby obtaining the B-spline coefficients of its first derivative. The Stable Evaluation of B-Splines and Splines_ as follows from the Curry-Schoenberg Theorem IX(-44). all .B3-k) = 20¢ ~ 1) -“l--9‘-1'-%Bj.- J. We have left the limits of summation in (12) unspecified.is with the coefficients k. .)/(k -— m) an “average mesh length“. and.]. that is. — o:.m) as a divisor into the denominator in order to stress the fact that we are indeed computing a difference quotient of sorts. if indeed t. Repeated application of (12) produces the following formula for the mth derivative of a spline: (15) Dm(Za_._m = 0 by IX(22).]. (tr+1=—m "‘ tr)/(ff _ ml i We have taken here the factor (k -—.._m Li Ii with 0:. Vm := V(V"""1) and Var := o:.+. then B..s—1 _ I. it really doesn’t matter how we interpret the definition of cz£~m+1) in this case...m+1) = Vma.k_1 OI].. . as we will follow the useful maxim anything times zero is zero.. Here. . we need not bring in additional coefficients as we did in (I2’).t_. This implies that _ (17) o¢f.-. They apply to finite sums after these have been made formally biinfinite through the adjunction of zero terms.-. a""'1 for m > O ..-""="1"‘-—lC-|..) = Z@§’“+‘)B.B_.._|_.] for j ¢ [r —.BJ-. Vm denotes the mth backward difference.. then (13) Z-.+_..._.:1:_. all r. if we are interested in the fixed interval [tr .. W On the other hand.¢) J' _ 2 o:J~B_._m — tr = O. one simply refrains from attempting to compute of-m-+1) in case t. that is. [tr . . s--1' __ L _ 2 1) . In computations. At...k + 2 .2 0:3--Cl.._... . the formula (16) may lead to division by zero. s — 1].¢ on [tf-.'_1 J-+k-..t_.. that is....... ts].__. ' In general.= j ( $ Cli_jBj. j=r—k'+1 from which we have (14) .t.-/hm in case t is uniform.. But. = h.._1. — t. with the step (t._ -— tr = O.. formula (12) and subsequent formulas are written for biinfinite sums. ( I T Q’ for m = O.. The subroutine BSPLPP We are now in a position to discuss the subroutine BSPLPP for the construction of the ppform for a pp function f from a B-form for f..._.. .r If l* The subroutine BSPLPP 117 In a way.._1 vanishes identically on [tr .1 _ Bj.. 3I since B.. K) * .LSOFAR) . Z52Cl G1 t 1| H E R E toot: H D R K A R E A ##1##: SCRTCH .FACTOR. HITH 1:r.BREAKPOINT SEQUENCE. . IF (T(LEFT+1) .LENGTH or BCOEF AND DIMENSION or SPLINE SPACE SPLINE(K. T(LEFT)) ‘so TO so LSOFAR I LSOFAR + 1 BREAK(LSOFAR+1) .. c SCRICH(K.LSOFAR PARAMETER (KHAN = 20) REAL BCOEF(N).1) = BCOEF(LEFT-K+I) FOR J=1.K) .S RELEVANT TO cunnsur KNOT INTERVAL IN SCRTOH(.KHJ.GT..J. THE SPLINE AND ITS FIRST K-1 DERIVATIVES ARE THEN EVALUATED AT THE LEFT END POINT OF THAT INTERVAL..x or suns SPLINE INTO ITS c PP—REPRESENTATION BREAK.N.COEF.r(K) no so LEFT=K...B-SPLINE COEFFICIENT SEQUENCE. ID(if!Cflfi iflflfifi fl fifiCgflfi(§f)iHD€UC) HD(3C) HD INTEGER K.KNOT SEQUENCE.0 BREAK(1) ... THE K RELEVANT B—COEFFS OF THE SPLINE ARE FOUND AND THEN DIFFERENCED REPEATEDLY TO GET THE B—COEFFS OF ALL THE DERIVATIVES OF THE SPLINE ON THAT INTERVAL.» | F'" 113 X..L.T(N+1) COEF.S RELEVANT TO CURRENT KNOT INTERVAL FOR‘THE J-TH DERIVATIVE BY DIFFERENCING THOSE FOR THE (J-1)ST DERIVATIVE.. or LENGTH N+K BCOEF.J) = (I—1)ST DERIVATIVE OF SPLINE AT BREAK(J) FROM THE RIGHT .JP1.. L ) CALLS BSPLVB c t convsars THE B—REPRESENTATION T.T(LEFT+1) c c IUCNQIU 9 10 El V IF (K . OF LENGTH L+1.. 1) too TO 9 COEF(1.. .N ' FIND THE NEXT NONTRIVIAL KNOT INTERVAL.1) .. or LENGTH N N..NUHBER OF POLYNOMIAL PIECES HHICH MAKE UP THE SPLINE IN THE INTERVAL (T(K). scosry s.K SCRTCH(I. NEEDED TO CONTAIN BCOEFFS OF A PIECE OF THE SPLINE AND ITS mote: U U T P'U T K-1 DERIVATIVES moses: BREAK. BCOEF...K-J B-SPLINE COEFF.OF SIZE (K. Ta-' A .ARRAY OF SIZE (K. BREAK..L).L).. L. CONTAINS (IN INCREASING ORDER) THE DISTINCT POINTS IN THE SEQUENCE T(K)...T) K.J+1) .. USING BSPLVB REPEATEDLY TO OBTAIN THE VALUES OF ALL B-SPLINES OF THE APPROPRIATE ORDER AT THAT POINT..LE..BIATK(KMAK). T(N+1)) room: H E T H D D ooomot FOR EACH BREAKPOINT INTERVAL. K.... BUT C H E C K E D FOR.. AND STORE IN SCRTCH(.sc0EF(LEFT) so TO 50 srons THE K B-SPLINE COEFF.T.T(N+K) LSOFAR .BREAK. .. SCRTCH.DIFF.COEF(K.. cuss.EQ. KHAN (= 20) IS IHPOTHE ARBITRARY DIMENSION STATEMENT FOR BIATX BELOW. The Stable Evaluation of B-Splines and Splines SUBRUUTINE BSPLPP ( T...ORDER or THE SPLINE .E w :=- COEF(I..KHAX. K .SUH DIMENSION BREAK(L+1). Ehe I5-IUIZ THE RESTRICTION K . N. COHPUTE THE...LEFT.K-1. COEF. . . c Ctttifit I H P U T moose: } T. I.. no 10 I=1.. THEN consINE HITH THE B-SPLINE COEFF.. or COURSE.k 011 lg?---§. ‘AND THE SUBSEOUENT CALL BY THE STATEMENT J = JP1 . BIATX ) KMJ = K+1 .J)—SCRTCH(I.K J = JP1 . T(N+1). Ofi fl fi fifl fi fi fl vouto HAVE TO CALL BSPLVB ( T. the number D-""“1f(§.. we must find the L + 1 distinct points £1 < .EQ. of the one-sided limits) justified . for i= 1. 2. store them (in increasing order) in BREAK(1).J oo 2o I=1.JP1) = 2o ~ 1- CONTINUE (SCRTCI-I(I+1.f=2Q'5LEFT—-l::+rBLEFT-—lc+r. no 2s I=1.KMJ) + sun so" OOEF(KMJ.") and store it in COEF (j. and k .1 FOLLOWED BY A DIRECT COPY or THE LINEs DELTAR(J) -= T(LEFT+J) .. DELTAL(RRAx) AND oELTAR(ENAx) APPEAR IN A DIMENSION STATEMENT.. Then §. 1) _ RETURN FAcToR = 1.X EIATI(J+1) = SAVED FROM BSPLVB .J)_= COEF(I..GT. . IF THE REPEATED CALLS TO BSPLVB ARE THOUGHT TO GENERATE TOO MUCH OVERHEAD. FIND THE VALUES AT T(LEFT) or THE J+1 E-sPLINEs or ORDER 1+1 HHOSE SUPPORT CONTAINS THE CURRENT KNOT INTERVAL FROM THOSE or oRoER J (IN EIATI ).. 1.The subroutine BSPLPP 119 oo 20 JP1=2. THEN REPLACE THE FIRST CALL BY I EIATx(1) = 1. ._|_1 = T(LEFT + 1). BREAK(L+1) and then compute.LSOFAR 6o"~ coEF(I.J))/DIFF FOR J = 0.K) no so JP1=2.JP1 2s SUM = BIATX(I)*SCRTCH(I. o. K-1.. .L and for j = 1.. . JP1..1 among the numbers '1‘(K). . LEFT.) soRTcH(I.K CALL BSPLVB ( T.S (IN SCRTCH(.K FAcToR = FACTOR*FLOAT(K+1—I) = no so J=1..LSOFAR) = SUM 5o CONTINUE L = LSOFAR IF (K .1 KHJ = K . 1.-. = T(LEFT) < T(LEFT—|— 1) for some i '_§ L.1l1 T"=1 with agreement ‘at’ 5:" and (that is.T(LEFT+I) — T(LEFT+I — KHJ) IF (DIFF ..LSOFAR) = SCRTCH(1.K... .. T(LEFT).i).|.KHJ DIFF . NOTE.'1'. oo so I=2. Suppose §.. As already mentioned in Chapter IX.J)*FACTOR “ END RETURN . LEFT.K—J) ) FOUND EARLIER To COMPUTE THE (K-J—1)ST DERIVATIVE AT T(LEFT) or THE GIVEN SPLINE.JP1 sun = o. T(LEFT). EIATI ) COEF(K.. EL_|. with oi-fl as given by (16).. 1'=1 with b.r1lk+r into the (j + 1)st column of the two-dimensional array A as follows... . 120 X.. Therefore.1.4B~i4 = B44 -i=1 withthe k no t seque1icet=(0000123466.. ... . A final change of variables.j... .. .j+1)<-¢v§_. A(r. i i LEFT.. b )... .+. on (5.. .. EH4). k and (19) 7- ' M ’3+1) 4__ . 'iI"=1.. := BLE1="['-k+.k—j(€:_)-T T = 1._ A(T+1Ij)_A(TIj) ' E U” J)T(LEFT+r)—T(LEFI'+r—k+j)’ r=1.. then (16) translates into (18) A(r. . (20) Example: Computing a B-spline once again This time. by (15). If we put the k: —j numbers a£“:..6‘*viaBSPLPP.+. evaluate the B-spline f on a fine mesh with the aid of PPVALU (and INTERV) introduced in Chapter VII. k — 3-I 1 I §-£1 . ls —.6.. we use the subprogram just discussed to recompute the cubic B-spline whose polynomial pieces we obtained in Example (7) with the aid of BSPLVB..3' — 1 is substituted for j.-1». 1) +— CILEF-1-_i.‘. ls: —. .. then leads to the DO 30 loop.we : .k:—j. .4..?l..lt—-1. . both sides are just polynomials. j=1.k—j. obtained from the subroutine BSPLVB mentioned earher by a CALL BSPLVB ( T.i‘. we then find i=-J‘ D='r<e*> = ZA(r=5 + 1)._.. Once these coefficients are computed. ..i+r. . k Djf = X CBLBE-‘ii"_Ili-l-k+rBLEFT“k+TJ=*j on ' ' €-i. After we obtain the ppform for the spline 7 I 3: Z 5-i.—+1l r=j+1 for j = 0. in which k_ —.+.. .-. . r = 1. The Stable Evaluation of B-Splines and Splines since.. .FORHS THE B—REERESENTATION OF THE SPLINE BE EVALUATED. CALL BSPLPP ( T.s) sToP END E] The SUbl"OUl'.4).1.KNOT SEQUENCE. K. CALLS BSPLPP(BSPLVB).ovides the value of the jth derivative of a spline at some site. .. no 2o IA=1.F20.. in the subprogram BSPLEV of de Boor [1971] and de Boor [1977]1.' BVALUE The construction used in BSPLPP can be exploited in a slightly more general setup to provide the value of the first so many derivatives of a spline from its B-form.. EVALUATE CIOCDCI B(4. .LE.4o K = FLoAT(IA)/5. EXAMPLE 3. . SCRTCH..ORDER OF THE SPLINE . ION OF A B-SPLINE.LENGTH OF BCOEF AND DIMENSION OF SPLINE(K. SPECIFICALLY.a*o. BCOEF.. T.1. EXCEPT AT THE C RIGHTHOST KNOT. BCOEF. This is done. 4.1. N.. ..1.. OF LENGTH N . K . Instead. BREAK.4...T).T) DATA T / 4*o.VALUE. COEF. o ) 2o PRINT 620. Cassatt C I N P U T orsoss - T. BCOEF. K. .EREAK(5).. CiflfDCPfiC}fl%D€}O€1 A ...4*a..lI'|E. . / CONSTRUCT PP-REPRESENTATION . BCOEF. ASSUHED NONDECREASING.L REAL EcoEP(?J. L. BUT IS N O N H E R E C H E C K E D FOR.The subroutine BVALUE 121 CHAPTER X.s.PPVALU(INTERV) C c c INTEGER IA. OF LENGTH N+K. L ) As A CHECK. F TO H A R N I N G . VALUE 620 FoRNAT(F1o. C . but we do not consider it liere. DL. VALUE = PPVALU ( BREAK.4..coEP(4.. FROM ITS PP—REPR.. A S S U M E D POSITIVE . for example. /. but from its B-form rather than its ppform. N.B—COEFFICIENT SEQUENCE. N. COEF. .scRTcN(4. ‘REAL FUNCTION BVALUE ( T. K.T) . C THE SPLINE IS TAKEN TO BE CONTINUOUS FROM THE RIGHT. I. WHERE IT IS TAKEN TO BE CONTINUOUS FROM THE LEFT.. 7. KMAX (-20) IS IHPOSED ARBITRARILY BY THE DIMENSION STATEMENT FOR AJ. THE VALUES SHOULD AGREE NITH (sons oF) THOSE GENERATED IN EXAMPLE 2 .|ECOEF / s*o.. we now discuss the subprogram BVALUE which is analogous to PPVALU in that it pr.T(1i). 4.4). DR BELOW.... THE RESTRICTION K .4..x SET KNGT SEQUENCE T AND B—COEFFS FOR E(4. K.. ON A FINE MESH. JDERIV ) CALLS INTERV C CALCULATES VALUE AT A OF JDERIV—TH DERIVATIVE OF SPLINE FROM B-REPR.. CONSTRUCTION AND EVALUATION OF THE PP—REPRESENTAT~ C . NE. I .AJ(K) AND conpurs DL(J) = x ... T(I+1) .JCMIN..).J)*B(. . IF (JDERIV . saw ANY T. DR(J) .—1. set ANY OF THE AJ not OBTAINABLE FROM INPUT TO zzao.X)*B(. PRECISELY...JC.X) -----------------------------------.x.THE VALUE OF THE (JDERIV)-TH DERIVATIVE OF ##### H E T H D D ###### THE NONTRIVIAL KHOT INTERVAL [T(I). X LIES OUTSIDE THE SUPPORT OF THE SPLINE F . 1 .. HFLAG ) IF (HFLAG .K-1 . X .T(I+1)) IN AJ(1). T(I+1) AND T(I) .) ' CALL INTERV ( T.GE.)*B(. HENCE BVALUE = O. COEF(.+H—1) — X)*A(.. I. AND THE COEFFICIENT FOR B(I. (x ..FKMJ GO TO 99 #** FIND I S. T0 T(N+K) APPROPRIATELY.T)(X) ) . (SEE I.T)(X) ) . O) GO TO 99 ### IF K ' 1 (AND JDERIV = O). (THE ASYHHETRY IN THIS CHOICE OF ‘I MAKES F RIGHTCONTINUOUS.)) + (T(..+K-J) — T(.JJ. HITH J I JDERIV.. X. EXCEPT AT T(N+K) WHERE IT IS LEFTCONTINUOUS.LE.J-1) " BCOEF(.T) ) BCOEF(.INTEGER GIVING THE ORDER or THE DERIVATIVE TO BE EVALUATED A s s U H E D TO BE zanu on POSITIVE.+M—1) — X) TO URITE (D**J)F(X) EVENTUALLY AS A LINEAR COMBINATION OF B~SPLINES OF ORDER 1 . J .J—1) ..HFLAG.J) Ii 51 ". * I.. THE K B—COEFFS OF F RELEVANT FOR THIS INTERVAL ARE THEN OBTAINED FROM BCOEF (OR TAKEN TO BE ZERO IF NOT EIPLICITLY AVAILABLE) AND ARE THEN DIFFERENCED JDERIV TIMES TO OBTAIN THE B-COEFFS OF (D**JDERIV)F RELEVANT FOR THAT INTERVAL.THE POINT AT HHICH TU EVALUATE ......(25—29) OF TEXT)..LT.1 IF (KH1 .LE. BCOEF(... N+K AND T(I) . GT (T(. J-1. O) _ GO TO 1 BVALUE I BCOEF(I) GO TO 99 ¢¢¢ swunz THE K B—SPLINE coarrxcxanrs RELEVANT FOR THE KNOT INTERVAL (T(I).X.. NE HAVE FROM I.(15—16) OF THE TEXT THAT é (D**J)F I SUN ( BCOEF(. KH1 I K ."'.. BVALUE I O.J.KH1 . ##### U U T P U T ###### T BVALUE...~—— (I — T(.NHI.“. K) OOOOOO C QQQOQQ AJ(KHA1)..T)(K) MUST THEN BE THE DESIRED NUMBER (D**J)F(X).EQ.ILO.T(I+J) . JDERIV..JCHAX.LT. CONTAINING x IS LO- CATED HITH THE AID OF INTERV .N. O O O O O OQfi fi fi fi fi fi fi fi ifi ilfi fi INTEGER JDERIV.. IF NO SUCH I CAN BE FOUND. J .. 0 .. .S not OBTAINABLE EQUAL TO T(I) on.—1) A(..T.SUM ( A(. .))/(K-J) ‘ -I THEN.M—1.T(I+1—J).X. N+K. BVALUE I BCOEF(I)..H.DR(KMAK).KMAX.JDRNP1 PARAMETER (KHAX = 20) REAL BCOEF(N).KMJ.K.T(I+1)) F AT I .) + (T(.DL(KMAK).1. The Stable Evaluation of B-Splines and Splines 122 x. HE USE REPEATEDLY THE FACT THAT H I ggfi ( A(...IMK.T(N+K).LT.T(_))#A(.K—J.GT. 0) JCHAK = K + NHI no 15 J=1.x DO 16 J=JcMAx.JDERIV KMJ = K-J FKMJ = FLOAT(KMJ) ILO = KMJ DO 23 JJ=1.KM1 DL(J) = x .Kui DR(J) = T(I+J) " X no 21 JC=JCMIN.KHJ AJ(JJ) = (AJ(JJ+1)*DL(ILO) + AJ(JJ)*DR(JJ))/(DL(ILO)+DR(JJ)) ILO = ILO — 1 BVALUE = AJ(1) " RETURN END W1iP'I The calculation is based on the formula (15) for the derivatives of a spline and on the recurrence relation IX(1-4). DL(J) = DL(I) no 9 J=1. = . ### COHPUTE VALUE AT I IN (T(I). We locate i so that ti 5 X < t.JCHAK DR(J) = T(I+J) . KM1) GO TO 39 JDRVP1 = JDERIV + 1 DO 33 J=JDRVP1. DR(J) = DR(JCNAX) cc TO is cu TO 20 no 19 J=i.T(I+1—J) no 6 J=I.I DL(J) = X .JCHAX AJ(JC) = BCOEF(IMK + JG) ### DIFFERENCE THE COEFFICIENTS JDERIV TIMES IF (JDERIV .I _ IF (NHI .EQ.EQ.KH1 KHJ = K-J ‘~ ILO = KHJ ~ DO 33 JJ=1.KM1 AJ(J+1) = O.T(I+1)) OF JDERIV-TH DERIVATIVE GIVEN ITS RELEVANT B-SPLINE COEFFS IN AJ(1) AJ(K-JDERIV) IF (JDERIV .GE.T(I+1—J) co TO e co TO 10 JCHAK = K NMI = N . O) GO TO 30 DO 23 J=1._.BCOEF('£ — K + 1"). 1) -¢.KMJ AJ(JJ) = ((AJ(JJ+1) — AJ(JJ))/(DL(ILO) + DR(JJ)))*FKMJ 23 ILO = ILO -~1._|_1 and then compute the K-JDERIV relevant B-spline coefiicients for the JDEHIV-th derivative of f according to (18 and (19). This means that we initialize E5?!‘- 21) A('r.KH1 AJ(K—J) = 0. 0) JCMIN = 1 .GE.IHK no 5 J=1.K IF (INK .The subroutine BVALUE JCHIN = 1 INK = I . I)CliEl1(iIF) I= . . . ‘In + 1)Bi_(k_m)+r'k_m($). of which the derivation of IX(19) is a particular example and which is as follows._J-+. we want to evaluate the spline f itself.2)’ ..__.. then we obtain the fact that (25) f(x) = 2cr.» j=--O.. The Stable Evaluation of B-Splines and Splines and then compute _ _A (‘PL+1.1. to make use of the first algorithm in de Boor [1972].. Now we know that. (I) (rs — t.. t Consider first the case m = JDEHIV = 0... and k := K. 3 = 1.-re) with (24) aLg]($) r: (IF — ?51~)@1~ + (¢1~+i=-1 Ilfir-i _ t-r+k—1 _ tr If we repeat this process again and again. It is more efficient.~_|_. 5? :=T(i+s)—X.-. -_ ——-—-——-—"-"—'""—-"""_""'"_= 9 > °= P I. r+k—1 — tr 1.t t J: = Z CY-r -.iv. := E A(7‘..JnE1=. we obtain that _f(:i:) = E a.. 1:: — 1 r with (26) _ [j+1] 0:1. Here. that is...-1._.K— 1 introduced earlier in the discussion of BSPLVB.... tr+k . we have used the abbreviations 5...II. .k—1(517)1. 1"‘ rt‘ -. s= 1. . CBT1 .———-—r—-— Br.' A(_m+1)..l:._j (rs). - j = O.T51-+1 ~ Now change the dummy variable of the summation in the second sum from r to 1' — 1 and recombine the two sums to get that re) = Z -:»£-%>B. From the recurrence relation IX(14).~_|_._(K_3) 5. k-m. + 6. .(:t') .’ :=X-—-T(£+1—s).= .l+ 1](iII):B.124 X.k—1($') + Z 01'-r —-—rik———— Br+1.B. .3' .~_. with m := JDERIV...)al£ll (rt) + (t.._. -r=1 _ We could therefore finish the calculations with an appeal to the subprogram BSPLVB for the values of the requisite B-splines.K J.'. (22) 1.. though...~. :1: := X.'J) —A ('. t.3(=-:> £13" <31) oz.k—j+1..-__|_1). Now take j = k: — 1 in (25) and take ti 5 :1‘: < t. Suppose we put the k—. . =: c1:. j=1. constructible column by column by (26) and producing eventually the polyno- mial elk] of order k that agrees with the spline ES o:_.. as a convex combination of its two neighbors to the left if.. Z 75 Therefore _ _f(fL') = I-OI‘ Iii § I < t£_|_]_. Table of polynomials ai?-I of order j... 3 :1: 3 t._|.. Then (26) can be written *r=1. t.k—j. on the open interval (‘ti . 1... .~:) l @E?’<:-~> ct... A(r. according to (26).. I A('r 9' + 1) {. . Then 1! I B’-*"i(“’) = B"1($) = io. but with coefficients which are not constant anymore but are polynomials of order j + 1 in the independent variable rs.al:"] into the jth column of the two-dimensional array A. ..lklf_:r ) @£*“"<:-~> Oi£_]_ =2 a. ._i..+1]..l1_}1(:.|_2(:-I’-) ¢~£’lh. ." t._1+r.. This makes it possible to evaluate our spline f at the site zr in [ti . t...1) '\ |-I-J I by constructing successively the entries in the following table.k—1. The leftmost column consists of the B-spline coefficients for f pertinent to the interval [ti .. . Every entry in a subsequent column is obtainable._|_1. Ore-I-=+1 =1 ¢1rlll...+1(='~'1) aiIi]k+2($) 0‘-'1--k+2 =: Ck»i_il.j)<-—-aE_]_k+J..j+1 numbers ci:R]_k+j.B._|_1. ---_i--_---_--_i_6"%“-""+“'*‘"A(T + 1"]-) + 5fA(T’j) H (28) 51%-j+1—r + 61? ’ ' *r=1.I.£1](:r) (27) FIGURE.The subroutine BVALUE 125 This means that we have rewritten the spline f of order k as a linear combination of B-splines of order k — j . as we assume. .. 6§Z=I}-. 6) on a fine mesh. Otherwise. if we initialize ' ...B...TI=Z. we could suitably restrict the indices appearing in (22) and (29). k -—m. it) = D"“f(:i:) 1 for ti. In this case..‘ +6RA . The first part of the program takes care of the possibility that there might not be I: B-spline coeficients for the interval [t. and then compute._. . it would be more eficient to convert first to ppform via BSLPP and then use PPVALU for the evaluation.-_. ll’ '| I We have shown that.+..k-—j. But. 4. Consequently. < k and/or n < '21 .-. T=‘-1.._ A +1. 1. if we compute the k — in numbers A(r.--—-1'6.t.1.. "' | A(rI +_ ai—k+T1:|- T -:' 11' ' .3). 3 :1: < t. . use the abbreviations Il|-_. ll‘ l 126 X....k--1.-..—. but use BVALUE this time..' A(T1j+1)m (29) 6k—j+1—r {T 61' 1* r=I.<_ n + it. by (22).II--ti+]__.. j='m+1. . it seems inefficient to burden the calculations (22) and (29) in this way with additional index calculations.i (C and then compute the remaining entries in the triangular array A according to (28).+1]. we do not need to invent (explicitly) additional knots. in contrast to Examples (7) and ('20).|.. . 1' = 1.-in-Q 6._-. we simply choose the “missing” coeficients to be zero and then choose the correspondingly missing knots (whose choice is then entirely immaterial except for the necessity of avoiding division by zero) to equal the first or the last given knot as the case may 1' be.i€—1. One would expect to use BVALUE if a spline is to be evaluated no more than about two or three times ‘per polynomial piece (see problem X. 5 a: <1 t._.|.1..m+ 1). _ (30) Example: Computing a B-spline one more time We compute once more the values of the B-spline of order 4 with knots (0.<w> for t. then Au. The subprogram BVALUE employs the two steps (22) and (29). ..-. The Stable Evaluation of B-Splines and Splines I-I. . is = re) = Z -:~=. Rather. A 6*' ~ _. since this case is likely to be exceptional.. Note that.. according to (28). then I A(1. where we.|1. once again. This happens when 1 5 1. 3.i I11 ii I F-£_ __—___| I |. . c corucros vrrn rnoss osrnrusn oo 20. 1 2'? EXAMPLE 4. In formulae.B¢.6’.B__-5. IS given by 2.+1 with .F20..51--1 + Q5£(t-£+k .1.4. CGNSTRUCT ION OF A B-SPLINE VIA CALLS BVALUE(INTERV) rurscsn IA REAL BCDEF(1). / .B.40 x = FLOAT(IA)#.-.5 .r) / on (0.T(5).=_) = 1.22. we have again taken the tack that even if our spline E. for a specific spline f = o:..!=+1) = $k BikThis implies that E. 4.'n. Indeed..-|-1 it._|_.VALUE. 20 PRINT 620.4.IA=1. But then ‘rt B.4.0 ) .. VALUE 620 FORMAT(F10. all ‘5- This allows us to prescribe one B-spline coefficient in the anti-derivative for a spline arbitrarily.-—-=2r:i:_.. or (31) fit = . all ii.=. — '>'. ..6)..-_ -.5 Integration We know from formula (12) for the derivative of a spline that u y D(El3iBi.=_B.B. and all other coefficients are then determined by (31)... scosr..1...2 — 1.+..—t_.B. is the first derivative of the spline E.ti)/N.1..|...Integration CHAPTER I. we nevertheless treat it as a spline with infinitely many knots by adjoining suitable zero terms.6’. aiB. ..6-.+1 With -- H -t---1? _ 2:1‘.-)/k i=4 for *i=n. 1. o:.r) on A FINE MESH.. '50 = 1 in (32).a.6’. --_t.. we manage to construct an antiderivative E.6’..+1. c svntunrs s£1.6. vntus = BVALUE ( T. scosr / 1.. . x. THE vntuss SHOULD IN EXAMPLE a .|. I’ < 7'01 and c and in arbitrary.(t_._1)/(t.X c ssr KNOT ssqusucs r AND DATA r / o.. -I O for all ii < 1 by choosing c = 0. Here. has only finitely many knots.1 provided k(. This is quite necessary because a spline with finitely many knots usually has no anti-derivative with finitely many knots....s. x. the most general anti-derivative for the spline E. a...B) STOP ' END BVALUE s-cusrrs FOR B(1. We find that we . and 1* :== ls: —..2). K (for BSPLPP) d8SCI'llI)8S thfi B—IOI'II1 IOI fl(T(I)__-I-(1. (c) Give such a count as a function of k and Z for the cost of converting from B-form to ppform by BSPLPP. ( b) What P art of T .._1. (b) by PPVALU. HI. is the derivative of a spline with finitely many knots if and only if C25: (ti. K would give the B-form for f |(-I-(D .k-1 = 0ii+e-1 — it ' tt+. ti - . . 3. Prove: If z occurs exactly m times in the sequence t. BCOEF . Problems 1.128 X. 4. then — ti . K a partial representation.1DTBt. It is easy to pick out of the B-form for a spline f in T . Use BSPLPP to calculate the value and first it . K. BCOEF(I—K+1) ._|_. —— tj) = O.|.f—JumPzDTBt+i.=('?j+r-=—*§)/l=)B¢.-(3))? (c) Vlfhat if I < Kin (a) or (b)? Could an appropriate representation usable in BVALUE still be picked out‘? 2.-+1. . N . (Don’t cause any more computations than absolutely necessary). _a B-spline). BCOEF.I=-i + -—*-"i*'. Use Leibniz’ formula I(iv) to establish a recurrence relation that relates the jth derivative of a B-spline to that of _two B-splines of one order less.. .r. I y (a) Verify that the input list T(I—K+1) .11)).1. Problem VII.ti+1 . Of course.. 5. then use IX(53) and Theorem IX(44) to construct a B-form for the resulting pp function and compare with the B-form you started with. -.1 derivatives of a spline at just one knot'T (i). Give an operation count (floating-point operations) as a function of it for the evaluation of a spline of order k at-one site ' (a) by BVALUE. Take a spline in B-form (for example. 3 H f Z-sBv.|. convert to _ppfo_r_m_ by BSPLPP. The Stable Evaluation of B-Splines and Splines It follows that the spline r:. _ 7.:-=+1(fl-'=) ni Iii HMH J I on t1 5 as 3 ts. . Change BVALUE into a routine BVALLC that treats splines as leftcontinuous functions (cf. m m 1 ine (Z11?-c. Partial B-form.t.1 —~ m.I= —. N . —"i"'—'—Jl-1I11l7>. (d) For how many interpolation sites (per interval) is it cheaper to convert and use PPVALU than to use BVALUE‘? .. these infinitely many coefiicients need not worry us if we are only interested in the integral over an interval containing a finite number of knots. .B. 6.<y>dy= t1 1. — 1)!-) ' 1. is the first derivative of a spline (with finite support) if and only if c.) = O.. (a) Prove that f := cr...... = b... for f = 2.._.(t..) necessary and sufficient for f to be the rth derivative of a spline of finite support....i:..._+1] from cx. Develop an alternate routine BSPLPP that I11B.1-:. . (Hint: Express each of the polynomials a-if] in local '1 polynomial form.+1 = --_. (b) Prove that f is also a second derivative of a spline (with finite support) 1-1.+.H... _ em .. — t. li if and only if in addition 1 129 11.:. with t. -Iil-Ip-II-L I 1 I 10. CI-11B-£I.. state and prove the r conditions on (o:. — t-) Z: (t 3-+1.r.. "“ (11-1) 1-.:tT+S1 ‘ '.Problems i_._+1]‘? (I-Iint: I [I-=1. 1 i=1 .l-{BS no use of BSPLVB but rather uses algorithm (25) — (26) to derive the local polynomial co- efiicients of the polynomial piece of f = E.+1 = = t. . = a._.l. J - ._|_. l F This shows that the choice t1 = =11 ti...a.) l- - _ I-low could this idea be used to derive a routine that evaluates simultaneousiy f and its first s derivatives at some site z in [tm .1. Use (15) and (16) to show that. and t. 8. t..._.16) — i=1 Ef (Z)($ — Z) _ /(..B.J..f)(t-1") : A'jar—k+11 for j = O1---13- I i -1.. on [tm .‘.1 — tj) = O. I - ('Dj...--I P-(t.. t.B. 9.i=1 (c) If you have the courage..._|_1.:tT<tT+1i.|. of the end knots as proposed in Chapter IX makes the imposition of end conditions on f and its derivatives particularly easy. J___ ‘I.‘ _lI| I ___.-It_ II ___ __ _lI-_llIl _1 _LI|_ -II’ L__‘ ___.I-__ I-ll I_r_ ‘_.hf-I._ _______|I__ ________T I_I_II_IJII_P_|| __ __|_____| IILLI If._ Ili i\_I-__ _‘__|| __Il_______L II1 _|_ II|_|__ LI _ .-__:_ ___I_ II__ __I 1 Ill___ |_ I____ ILIE III I .JI1. ILI1 __ _It _|_‘1 i 1__ III_I__III _-I _1 I_______ . I I-II1I i ‘ __.IFlIfI:_I__|_t\_ __ILII L ___ _|_ ‘__ —_I_IqII|__I1I _II‘ _I__ II_I‘ _|_Hi___I_. the values of the spline f = 2 C-l!_-jB_-j on the interval [ti . . by the k B-spline coeflicients “nearby” (see ' 131 .:. .+1 = . Cr-.|. in particular [G. we made the point that B-spline coefficients model the function they represent.|.n. let Bi == Baht. i = 1. and t1 = . .C€_-jBJ'_. Bounding spline values in terms of "nearby" coefficients Recall from B-spline Property IX(iv) (see IX(36)) that the B-spline sequence (Bi)? provides a “local” and nonnegative partition of unity on [a . t.. all i.. .= ti.-.. thfifl = it O:3.. This gives the following property (to add to the list begun in Chapter IX): (1) B-spline Property (ix): Convex hull..= t. Control Points.-. and Knot Insertion In Example IX(58).. also.. .+1 and f = 23.+1_. II1(l€B(l. ..-.x{o:._. Throughout this chapter.1.B_1'(€. . In the present chapter. = b so that. <1 :1: '< t¢+1. then (3) min{ oq__|_1_.._.. osi... b].. let t := (t£)"f+k with ti < t. . .. Ift-5 5 :1: 5 t. . we document this assertion in more detail by continuing the list of properties of B-splines begun in Chapter IX.. 0:-5 In words..I7). . above and below. . . . . (2) Corollary. paying special attention to the control points of a spline and introducing knot insertion as a remarkably efiicient tool for establishing the shape-preserving properties of a spline fit and the total positivity of the B-spline collocation matrix that underlies them.=.'.1] are bounded.II-' XI The B-Spline Series.1.t-n+1] - is the basic interval. .:.. while all Bj(fl3) are nonnegative and sum“ to 1._1_. and let $ = $.1} $ § n1a.. the value of the spline function f := E3. For t. ojBj at the site as is e strictly convex combination of the lc numbers cxi_.. t£. = 0.b]=[ik.... if ti 3 CB ‘_~_'-1 $54.+.. 7869-~ O-703 Based on numerical calculations. A different proof (along the line of the above proof sketch) can be found in de Boor [l. but the proof there is unnecessarily involved.. o:jB.i_.__i.. Then |(—D)“"”1.132 XI. Du-1f(1_i)1 i .ti.+.. which depends only on I: and not on the particular knot sequence t.__i_.-i.-+1] in [ti+1 . . for Ti in any knot interval [ti . . both inequalities for certain t. PROOF SKETCH.i..4 5 6 U1 ._.and i-independent constants. ti_|_ii]...|... given above are computed with the aid of de Boor [199O]1. On the other hand..._.D._....] for a certain constant independent of i and t. The best bound so far is obtained in Scherer 8: Shadrin [1999]: .._-. .(ri)| 5 const|At.|i.. are k _Di.-.t. _§ li32kH1. so that for all i..+. I Dii ix. The specific numerical values for Di.. . ._.i + k — 1}). t.5680-~ 12..+.0886-~ 22.-..~.i. ~._.__1].Q76[g. for the ith B-spline coefficient oi of f G $ii.i._+1] in [ti . . Let f := 23. Aikf 3: Mi ‘Q .. in general.. we get [if — c[[[i._. by Markov’s Inequality (see Rivlin [1969]).] = (M — m)/2. El The existence of such a constant Diim. iii.i.__i.I-bd ..[\f -.bii. (Bi)? is a relatively well conditioned basis for $ in the sense that there exists a positive constant Di. Since B-splines sum up to one. while. goes back to de Boor [1968].c\[[i_. This shows that |o:i| § const||f|[[i.]/|Ati|”"1-. it is conjectured that.._. The B-Spline Series.m I.] for any particular constant c. as the following property shows.-|""'1 (since D“-“ 1.. PS“ . and Knot Insertion Problem 1).. Control Points. any B-spline coeflicient is closely related to the values of f “nearby”. (5) implies that [oi — c[ 5 Di. .___i___.bii. We use the abbreviation llfllr == SHPlf(=1=)|:'cEI (4) B-spline Property (x): Good condition. (5) [ail 5 D“'“'“'[l Ea-lBj[[[1‘-i+1--1‘-i+I=-1]‘ Ii Smallest possible values for Di...] § const[|_f [i. For the particular constant c := (M + m) /2 with g := { f (11) 1 ti+1 5 1: 5 ti+i.... y ID”_‘f('"=:)| S wflstllfll[i._.+.i to lie in a largest knot interval [ti .(1-i) is a certain sum of products of 1/ —--1 factors of the form ti — ri with s G + 1. ~ 2“—3/2. Choose 1-i in the dual functional formula IX(54).. This give the following converse to Corollary (2)._+..3._._1 }. .-+t- k___ _ i.... Finally. B5. a spline with 'uecto'r-valued coefficients.113_ For this reason. a spline with values in the plane or in 3-space..e.i.. Let f = '23.n) the control point sequence of the spline function E5. . the graph of a spline function (or... This term had its origin in ComputerAided Geometric Design. :1: G [o. Correspondingly. its B-spline coefficients are then points in the plane or in 3-space. y (3) C°I‘°11flI‘Y.-Then _[fii— [£Dk..s|lfll| 5 ll 2@§Bj|l 5 llflll I= maxi lesi' The point to note here once again is that Dii. by definition. Control points and control polygon The close relationship between the value of a spline and the “nearby” B-spline coeflicients has led to the definition and use of “control point”. that is. by B-spline Property IX(v). and their sequence is called the control point sequence of that spline curve.i.-i. :1: = Z:t.m .. Now.and f([ti_|_1.==(:. does not depend on t.c¢._.b]. namely the planar curve w '—* (1=.ti_. a vector-valued spline.DI§. a spline curve is.Control points and control polygon 133 (6) Corollary. one calls (9) (P._i.. scalar-valued spline) f G $ defines a curve. where spline curves rather than spline functions are used. that is._1]) = [m . since.i_i. CIjB_-j G $..-‘i. the assertion that (Bi) is a relatively well conditioned basis for $ is properly expressed by the following corollary which combines (5) and (3).M].iB_.)eIR? :j=1. 5" where (see IX(39)) It ism: +-. Here.-(as).f(=v))i and this is actually a spline curve. We know from (5) that lajll : 5 'Dk_P°llfll[_tj+1--tj+k—1l' Further. the linear Taylor polynomial for f at tgfk.+1-. .Pll 3 Cfinstllf '. P1= flfisl + (.t_-. le. Figure (10). e . The B-Spline Series. the control polygon (11) Cratf of a spline f G $ is the broken line with the spline’s control point sequence as vertex se q uence .. and Knot Insertion I "~. then (12) Proposition. ._1] (14) 5 1 const '§(t_i+i'-1-1 T tj+l) 2 2 -fllil-_-. ‘/1 (10) FIGURE. recall from the knot-averages B-spline property (see IX(38)) that Ms? = Pills): an P E HQ- Choosing. A control polygon exaggerates the corresponding spline. we get l-115 -' flfirll =-' lA. that is.134 X1. If the spline f G $ is continuously differentiab <13) lei — r<r. reglons of convex1ty/ concavity._|¢|II- . The control polygon 1s an exaggerated version or caricature of the spline itself. . .. .g..t}r)Df(t}i). in particular. etc) or' the spl1'ne'see . Control Points. hence makes it easy to locate certain important ' ' ' features (zeros. _ The close connection between a spline and its control polygon is also evidenced by the following proposition.d Any crossing of the spline by some straight l1ne 1s brackete by crossings of the control polygon by that straight line.Pllliiii-¢i+l. Finally.o\ s ‘3°T15tkllil2llD2fll[ti+1--ti+s_-1l- Pnoor.=+|i-ll’ .i-lrlf —. this requires a way.rsl2llD2fll[t...?. This has immediate appeal when generating a computer graph of a spline since most graphing programs only plot broken lines anyway. This means that we can rewrite any f G $Aas a spline with a refined knot sequence t and. Have a look at Figure (17) which shows the spline from Figure (10) along with its control polygons obtained by repeated midpoint refinement in which the next knot sequence is obtained by inserting into the current knot sequence all its knot interval midpoints. much as we derived the differentiation formula X(12). Then 1 y ‘ll lf($) — P($)l S g (ti+1.-‘_._ rii._1. I ..F‘ Knot insertion 135 (15) Corollary..]=- while _ lP($)_—Cls. as first proposed by Wolfgang Boehm [1980]. One such way is provided by knot insertion.... For any continuously differentiable f G $. by comparing coefficients. Now.|' IF"!- Kn0t insertion Any refinement t of the knot sequence t can be reached by adding or inserting knots one at a time. and let p be the linear polynomial that agrees with f at t.. to which we turn next.fithe spline space‘ $ = $ii. . be certain that the control polygon C7. I] The proposition and its corollary are nicely illustrated in Figure IX(62). Let t.s—%"+1)|} S °°I1St|l=l”||D2f||. Of course... | l'l |1 '\. we avoid certain mostly notational complications by assuming k: > 1 throughout this discussion.-E for any knot sequence t that is a refinement of the knot sequence t. -E-f is close to the spline itself.5_. ~i -\.. for constructing the Bform of f G $ as an element of $. preferably fast.-.I-Q from its B-form based on t. by choosing the meshsize |t| small enough. In symbols: ' ||I""'-n (16) . l|f—Cs. We derive his algorithm with the aid of the dual functional formula IX(54). C ilikl-2*..1.s | _ ‘ll C ‘l5 ==’. directly from the Curry-Schoenberg theorem IX(44).'_\ i. There being nothing to calculate for the case I: = 1.T.. and t.rs —" '3..if|| 5 ¢0I1S1=lt|”llD”f|lPROOF.r.i is a subspace of $.."1:f(9-ill 5 ma-X{|f(i§r-¢o')l= lf(¢§+1..i.- $ —— $._. by the Proposition..:+.._. 5 as 5 t. for ti-_|_i. Assume that Ii is obtained from t by the insertion of one additional term. . .f 1: 2 Q. (see IX(15)) on the interval (ti. for ti <1 x <1 ti+i. _ ti_._1 5 :1: '3. with ' O. :1: Say.-5. J Then (see Problem 11). for any j.ti)_..:_1) and is constant outside it.-_..biii"'s. for ti <1 11:.can be computed as I <20) with is = »\.f = i Q ___ i — D“"f('o) |- A A - "Pit == ('5. After three midpoint refinements.s + 511-=(=1=)*§r.l2i-ii as a weighted sum of the 1. .-‘+1:-1 _t§ the broken line that agrees with wii.¢7it($))t_i-1. £01" tj_1 > 17.=+t-1 *. :9: |--> o. for :1: 5 ti.t. the control polygon of this spline is graphically indistinguishable from the spline. DH—1f(Tj)_ 1-1 Now note that ihiii appears linearly in (20). and Knot Insertion fl. for ti = ti+i.. . I We know from the dual functional formula IX(54) that the jth B-spline coefficient for f G $ as an element of $5.1.ti+i.-‘+1 — -) ._. -E-_ _ ti._1._1. (13) E-is = (1 . with ' . Control Points. i't’s just .136 XI.:ii.' ' ('5. The B-Spline Series.')= 3-113} while its jth B-spline coeflicient as an element of $ is F“ aj = Aj1k._ t. 1.-""‘ (17) FIGURE. substitute the resulting expression into (20) and multiply out to obtain Eli as the corresponding weighted sum of the ozi’s. h (19) $. hence all we need to do in order to relate Gi to the oi’s is to express.. 1. wii.(m) = ——-ii-—. if possible.‘ — i -F . _. If the knot sequence t is obtained from the knot sequence t by the insertion of just one term... respectively. 5i = ozi or = cei_1. There is therefore some thought needed only for the case ti < 9: < ti+i. A (24) Corollary.if. :1: say. . all (with P.'. instead of wiii.(s))i. (22) B-spline Piloperty (xi): Knot insertion.a=i<i=>>e-1+ a-i<i)e.i.(. E3.. correspondingly. the refined control polygon can be constructed as the broken line interpolant at the sites (ti?) to the original control polygon.-.'... note that . tr] has the numbers t. exactly when ...:. all j).i := f =: 2.'_k : J "/1. By IX(-'38). see Figure (26).—)>.?.r) and wg = u:ii. when wi = 1 — mi-i. an jIn other words.. that covers all cases... the particular spline p : zr i—r.k + wflkik = (*5i+1 — ') ' ' ' (t_'i+l=—~—‘2 " ‘)(w1(t3i -' ') + w2(t..($). 3...).. (VV.i:1 J: S . that is.. hence (22) implies that oo e = <1 . Hence.(CB))CJ5_i'_]_ + aJ”i'k(SC)C1!i'. This proves the following. Boehm [1980]) If the knot sequence t is obtained from the knot sequence t by the insertion of just one term. -|.. :"""n By using wii.._i = (1 _ o. 7lbj—1.o.-..(:.-u._1. In this case. (‘w1('5i*')+ wz (*i+k-1 "" ‘ll =(="1'-')= that is. The calculation (23) has the following pretty graphical interpretation (and is usually so described'in CAGD).G $.. we look at the particular weighted sum w1‘kJ—1.I== if t_-j-1-it--1 § 93.11 3'... + o.with I Si = — Qi:. = (i. the vertices Pi = Eii) of Ck-if lie on Ci.-).l. we obtain the formula (21) X. §iBj. then. 1: >r.) = cu.-. aiBi_i. for these cases. ' crii-r<?. PROOF.at on [a .r+k—1 " ‘ll-|I'-"||- This agrees with il-ii.Knot insertion 137 For this. |:\ . then. for any f.ir<'a.. as its B-spline coeflicients.-.. for any f G $. 3.5. W.i-1 5 rt.138 XI.5.r. -in3-—Z-$ . and therefore we must have Ei = for the corresponding B-spline coefiicient for f G $. Bi I=-"' Bjikzh Iii‘ is the only B-spline of order It for the knot sequence t that is not zero at st hence must equal 1 there. then the calculations carried out are exactly those of the first algoritlim in de Boor [1972] a11d described in Chapter X...--2 -.+. and Knot Insertion ii-1 113 li+2 s--l-—-e P-_ . S"or is the largest integer r with the property that for some 1 5 ji <1 < j.ii_. Control Points... the calculation (23) is exactly the one for a. The B-Spline Series. < 0 for i = 1.0... 5) with it = 4 produces the heavily drawn control polygon from that of Figure (10). To be p"iecise .|. J 1 ti+1 ii ' Pi CB 33. More than that. \/3fi3tlOI'l diminution It is customary to denote the number of sign changes in a sequence or == (oi). o:i. with ii the knot sequence obtained from t by inserting :1: exactly as many times as are needed to have ti < ti+1 = 11? 5 t:i+l=—1 < ti+ki i.0. for ti < :1: < ti.o:i.5.. the first step in the evaluation of f G $ at the site 2:. This conforms with the fact that. when (22) is used to insert :r it —— 1 times. [ “ (26) FIGURE.0. iii o Fl t.i.-..'" b y S"o: .2]:r:) in X(24).1.-2-. Boehm [1980] already points out that. ti+3 Insertion of the point :1: = 2 into the knot sequence (0.1 and with j = r. by the Lemma. . .. 2. oiBi and ri < < r. Thm 4. f(r. . . I-lere is a simple proof.(Ti)f(Ti'_)'> O 1001‘ ‘Z: = 1. . though.. arbitrary in the domain of f. It -— 1. 10. Insert into t each of the entries of a given sequence r = (r1-< . (28) Corollary. . . l S_(ZCIi:Bi') 5 S—C. . based on knot insertion. E] One denotes similarly. But the proof there is merely a refinement of arguments by Karlin [1968: Ch.. .7‘. that is. the number of its sign changes by S“ f and defines it. then one can find indicesl 5j1 < <31.I. Set f := EaiBi. Property is proved in de Boor [1976]1.. . all i.-)) 5 s-a 5 S"‘o:. Thm. More than that.-. If f = 2:3. . Corollary (28) is a special case of the following slightly more sophisticated statement.-5nso that (30) C1!i.< r.. as the supremum over all numbers S'(_f(r1). . (29) B-spline Property (xii): Variation diminution. In that case. f(r. o:iBi is not bigger than the number of sign changes in its B-spline coeficient sequence or = (oi).) enough times to have each appear in the resulting refined knot sequencet exactly k—1 times.Variation diminution 139 (27) 1Lemma._f(r. Then (_f(r1). (Lane EL Riesenfeld [1983]) If Er is the B-spline coefficient sequence obtained from the coefficient sequence or for f G $ by the insertion of (zero or more) knots into t.. 3. .Bj. . it is an immediate consequence of Corollary (24). i PROOF.2] in support of the above Corollary (28). this implies that a B-spline of orderxk > 1 is unimodal in the sense that it has exactly one maximum. PROOF. . then S"'E'i 5 S_o:. . are such that f(ri_1)f(ri) <1 0. In this particular form. for a function f. . .. (Schoenberg [1967]) The number of sign changes in the spline function 2:3. it is bell-shaped in the sense that. ' S_(f(7‘1).-)) ‘ with . for j = 0. Actually.. hence.r arbitrary and ri < . ' 1:1 With the formula X(12) for the derivative of a spline. It is suficient to prove this for the special case of insertion of just one knot.-)) is a subsequence of the resulting B-spline coeflicient sequence E: for f. its jth derivative has at most j sign changes.1 & Ch..< 1-. . To illustrate this point further.'iBj1.-..-+1) over which the function f changes sign.. all i.i.140 XI. Then the index sets Ii := : §_ii. Property then requires the existence of it indices 1 5 3'1 < .7".$11.._|.f(Ti) > O for i = 1. and certainly 3'1 3 -..1‘.. But.-lila- PROOF..< ji-. i = 1.iB. Control Points. . 5 n so that B5. ti. all i. . ls..-__|_1/-. namely the indices 'r+1—-k. we can choose ji E — 1. we must have > 0 for some ji E Ii .. .... For each 21. However. t.. there are only ls: distinct indices Tn for which Bi. It then follows that we can find sites ‘T1 < < Tii all in the open interval (ti . (Ti) 75 0.. .. Thus ( —)l§j.. and also the coefficient oi. for which f(Ti_1)_f(Ti) < O. since cxi_.7‘... . so that (32) holds.. ... <1 Ti -<' t.-Bi and assume that.< ji.ii. 1:.t. lc. ..Tii all lie in the same interval [ti . oi.1).‘_'i-ii]-. t. for some T1 < < T. that is. suppose that the spline function f = E5 o:. '< O... . that is.ji = ('r+1 —-k)+(i—-1)=T—k+t. .-53_. III (31) Lemma..1 simple zeros in the open interval (t.. while Bi(Ti) > O for both (since > O). .-__> —_= (Ti + 'T'i_|_1)/2 exactly I: times...+.. . . Therefore. with 3'1 <1 . so that CI_. and so a'31"—k+'i..|. By (23).-i(Ti) qé 0 for some i = 1.(Ti) 75 O}. with 5: the B' sPline coeflicient sequence for f with respect to the knot sequence t obtained from t by the insertion of just one knot.. . Let f =: 23. . ('T'i'_)f('T'-5) > O fOI' = 1...-.'r.lc(Ti) > O1 11--'1k1 .5 ji.. Inductive application of the following lemma therefore finishes the proof.has kc . mustbe nonzero and have the same sign as the number f (Ti).' . . (Ti) 75 O and cz. there can be no equality here.the places at which the spline function f changes sign with the places at which its B-spline coefficient sequence changes sign... since (ji) is strictly increasing. we must have cs.T.-. all If there exist 1 5' 3:1 < < 1.=.3 n+ 1 so that si "" A =3 Ti)f(Ti)>-O for 'i=1. and Knot Insertion PROOF OF (29).~_ > O for either j = ji — 1 or j = Eli. f('Ti)f('T'-i_|_1) < 0. are pairwise disjoint.... III B-spline Property is more precise than Corollary (28) in that it also connects. The B-Spline Series. assuming without loss of generality that _f(T1) -< O. ‘ gtjigji (Ti) _f('T-5) > O £01‘ =1. the index ji corresponding to the site Ti must be “near” Ti in the sense that B.. Ccnsequent1y. since the It sites ‘T1. all i.. i = 2. Further. then there also exist 1 $31 < <j._cx_i._1]. Let it be the refinement of the knot sequence t that contains each of the sites ‘T. From Corollary (28) and the definition of S_g. DI/g is nonnegative. Vi = E for all straight lines E. Corollary (28) and Proposition (12) form the basis for a very effective “shape preserving” spline approximation method of much use in Computer Aided Design (cf.- But more is true. that is. . the sequence or of B-spline coefficients (or. For a given function g on [a . the number cx. the spline approximation Vg to g crosses any particular straight line at most as _many times as does g itself.)Bi i=1 on [.)'f the knot averages given in IX(39). using . Riesenfeld [1973] or Barnhill & Riesenfeld [1974]). nionotone functions to monotone functions.. We combine this fact with. V‘/e conclude that..|_1]. A. for moderately small Diiioi). hence Vg is monotone nondecreasing. more precisely the control polygon) for a spline function f gives a fair idea of the graph of f.. this spline approximation is defined by (33) Vg == 2 g(t. . we know that (34) S‘ V9 5 $_(g(1I':. then the leftmost coefficient for that interval. so is Vg for nonnegative g.. (35) .'. and convex functions to convex functions. Therefore. .Schoenberg’s variation diminishing spline approximation 141 that is. must also be positive. . ti-+1] must strictly alternate in sign and with the same orientation as that of f. ... This suggests that V maps nonnegative functions to nonnegative functions. t. if g is monotone nondecreasing. b].1 . proof of these claims is immediate: Since the B-splines are nonnegative. If f is positive on the left end portion of the interval [ti . for moderate I: (that is. for example. Schoenberg's variation diminishing spline approximation We continue to assume that It > 1.)) S 51. . (34) to obtain the following description of the shape-preserving or variation diminishing character of Schoenberg’s transformation V: I (36) S_(l/g — E) 5_ S‘ (g —_ E) for all E E I-142. with t* := (t:‘. b]. This is illustrated in Figure (10) for the special case that g happens to be the control polygon for Vg. Finally.. By IX{38). by the formula X(12) for the derivative of a spline. In words._|_1__ii."|. the la coeflicients that determine the spline f on the interval [t. then.. |—1.-_. ..I I I l-'if-i ‘ i-i-1?‘ | Schoenbhrg’s variation diminishidg (and smooth) cubic spline approximation to the broken line sketch of a curve.. j = 1. a positive linear map and. that is.iil coincides with that same straight line. ti+1]_ depends only on the values of g at the it “nearby” sites t:‘__. Vg is convex. ls. hence V is. for that reason. .. I . |'| 142 XI. oui. If g has T continuous derivatives for some T 2 2. Sharpen (3) in case ti = :13.1-|. . then I/lg on the interval [ti ..I-i—-lZ— iqi} 1 ..r-=|'¢I2 and no exponent higher than 2 can be put there. ti_|. Warning: Vg is a shape-preserving linear approximation.. czi_|_1 all have the same sign.3ll[f-i'+i--ii+el with '7 = 3 the best possible constant. The knots of the spline are indicated by >< ‘s.I 1 I (37) FIGURE. .) ). and Knot Insertion Ii' ' §*‘Ei -2}. I I -I |. Vg cannot be a very high order approximation. (*) holds . Also. “11” _-IIIi? - '$"i——'Ij'i-Klflim- —- .. see Example XII(11). if o:i_1. then. lie on a straight line.+ -‘. then lls — VQII 1'5 ‘-‘~<>"I'1P=1=g. In particular. The function Vg on the interval [ti . that differentiation formula twice. . The B-Spline Series._H-I. then D21/g is nonnegative. From (5). as shown in the next chapter. (i) Prove that.. if the points (t}‘_. . This means thatc Vg is not as good an approximation to a smooth function as splines are capable of providing. . in particular.‘k. '4 I l I I I “ I-I -l I. Control Points..D.tI.g(t:'_.+. .1--- I I_ . Vg provides a local approximation to g. if g is convex. 2. Ir l Problems 1._. . ' These various proper ties of Schoenberg’s variation diminishing spline approximation are illustrated in Figure (37) which shows a broken line sketch g of some shape (see Figure (10)) and its smooth cubic spline approximant Vg._ . .. . .i—. even if r is greater than 2.'i. (ill) 1': lail g 'lll 2aIIB. . for £01‘ : ll. 1]. f is a parabolic spline). incase or has only finitely many nonzero entries.0001 (that is.+.f_:% is monotone. in 8. at a and b.3 (that is. and. [oii — f(:r)[ 5 const[t| ||Df|[[ij__iJ. . directly for the coefficients found in 6. 0 1/3 4 /3 3 13 / 3 5 9 (»r)[2[1/2[9/2[5[ 0 [5/2' 10.ti] if and only if the corresponding B-coeflicient sequence (c:zi)..._1._. To what an extent does generalize to higher order splines? 5.. 11... with knots at the integers) and with B-coefficients ozi = (—-)i.-*1:-:§2)Bi... in the fourth significant place) and calculate the resulting change in f In what significant digit did fchange‘? 4.ii]. 7. then f is monotone on [_t.. Prove: If f = 2. In the contrary case.Problems 143 even with '7 = 2. . 'Prove that Vg = g at every ti with ti = particular.ti_|. Verify that. :E_i]' = 55:.. 'Generate the spline curve of Figure (37) with the aid of BVALUE from the function table ' IT.1. Verify B-spline Property Example IX(58).) (ii) What is the smallest value of '7 we can choose in (*) in case ai_1 = Cl!-if (I-1+]? 3. by X(15)-X(16).8. Verify that Corollary (8) carries real information by the following numerical experiment: Calculate [| for the spline of order 20 with a biinfinite uniform knot sequence (say. Then conclude that the B-spline coefficient sequence for the jth derivative of a'B-spline has exactly j strong sign changes. 9. b] = [0 . Vg is the Bernstein polynomial of order lc for g (see IX(10)). then Df = 2:... (ii) Prove that does not generalize to higher order splines by constructing a parabolic spline that is positive on [t..] for some const that is independent of f or t. When the single knot Q is inserted into t to obtain the knot sequence t.. for some i.o:i_2 are negative. with i uniquely determined by the condition ti_1 -< Q < ti if that condition obtains. Let f = Z:_. Prove that S" (orm) Z 1 +S" (or).criBi_ii. there are. . for n = -it and [a . Does . fOI' 5: ‘ll.1. ti] while some of the coefficients a. gr tJ'_1. = ti+i. all i. several choices for i. Prove that. ofihand. .|. (Hint: Make use of Problem IX. then. o¢iBi. ‘P’ ‘ll.. . I-Iow biga "y must you choose to have |oii[ 5 "y[|f|| be true‘? Now change just one coefficient from (—)i to (—)i + . for any continuous f E $ with B-spline coefficient sequence oz and any :1: G [ti . equal to evaluation at :17. .s. 12. (c) A is rnultiaffine.'.ii.|l.t. that lS.__1)) f(_)1‘ every permutation 11' of order it — 1. being sure to identify the places in the text where the assumption It > 1 was explicitly needed.(p) as the polar form or blossom of p.. This identifies blossom. that is.:i_1)p is symmetric.:r:) = p(x) =.:p is independent of Ti.|i..is a function of t. w E V and all real scalars 0:. )t(CU.. /\_...all at. . and Knot Insertion 1t matter which one one chooses‘? Test this question by proving (18). . _ \_iI-l_I|. -'= }t(l-'j+1.ii parametrized by k— 1 variables. de Casteljau [1963]). .3.i_|_1.“-(.. .1 only... that is.sii__1) 1-1» A(s1. for p G Iliiii. 9:) --= [:12].l|_ . . .) _ (I3) A lS symmetric. a map f : V -+ W is afiine if f(om + (1 —. Specifically. IiJ'_|_.) (c) For any at G IR.1. but did not become public knowledge until Ramshaw’s work . ... ._1) = )\(S. .—n-Q . S. ' for a certain linea_r functional A on II. and satisfies bl O ssom(P)(:r:. the scalar-valued map blossom(p) : (s1. . the latter a term introduced by L. a) 13. . )t(-91. A3.-_|_ii..li|' >.. prove the following.g.144 XI... These observations.n-(1). . were already made by de Casteljau in the 60’s (see. .1IT... multiafline. 3-II j. (Blossoming) Consider the dual functional formula IX(54) as it depends on t. . It follows that. for each p E Iliiii.._1). . Work out the details of knot insertion for the special case ls: = 1. e. and as a linear functional on _II. Ramshaw [1989] who uses this insight for an alternative approach to knot refinement that has become very popular in CAGD.i. Control Points. using the term ‘polar form’. . (Recall that.. 13. that is.1 arguments. . (To recall. an affine function of each of its It —. .o:)w) = o:f('u) + (1 -— o:)f('w) for all 1:. The B-Spline Series.l..-. Such results provide an ideal against which one may then measure the actual performance of a specific spline approximation scheme.___i Choose 1-1 5 .i_|_i.1/I 5 hazy 6 [11--bl} of the function g. we use Schoenberg’s variation diminishing spline approximation and other local approximation schemes in order to establish how well a function of a certain smoothness can possibly be approximated by splines of a certain order.v($) . that is.5 Tii in any way whatsoever in [a . We have a knot sequence t = (ti)'{‘+"“ with ti < ti_|_i. ' ‘ We continue to use the setup of the preceding chapter.i_i.9(y)| I II —.49 == I["l= 92:- (¢. The distance of a continuous function from $. h]. and ti == = ti.i_... t._1]... h] and consider the kth order spline approximation Ag to the continuous function g on [a .b] by splines of order ls: with knot sequence t. . = a. by elements of $.1 = ---=t. NEIWNOT In this chapter. both familiar from II(18).. h) == m@~1<{|. all i. that is.t.. We use the abbreviation V IIQII == G1g_gg'-bIg($)| and the modulus of continuity wls.)B. b]. . . . Ag = g in case g 145 . constructed simply as follows: F (1) ..XII I Local Spline Approximation and the Distance from Splines. The transformation A reproduces constants.. as [Ct .i_.. b] = [tk . =bso that [a . We are interested in approximating a certain function g on [a. B-splines sum up to one. we might choose T-1"-=t1f_+k/2.-‘ Now choose the Ti’s appropriately. . . each Ti “near” the support of Bi. Then i _ mfl1<{\9(i)—9(T.. taking absolute values on both sitlhs and using the non-negativity of the B-splines. . Take a site :i": in some interval [ti . ' he) .\1=\)..ti_.. the rest of Property IX(iv))..g<-..-_ ti-+r~=/2 == (t-1+0-=-11/2 + *i+u~=+1>/2) /'3 in case k is odd.._i. For instance.'y E [ti_|_1_i.=_']'—|-1—l\2 (see Figure IX(27)). where we declare .y = [ti .-. together with the fact that B-splines are non-negative and have small support (that is..>\B. This is so because. ti-_|_1] in [a . by lX(37).»~. Tl-:ll. ti-+1] or :t./2 .=j+1-—k and.| '4 146 XII. g(:.(e> i=_'i+1——k Sma=<{l9(i'=)-g('n)| =2‘ —k <i5J'}- . b].i2i) 3 wly. Therefore J‘ 9(fF=)-(A9)(=5-’=)= Z (g(£)_‘g(Ti))Bi(£)1 1'. while also g(i')=9(5=) i Bi(=-i=)= i=j+1-in i g(51)Bi(55) i=j+1--it since B-splines sum up to one.(Ag>e>| 5 2 lye) . This property.. kltl/2) S l(I= + 1)/2lw(9. The Distance from Splines is a constant function.-:)Bi(f-'1) 1I'. make it very easy to establish a useful estimate for the error in the approximation scheme The argument is entirely analogous to the one given in Chapter III for the error estimate IIl(18).r:) = c for all as in [a . b]. Then ' J (A-Q)(11=)= 9('»"-.'l"l» '.)\=i—k <¢-52'} - 5 max{ — g(y)[ : :t. if .. the interior knots in [-1 . much better estimates can be given._i} 5 constiiu:(g.3. then the transformation A becomes Schoenberg’s variation diminishing approximation method V XI(33).i_1)/(ls —..:(g.tan/2 = <~/F/4)/2 = |1=|*/2/8. with I2 broken line interpolation. If we choose Ti = tffk = (ti_|_1 + + ti_|.-..1=) 2 ng . . The estimate (2) shows that the distance of any continuous ‘function g from $1. -). . all i. A more careful analysis by Marsden [1972] of the error g — Vg produces the following striking estimate: <3) d1s<g.. with h -= 2/N and with ih.|1=|) and therefore (2) dist (Q..r) = i/H in Chapter III (see 1n(19)) and taken up again in Problem IIl.:_|. . the continuous function g has a singularity. ‘for some continuous function g and some sequence (t) of knot sequences with —-+ 0. with |t| := max Ati _ I the mesh size of the knot sequence t.1).i-. dis (9~.N—— 1... 1] for our spline.. 1] to the function g(:.The distance of a continuous function from $ii. that is.=(g."c) = \/[:.5 there. for functions with many continuous derivatives. . the best approximation error goes to zero no faster than the bound in The reader is reminded of the discussion of broken line approximation with a uniform knot sequence on [~41 . as before.|1=|\/<16/12>}> which brings in the order of the spline as well -as the mesh size |t| of the knot sequence and so establishes a kind of connection between the estimate (2) and J ackson’s theorem II(22). . In this example.mi11{ \/%‘2.. |1. We conclude that i llg — Agll S [Us + 1)/2l=~*(g. of g at |t| goes to zero with It is possible to show that this estimate is sharp in the sense that.> s ||9—I/all £2-=~=(g. For smooth functions.~$2. The estimate shows further that dist (g. . ' .|). siii) == min{ |[g . h) = hl/2 while.6).'.s|| = s e $. and this is typical for functions for which the bound (2) is sharp as far as the order in |t| is concerned.ii 147 (using the monotonicity and subadditivity of ::n( g.$.) goes to zero at least as fast as the modulus of continuity o. To recall. $ii. goes to zero with the mesh size This says that we can approximate continuous functions arbitrarily well by splines of a fixed order if we are willing to use many knots. see Problem ll. for g(. i = —N + 1.. i) in case g has a piecewise continuous derivative._1. The distance of the function g from $ii. can be bounded in various ways. h) 5 h[[Dg ~— Ds][ in case g and s are suficiently smooth.s.i__1.1.i) 5 consti._.i.t) 5 constli \1=\2w(D“9. Therefore. dist (g. on choosing s so as to make this bound as small as possible and recalling from X(9) that $. we can now repeat the procedure and find that dist (Q.|.. := constiiconst.1(Dg. |t| [[Dg —— Ds[| for all s E $.lackson’s theorem for polynomials (Theorem II(22)). Further..i in case s is itself a spline of order ls: with knots t.) 5 consti.i.:i.1-.i is the same as the distance of the function g -.:i. I-Iere is a quickie._inC[o. $ii.. ' w(g — S. |t[o.. $ii. by (2)._2.. $ii. Of course.i H C'[a . Proceeding in this way.i) 5 consti. we can use (2) again. in case Dg is continuous and so get (5) dist (g. . If the function g is even smoother and if ls —— 1 > 1. dist (g.i. In symbols. we finally obtain the estimate (4) dist (g.i) = dist (g -— s. this time to estimate dist (Dg.b]} on [a. We conclude that dist (g. $'..148 XII. from II(20). .i.i) for all s E $. for all s E $ii. b] and. $ii. $I¢..consti.b]. b].. = {Ds : s E $i.i). . $. ltl) with consti: := consti.s from $ii. [t] dist (Dg. having them both piecewise continuously differentiable suffices. $i=. $..i) 5 constii a.i O C[a .le--1. The Distance from Splines The distance of a smooth function from $. we obtain the analog of . l with consti.=(g —. It does not tell us how to construct such an approximation. . for example. .15---<b=t. F"I'l-r. . satisfied by the sequence of uniform partitions.P" l 1- | Example: Schoenb-erg’s variation diminishing spline approximation 149 (6) Theorem (Jackson type).i converges to g as we make the mesh size [t] small. with Nh = 1.i_|_1=~~-=t.i.i_|. $. 1]. For a proof and further such results..ii. 1) uniform.g(Ti)Bi to g that gave us the bound In response to this. in general... see DeVore 8. > n with dist (§(").__i IHT: (10) Theorem (Saturation theorem).l_I_. . [t[k[|Dkg|| in case g has ls: continuous derivativeg (since then a=(Dl°_1g.1._i) 5 consti." '-"I-' (9) dist (Q. For = 0. .i) 5 constigi |t[5la:(Djg. as the following theorem shows. and consider Schoenberg’s spline approximation V9 = 9(*ia)Bi -t to the specific function g(:r) = I2. b] = [0 . i = 1.) Then dist (g. The theorem states that the distance of a smooth function from $.. Theorem (6) only tells us at what rate a best approximation to a smooth function g from $.. we get '1-'.—-"'. Suppose (§(")) is a sequence of breaks sequences satisfying the following mixing condition: For some positive number p and all n and all interior breaks £5") there exists ii. t.|. there exists constiihi so that. .i = ih. (This condition is. this function g has derivatives . we illustrate by an example the important fact that the error in the approximation Ag to g is. -‘1]..I_. Clearly. h) 5 h[|D"°g||). that is. for all t = (ti)'i"H° with (7) ti:---=tii=a<t.:.1: -—. for j = k -— 1.§(fi)) > p|§(“)|.l-I-_I— In particular.: Richards [1973]..I_.i_|. take the knots in (0 . (8) dist (g.N — 1.i.:i. goes to zero at least as fast as the kth power of the mesh size This order cannot be improved except in a trivial case in which the distance is obviously zero. $ii..ii and for all g E C'(~l)[a . no better than O (|t|2) no matter how smooth the function g might be. . . The reader may feel that the proof of Theorem (6) is based on a construction. .i. (11) Example: The degree of approximation of Schoenberg's variation diminishing spline approximation We take the interval of interest to be [a .3ia>) = o (|§("')[*'°) implies that g E l_l. namely the approximation Ag = z. ’:*%:... .3 ( — )k (k— 3) ( :1: ) l. lib ii.Z1:?. using the fact that * —— tik - “'1: -/(ls 1). ll-[ ZCZ and so a = (—>'=-=’-»... we obtain Big.1: -— 1.=[(-lgli) km’ T1) --h2 k . If ti_|. this For a uniformly space no q expression simplifies.." I2 1:) 2 is--l ---—"=-———— = --1: (k—-1)! 2 *’= e+-2 we-1>:.. k-—-1 $1‘-r=(='B)= [<-er + (Zta+a)(—I) i=1 -—1 k—2 ls:-2 l:—1 +2 Z t.. Take It > 2. our parabola g agrees with whatever knots t. The Distance from Splines 150 of 1' fill or Clers.'. We compute its some spline of order It B-spline coeficients directly from IX(55): ___ 1 2 ii-—3‘Dk-—3. f I. . all a.£+_.Vg = ZeiBi with ei === (-)’=-=*D*=—%z»..~/(rt ..)2 5 -1 + . i. on the interval [0 . j'=11"=j+1 Therefore. and so conclude that the error on [0 . ._' j = 1. it is even analytic..-3) ..-/<1= 1>1/<1: 2). we might pick. 1] is given by 9 . Then. .. and so offers the transformation V a fair chance for showing just how well it can approximate to smooth functions..= .1)! i 1 =2(t."b_k(t 1)‘ ori = g(tI..2) = —h2k/12. then 2 5-i.:»§._ .it.i+i-(T-S'3r)k—3 + .1)!. Further.no . (since D29 == 2) .) + . .i = ti + jh.i==-1 T d k t se uence t with mesh size [t] = h.'.|_i l '.(t. 1]._.>2/(Is . .'l l¥ - ii] ' XII. .2)) _ 1 Nil-I ?r'?r' k—1 '=I k—1 = [rem — Z rt.)2/(la . the error is no better than O (ha) even though our function g has infinitelymany derivatives.n—lr:+2 in case of a knot sequence t with uniform mesh size h. since the function g — p vanishes at zit..Vg[| 5 constii|t|2|[g”|[ for all 9 e c<2>. that is.ti_|. g(tfk)Bi to our parabola g is given by Q . t.1] and let p be the straight line that agrees with the function g at the site :i: twice.i+1 _ '3.rF=)2ll==% it I191 and therefore.r) = g(.__1) .. Precisely..+1—k. lglil — (V9) (ill 5 max{ (l7.. we have from Theorem I(14) that i(g — p)(w)| = (I . hence ' 9—V9=9—P-V@—Pl But. -In particular. But this implies that the error is constantly equal to —h2k/ 12 on the interval [t2(i."'E) + g"(:i‘:)(s: -— Therefore Vp = p. containing :i:.. ma-Xi l(9 — Pllfllll 1 t.1_ii].i_|. the function g— p vanishes twofold at Lt.. therefore is of order ha in any interval of length h. 1 lglil "T (V9) iii] S.l1=|2ll9"llWe conclude that (12) ||g .V9 = $5-iBt with ei=-—h2lc/12 for i=lc—1. E] .. on [0 .. (tit "* tjlz lllgnll/2 5¢0nst:. the error g—Vg is always 0 ([t|2) in case the function g has two continuous derivatives.. it follows that the error at T is given by §(f'-'5) — (V9) (51) = -We —P)(i) = — i (Q —P)(tik)Bii=j-I-1--it Consequently. On the other hand. This can be seen as follows: Take T E [ti .Example: Schoenberg’s variation diminishing spline approximation 151 We conclude that the error in the approximation Vg = E.+1-aw. 1].. p(:. with I(vii).k 5 -"'5 5 ti:-= lNow. The Distance from Splines ' Local spline approximation schemes that provide the best possible order Of approximation The argument for the [t|2-convergence of Schoenberg’s approximation Vg to a smooth function g just given contains a very simple idea for the construction of spline approximation schemes that realize the potential order of approximation to smooth functions as expressed in Theorem We take the time to discuss this idea in some detail because such schemes also allow us to..i><\\a. More generally. forall f. pi is a continuous linear functional on C'[a. M since.maxi!/all < as 1. b]. #i(@-'9) = £1/J49 and that (14) l/eel 5 ll/all ll9ll £01‘ all 9 E ole . all i. A(g+f)= Ag+Af.b] Sup llA9ll/ll9ll 5. for any site at and any function g.i = 1.:i. one might choose _ K (16) Hag = Z:i3tjQ('l't3") J'=1 . all i.. that is.bl with := sup{ [pig]/[[g[| : g E C[a. .. ' A(o:g)= o:Ag ..\\)|\a\l by XI(3) and (14). and is continuous or bounded. (15) ll/‘ill == geC[e. with pig = g(Ti). that is..gEC'[u.. hence [[p.b].i in the form (13) A9 = i(#i9)B»=: .b]. mielael s (m. g€C[a. This means that #i(9 + f) = my + /hf. The approximation (1) is of this form.b] } afinite constant. also called the norm of the linear functional pi. ” |(Ag)<=-al s. It then follows that our approximation scheme A is linear.152 XII. gain some insight into the effect of knot placement on the achievable accuracy of approximation. i=1 with each pig a number that depends linearly and continuously on the continuous function g. for all o:€IR. . Suppose we constructed a spline approximation Ag in $. =1. that is. that. In fact. ti_. we know that on [ti . then it will satisfy (19) provided Tii E [ti . The resulting spline approximation Ag = z. Even more generally than this. ti_|_i.<1=> with Mi a function of bounded variation.]. we then have 5 Z5. ti+i. in the support of Bi.ti-+1].I=.t_i+. 'I'.]._. all j . the approximation Ag to g depends only on the values of the function g oh the interval [ti-_|. ti-+1]. ( 19) implies the bound (20) llAgll[ti.--it: - therefore. . ti+1] identically in case the function g vanishes identically on the slightly larger interval [5_i'+]__k_ ..Local spline approximation schemes 153 with Tii sites in [a . . A special case of (17) is the choice (18) my = fl 'mi(-”'I)9(=1=) d== for some integrable function mi.. a mi. I the most general form for such a number pig and we mention it here only for the sake of completeness. |fi’ii|. A different way of stating that the linear functional pi has its support in [ti. all t. 1n which case |[pi[| = fa |mi(:t)[ dzr.]. b] and flii certain specified real numbers. in fact. For such pi. ._.. the difference of two monotone functions and the integral a Stieltjes integral. If pig is of the form (18). 5J'+k].-_]i-I-1.. the approximation Ag vanishes on the interval [ti .ti+1] g ll/Jill)llgll[tj+1--..I=]T g E Ola’ ' ' In particular. provided mi(:r:) = 0 for 1: ¢ [ti . . Suppose now. for each i.i. that is.. that is. Bigu.i].j_|_j. pi has its support in the interval [ti ..(pig)Bi is then local in the sense that. on the interval [ti .i . . ..-_. . . then it will satisfy (19) provided mi has its support in [ti . secondly..ii].ii]. ti-.bl- If pig is of the form (16). This is. ?l.. By this we mean that (14) can be strengthened to - (19) l/eel 5 ll/ell llgl [¢. ti_|.1_. one might choose b <11‘) /ae= / go) dM.+i] for all 9 E <3'[~'-1.ti+ii] is to say that pig = 0 whenever the function g vanishes identically O11 [Iii .|. some piecewise continuous function . Ag: If Z (pig)Bi and 't=_'f-I-I—-1: 3' Z B. that is. . . . by assumption. The Distance from Splines The last ingredient for our successful local spline approximation scheme A is the requirement that it reproduce polynomials of order k. .t_i+i¢] 5 (1 + mgr llmll) IIQ — P|lrei. 9-A9=Q~—P—-(AQ—P) =9—-P—A(g—P)Therefore. b]. . then (23) [[g—Ag[[ 5 (1+mp.e. with (Bi)? the B-spline basis for $ii. . b] satisfying (19).154 XII.tj+1] + -_ pll[t_i+1_i. and pi a linear functional on the ' ' ' continuous functions C [a . _ Agllltj--tj+1] s — pllitj-. The combination of (20) and (21) allows us to prove. to make them theoretically and practically useful schemes. in the same way. all t.5. for instance. t_i_|. . we were able to prove that llg . .. ' (gI]:['(k)[ti+1_i. that is. . t satisfyihg (7). reproduces straight lines and. The first such scheme can be found in de Boor [I968]. (21) Ap = p for all p E l'l.' I.. Only then can such a scheme claim to achieve the best possible order of approximation. ‘i ‘fl Schoenberg’s transformation V.x[|pi||)constii|[D"°g[| [t["°. if Ap == p for all p E 11.|i ._|_1_. PROOF.1 Now choose the polynomial p of order ls to make g -— p as small as possible 011 [ti. from (20). (22) Theorem... E] It is not very difiicult to construct such local approximation schemes satisfying (21)..._-iii.\ and our assertion (23) follows from this by a reference to II(16). all g E C[a . that ll9 -Ag|[ = (9 (|t|l‘). This m akes the construction of such schemes something of a chailenge.=. 2 ll in consequence. But.tj+kj1 '. we have.Vg|] = C7 (|t| ) for a sufficiently smooth functions g._. .. . that ls.li] t0 get I -T S + I.b]. Let Ag := Z::"___1(pig)Bi... and Til.i. For any polynomial p of order ls. Tiii the extreme sites of the Chebyshev polynomial of order ls 1-. .f the trans forma tion A reproduces 1'I<ii. for all g E C(l°)[a. I. we must construct them in such a way that the number maxi []pi[[ appearing in (23) or (24) can be bounded independently of t. with pi of the form k #19 = Z:l3ijQ('="ijl il=1l‘. broken line interpolation (of Chapter III) (cf.3 [\I. at least for knot sequences that are not too nonuniform... Also.F“ Local spline approximation schemes 155 for the largest interval in [ti_|.. but the choice of the sites ‘Til.. and similar schemes discussed in Lyche 82: Schumaker [1975]. there exists constigi.|. Let Qg be the quasi-interpolant to the function g as given by (25)./2. that is.1. . . ( §(ti+1) + 49(ti+s/2) — §(ti+3))B-23. this gives A as. In this connection._-_-ii since it even reproduces all of $ii_i on [a . . ._. Problem IX. all j (which would imply that Af = f for f E $k. Also. . . l A proof can be found in de Boor & Fix [1973]. . . It is of the form (25) A Q9 I= Z (Ari?) Bi -i=1 with Ai the dual functional IX(54). b]. j = 0. b]).. The quasi-interpolant Q. Tiii in a largest interval [ti .). see de Boor [1976]2 for a discussion of pi satisfying piBi =-.. b]. . and this ratio enters the error bound only for j > ls/2.l I—l III!- with_ti_.Here. 1.1] ensures that the number maxi can be bounded independently of t.ls 5 T.. so that._»_-ii but all of $ii. The quasi-interpolant of de Boor & Fix [1973] does not quite fit the pattern. it can be shown that this scheme reproduces not only l'l.ii. Problem 2).1] in [ti_|.i (on [a . b]._. .ls—-1. . Then.1 . For ls = 3. The scheme is therefore local. Still. the weights flii depend on t. as long as g is a smooth function.ii_. i = 1.. For it = 2. an analysis of the error g — Qg can be carried out along the above lines. for all t = (ti)"f"+k satisfying (7) and for all functions g E C(l°"'1)[a . But it fails to satisfy (14) since it is not even defined on all of C [a .I=H1El. while the weights [6-ii are so chosen that Ap = p for all p G lT<. see Problems 7 and 8 for removal of the mesh ratio dependence. ti_|. .i1[T-—-S[= 1. Tl’t|. ti_|. . provide a local spline approximation to a smooth function g which simultaneously approximates the function g and its ls -— 1 derivatives to optimal order. ls — 1.n.1 . this gives "Ii = M= Ii.1] of the form [ti . (26) Theorem. For ls > 3. . . see de Boor & Fix [1973].. ti_|_1].ti.8). ltl) forj =0.i. b].. see Problem 3. l llDj9 ~— DTQQII S <=<>I1S'11=e=('1'??»1=)(2’l_'°)*ltlk7j"1w(Dk_19. the error in the quasi-interpolant Qg for g satisfies I l F I1 ['4 .. .. with Ti = ti_._3/2 := (ti_|_1 +ti_|_2)/2 (cf. for all ls -— 1 times continuously differentiable functions g on [a .(iii.}C{Alli-/All_.. it reproduces l"l.s 5n} is the local mesh ratio for t. 156 XII.:... But exactly how this should be done -1s not clear._. the bound (9) . If we combine (27) with lI(16)..t..C0nStklIjlkllDkgllIj Ij the i... $1“) 1s terms of the (global) mesh size |t| = max.._|_. $.. it is equivalent to B-spline Property XI(x) (see Xl(4)). we I can 9 a benefic1al way 1n case the kth der1vat1ve o Ql choosing I5 relatively small in areas where \D'° influence this bound 1n varies gr eatly in size by is relatively large.B.. 1-1+1 EX act minimization of the bound in (28) as a. for k > 1.. (_T'Jj_|_2__k t j_|_k__1 l EL nd i \Ij \ its length . then we obtain the bound llg _ Agllltj--tj+1l 5.1l' GO0Cl l<fl0t placement The spline approximation schemes discussed in this chapter are local and so allow us to gain some insight into the efiect of knot placement on the achievable accuracy of spline approximation. hence our approximation scheme A reproduces all of $... t difiicult If we are w1ll. all j..t) 5 const. it is possible to choose the linear functionals pi in our approximation scheme A so that }. But we have in (24) and e (27) some specific information about how wemight choose t so as i1_()_II13l£ the bound in (24) or (27) small. O that kind of effort.._|_1 . we then obtain the following specialization of (24): — A-gll[tj.. = 5-.’S in (13).L-5B3.-...|.1 for an Q e Ola .. certain sites in the interval [t.€ + (gl 1—'['<:k)[tj+g_. all i.||g||[. function of 1: = (Q). It follows that heal s D. We have used the resulting bounds so far only to describe dist (g.-. The Distance from Splines We mention... where specific values for the constants Dhm can be found..1ng to exert (satisfying (7)) for fixed n is actually qui e ..tJ+. ..|\D'°g||\tIi° or themore elaborate bound in Theorem (26).| 5 Dkjm.L. Clearly.. for completeness. For this particular scheme.. |..=. with this particular choice for the /.. then we are better ofi attackmg directly the problem 1 I f . while pi is of the form /1&9 = Z5ijQ(Tij) j with 11..- dist (g. the theoretically important fact that.. =_ B1.1] and Z3. we have AB.. Ati.I1tBI“VEI-l.tj+1] ..|¢_.. b1 while. This fact can be found in de Boor [1976]2..]¢._.J. for example. We can only hope to obtain an optimal knot distribution or density. Q.__(.l 1 r I determining t (satisfying (7)) for fixed n so that dist (g.1. on [o . In typical practical situations. . In any event.'?T1. Then. ... the function g is only known approximately or known implicitly (for example.. .__|. . Let .. . (Results by Barrow & Smith [1979] serve to justify this simplification. . .+1]lA(_:jlk = COI'lSt&I'1'l. . equation). b].Illlk! = 11 ‘ I 7n" This suggests that we place (2. Qm are chosen so that ‘I ll. ..a]|5 .. Qm is a somewhat expensive task and is not justified anyway.) is as small as possible. i-. .) is quite sensitive to the precise location of some or all of the knots and it is important to approximate the function g well using a spline with as few knots as possible. The exact determination of such (2.. . This being so. But this is not an easy problem and repays a.fOI' = 1.. b) into groups of it — 1 each and let each such group coalesce into a knot of multiplicity ls: -— 1..'..(j+1] S c0nst'kll'Dkgll[Cj....1 := b. . be the distinct sites among these grouped and coalesced knots in the open interval (o . .. I‘. .(. because we usually do not know the kth derivative of g. b] = l'l<. We cannot hope to place each knot optimally. (30) is minimized (for fixed m) when (2._. If the number of knots for the knot sequence we have set our hearts on is not an exact multiple of k -.Dkgll[Cj__CJ.+1]lA<f. given the approximations we have already made or are about to make. ..1|Ao|*so. F1 Clo .. . $..1.an _ is a continuous function of O: and if Di“ is continuous and monotone increasing in [3 and decreasing in Oz. . .Good knot placement I H 157 J I-W’. b) and set (1 := o.m. as the solution of some differential ’ +'. . Still. the task is obviously equivalent to determining Q2.. $.|.])1/kA§j = constant for j == 1. we cannot even attempt to find such optimal knots unless we know the function g well enough to evaluate i || g —— f (see Example Xll/(34) for one such attempt).) We group the knots in the open interval (o . m == l|D‘l?.-. .J.<. . .. But. $.-_1|| -I|-. . .__L. we would like to have some scheme of choosing the knot l I Ii sequence t appropriately.(. . and (28) becomes — A-gll[(j. we now take certain liberties with the placement of individual knots in order to make the analysis easier... .1. Qm so that ([|D'°g||[(.9|l[a. Qm so as to minimize I‘ <30) Since my||D*g||[<. now coincides with l_I<~_.. .:¢. .|.ll that effort only if dist (g.-C_-. then we simply bring in a few more. The Distance from Splines 1 . We can easily obtain one from the other.r)| / dzr. .1 sites jG(b)/m. hence we can compute an approximation to it from an approximation to Di“'1g. . Burchard [1977:Lemma 1.)3_ j=2 I -1 . .. to the extent that h approximates the function lD'°g|.=]Di°'19==f lDi°9($)ld5This latter function we can compute (in principle) from the (It — 1)st derivative of g.=. It really makes no difference whether we construct the piecewise constant function h or the continuous piecewise linear function H(a::) := /I h(s) ds. . ‘+1 := 1k 5 1 ID g(:r:)| / d:Ir= -51- := 11¢ |D g(:.-(2: — Q-. But. Qm so that C" (31) /t.5] proposes to compute first some pp approximation of order is + 1 to g (using some convenient choice of breaks) and then use the absolute value of its kth derivative for the approximation h. A different proposal can be found in de Boor [1974] and consists of constructing the function h from a current pp approximation f of orderk to g as follows.. . .153 XII. its integral the function H I H approximates V . It remains to discuss how one might obtain a piecewise constant ap— proximation h to the function |D"g]...1 and therefore produces asymptotically the same distribution of Q. Specifically. assume that we have some pp approximation f of order it to g. . Its (k — 1)st derivative Di°"1f is then a piecewise constant function and can be written I ' - (Di°"1f) (ct) = o:1 + E o:.m. . s as does the problem of determining (jg. j=1. VB-1‘[.. and the stated task amounts to nothing more than evaluating the known piecewise linear function G71 at the m-. hence so is its inverse function G“ 1 (ignoring the possibility of multivaluedness at some breaks). This latter problem is very easy to solve if we replace the function |D'°g| by some piecewise constant approximation h ~ |D'°9|For then ' I G(:-1:) == / (h(s))1/kds is an easily computable.m — 1. j = 1. continuous and monotone increasing piecewise lin- I" ear function. . COEF.]D'°_1f.'| ***** OPTIONAL P R I N T E D U U T P U T *****# CUEFG.___.I) FDR BREAK(I) . COEFG..__€. The total variation‘0f the function Dk—1f on the interval [a . SPECIFICALLY..B) IS TO BE SECTIONED BY THE NEW BREAKPOINT SEQUENCE BRKNEW .JO€'JOQO (_EO OQO IS SET ..5+1 the break sequence for f. I.. D**(K-1)F(X) = CUEF(K.IF. '-" *.B) = (BREAK(1). The subroutine NEWNOT in the following subprogram The algorithm just outlined is carried out SUBROUTINE NEWNOT ( BREAK.LINEAR FUNCTION G WRTO WHICH BRKNEW WILL BE EOUIDISTRIBUTED. cosr._|.]D'°“1g. .* ."'-T"-_:'-‘ I- .-_1/2. . K. §. JQO FJO C. €e+2 . . j = 1...Z < Z. BRKNEW. .LT.LE. memo: O U T P U T aaoooo BRKNEW. ...i+1 "' §a-1 . 1 mifld O11 . '< ...THE COEFFICIENT PART OF THE PP—REPR. Specifically. BREAK.THE PP CUEFFS UF G ARE PRINTED DUT IF IPRINT ._|_3/2.NUHBER OF INTERVALS INTO WHICH THE INTERVAL (A..._|_1] the slope at ({..1 5 so that 2 §a'"§1 = on l<‘§1--§2l= A -£— + -.]Di“_1 f at the three sites §.==]Di°_1f = Z l0-6l($ *' Q-ilii-i . The number crj is the jump of D"°"'1_f across the break fij.!:="..... COEFG ) RETURNS LNEW+1 _KNOTS IN BRKNEW WHICH ARE EOUIDISTRIBUTED ON (A.GT.1 + Q-1+2)/8 of the parabola that interpolates the function Var [. 6+1 -* 51-1 +1 1 ' where we have used the abbreviations ‘P@+1/2 5= Dk_1f 011 [Q . ._. L. .. — The subroutine NEWN OT I59 with § = (5. PL |.. Z. COEF..all 5This amounts to taking for h on [5.. L...T=2 and.n[€.BREAK(L+1)) WRTO A CERTAIN HONOTONE FCTN G RELATED TO THE K~TH ROOT OF-THE K—TH DERIVATIVE OF THE PP FUNCTION F WHOSE PP- REPRESENTATION Is GQNTAINED IN BREAK. we might choose h = H’ G lI<_. :13] is therefore I V&1'[a.CONTAINS THE PP—REPRESENTATION OF A CERTAIN FUNCTION F OF ORDER K ..£1 l c_._1 +35: +3§.___._|_1/2 and §..__.ARRAY OF LENGTH LNEW+1 CONTAINING THE NEW BREAKPOINT SE- QUENCE COEFG. LNEH...§i+1l-. L... K ammo: I N P U T ##1##: BREAK... X ..). 2 FOR THE MONOTONE P. . we construct the second order spline function H as an approximation to Var [.11- i O O(_. BREAK(I+1) LNEW. .. taking this to be an approximation to the function Var [.§. K. €-5+1].. 0 IN DATA STATEMENT BELDH. L.“. .L).COEFG(2.(I.2) — CUEF(K.LINEAR FUNCTION G .BREAK(I-1)) COEFG(2.L).LE.BREAK(I+1)). G(EREAK(J+1)) AND THEN BRKNEH(I) = RREAK(J) + (STEPI-c(BREAK(J)))!DG(BREAR{J)) . BRKNEH Is UNIFORM./FLDAT(K) U CDEFG(1.CONSTANT (K—1)ST DERIVATIVE OF F .COEFG(1. I. B) = (BREAK(1) .-4--'I-ii'-'$W-- ..coEF(K.LNEH.GT.. DIF.LE. FOR I=2. QO O OGLTOLDO O OLDLDOQOGO INTEGER K L LNEW.L) soo FORMAT(7H STEP =.I) = COEFG(1. STEP.I—1)*(BREAK(I)“BREAK(I—1)) DIFPRV = DIF 10 COEFG(2. BRKNEW IS CHOSEN UNIFORMLY SPACED.J REAL BREIR(f+1). FoR THIS.. THIS REQUIRES INVERSION or THE P..LINP EAR FUNCTION c . WITH sTEPI = (I—1)*STEP .2E16.5)) IF c Is CONSTANT.7/(I5. THE MIDPOINT Is CHOSEN IF DG(BREAK(J)) = 0 . 0. (A . NEVERTHELESS.coEFc(2.___i. GO TO 9O CONSTRUCT THE CONTINUOUS P. ...LE. ON (BREAK(I). 0) PRINT aoo. C 1) c Is CONSTANT. STORED IN THEN COEFG . ' DIFPRV = ABS(COEF(K. B) AND IN THE EVENT THAT PC = D*#(K—1)(F) IS CONSTANT IN THEREFORE H = O IDENTICALLY.LINEAR FUNCTION c IS CDNSTRUCTED AS G(I) = INTEGRAL OF H(Y)**(1/K) FOR Y FROH A TO X r AND ITS PP COEFFS.ONEDVH. CONSTANT FUNCTION H WITH BREAKPOINT SEQUENCE BREAK WHICH IS APPROXIMATELY PROPORTIONAL TO ABS(D**K(F))...I). THE P. ‘ -___ - _. IF (STEP . THEN. BREAK(L+1)) .L DIF = ABS(COEF(K. J Is FOUND so THAT c(BREAK(J)) .L) = (2._ ___ -1 — T-_ — __ 1-1 |—n ___- XII. orsovx = 1.1))/(BREAK(3)—BREAK(1)) DO 1O I=2. CONSTRUCT BRKNEH(I) = A + G#*(—1)(STEPI). BRKNEH Is DETERMINED BY ERKREw(I) = A + G**(—1)((I—1)*STEP) . STEPI . ABS(JUH AT BREAK(I) OF PC) ________________________ __ II + ABS(JUMP AT BREAK(I+1) cs PC) ___________________#-_-___-_ BREAK(I+1) ..ETEP. I=1.I—1) = (DIF + DIFPRV)##ONEOVK COEFG(1..L)#(BREAK(L+1)—BREAK(L)))/FLDAT(LNEH) IF (IPRINT .LE. The Distance from Splines 160 Commas: M E T H U D ###### THE K-TH DERIVATIVE OF THE GIVEN PP FUNCTION F DO ES NUT EXIST C (EXCEPT PERHAPS AS A LINEAR COMBINATION OF DELTA FUNCTIONS).I=1.BREAK(I—1) WITH PC BREAK(I+2) — BREAK(I) THE P.RRKREw(LREv+1).STEPI # DATA IPRINT /o/ C BRKNEW(1) = BREAK(1) BHKNEW(LNEH+1) = BREAK(L+1)IF C IF (L .) co To so BRKNEH IS UNIFORM . WE _CONSTRUCT A P .*DIFPRV)**UNEDVK C C C STEP = G(B)/LNEH srsp = (CDEFG(1.IPRINT.E16..LNEw+1 WHERE STEP = G(B)/LNEW AND (A .I).DIFPRV .I—1)+COEFG(2.1) = o.I-1))/(BREAK(I+1) .I) — COEF(K. SPECIFICALLY.L)+CDEFG(2. LNEH as BRKNEH(I) = BREAK(1) + FLUAT(I—1)*STEP RETURN END (33) Example: A failure for NEWNOT BRKNEW IS UNIFORM .-ant is used in NEWNDT to construct a possibly better knot distribution and then./:. So we feel safe to begin here with an example where.NLow. _ CHAPTER III.DEcAr. even though the function to be approximated is not uniform.EQ. STEPI = FLoAT(I—1)*sTEP ' 21 IF (J .ERRNAx.r:) := 1.aREAK(1))/FLoAT(LNEH) Do as I=2.c.J) .> DECAY = o.ITER. L) ‘ co TU 2? IF (STEPI .NHIcH. CoEFG(1.11t (at those knots) in constructed in CUBSPL.) on To 29 BRKNEH(I) = BREAK(J) + (STEPI — CUEFG(1. We will give examples in later chapters showing the effectiveness of knot placement algorithms such as the one encoded in NEWNOT. EXAMPLE 2. 0.J. somewhat surprisingly. cusrc SPLINE INTERPOLATION HITH cooD KNDTS cALLs CUBSPL.J) co To so aRRNEH(I) = (BREAK(J) + BREAK(J+1))/2.TAU(NNAx).EQ. so STEP = (BREAK(L+1) . NEWNUT produces only marginal improvements. ISTEP /20.1:+ 1 on [-1 . The initial construction of an interpolant on a uniform knot sequence to N data points is followed here by a cycle: the current interpol. We construct our approximation to the function g(:. The main program below is an adaption of the program used in II(1) and IV(8).J+1))Go To 2? J = J + 1 co To 21 IF (CUEFG(2. .J))/CDEFG(2.ALocER. a new cubic spline interpola.IsTEP. c(x) = soRT(x+1.scRTcH(2. C READ IN THE NUMBER or ITERATIUNS To BE cARRIED our AND THE LDHER C AND UPPER LIHIT FOR THE NUMBER N OF DATA POINTS TD BE USED.NHAx. DATA STEP.H. . 1] by cubic spline interpolation: using the routine CUBSPL of Chapter IV with the “not-a-knot” end condition.LNEH . NEHNDT INTEGER I. 20/ c THE FUNCTION c Is TO BE INTERPDLATED . coNTINuE RETURN 2? 29 30 c ' C . IF G IS CONSTANT.ITERHx.NHAx).N.Example: A failure for NEHNDT 161 J = 1 Do so I=2. with these new knots.. The number of times this cycle is repeated is specified by the input parameter ITERMX. ll l l .Dx.NHAx).sTEP.c(4.NM1 PARAMETER (NHAx=2o) REAL ALGERP.TAUNEH(NHAx) " c ISTEP AND sTEP = PLoAT(IsTEP) SPECIFY POINT DENSITY FOR ERRDR DETc ERHINATIDN.LE.PNATx * . 55 -0.ISTEP H = FLDAT(J)*DX PNATX = C(1. N.I)+H*C(4.5714-D1 o.1068+00 0.F11.NHIGH BOD FDRHAT(3I3) PRINT soo. ITERNI TIMES DETERMINE NEH KNOTS PRDH IT AND FIND A NEH INTERPDLANT Do 15 I-1.ITERH1. 3 CYCLES THROUGH NEMNOT _ N HAI.I)+H#(C(3.(TAU(I+1)—TAU(I))/sTEP INTERPoLATIDN ERRDR IS CALCULATED AT IsTEP POINTS PER PULYNOMIAL PIECE .TAUNEMI) CONTINUE ERRHAI = 0.‘I62 XII.c. o ) IF (ITER .53 ‘Y DECAY EXP 0 O0 -0 64 -0 S2 —O 69 —O 53 .GT.I)+H#(C(2. THEN.1 coNsTRUcT CUBIC sPLINE INTERPDLANT.69 -0. The Distance from Splines READ 500.941e-01 o.NH1.N.1476+0O 0.TAUNEH./) LooP OVER N = NUMBER or DATA PoINTs Ao N-NLoN. D. Do so J=1.NN1.2) STOP O CYCLES THROUGH NEWNOT N HAX.NHIcH.4.7197-01 0.54 -0.6038—01 0.Ass(c(TAU(I)+H)—PNATx)) CALCULATE DEcAr EXPONENT ALDGER = ALoc(ERRNAx) IF (N .I)/3 )/2 ) ERRHAX .N c(1.54 -0. * GO TO 11 ESTIMATE HAX.6908-01 0./FLoAT(NH1) .7510-01 0. c.2 KNOTS ARE INITIALLY EoUIsPAcED NN1 .ALcERP)£ALDc(FLoAT(N)/FLoAT(N-2)) ALGERP = ALOGER PRINT 640.4.53 -0.1461+00 0.1273+D0 0.N TAU(I) .ERRHAK.5683—01 1 4 O.8171-01 0.DECAY 540 FORHAT(I3.22H CYCLES THROUGH NENNoT// 2aH N NAN ERRDR DECAY EXP.59 —o.1. D 1D I-1.ERROR A a a 10 0.oo -0.GT. ITERHX) co To 19 ITER I ITER+1 cALL NEwNDT(TAU.INTERPOLATION ERROR ON (-1 1) LOOP OVER POLYNOHIAL PIECES OF INTERPOIANT DO so I-1.NLOH.N 1 H 2. ITER . -0.s6.6431—01 o.scRTcH) Do 1a I=1.FLOAT(I—1)*H .6o41—01 0.ANAx1(ERRHAx. ITERHI coo FORHAT(I4.6568—01 O.NM1 DI .E12.9175—01 0.N TAU(I) .1114+UD 0.ERROR DECAY EXP. NLUN) DECAY = (ALDGER .I) = G(TAU(I)) CALL CUBSPL ( TAU.a3o3-o1 0. ---= b. both for uniformly spaced data sites and when. . The distance from $3. for the function g(:.. or cubic.n. it turns out that NEWNUT failed to do this. the approximation with the “good” knots is slightly worse than that with the uniform knots. Yet. I '\ The above arguments that led us to the knot placement algorithm above were derived from considerations by Rice [1969]. the modulus of continuity is w(g.r) = A. In our example. It is instructive‘ to contemplate the reason for this failure (which was not apparent t_o me right away). The reason: the “not-a-knot” end condition used in CUBSPL explicitly forces the first and the last potential jumps in the third derivative to be zero.. and this makes h of (32) vanish between the first and the second (and between the secondlast and the last) data -sites.. because of Theorem (34) below. For the uniformly spaced case. on closer inspection. to be about —. 163 The output shows the maximum interpolation error as a function of the number of data points.r)]1/I‘ dzr < oo.4. for all N >.1 = = t:. (34) Theorem. _ tr /T |D’i°g(:. Therefore NENNDT puts all breaks well away from the ends of the interval. .)T+'i° with t1 = = ti. 1].4 tried. Assume that the function g is continuous on [o . .973] concerning dist (g.. .)..__|_. and with n fixed. NEWNOT was used three times to achieve a better knot distribution..1. But.1'1) where $.__|.5. denotes the collection of all splines of order ls with some knot sequence t = (t..b] near which |D"°g| is monotone. the fourth derivative of the function g grows large near -1 and it is there that one would wish knots to be placed. in accordance with (2) above (recall from Figure II(17) that. the typical exponent for fourth order. T. h) = hi/2). and the kth root of Di‘ g is integrable.. t. NEWNUT relies essentially on the jumps in the third derivative of the cubic interpolant to gauge the size of the fourth derivative of the function g to be approximated./0: + 1 on [—-1 .6 whereas I had expected it.F" The distance from $. for each .. the decay exponent is still only around —. even after three applications of NEWNUT. This means that we are interested in the number i W (g1$k. The best laid plans . Burchard [I974]. = o.These considerations produced the following theorem (among others). Dodson [1972] and de Boor []. with a relatively large jump calling for relatively many knots to be placed near that jump. that is.. In fact.$k. the decay exponent is about —.. approximation. b] and is ls times continuously differentiable at all but finitely many sites in [o. We consider now briefly just how well a function can be approximatled by splines of a fixed number of knots if these knots are placed appropriately.:¢_.N.. . . . i=1."c) = 1... b] = [—1 .)'{""1 of break sequence so that (B1) /g C-I-1..m"'°(/f ]Di°g(:r:)]1/I“ dz) .$. A _ I I ii _....n_"°(f ]D"°g(:1:)]1/1° dz‘) . = o. The Distance from Splines Then b (35) ‘ N dist (g. 1].. already the first derivative becomes infinite and so. we find . ..... b].n. For the Example (33) of approximation to g(. $k..) = (9 (ark) . $. Nevertheless..DkQll°¢ in case g has k continuous derivatives on [o . i = 1..__|. — it. b] (so as to make the bound as small as possible for fixed n). This follows from the fact that./as + 1 on [e . we find that dist (g..1 b |D’°g(w)|”"‘dI= we have then (36) |D”g(I)|‘/kdw.164 XII. when we compute the ltth derivative of g. Theorem (6) produces the estimate I dist (9. that is. t._.. We can gauge its power by comparing it with Theorem (6) which states that y d1St (Q. that is. that is.) = 0(»A-"1/2) y which is sharp as we saw in the example.. . b k dist (g.-. with h := (b — o)/(n — it + 1). for the choice § := ((.._2'“ —3 —(2k—1>/2 and therefore ]D"g(:1:)]1(l° = c0nst. for uniform knot sequence. Theorem III(20) concerning best broken line approximation is a special case of this theorem.t) _‘§ COI1Stk]lS]k]].m... $.(a: + 1)"(2'°‘1l/12") which is indeed integrable. + th. But let the kth derivative of g become infinite anywhere in [o .. b].. ..lI_dc"jCI1) § const..) § const. and Theorem (6) ceases to produce such rates of approximation._. for instance.. If we choose here the knot sequence t uniform inside [o .. the order of approximation achievable is n"'“.. Since f [D4g(s)|1/4 ds = const(:."-1.Example (33) to use such data sites and to make no use of NEHNDT produiies the following output N |—~|—=|-A -l'=-I\JO JCJ'1. For N = 12. it seems . 1] well by means of cubic spline interpolation at knots with the not-a-knot end conditions and using N data poi11ts. the error decreases like N-4. We would therefore expect to have C7 ('n.":) = ‘N. .1284+O3 . this amounts to choosing the N interpolation sites as 1 (as) | -A =2((»1-1)/(N-1)).1138+O2 .r + 1)1/8 -1 - for :1: Z -1. ERROR 3834+O3 .— Example: A fai. It may well be (and we would need double precision calculations to verify that) that."'. But this time.lure for CUBSPL ‘ 1 / 165 1 |Di°g(r)|1/if d:1: = 2k consti.7 =1: 10“9 = 0 in single precision on a UNIVAC 1110.OOOO+O0 DECAY EXP .. sequence of our interpolating cubic spline satisfies (31).b] = [-1.i>- MAX . with the good knots.23 —INF NaN What a disappointment! The “INF ” we can understand easily enough.0OOO+OO OCJOOQO .. Theorem (34) indicates (as does the earlier discussion of the knot placement algorithm) that we should choose the knot sequence according to the break sequence § for which (31) holds.11 even for N = 10 is disappointing when the function we wish to approlzlimate lies between 0 and 2./Ii: + 1 on [-1. . (:1: + 1)1/wk) = 2!: const. a= 1. 1] provided we choose the knots right.. But an error of 383 for N = 4 and of‘a.21/mi“) which is finite./rr + 1 on [12. . The modification of the program for. we choose those N data sites explicitly so that the resulting break..N. ... but it seems to start oif so much larger than with the uniformly spaced data sites. This we carry out in the next example. we have T2 — T1 = 2(1/11)8 = 4.00 — 70 — (DUO 59 -6.4572+O2 . (37) Example: A failure for CUBSPL We continue our attempts to approximate the function g(.:) = 1.._"'°)-convergence to this very unsmooth function g(. 1))“ .1)/(N .13 -2.96 -2. although the point of improvement comes later as the mesh becomes more nonuniform. . A proof of (39) goes as follows: For any f E $4. = 2((r .1. respectively.ERROR DECAY EXP. . In our case. . . In order to make certain that the program is correct. This produced the following output. 1] and llf-1ll== ma-Kl llhfll/llfll I f 6 Cl-1--1l=llf|l as 0} the norm of the interpolation process I4.fll + lll4ll Ila -— fll~ Now we choose f E $4 to make the Tight hand side as small as possible.1.14 -2. = 2(('£ . this produces (39). we can expect dist (91-$4) to .91$4) with $4 the collection of all cubic splines with knots T2. 5001+01 7842+00 1217+00 5025-01 3364-U1 2408-01 1809-01 1408-01 1129-01 0.IL 166 XII.00 -4. If we denote the cubic spline interpolant to the function g by I4g_ (as we did in Chapter IV).ERROR DECAY EXP.f) —. and T. therefore g — I4g = (g -—.20 -2.) ~ In order to explain the difficulty with the data sites (38). l also ran it with the following more uniform interpolation sites T. N 4882+02 1179+02 289B+01 574B+00 13B1+00 8346-01 5395-01 4629-01 2145-01 HAX. N HAX.09 Both show an improvement for larger N compared to uniform spacing.I4(g — f) for any f E $4. TN_1 inside of [-1 .1)/(N . hence Ila — Lryll 5 lly — fll + llI4(9 — f)ll 3 Ila . .1? -2. (An analysis of the proof for Theorem (34) would lead one to expect exactly such rates in these cases.48 -3.57 -6. then we can show that (39) llg -— Llyll S (1 + llI4ll)di3t(.1))“ . we need the following error bound (see Problem III. The Distancie from Splines hardly worth the effort.2). I The particular choice of the data sites enters the bound (39) in two ways: (i) It influences the approximation power of the function class I4 since it determines the knot locations.-They show a decay exponent of -2 and -3. I4)’ = f. =---=¢. only a bound.used in Example IX(58) (see IX(59)). we use t = (t. b].><Dt> <7. .. We choose the same knot sequence used implicitly in that example.'1. Example: Knot placement works with a local scheme 167 become smaller (for fixed N) as we come closer to the data sites (38) that are “right” for our particular g... at least approximately.<T. m = N + 2 and 1:. knot placement based on the local behavior of the function to be approximated makes sense only if we use an approximation process A that is more or less local.§A»=.. i=1."‘) I: (I-5+1 — I. then it makes no sense anymore to adapt a knot sequence to the local behavior of the function. ' (40) Example: Knot placement works when used with a local approximation scheme To illustrate the point just made. namely the fact that..g*'<==.. that is. this does not guarantee that the interpolation error will also get larger since (39) is. we replace the cubic spline interpolant at knots in Example (37) by the quasi-interpolant of Theorem (26) which 'we know to be a local approximant.-: i=1 with (B.b. (See the case of uniform data sites in polynomial interpolation in Example II(1).11 i.'4(I. then.N—2..=-1.g._|_2. that is.. an estimate of the form (28). as already. as ||I4[| gets larger.. By this we mean that the error at a site may well depend on the behavior of the function g anywhere in [a .__|_2 ..>g*(¢. But it explains why it gets larger when it does. as soon as our approximation scheme has this property.)']" the sequence of B-splines of order 4 for t and A. the approximation process becomes less and less local.. In other words.=2(t/(N-1))8—1. t4'+.. But. .IZ)(t.II!) (1:-5+3 —- W8 CIIOOSB T-5 = t... from IX(5-=1).'. (ii) It influences the norm of‘ the approximation process I4.) + §(A=:.) j-C4 ‘With 'l.. computed as 1 >o = $<->3-A03-1¢.. for which we get. it so happens that the number |]I4|] gets larger and larger. 8.) Connected with this is a further reason for the failure on Example (37). after all..)'["“H‘ with ls: = 4.. Of course. i tm+1="':tm+4=1- The approximation Qg is then computed as Q9 = fi()'~i9)B-.2> .A1:. As the data site sequence becomes more nonuniform.2>/2..A¢... . <41) My = go. ) DECAY = o. A C CONSTRUCT OUASI—INTERPOLANT.DECAY.NHIGH.20). The Distance from Splines For i = 1.) = 0.NLoN. BCOEF(1) = 0. 6 - C C " BCOEF(1) = c(-1. READ IN THE EXPONENT IRATE FOR THE KNOT DISTRIBUTION AND THE LDNER AND UPPER LIMIT FoR THE NUMBER N .BREAK(20).n._ DO 6 I=1.1 -i—-mi . fifififi DO 40 N=NLOH.DDG A . i.DTIP2. CALLS RsPLPP(EsPLvB) C .BCOEF(22).ERRMAX.NHIGH.2 NM1 = N-1 - H = 1.ISTEP.DTIP1.ALOGER.5/c(x) DDG(X) = —.PNATX.T) ) . .T(26). DATA STEP.HMK. EcoEF<I) = G(TAUI) + (DTIP2-DTIP1)*DG(TAUI)/3.*(FLOAT(I)*H)**IRATE — 1. READ soo. DTIP2 = T(5) .4).H.DX.SCRTCH(4.NLOW.DG.T(4) TAUI = T(5) C C C ' S P ECIAL CHOICE OF TAU(2) TO AVOID INFINITE- DERIvAT1vEs OF c AT LEFT ENDPOINT .168 XII. For this reason. this gives that 319 = 9(-1) = 0For i = 2.NNIcH 500 FORHAT(3I3) C C PRINT 600 oco FORNAT(2aH N - HAX.HHK T(I+4) = 2.N TAUI = T(I+2) DTIP1 = DTIP2 DTIP2 I T(I+3) . INTEGER I./FLOAT(NH1) H = N+2 HHK = H-4 DO 5 I=1.STEP.5#DG(X)/(X+1. this would give Agg = oo. .TAUI y ISTEP AND STEP = FLOAT(ISTEP) SPECIFY POINT DENSITY FOR ERROR DETERNINATIDN.DTIP1#DTIP2#DDG(TAUI)/6.#DTIP2#DG(TAUI)/3.-.IRATE. 20/ c IS THE FUNcTIoN TO BE APPROXIHATED. 15 BCOEF(2) = G(TAUI) . + DTIP2#*2*DDG(TAUI)/6. 5 - C C T(M+I) = 1. C C C C G(X) = SORT(X+1.2. DO 15 I=a. DG Is ITs FIRST.H./) LOOP OVER N = DIM( SPLINE(4. QUASI-INTERPOLANT WITH GOOD KNOTS.IRATE. INTERIOR KNOTS ARE EQUIDISTRIBUTED HITH RESPECT TO THE FUNCTION (X + 1)#*(1/IRATE) .N. EXAMPLE 4.G. we use instead T2 = t This gives 329 = 9035) T 2A'349'('35)/3 + (A'54)29”(t5)/6CHAPTER XII. CONVERT TO PP-REPRESENTATION .J.2 .NH1 _REAL ALGERP.) - Dc(x) . IsTEP /20.T(I+2) ' # " FORMULA XII(30) OF TEXT IS USED . AND DDG ITS SECOND DERIvATIvE ..ERROR DECAY EXP.|—-.C(4.4 T(I) = -1..L. N IS CHOsEN As THE PARAMETER IN ORDER TO AFFORD COMPARIsON HITH EXAMPLES 2 AND 3 IN HHICH CUBIC sPLINE INTERPOLATION AT N DATA POINTs WAS UsED . 15 N 4 6 6 10 12 14 16 1B 20 HAX.00 77 It shows clearly the O (N *4) convergence for the correct knots (before underflow puts an end to it).ERROR O 412B+OO B933-O1 3258-01 1535-O1 B372-O2 5060-O2 3281-O2 2656-O2 1289-O2 DECAY EXP.1))‘. then 2. Also.N. DO 3O I=1.19 4 .. 0. is). = 1..ERRMAX. then necessarily 11.15 4..L C C Dx = (BREAK(I+1)-BREAK(I))/STEP j ERROR Is CALCULATED AT IsTEP POINTS PER PIECE.ABS(G(BREAK(I)+H)-PNATX)) c 90 C - CALCULATE DECAY EXPONENT .i=1 (31_.16 4.DECAY 640 FORMAT(I3. Problems .BCOEF. .-_ = 2((t—1)/(N . ERRHAX = 0.1]g.4.?=. all 2'..Problems 169 CALL BSPLPPCT.H. Verify the assertion in the text that A is linear (if each pt.2) STOP END The output for - 17.1).INTERPOLATION ERROR ON (-1....) ERRMAX = AMAX1(ERRHAX.F11.I)+H*C(4. 0]) for every constant function g. Conclude that.1)/(N . we get O (N -3) convergence and an impressive improvement over uniform knots. DO so J=1 IsTEP H . In the following three problems.3. .L) ESTIMATE HAX..1))3 . Prove: If pig = Z::. 0. = 2((¢ . ALOGER = ALOG(ERRHAX) IF (N .1 is as follows: N 4 6 8 10 12 14 16 13 20 " HAX. 16. NLOW) DECAY = A (ALOGER — ALGERP)/ALOG(FLOAT(N)/FLOAT(N-2)) ALGERP = ALOGER C - 40 PRINT 640.16 4.g(T-55:) and Tgj € [ll-5+1 .I)/3.)/2.BREAK.13 4. if also is = 2.ERROR 0.I)+H*(C(2.E12.GT.SCRTCH. 1.7240-O0 O 9952-01 9091-01 1197-01 5579-02 2940-02 1999-02 1035-02 9995-09 DECAY EXP.IJ+H*(C(3.89 4.FLOAT(J)*DX PNATX = C(1.17 4. ti+k_1]. and A is . g = [t. 8.C. j.1 and T..I1Cl Ag = g (on [a ..4. LOOP OVER CUBIC PIECES . for the slightly less nonuniform knots.00 4. 2. let A be the approximation map given by (13). 1. T. Use the fact that [:2. for the higher order derivatives..I/g[] _-g const]. to g for which llgm . < 3h/2. 4.t.a:]g)/(T — :12) (see I(vii)) and that [:i‘.:i:. as far as the approximation to higher derivatives is concerned.. and h a continuous function. + Tj. with ti already picked. Cubic spline interpolation (as discussed in Chapters IV and V) is not local.. far each i. 45.§) for some E between 1i‘ and :1: to show that llg .¢) 3 consti. Theorem (26) establishes the existlence of an approximation Qg E $i. '1 . (Hint: Use (27))). Let (T. . Use Problem 7 to show that the conclusion of Problem 7 holds for an arbitrary knot sequence t. . |t|o(g*. Modify CUBSPL to treat the not-a-knot end condition in the alternative way outlined on p.. = 1.‘.-< t.1 contains a subsequence ti. I '| 3. . . (Hint: Show that any strictly increasing sequence ti. .i l'=l’°""‘w(y”"‘). AA 9 e o<1>[a ._3 . (Hint: If t has multiple (interior) knots.[. also at the sites 'I'_.1 for which mi. yet it is possible to construct interpolating cubic splines that are local. set h := [t[ and. D.Dj@9ll S ¢9nS1*1=. The trick is to use additional knots.. the error bound involves the local mesh ratio Tm..170 XII. Then repeat the calculations of Example (33) with this modified CUBSPL. rt if these prove too tricky. .. then use the fact that the error bound in Problem 7 depends only on [t] and not on t to let ii approach t. with h/2 g 1:. ltl)» for 2' < 1-=. Prove: If A reproduces II. choose $2.. b]). = ti..) = 54. etc. approximate t by a sequence ‘t with simple knots. 5 4 and [ii] 5 2]t].:t]g = g'(. possibly.-.) 9.3).5.I:) — [:i:. with simple knots at the Tj’s and. so that C.1)/2... $. (iii) Z.. tj. Prove the existence of an approximation Qg E $1.... t._. b]. has its support in some interval [tj .. The Distance from Splines broken line interpolation.) 8. = p for all cubic polynomials p (on [a . |t|) 5.) 6.].:I:]g = (g'(:.<..._. .t to g that simultaneously approximates all derivatives of order < 1-: of g to optimal order... that is.. For each i.. with f E $... but.(:r) = 0 for :1: 4 (T. and. p('r.)‘f be a sequence of data sites... construct a cubic spline C’. then A reproduces all of $. w(h..+1/2 := (T3. independently of mt. .< t. Theorem (26) as stated applies only to splines with simple knots. then dist (g. (ii) C..(T. (Ignore the additional difiiculties for _i = 1. ... For this. < .-4+1 = t...|. 7.-_)C'. <1 ... without ever making the second and the second last data sites breaks.. that is. Prove the following fact of use in the analysis of finite element approximation: If g = hf. 2 and T1...]_] contained in [13.. -_+.. that is. we mention osculatory interpolation and complete even-order spline interpolation and its best approximation properties.)? of data sites is given somehow. Finally. The Schoenberg-Whitney Theorem Since the sequence (B. If the strictly increasing sequence T = (T.. We discuss also a particular choice of knots for given data sites with which spline interpolation becomes the optimal recovery scheme of Micchelli. < b implies T < It — 1.)"f' of 11. it is very easy to check whether this matrix is invertible. whether (1) has exactly one solution for every choice of g.£0. and (B. i= 1. with ti < t... As it turns out. SPLOPT In this chapter. SPLINT. = = t.)‘i‘ is the corresponding sequence of B-splines of order l-:. with coefficient matrix (Bj(T....9- J=1 This is a linear system of 11. we discuss spline interpolation of arbitrary order and point out that one has to monitor the interplay between interpolation sites and knots carefully in order to produce a reasonable interpolation scheme..)). t = (t. that is. We‘ therefore expect to accommodate n interpolation conditions....t. equations in the 11. Throughout this chapter... the spline f := or.. 171 .7't.)'-f is linearly independent. then.-B. Let T be strictly increasing and such that a -< t. agrees with g at if and only if T1- (1) Z‘-1*-'jB§('c) = 9(5). the space $ := $k. (T. the spline collocation matrix.. is n-dimensional.)‘]‘+l° is a nondecreasing knot sequence. for given function g. = T3.XIII Spline Interpolation.-vector or := (o:. ii: I.. unknowns.. its linear span.. Rivlin and Winograd. all i.)) of the linear system (1) is invertible if and only if (3) B£(T£). (2) Theorem (Schoenberg—Whitney). Then the matrix A := (B. The original theorem by Schoenberg 8.) 79 0) must. then the first i columns of the matrix A have nonzero entries only in the first i — 1 rows. Here. Goodman [1994].. Again.]B. this may not be so. ifand only ift.t is positive there._. can be found in de Boor [1976]1. A cannot be invertible.) 75 O. respectively. .) : i._. if T.. For the proof of the converse. If the matrix (B. TL of A have nonzero entries only in rows 1+ 1... hence A cannot be invertible.. N.. T. (T. hence this sequence of columns must be linearly dependent.have at least one strong sign change.. the bound being easily provided using knot insertion.. see Problem 9). If ii and Ei are the resulting knot and coefficient sequence. Actually. the sequence (o:._. used in the next statement. 3 T. are also permitted)...B.'into the knot sequence k times..) B. from fl‘ (T... t. .|. = t._|_1)/2.. the fact that between any two zeros of a differentiable function must lie a zero of its derivative). see also Problem 1. . (4) Proposition.B. < t.. .. ...) > 0 (since...1. c1:.. An elementary proof of the present theorem. does not vanish at z. but it can be guaranteed by inserting each of the sites T. then S or > T —. .... all i. .. . . This gives altogether T strong sign changes in or provided we can be sure that different T. ]a. .172 XIII. while now . then still fl‘ (T.(T.. + T. using nothing more than Rolle’s Theorem (that is..B. is an isolated zero of f. . alli (except that ‘T1 = til‘ and T.) > 0 we know that T... For the definition of the number S-0-: of strong sign changes in the sequence oz... 138 (in Chapter XI)..(T. < T.._|_1/2 == (T. generate different sign changes.. vanishes at T = (T1 < < T. then B.) > 0 while _f(T. This argument uses nothing more than the fact that both the sequence T and the sequence of the supports of the B-splines are increasing. : B. j = 1. The importance of the function fl’ in considerations of zeros of splines seems to have been first recognized by T. Off-hand.) while ft = Z).7‘ —.: Whitney [1953] involves truncated power functions rather than B-splines.(s.) 72 0).(s.kn= I " . PROOF.. see p.T) is invertible with both (mj) and (9._. we make use of an upper bound on the number of ‘isolated’ zeros a spline from $ can have._. o:_.) increasing. hence. so must the sequence (tr.. Spline Interpolation that is. in case f(z) = 0 while ' (5) ft 1: 2 l@5lB1. Note the use of the superscript t to indicate the dependence of ft on the particular knot sequence we use to represent the spline f as f ==: 2.1. 2' = 1. and so. one direction is quite simple: If for some i. Since _f"(T. then columns 11. Iff = Z35.._|.. we call z an‘ ‘isolated’ zero of f E $.) = O..n. hence we have proved the following.. (6) Proposition. 5 t._|_. . N. f-'=_fJrI=zC1'. . We only need to prove the ‘if’. .-_|_. r I | which is nonsense. with Ao: = 0..)) must be banded... t.. If a: eé 0 tl1en. by . cr. namely that of T. E Pnoor OF THE SCHOENBERG-WHITNEY THEOREM. .-B... 0111'._) 75 0} = (Fl for "i 75 h. has the ‘isolated’. Since A is square. ' Consideration of repeated interpolation sites as in osculatory interpolation also raises the question to what an extent Proposition (6) still holds when 1* there counts the number of zeros of f with an appropriately defined multiplicity.. zeros 1-.. -< Proposition (6).) 75 0} (7 {j : B_..~('r.. all 11 (with ti" = "r1 a11d 'r. our matrix (B.¢+1—-1/. hence.. . Goodman [199-4]. = 1. Then. Let I =: (c.. actually uses a very natural definition of multiplicity of a zero z of f E $.o:. as a major benefit of using B-splines. T S-0: 2 S"E"r 2 1‘..) forsome 1 ii 1/ 5 p 5 n.. Bandedness of the spline collocation matrix Assume now that the n >< n matrix (B3. namely the maximal number of ‘isolated’ zeros near 2: achievable by some g E $ in any particular neighborhood of f. T. . ' l‘ El The Schoenberg-Wliitney Theorem has been generalized in at least two directions: permission of coincidences in the sequence -r corresponding to osculatory interpolation. as well as Pl . t_7'_|_k). See de Boor [1997] for verification that the sharpest result in this direction..-('r..'r) instead of the whole sequence (for a suitably longer knot sequence).. hence ti -< 1'. For.Bandedness -I"l|I" 173 -I"'In-ll {j : B.. by the linear independence of the B—spline sequence. and (ii) consideration of a subsequence (Bmj : j = 1.. Consider f =-. J'=v In particular._|_.)) is indeed invertible.. Then necessarily I = (r_.Z5. S_(cr._|_k permitted)..{('r. it is sufiicient to prove that Ac: = 0 implies or = 0..) Z . with fewer than k bands above the diagonal and fewer than k bands below the diagonal.-('r. therefore. < t.. with Lemma XI(27).'jB_.d) be a maximal open interval in i SUPP ft = U (ti . f.. < 'r. . BJ'('T-5) 0 and only tj < Ti < tj_|_j. f eé 0. . for 1* = 1. J) = 2%. we have.. H ‘l 'L I in .|-Fm. i."§'"* (7') Theorem.. det A(I. .-(11) 76 0 together implies that t... and B. (Karlin) The rnatrix-(B.. \ ‘I n. . However. k-3. .. . Since the determinant of a matrix is a linear function of the columns of that matrix. . we need a notation for submatrices of a given matrix..$ — il 2. For a given m >< n matrix A := (oi. H with all the '73 2 O.:+1) det[. + 'w_.-. i1 i detA(_""’ T) 311*--:.|. for any I..)) is totally positive. since only neighboring columns of A participate-in a column of A. .. .) = 0 for |_..____over certain nondecreasing sequences. aa A(I.< t. . ___ PROOF. Therefore. 2. with .BJ*= with all 'UJ_-f E [O ..B.?-r~. that-is. det[---.. lj -—. This shows that the matrix (B_7'('l'. k) in the case of interest. .-F-u. Spline Interpolation hence B. since the corresponding determinant is trivially zero.)) has bandwidth less than k (in the sense that B. we use the abbreviation ' I "r s A ( J) := (a'*PJ'e)P=15q=1' The matrix A is totally positive if and only if all its minors are nonnegative.. and ti < 11.. := B3. and the sum. ofihand.(a'). . if the 'ri’s are spaced “in tune with" the _ tfs. 1.Bj_|_1(::s). <5.. .il < ls. then the matrix (B. 1].(a:).174 XIII.]. then _ s ... J) = Z W aa EU. that is. Of course.. Total positivity of the spline collocation matrix A second impor- tant property of the linear system (1) is the total positivity of its coefiicient matrix.('r. have ii. . all j. J. Ba‘ = (1 -' 'w. we may omit all H that are not strictly increasing. . If ii is obtained from t by the insertion of just one knot. . H)..-.§m __ _ . det[. (‘T-_.?r Z0 T whenever 1<i1<---<i.) 72 0 and B.unchanged in their respective places.B_. H). aa Eu. It follows that. 1'.. .. .'+1)BJ'+1 +'w.-) and given sequences I = (i1.|.j_. . .-(11)) might as few as k bands.. < t.. if and only if.€.. ... .. .).71<"'<. In order to describe this property..]= A (1 — w.) and J := (jl. for example..-('r. this allows us to solve (1) using no more storage than is required to store the 2k -— 1 possibly nonzero bands of the matrix (B. linear system with an (invertible) totally positive coefiicient matrix may be safely solved by Gauss elimination without pivoting (see de Boor 8. in each ro_"w of A. (T. H) is the identity matrix. J) = 2')’._|_1. det C. meaning that C_1(i. Now insert each of the 11.. 4. and then solves it using a banded matrix solver without pivoting.enough times so that the resulting refined knot sequence t contains each T-5 exactly is .. Consequently. with t. If C is invertible and totally positive.~ The subroutine SPLINT 175 with the 7.-I det }i(I.e. (8) Lemma. 0 for any H. By induction.: Pinkus [1977]). The total positivity of the collocation matrix (B.)) is also banded. J) Z 0. C'_1(i. .1 times.'~:-r1:'c-=we-<— . Z 0 and all H strictly increasing. Thm. El The subroutine SPLINT . all i. (T. or in de Boor [1976]1. By Cramer’s rule. and that entry equals 1.)).j)(-—1)i"5 Z 0. A very simple but practically important consequence of total positivity is given in the following lemma. Thus A(I . the sole nonzero entry in subsequent rows occurs to the right of this one.j) = (—)i_5l det C(\j. III A different proof of this theorem can be found in Karlin [1968:X. H -I""lnl" with the '75 Z O and all H strictly increasing. Further.j. H) Z.. detA(I. and therefore det A(I. <1 "r. Since our matrix (B.1] as a special case of a more general result.(T-5)) is of interest in the present chapter in part because it is possible to show that a. = t. The following subprogram SPLINT sets up the linear system (1) for given t and 1'. we have detA(I. namely the entry belonging to B. and also to dispense with the prograrn complications typical for a storage-efficient banded matrix solver using row and/or column interchanges. PROOF.H). there is exactly one nonzero entry. then its inverse is checkerboard. H) has a nonzero entry in every row iff A(I. However. ...JJ. ..O O O O Q OQ O QO Qfigi fi INTEGER IFLAG..AN INTEGER INDICATING SUCCESS (= 1) OR FAILURE (= E) THE LINEAR SYSTEM TO BE SOLVED IS (THEORETICALLY) INVERTIBLE IF AND ONLY IF T(I) .. T(N+K) NP1 = N + 1 KM1 = K ... I.. GTAU. . OF LENGTH N IFLAG..LEFT.1 KPKH2 = 21-KH1 LEFT = K C C 5 .. TAU(I) ..S scosr or THE SPLINE or oaoss K wrrn KNUTS T(I). FOLLOWED BY A CALL TO BANSLV (WHICH THEN OBTAINS THE SOLUTION BCOEF BY SUBSTITUTION). SINCE THE TOTAL POSITIVITY OF THE MATRIX A MAKES THIS UNNECESSARY.CORRESPONDING ARRAY OF LENGTH N . H + K .THE.ILP1MX. BCOEF. KH1. AND A IS A BAND MATRIX WITH 2K-1 BANDS (IF IT IS INVERTIBLE). OQ Ofi QO fi("JO (. A s s U H P T I 0 N . SIMPLY BY LOADING HTAU INTO BCOEF AND THEN EXECUT- ING THE CALL BANSLU ( Q. VIOLATION OF THIS CONDITION IS CERTAIN TO LEAD TO ~ IFLAG = 2 ... T..T) Z K. I=1.. WITH THE MAIN DIAGONAL GOING INTO RON K .. N . B(I) = GTAU(I).. THE B-COEFFS FOR THE INTERPOLANT OF AN ADDITIONAL DATA SET (TAU(I).LT. ZERO OUT ALL ENTRIES OF Q LENO = N*(K+KM1) DO 5 I=1. CONTAINING THE TRIANGULAR FACTORIZ* ATION OF THE COEFFICIENT MATRIX OF THE LINEAR SYSTEM FOR THE BCOEFFICIENTS OF THE SPLINE INTERPOLANT.. conrsruruc DATA POINT ABSCISSAE... K-1. CONTAINING oars POINT osDINATES T. or LENGTH N+K NUMBER or oars POINTS AND orssnsrou or SPLINE space S(K..N).GTAU(N)=Q. DIAGONAL BY DIAGONAL.KPKM2..NP1_ REAL BCOEF(N). ii ‘U ##### 'G I4 ###### TAU.B—COEFFICIENTS OF THE INTERPOLANT. Spline Interpolation SUBROUTINE SPLINT ( TAU. SEE COMMENTS IN THE PROGRAM BELOH. .. THE BANDED SYSTEM IS THEN SOLVED BY A CALL TO BANFAC (WHICH CONSTRUCTS THE TRIANGULAR FACTORIZATION FOR A AND STORES IT AGAIN IN Q ). IFLAG ) CALLS BSPLVB.. smtmt H E T H O D tmtmmm THE I-TH EQUATION OF THE LINEAR SYSTEM A#BCOEF = B FOR THE B-COEFFS OF THE INTERPOLANT ENFORCES INTERPOLATION AT TAU(I).. THE MATRIX A IS GENERATED RON BY ROB AND STORED. ALL I. Q.LENQ.. BANFAC/SLY sptrur PRODUCES THE B—SPLINE COEFF.ORDER or SPLINE 0 H‘I meets O U T P U T ###### . N.. ALL I.J. I=1...N... TAU rs STRICTLY rucnsnsruc GTAU. N..T.KHOT ssqusncs.. . BCOEF ) BCOEF.TAU(N). HENCE.ARRAY OF SIZE (2#K-1)*N . K.. IN THE R O N S OF THE ARRAY Q . T(I+K)..HTAU(I))..176 XIII.N.N HITH THE SAME DATA ABSCISSAE CAN BE OBTAINED HITHOUT GOING THROUGH ALL THE CALCULATIONS IN THIS ROUTINE. Y or LENGTH N ..LT. TAUI DIMENSION Q(2#K—1.K.KM1. I=1.. Q. BANFAC DOES NO PIYOTING. I=1. 2#K—1.LENQ q(I) = 0.. vnrcn TAKES on res UALUE crau(I) AT TAU(I). ARRAY .K.J>. NE TREAT Q As AN EQUIVALENT oNE-oINENsIoNAL ARRAY (BECAUSE OF FORTRAN RESTRICTIONS ON DINENsIoN sTATENENTs) . N.. INTO G{I—(LEFT+J)+2*K.NP1) c ### FIND LEFT IN THE CLOSED INTERvAL (I .I) IF (TAUI .LT. TAUI. NE THEREFORE WANT BCOEF(J) To co INTO ENTRY I —(LEFT+J) + 2*K + ((LEFT+J) ~ K—1)*(2*K-1) = I-LEFT+1 + (LEFT —K)*(2*K—1) + (2*K—2)*J - OF Q .T)(TAUI)..GT. ALL I. KH1. T(LEFT)) co TO 99s 15 IF (TAUI . KH1..The subroutine SPLINT 177 c ### LOOP ovER I TO coNsTRUcT THE N INTERPoLATIoN EQUATIONS no so I=1.J) = B(J. HENcE A(I. IFLAG BY BACKSUBSTITUTION KH1.LEFT ACTUALLY MIGHT BE NDNZERO. T(LEFT+1)) GO TO 993 ### THE I—TH EQUATION ENFoRcEs INTERFoLATIoN AT TAUI. IN BCOEF (USED FUR TEHF. T(LEFT+1)) so To 1s LEFT = LEFT + 1 . C1000 C###### I N P U T smears .LE. 1. KH1.1 ~ IF (TAUI . ONLY THE K ENTRIEs WITH J LEFT—K+1. LEFT.999). I+K—1) SUCH THAT c T(LEFT) . BY THE OOOOO FOLLOWING 16 cALL BsPLvE C T.LEFT—K+J).N 41 BcoEF(I) = oTAU(I) CALL EANsLv ( Q. IF (LEFT .sToRAcE HERE). K+KH1. 'SUBROUTINE BANFAC ( W.LT. K. ILPIMX) co TO 15 LEFT = LEFT . I. N.. we include here a listing of one such.J. NBANDL.E. BCOEF ) NE THEREFORE WANT scoEF(J) = B(LEFT—K+J)(TAUI) TO co INTo A(I..J) Is To co INTO Q(r+K.(LEFT+J)-K) sINcE A(I+J. J c ### soLvE A#BCDEF = GTAU 40 no A1 I=1. BCOEF ) RETURN i SPHINT ' NUT INvERTIELE) RETURN The program makes use of an unspecified banded matrix solver BANFAC/BANSLV to solve by Gauss elimination without pivoting. NROW. NROWW. T(LEFT+1> c MATRIX Is sINcuLAR IF THIS Is Nor POSSIBLE LEFT = NAxo(LEFT. IFLAG ) co TO (40.J. 99a IFLAG = 2 999 PRINT 599 ass FORNAT(41H LINEAR SYSTEM IN END A .K JJ = JJ+KPKH2 Q(JJ) = BCOEF(J) O O OQO O O C so c *#*OBTAIN FAcToRIzATIoN OF CALL sANFAc ( Q. TAU(I) . ALL. IN THE PRESENT FRocRAH. IF NE CONSIDER q As A TWO—DIM. IFLAG ) RETURNS IN W THE LU-FACTORIZATION (WITHOUT PIVOTING) OF THE BANDED MATRIX A OF ORDER NRON WITH (NBANDL + 1 + NBANDU) BANDS OR DIAG* ONALS IN THE WORK ARRAY N ..LT. STORED AGAIN IN Q. NBANDU. K+KM1. WITH 2*K—1 ROWS (sEE coHHENTs IN EANFAC). For completeness. THEsE K NUNBERS ARE RETURNED. JJ = I-LEFT+1 + (LEFT—K)#(K+KH1) DO so J=1.N TAUI = TAU(I) ILP1HX = HINO(I+K.LT. "CALL EANsLv ( U..NRUNw.. THIS MAKES IT POSSIBLE TO sULvE ANY PARTIGULAR LINEAR sYsTEM A*X = B FUR X BY A . O) 999. NRGNN.I) ..NROW ..JMAX.. U) GO TO 999 GO TO 900 GU TO 2o .NRUU.NEANDL. EXPLIUITLY. 13 24 35 45 5? se 79 12 23 34 45 5s er 78 as 11 22 33 44 55 as 77 as 99 21 32 43 54 e5 76 s7 es ALL UTHER ENTRIES UF W NUT IDENTIFIED IN THIS WAY UITH AN ENTRY UF A ARE NEYER REFERENGED . A HAs NBANDL sANDs RELUN THE DIAGUNAL + 1 (MAIN) DIAGUNAL + NRANDU BANDS ARUYE THE DIAGUNAL AND THUS.NsANDU.2)—BANDED MATRIX UF URDER 9 WOULD APPEAR IN. WITH THE DIAGONALS OR BANDS OF A STORED IN THE ROWS OF W .J) FUR I=-NsANDU. THEN I CONTAINS THE LU-FAGTURIZATIUN UF A INTU A UNIT LUNER TRIANGULAR MATRIX L AND AN UPPER TRIANGULAR MATRIX U (BOTH BANDED) AND STORED IN cUsTUMARY FAEHTUN UYER THE GURREEPUNDING ENTRIES UF A ..MIDNK. ESPECIALLY FUR THE T U T A L L Y P U s I T I v E MATRICES NHIGH DUGUR IN sPLINE GALcULATIUNs. THE RUUTINE Is INTENDED FOR USE UITH MATRIGEE A NHIGH DU NUT REQUIRE RUN INTERCHANGES DURING FAGTURIZATIUN. THIS IS THE STORAGE MODE USED IN LINPACK AND REsULTs IN EFFIGIENT INNERMUsT LUUPs.GE.J..) CONTINUE 1D IF (NEANDU . NEANDL.KHAX .PIVOT _ C IFLAG = 1 MIDDLE I NBANDU +-1 W(MIDDLE.J) IS IN W(I+HIDDLE.NROWM1 IF (w(MIDDLE.. THEN l ~_ UNE UP NROH-1.1 78 XIII. IFLAG .1 GO TO 10 A .GT..RUU DIMENEIUN UF THE UURH ARRAY H . NBANDL + 1 + NBANDU .1 IF (NROWM1) 1 IF (NBANDL . A IS UPPER TRIANGULAR. UR ELsE ONE UF THE PUTENTIAL PIvUTs UAs FUUND TO BE ZERO INDIGATING THAT A DUEs NOT HAVE AN LU-FACTORIZATION... Musr BE .) CONTAINS THE MAIN DIAGONAL OF NRONM1 I NROH . FUR EXAMPLE.INTEGER ###### INDIGATING SUCCESS( = 1) UR FAILURE ( = 2) ..NRUN) PART OF A BANDED MATRIX CONTAINING THE INTERESTING A ..K.. NEANDL.NsANDU FAILED TO BE NUNNEGATIUE.900. O. IFLAG . OOCICIQOAE # INTEGER IFLAG.... A(I+J.1. NRUU. THIs IMPLIEs THAT A Is SINGULAR IN cAsE IT IS TUTALLY PUsITIvE . O O O O O O O OIE ##### M E T H U D ###### i GAUSS ELIMINATIUN U I T H U U T PIUUTING Is USED. B ) UITH THE SOLUTION X GUNTAINED IN B ON RETURN .. NBANDU. WITH MIDDLE = NBANDU + 1.GT.NROW).NUMsER UF BANDS UF A AEUYE THE MAIN DIAGUNAL . THE INTEREsTING_ENTRIEs UF A (1. WHILE COLUMNS OF A CORRESPOND TO COLUMNS OF H . REAL H(NROWH.IPK.MIDDLE. I..EQ. O QO O O O Q O QO GOO ##### U U T P U T IFLAG . DO 5 I=1. THE RUUTINE SHOULD NUT BE UsED FUR AN ARRITRARY BANDED MATRIX..THE FIRsT 1+1+2 = 4 ROWS UF W As FULLUNE.NROWH1 FACTOR.NsANDL ~ _ J=1. CHECK THAT DIAGUNAL Is NONZERO ... NEANDL. Spline Interpolation UURX ARRAY UF SIZE (NRUNU.2. NROHW .NUMsER OF BANDS UF A EELUU THE MAIN DIAGUNAL NBANDU . NROH. NRUHW.I) DIVIDE EACH ENTRY IN COLUMN I EELOH DIAGONAL BY PIUOT . B T COMPANION ROUTINE TO BANFAC .NE.) RETURN 999 IFLAG = 2 RETURN END SUBROUTINE BANSLV ( W.IPH) = H(MIDHH+J. SEE BANFAC . DO A0 H=1._ ##1## O U T P U T ****** .. JHAX = HINo(NEANDL. NBANDU.I) IF (PIVOT .JHAx 32 N(HIDDLE+J. DO 15 I-1.) GU TO 999 JHAX Is THE NUHEER OF-(NONZERO) ENTRIES IN COLUMN I EELOH THE DIAGONAL .I) IF(PIv0T .DESCRIBE“THE LU-FACTORIZATION OF A HANDED MATRIX A OF ORDER NED“ AS CONSTRUCTED IN FOE DETAILS.JHAx 15 H(MIDDLE+J.I)*FACTOR so CONTINUE CHECK THE LAST DIAGONAL ENTRY . 900 IF (U(NIDDLE. CONSTRUCT LU FACTURIZATIUN 20 DO so I=1.NBANDL.THE' UPPER TRIANGULAR SYSTEM U*X = Y Is sDLvED FDR x .NHOH. Qfifi fi i fi figfi fi fi gfi fi 1 . AS STORED IN U.. KMAX = MINO(NBANDU. THE CALCULATI0Ns ARE so ARRANGED THAT THE INNERN0sT LOOPS STAY NITHIN c0LUHNs.NBANDU. GIUEN THE LU-FACTORIZATION FOR A IN THE HORKARRAY H . NROHW. ##*## DJU21 .) G0 TO 999 JMAX = HINO(NBANDL.EQ. OF ORDER BRNFAC .I)/PIVOT RETURN c c c 0 0 c 0 0 c c c 179 A IS LOWER TRIANGULAR.NR0H .. ##1## I N P U T ####*# ' H.. IT RETURNS THE SOLUTION X OF THE LINEAR SYSTEM Aii = B IN PLACE OF B . NROH .NROH) .JHAx 40 w(HIDHR+J.I) = W(MIDDLE+J. PIVOT = H(HIDDLE. THEN.EQ. DO 32 J=1.NRDNN1 U(HIDDLE.I) = w(HIDDLE+J. . 0. CHECK THAT.IPH) DO 40 J=1.IPH) .CONTAINS THE SOLUTION H E T H O D (HITH X .) THE UNIT LOWER TRIANGULAR SYSTEM L(U*X) = B Is SDLVED FDR Y = Utxl AND Y sTDRED IN B . NRON ._ The subruutine SPLINT C - C DIVIDE EACH COLUMN BY ITS DIAGONAL .I) DO 15 J=1.I) Is PIVOT FOR I-TH STEP .NRUH — I) sUETRAcT A(I.HHAx IPK = I + K MIDMK = MIDDLE — K FACTOR = H(HIDHK.H(HIDDLE+J.EIGHT SIDE OF THE SYSTEM TO BE SOLVED .NRDwH1 PIUOT = H(HIDDLE. ****** A = L*U.I+K)*(I—TH COLUMN) FROM (I+K)-TH COLUMN (BELDH RON I ) . NBANDL.DIAGDNAL IS NONZERO AND A Is NOT JUST A TRIANGULAR MATRIX. 0. 0.I)/PINDT KHAX Is THE NUHEER OF (NUNZERO) ENTRIES IN RON I TO THE RIGHT OF THE DIAGONAL . NROHM1 REAL N(NROHN.180 XIII.NROHN.JMAX B(I-J) = B(I-J) .. This makes BANFAC/BANSLV in general inappropriate for band matrices other than totally positive or strictly diagonally dominant ones. In fact. b] that also contains all the data sites 1'1.I-1) DO 45 J=1.NBANDU.NROH—1. SUBTRACT RIGHT SIDE(I)*(I-TH COLUMN OF L ) FROM RIGHT SIDE (BELOW I—TH RON) . They will then recognize the splitting of the task of solving Cx = b for x into factoring C’ and then solving for x with the aid of that factorization as quite customary.J. we consider only knot sequences t = . . Conte & de Boor [1980].NROH. . I. A IS LOWER TRIANGULAR .EQ.1) END Readers unfamiliar with the computational (and theoretical) aspects of solving systems of linear algebraic equations are urged to consult the fine textbook on that subject by Forsythe 8: Moler [1968] or any textbook on numerical analysis. .I) BACKWARD P Ass FOR I=NRON. THEN SUBTRACT RIGHT SIDE(I)#(I-TH COLUMN OF U) FROM RIGHT SIDE (ABOVE I-TH RON). The interplay between knots and data sites We consider now some bounds on the interpolation error.B(I)*W(MIDDLE-J. DIUIDE RIGHT SIDE(I) BY I-TH DIAGONAL ENTRY OF U. 1) so TO 41 RETURN 49 B(1) = E(1)/H(MIDDLE.. .I) 45 JMAX = MINO(NBANDU.NRONM1 JMAX = MINO(NBANDL. for example. We continue to measure the size of a function g by its max-norm '"" llyll == a1g§%_¢b|9(I)l for some fixed interval [a . DO 31 I=1.JMAX.JHAx B(I+J) = B(I+J) — E(I)*N(HIDDLE+J...1. Spline Interpolation INTEGER NBANDL.EQ..2.I) I=I—1 IF (I .NROH—1.MIDDLE. NROH—I) _ C C C 21 GOOD C DO 21 J=1...GT. DO 21 I=1..NROH). 1) GO TO 49 NRONM1 = NROH — 1 IF (NBANDL .I) " 40 I = NROH RETURN 41 B(I) = B(I)/W(HIDDLE. 30 IF (NBANDU . 71—92]) is the fact that no pivoting for size is used. Tn.GT. Although we could be more general. 0) GO TO 30 FORWARD PASS FOR I=1.NROH 31 B(I) = B(I)/H(1.B(NROH) MIDDLE = NBANDU + 1 IF (NROH . the only special feature of BANFAC/BANSLV above compared to other banded matrix solvers available (see for example. .-O) GO TO 40 . Wilkinson Sc Reinsch [1971:pp. In consequence.I..4 _<§ (1 + ||I||). For every continuous function g on [a .1=) with llfll == 111%-I>¢{|IIy||/Ilyll =9 E Cl<1--bl\{0}}- I Since Chapter XII already provides us with various bounds on the number dist (g. as we saw already in Example XII(37). = 181 =1:. We therefore expect the number |]I|| to grow large as T1. see Xl(-4)) so that the norm of the interpolation process I is bounded below by _> constk max II'llI1{tJ'+. The linear system (1) becomes singular when the condition (3) is violated.$4.+1 5 gt.03005.Bi by Ig... $. I -_- i ' ..)>0. ‘i-'=I. We assume that B-.._1) Fl (T5 . 'T'-5+1) ¢ AT-5 .-4 C $4.... we saw there an interpolation error of more than 383. 1] from cubic polynomials is 5 ./:1: + 1 on [-1 . o¢..+. since II.)‘. 383.. . The next lemma shows this to be no accident.. so that has exactly one solution and we denote the corresponding interpolating spline function f = E.. whatever t might be..... b].t). = b. To recall.._inte1"polation at knots at four (very nonuniformly spaced) data sites. We derived in Chapter XII the 'error bound XII(39) for cubic spline interpolation at knots.t) _<§ . with = 1.1) of the function ~._. therefore ||I]] > 12 754. the interpolation error is bounded by ' (10) Ila — IQII 5 (1 + ll-Ill) dist (9-= $1-=.7't. A different cause for large ||I is nonuniformity of ‘T. of B-spline Property XI(x). <t. (9) Lemma.. just as in Chapter XII.O3005.. with a corresponding loss of five decimal places in the accuracy achieved. . (11) Lemma. tj+._. .¢.-. 1].. The same argument establishes the following more general result. this lemma then focuses attention on the norm ||I of our interpolation process I . < ¢.03005.= 1.4 when using cubic spline. ._ The interplay between knots and data sites (t. II. of its allowable range (and the knot multiplicity of this limit is < la). dist (g. = =1.-./:1: + 1 the function to be approximated in [-1 .. We know from Example II(12) that the distance dist (g.j(T-. Therefore..‘+" with o..1 — ts.. approaches the limits ti or t.. There exists a positive constk (closely related to the number DE. .. a large "I makes the noise inherent in floating-point calculations an important contributor to the approximation error.. large HI would mean throwing away all that approximation power in $. so that.. tn<Tn—m+1 <"'<Tn_€b=tn+1- For ls: = 4.. g to g. as we will see below. I-:=:2-m say..] 1-3+1?‘ T-J goes to infinity. To be sure. One chooses t. and so shows that a large HI].t.M(¢. one can make most of the data sites also knots. this corresponds to cubic spline interpolation with the “not-a~ knot" end condition discussed in Chapter_IV (see p.1. (10) is a bound and does not guarantee a relatively large interpolation error for every g whenever [II is large.¢.rll'»"lmA proof can be adduced from de Boor [1976]_-3. Spline Interpolation A simple proof of this lemma can be found in de Boor [1975].. that is.=t. but is not guaranteed to do so. for every m times continuously differentiable function g. (12) 1'. But. .—l-:.-. ll9 -' Ikgll S ¢°flStk.. This theorem shows that spline interpolation at knots to a smooth function g produces good results even for nonuniform data site spacing. so that tk=a_'§T1 <---<Tm<tk+1.'n.182 XIII. for a.}... . ' The lemma shows that we can make "I arbitrarily large by letting two interpolation sites approach each other while keeping everything else fixed.. (13) Theorem. j= 1......) which depends on 1-: = 2m and increases to infinity as the following global mesh ratio MPH ml == sex 1-.“ must be very large. We denote the resulting interpolation process by L1.. Even order interpolation at knots For even order ls.. 44). may have an adverse effect on the quality of the approximation I1. . It shows that we should pay careful attention to how we place data sites and knots so as to avoid making the constant 1 + || in (10) large. even when Lemma (11) shows that HI.. see Problem 3 below. . There exists a positive const.. But. . $m.+1.t.~»») E1131? (gm). Theorem (13) uses the smoothness of the function g and is therefore valid only to the extent that this smoothness is not destroyed in calculations by noise._M(.+j.. 2// a 25H H MAx.STEP.N.COEF(NHAX*4).DO 11 I=1.EB.) STOP 24 CALL BSPLPP ( T.SCRrcH(140O).PPUALU(INTERU). I PRINT 600.X C REAL AMAx. is allowed to grow small.NM1 PARAMETER (NMAx=2oo) REAL AMAX.3) FUNCTION TO BE INTERPOLATED . except that AT3 =: h. IFLAG ) GO TO (24.BSPLPP(BSPLVB#).DX. '= 7.RATE 500 FORMAT(3I3/E1o.Example: A large ||I|| amplifies!‘ noise (14) Example: A large amplifies noise 183 We choose 1-: = 4.BSPLNB). THE RESULTING NOISE DR ERROR IN THE INTERPOLANT (COMPARED TO THE CUBIC) GIVES THE NORM OR NOISE AMPLIFICATION FACTOR AND IS PRINTED OUT TOGETHER HITH THE DIMINISHING DISTANCE H EETHEEN THE THO DATA POINTS.T(NMAI+4). The program is written to invite further experimentation.23).GTAU(NMAX). L ) . 1].STEP.J.H.RATE.N C 10 TAU(I) = FLOAT(I—1)/FLTNH1 . BCOEF.TAU(2oo). CHAPTER IIII.+x*(1.N.BREAK(NMAX). pick n.RCOEF(20o). OOOOO INTEGER I.TAU(NMAX). 20 / c _ C(x) = 1.IFLAG. CALLS SPLINT(BANFAC/SLV.SCRTCH(NMAX#7). g(:t) = $3 + :02 + :1: + 1. T.. TO DEMONSTRATE THE CORRESPONDING INCREASE IN THE NORM OF CUBIC SPLINE INTERPOLATION AT THESE DATA POINTS. 4.sIzE.NMAx.3/E1o.Dx.JCLOsE.FLTNM1.cOEF(soo).N 21 GTAU(I) = ROUND(G(TAU(I))) CALL SPLINT ( TAU. COEF. GTAU.H.ITERMx.IFLAG 23 PRINT 623 623 FORMAT(27H SOMETHING HRONG IN SPLINT. SET UP KNOT SEQUENCE FOR NOT—A-KNOT END CONDITION .4 T(I) = TAU(I) 11 T(N+I) = TAUCN) DO 12 I=5. . SCRTCH. 4.+x*(1.ITERMX DO 21 I=1.ITER.+x)) READ 5oo.ROUND C AN INITIALLY UNIFORM DATA POINT DISTRIBUTION OF N POINTS IS CHANGED I T E R M x TIMES BY MOvING THE J C L O S E —TH DATA POINT TOWARD ITS LEFT NEIGHBOR. A LARGE NORM AMFLIFIES NOISE. CUTTING THE DISTANCE BETWEEN THE THO BY A FACTOR OF R A T E EACH TIME . BCOEF. THE DATA ARE TAKEN FROM A CUBIC POLYNOHIAL (WHICH HOULD BE INTERPOLATED ENACTLY) BUT UITH NOISE OF SIZE S I z E ADDED.BREAK(2oo).Fx c # . initially equal to 1/ 6.FX 1 .RATE.FLTNM1.ISTEP.SIZE soc FORMAT(1sH SIZE OF NOISE =. N.ERROR) C ' START HITH UNIFORM DATA POINTS . NM1 = N — 1 FLTNM1 = FLOAT(NM1) DO 10 I=1. EXAMPLE 1. ISTEP / 20. BREAK. hence I4g = g in exact arithmetic..SIZE. We perturb the function values g(*rr) by errors of size SIZE.JCLOSE. N.sIzE.x COMMON /ROUNT/ SIZE DATA STEP. and T1 < < T7 equally spaced in [0 .N 12 T(I) = TAU(I—2) C DO 100 ITER=1.T(2o4).BCOEF(NMAX).ITERMx.GTAU(2oo).L. SCRTCH. IsTEP x = RREAK(I-2) — DX*FLOAT(J—1) Fx = PPvALU(RREAK.4.L.17+Oo 0.SIZE COMMON /ROUNT/ SIZE DATA FLIP /—1.259-03 O.83-O1 0.ERROR o.47?-oe 0.691-cs o.SIZE OF NOISE =O.26-O2 0.ER R OR _ SIZE OF NOISE =0. DE BOOR RETURN END The input N = 7.353—O4 O.10—O1 0.21—01 0. produces the output on the right which Shows the same kind of noise increase even when starting with supposedly correct data. TAU(JCLOSE) = (TAUCJCLOSE) + (RATE—1.33—03 O. on the left. SIZE = 10"-6 and RATE = 2.57o—O3 0.x.13-02 0.23B—06 0.0) AHAX .83—01 O.672-O4 o.AMAx 630 FORMAT(E9.2.E15.17+oO 0. Spline Interpolation CALCULATE MAX. The Same input.146—o3 0. JCLOSE = 4.763-O5 _ 0.00+OO H MAX.AMAx1(AMAx.238-06 0. DO so I-4.0.52-02 0.157-O4 The increased magnification of the initial noise is very noticeable.4 XIII.21-O1 0...10—O1 0.204-O4 0.42-011 0.250-05 O. but with SIZE = 0.159—o4 0.)#TAU(JCLOSE"1))/RATE 100 CONTINUE STOP END REAL FUNCTION ROUND ( X ) C FROM * A PRACTICAL GUIDE TO SPLINES * CALLED IN EXAMPLE 1 OF CHAPTER XIII REAL X.954—o6 0._ El In a very simplified form.AES(Fx-G(I))) CONTINUE H .42—O1 0.65-03 0. FLIP. confirming that the lower bound for “I in Lemma (11) is qualitatively correct.47?-oe 0. the machinery at work here is the following./ FLIP = —FLIP ROUND I I + FLIP#SIZE BY C. o.TAU(JCLOSE) — TAU(JCLOSE—1) PRINT ssO.3) MOVE TAU(JCLOSE) TOWARD ITS LEFT NEIGHBOR SO AS TO CUT THEIR DISTANCE BY A FACTOR OF RATE . ITERMX = 10.143-O5 0.N Dx . produces the -following output.O.(BREAK(I-2) — BREAK(I-3))/STEP DD 25 J=2.143-05 o.INTERPOLATION ERROR . 25 so AMAI .13—02 0.477-O6 .10-O5 H MAX.H.52-O2 O 26-02 O.65-O3 .33—O3 O. If we consider the linear functional Ah of approximate differentiation on .111—O2 O. The magnification factor increases like 1/h.COEF. (See also Problem 7.‘g is about as good an approximation to g from $. with s the noise or error in the computed function values. for moderate k (and certainly for k 5 4).a. Call the resulting interpolant I}: g.7. hence for a smooth g. then the computed value for Ahg equals Ahg -P s//1.|| -—+ oo as h -1.regardless of how small each Ar. de Boor [1975]) that |lI5|l s 2. These points are those used in Schoenberg‘s variation diminishing approximation XI(33). for k = 32. A large ||I does not come from some small Ar. Nevertheless.= .-. But.Interpolation at knot averages 185 C’ [a . for example.\hg ..:||) ds1=<g.Q. Then IQ‘ is just broken line interpolation. But now. If. that is.t as possible. Jia [1988] gives a counterexample to this.rall s (1 +.||I. .1) is to be recommended.-_) for given knot sequence t. However.. ll | . ll it is likely that. the norm becomes arbitrarily large when h becomes small. the data sites are chosen uniformly spaced.. might be! Interpolation at knot averages If one has the freedom to choose the data sites (T. This corresponds to Lemma (11). since ng . for any particular k. It can be shown (Marsden [1974] (see Problem VII). It has been conjectured that sup t < oo.t>. IIIZII S 27 ~ (in fact. but as yet unproven. |)\hg| stays bounded even though ||/\. for any continuously differentiable function g. R. the computed number A.O.. finally.) Now a final observation to prevent the reader from jumping to unwarranted conclusions. then |lI4]| 5 1. as the noise irithe data or in the machine arithmetic becomes the dominating phenomenon.. This corresponds to Theorem (13). ||Ij. and = 1. Ij'."!| 5 3 seems a more realistic. b] given by the rule . per se.bl \ {0}} = 2/71In particular. if the computed function values are inaccurate because of the finite precision arithmetic used. then use of the Greville sites (15) It = tie 1: (“+1 + ' ' ‘ + ti+k-1)/(Uh .g may become quite large as h becomes small. Therefore.. bound).. all 9’ then its size or norm is llihll == max{ IAAQI/llyll =9 E Cl¢1-. Ahg -—-> g’(a) as h -—-» 0. PNATx.GTAU(2O)..ALOGER.FLOAT(I)*H .A/1 + :1: in [-1.PNATX.IsTEP.) G IS TO BE INTERPOLATED . Spline Interpolation (16) Example: Cubic spline interpolation at knot averages with good l(fl01ZS In this example.NMR.C(4.SCRTCH(NHAX*?).ITERMx.ESPLPP(EsPLvH*> INTECER I.NLOW}NHIGH C C sou FORHAT(sIs) PRINT sun.DECAY. CUEIC SPLINE INTERPOLANT AT KNOT AVERAGES C WITH GOOD KNOTS.NHIGH. N.T(NMAx+s). L. C.ERRMAx * .INTERPOLATION ERROR ON ERRHAX = O.EHRMAX.FLOAT(IsTEP) SPECIFY POINT DENSITY FOR ERROR DETERMINATION.G(TAU(I)) TAU GTAU T N 4 SCRTCH BCOEF IFLAG ) CALL BSPLPP ( T.DX. ITER I 1 CONSTRUCT CUBIC SPLINE INTERPOLANT. CALLS sPLINT(BANFAC/SLV. C..RSPLVE). 20/ CICICIOCI C THE FUNCTION G(x$ . DO 12 I-1.NEHNDT. THEN.4 T(I) = -1. ITERMI . ITERMX TIMES. we conclude our experimentation with the knot placement algorithm NEWNOT begun in Chapter XII.1]_ CHAPTER XIII. ITERHI) GO TO 1a ( 1 | 1 1 II I 1 ITER = ITER + 1 CALL NEWNOT ( BREAK.NHIGH. 5 6 1O C C 11 12 T(N+I) I 1.STEP # .L T(3+I) -= TNE'J(I) _ ESTIMATE MAx. DATA STEP. GO TO 11 LOOP OVER POLYNOMIAL PIECES OF INTERPOLANT .LT.BCOEF(NMAx+2).BREAH(NMAx). (-1 .NLov PARAMETER (NMAI-20) REAL ALGERP. GTAU(I) .N. 4. * TAU(20}.ITERHI. L. IF (NHK . ISTEP /20. L ) IF (ITER . ' . BCOEF. namely cubic spline interpolation at knot averages. # C(4.sCRrCH(14o).GTAU(NMAX).NMAX).BCOEF(22).2O). DECAY I O. SCRTCH.22H CYCLES THROUGH NEWNOT// # 28H N HAx.DEcAr.NMAx. DO 4O N'NLOW. BREAK. 4. See Example XII(33)iI.NMK T(I+4) .sTEP. sun FORHAT(I4.Dx./FLOAT(NMK+1) DO 5 II1. READ 500.TNEU(NHAx) REAL ALGERP.1) .SCRT<x+1.N TAU(I) I (T(I+1)+T(I+2)+T(I+3))/3.ITER.1.H.1 186 XIII.2.T(2S).£) C “LOOP OVER N = NUMBER OF DATA POINTS . TNEW.GT. SCRTCH ) 15 C 18 19 C DD 1a I=2.H. EIAHPLE 2. READ IN THE NUMBER OF ITERATIONS TO BE CARRIED OUT AND THE LOWER AND UPPER LIMIT FOR THE NUMBER N OF DATA POINTS TO BE USED.TNEW(20) ISTEP AND STEP . 1) GO TO 1O DO 6 I=1.2 4 NHK ' N-4 H .G. We now have a cubic spline approximation process at hand which has a small norm.ERRuR DECAY EkP.G. to guess a reasonable knot distribution from an approximation to the function g(:1:) =. DETERMINE NEW KNOTS FROM IT AND FIND A NEW INTERPOLANT.BREAK(20).TAU(NMAx). We return therefore to the goal of Example XII(33).ALOGER. 1476+00 9126-01 6436-01 4381-01 2896-01 1919-01 1278-01 8604-02 5865-02 |__. 3 CYCLES THROUGH NEWNOT ||_ | N A CYCLES THROUGH NEWNOT 4 6 8 10 12 14 16 18 20 MAX.F11. DO so J=1.)/2'.L DX = (BR.) so ERRHAX . Both decay rate and error do indeed improve as NEWNOT is used more and more.I)+H*(C(2. The output for N = 2.I)+H*(C(3.N.F.IsTEP H = FLOAT(J)#DX I PNATX = C(1.2) STOP END The program allows one to specify the first and final value for the number N of data points to be used.E12. ITERMX IS specified on input.ERRMAx.I)/3. the knots are initially equally spaced and are then modified through ITERMX Cycles through NEWNOT.I)+H#C(4. 3. 6.EAK(I))/STEP C C INTERPOLATION ERROR Is CALCULATED AT ISTEP POINTS PER POLYNOMIAL PIECE . 75 -0 69 -0 65 -0 63 -0 61 -0 59 0 CYCLES THROUGH NEWNOT N 4 6 8 10 12 14 16 18 20 MAX .ERROR 1476+0O 7753-01 4044-01 2593-01 1822-01 1364-01 1065-01 8637-02 7155-02 DECAY EXP. is Shown below. 0 -1 -2 -1 -1 -1 -1 -1 -1 00 59 26 99 94 88 85 78 79 N ' 4 6 8 10 12 14 16 18 20 MAX.ERROR 1476+00 8335-01 5004-01 2833-01 1647-01 9871-02 6103-02 3895-02 2568-02 DECAY EXP. But. _ . ALOGER = ALOG(ERRHAX) IF (N .DECAY 640 FORMAT(Ia. even with 6 Cycles through NEWNOT.EAK(I+1)-BR. 1476+00 9126-01 7070-01 5975-01 5270-01 4767401 4385-01 4082-01 3834-01 0 00 -1 19 -0 89 -0. . we do not get the hoped for N"4-convergence.ERROR DECAY EXP.ABS(G(BREAK(I)+H)-PNATX)) C CALCULATE DECAY EXPONENT .4. . and for ITERMX = O. .4. to the left. 20. Example: Interpolation at knot averages 187 DO 30 I=1. For each choice of N.GT. ERROR DECAY EXP . 0 CYCLES THROUGH NEWNOT N 030141- 10 12 14 16 18 20 MAX. NLOW) DECAY = * (ALOGER — ALGERP)/ALOG(FLOAT(N)/FLOAT(N—2)) ALGERP = ALOGER C 40 PRINT s40.AHAX1(ERRMAX. . BREAK(NMAX).sCRTcH(14o). NLOW) GO T0 4 ‘ CALL NEWNOT ( BREAK.00 -1.60 -2.NHIGH.sTEP.1891-02 0.67 -2. A c(4.T(2s).ALOOER.-L .18TO-O1 O.72 -2./FLOAT(NMK+1) DO 5 I-1..NLOW PARAMETER (NMAXI20) .—»—. CHAPTER XIII.T(NMAX+6).188 XIII.1259-01 0.SCOEF(22>. Instead of starting afresh with uniform knots for each new N.68 -3. C DO 4O N=NLOW. 20/ C -A H THE FUNCTION G Is TO BE INTERPOLATED .N.5329-O2 0 3924-O2 0.H.2878-O2 0. C.40 statement and the statement labeled 4. ISTEP /20. # TAUINHAX). 1) GO TO 10 I$.45 -3.DECAY. 4 O 1476+0O 6 8 10 12 14 16 18 20 0.OECAY.GTAu(20).52 2 CYCLES THROUGH NEWNOT N NAx.Ox.SCRTCH(NMAX*7). 4.ITERMX.2.7545-01 O 3413*O1 O.BCOEF(NMAX+2).NMK.76 *2. ITER I 1 4 CO TO 15 NHK I N-4 H .ITERMX. G(X) I SORT(X+1.00 -1.TNEW(NMAX) REAL ALOERP.NHIGH 500 FORMAT(3I3) PRINT 600.7395-02 0.ERRMAx.TNEW(20) ISTEP AND STEP = FLOAT(ISTEP) SPECIFY POINT DENSITY FOR ERROR DET- ERMINATION.DX.NHIGH.BSPLPP(BSPLVB#) INTEGER I. READ 500. ITERMX _ 600 FORMAT(I4. REAL ALGERP.T954-O1 ' 0. This requires the following modification of the earlier program between the DO .SREAH(2o). I C(4 NMAX). 4 0.LT. we use the Cubic spline approximation last computed for the preceding N to determine the initial knots for the next N.H.2 IF (N .70 -2.ERROR DECAY EXP. _ DATA STEP. T(s+L) I 1.EQ.NLOW. CUBIC SPLINE INTERPOLANT AT KNOT AVERAGES C WITH GOOD KNOTS.ERROR DECAY EXP./) LOOP OVER N = NUMBER OF DATA POINTS .14?6+O0 6 8 10 12 14 16 20 O.22H CYCLES THROUGH NEWNOT// I 28H N MAX. IF (NMH . Spline Interpolation 6 CYCLES THROUGH NEWNOT N NAx.) DECAY I 0.G.4 T(I) I -1.99 We try the following reasonable variant.ALOGER. L.PNATx. C READ IN THE NUMBER OF ITERATIONS TO BE CARRIED OUT AND THE LOWER C AND UPPER LIMIT FOR THE NUMBER N OF DATA POINTS TO BE USED.ERROR DECAY Exp.PNATX. MODIFIED AROUND LABEL 4. TNEW.ISTEP.STEP.ITER. L+2. EXAMPLE 2M.2o).NMAX. 81 -3.BSPLVB). * FJOOOFJ TAU(20).3009-02 l 0.16 -3.ERRMAX.GTAU(NMAX).1139—O1 0.7548-02 0.NEWNOT.65 -2.4526-02 0.2240-O1 0.61 -2.G. SCRTCH ) L = L + 2 T(5+L) I 1. 5 T(N+I) I 1.52 -2-23 -2.84 -3.4183-O1 O . CALLS SPLINT(BANFAC/SLV. 4.DECAY 640 FORMAT(I3.The Chebyshev-Demko sites 189 ‘I I l’ C C D0 6 I=1. THEN.)/2. 6 10 DETERMINE NEH KNOTS FROM IT AND FIND A NEW INTERPOLANT. GTAU. C. IFLAG ) CALL BSPLPP ( T. use of knot averages may not guarantee a ‘small’ ||I. I -1 '\_1-_-_In-_ 1| | l -I _ 15 18 C C T(3+I) = TNEN(I) 19 ERRNAI = 0.t as S. T.CT. END - STOP The resulting output is also listed above.) so EHRHAX = AMAxI(ERRMAx. L..I)/3.I)+H*(C(3. := (Bj(r.):i. ALOGER I ALOG(ERRMAX) * IF (N .I)+H*(C(2. BCOEF.|]. SCRTCH. the analogue of the Chebyshev sites II(9) for polynomial interpolation is readily available for interpolation from $k..E12.1) . TNEW. To be sure. Jia [I988]. 4. DO 3O I=1. But it does mininlize the max-norm of the inverse Al}1 of the spline collocation matrix A.n) . BCOEF..N 12 GTAU(I) = G(TAU(I)) . to the right.I)+H#C(4. L.L TAU(I) = (T(I+1)+T(I+2)+T(I+3))/3.4. N. and shows the desired O (N'4) Convergence after a few applications of NEWNOT. 4. Cl Interpolation at the Chebyshev-Demko sites While.DECAY EXPONENT . 11 DO 12 I=1. CALL SPLINT ( TAU.1.2) . ITERMI TIMES. use of these sites 1'“ does not minimize the norm ||I of the resulting spline interpolation map IE over all possible choices ‘T of interpolation sites. DO so J=1... N. GO TO 11 ESTIMATE MAx. L ) IF (ITER .GT. Demko [1985] has pointed out. SCRTCH. INTERPOLATION ERROR IS CALCULATED AT POLYNOMIAL PIECE .Q..ABS(G(BREAH(I)+H)-PNATx)) C CALCULATE. ITER = 1 CONSTRUCT CUBIC SPLINE INTERPOLANT.ERRMAX. SCRTCH ) DO 18 I=2..INTsRPOLATION ERROR ON _- LOOP OVER POLYNOHIAL PIECES OF INTERPOLAHT . according to R. BREAK.F11. ITERHX) GO TO is ITER = ITER + 1 CALL NEWNOT ( BREAH.NHK T(I+4) = FLOAT(I)*H . C. NLOW) DECAY = (ALOGER ~ ALGERP)/ALOG(FLOAT(N)/FLOAT(N-2)) ALGERP I ALOGER C 40 PRINT 640.j= 1.N.ISTEP H = FLOAT(J)*DX ISTEP POINTS PER PNATX = C(1.L DX = (BREAK{I+1)—BREAK(I))/STEP C C (-1. -*.1. (19) ll-Bill S l|A¥1|\- With this in mind. it will be important to recall from Theorem (7) that A. hence. .span(B. :j qé ii: 1. by Lemma (8). that is <18) __ __ IICXII _ . : i qé _ B3’ with the distance measured in the max-norm.||@|1.. satisfy (22) 1 = (-)"-*f. . . .fB_.'n. lC'(m)l with the vector norm nxu == |1=<||. hence IIIZQII S |lA¥1l|ll9|lConsequently.'.||.oo- Here and below... Then (—-)'"-iaf = 1/ dist (B. . . is necessarily checkerboard. The basis for this choice is the following lemma.is totally positive.‘Z' 1 This turns out to be the sequence 1"’ of extrema of the Chebyshev spline of order k for the knot sequence t.span(B_-.. .. Let f.n. . . == m_f-'1-X|$ilIn what is to follow.mgx.. a.mg-X -W . (21) Lemma.. . =: :5. the function __ (20) Tk't ‘-—- (—)"'j dist (B_.. by definition.190 XIII. Cl‘IjBk‘1' with or = A.. This is. In that case.- IICII .*) ='||f. Demko proposgs to choose as interpolation sites the sequence 1' (if any) that minimizes ||A. the inverse of AT. the norm "C of a ‘matrix C is taken as its max-norm..1(g('rj) :j :..(¢. Spline Interpolation over all possible choices of 1' and thereby (see Remark (23)) gives the t-independent bound (17) I ~ ll-Fill 5 Dk. for some strictly increasing sequence.n). . the unique interpolant to any given g is Igg = E3. . if it exists. ¢= 1. . ..=. f.. J. ' El It remains to prove the existence of the Chebyshev spline. (24) Proposition. or‘ = Aj'1((—)""‘ : i = 1. For 1. = 5..n). '4 I H“ since ||a*|| 5 DE.. if it exists. let ft =: Z).. lufl = Hull dist (f.1.kerp. oi be the unique element of $1. ‘=1 span(B.t —> 1R= f H Z A:1<w">r<T. each of which is a global extremum. that satisfies f.>~ - 3' Then MB.. while kerp.) with t. and so CllSt I l{€I' pi) = Cll. hence that.The Chebyshev-Demko sites 191 In particular. for any linear functional p on any normed linear space X and for any f E X. The proof provides (not just coincidentally) an algorithm for the construction of the minimizing 1' =: T“.||.and set Pi = $. l{6I‘ pt-5) = El (23) Remark This shows that any f. essentially. proves (17).. ... This. ker /1)Hence. <—>"*-Q: = <->"-ms.3-. Let A. together with (19). as AI1 is checkerboard. min. while.f.. is uniquely determined by (22). 1 = dist (f. from B-spline Property Xl(x) (see XI(4)).. Then.. ||cr"'[| is taken on..|l¢I*|l = ||1‘1I1l|On the other hand.-:=-=1 23. := A. with neighboring extreme values having opposite signs. PROOF SKETCH.-(T-. hence. conversely.. Also. . = Zj<—>""*A:‘<m<->""~*‘ ' =2!/-1...1. has n local extrema.). < T. This algorithm is..: j qé i).= (T1 < < 1-. the (second) Remez Algorithm for the construction of a best approximation in the uniform norm. the Chebyshev spline. G $x=. PROOF. . satisfying (22) is necessarily the Chebyshev spline Tkit. .. in Lemma (21).+. hence. all i.T‘(m')| = ||»». < T.a.-.Si3 (fa. satisfies the conditions (22) imposed on f. at a 'r for which f.3) = (-)'"*‘. using the checkerboard nature of A. all i..TBj|| = 1.'. for example.2.11 1. .. ||o:*|| _§ ~A MATLAB program for the calculation of 1'“ for given t can be found in an example in the SPLINE TUDLBDX (de Boor [1990]g). . . .. . =: Z5.. since of -= E3.1. Further. . Spline Interpolation We start with the observation that (—)'"_iaI > 0.192 XIII. A.. is the uniform limit of (fm : m = 1. _f.-"Bj. so one might not even bother carrying out the iterations. finally. (25) (—)"_ifiIl-' 2 (—)"'i<1F 2 0.agrees with Ej<. .'T1(i. It turns out that a good choice for the 'r to start off the iteration just described is the sequence of knot averages (15).'§") while ||fm\| = max._.?'__1) 2 s-(21%.< T. . there is exactly one f. and vanishes outside (t1 . and therefore 1. take It = 3 and 1' = (1. . 2. .. if. all i. we describe. On the other hand..“) of extrema for fm therefore also converge. 0'. This implies that ti < 0". .t. whose coefficients converge monotonely to some sequence o:*. (with f1 = _f..cr..... all i.j_)|.. Indeed. for some i. which is nonsense. with the sum necessarily positive.).) so that (15) holds. necessarily to a strictly increasing sequence Tf < . Forthis reason..._. in general. $ t.'r. the difference. The corresponding sequences (UT < < 0. f2 = _f.-.) 2 1. For any '7 < . since fm strictly alternates in sign on 0?“ < < 0:‘...('r.. all i- lteration of this process generates _a sequence fm := 23.'a. |fm(a1’")l and f.) = i—1. at (J1. . it follows that _f... with (-)“-ma.. with Corollary XI(28).1. For example.6). 3. and the resulting 1'“ is often not all that different.'T1(i. .'B.).2. showing that._.a. By Lemma (21).. ...) = (--)'"'“i. It follows that the function f* := 23. cr. strictly alternates in sign on 01 < * .. see chebdem there. a§B_. all i.._.a_'T. .j)(—)"_j = (—)"'"i E5.Bj.< on. < t.. this function is uniquely determined by the conditions (22). since f. In particular.satisfies (22) since 1 = (—)“_ifm(o'.... we would have i—2 Z S"(o¢'{.~ < 0. The only difficulty with interpolation at knot averages is the unhappy fact that it is. then B. hence we must have S’ (or"' — ya“) = 11 — 1. In particular. |A.._. .5. _f. ....).B_-. Consequently. a. strictly alternates in sign at the sequence T1.— '7_f. by (25).= with fa-(0.) = O for all -12 § i § 11. .-.has n distinct local extrema o'1 < . it is independent of the 1' with which we started this process. m = 1. impossible to choose t for given (T. . / f($)h(:r:) dzr = O for every f E $1...-. = b..._.+ ~r.. with h(a+) = 1..-r.. + .1). and choose the n — I: points t. Micchelli. together with the usual choice for the first and last Ir: “boundary” knots. .'r.._+1 = = t. Details concerning the program SPLDPT can be found in de Boor [1977]. . 8. which we will denote by £12 S (read “Clap. .. = a.: Winograd [1976] have determined. b]. for given data sites 1'. .. ¢= 1. .3 from which the program is adapted. . b]. b] as the breaks of the unique step function h for which ' |h(:r)| = 1 for all .._.. . . Such choice would certainly satisfy the conditions of the Schoenberg-Whitney Theorem. t.. using Newton’s method. Rivlin._].. . (27) h llas § n -ls: sign changes in [a .. turns out to be given by interpolation at the given data sites 'r by splines of order k with its knot sequence t = (t. :p I.. starting with the initial guess (28) ¢.'-"1... .Optimal interpolation Optimal interpolation estimates of the form (36) 193 We have seen now several examples of error - H9 -~ 5'9" S ¢O11$11s||9(k)|l with S some approximation scheme.*-" .b]:=['r1.-... This initial guess for the optimal knots is often very close to the optimum.._... . This scheme. ess crowned") for the obvious reasons. tn in {(1._1. = (1-. . This suggests ‘the reasonable alternative of forgetting about the optimal knots altogether and using instead the knot choice (28) directly. = 13.l .n _ 1.5' in (26) is as small as possible. The subprogram SPLDPT_below calculates this knot sequence t for given 1'..17 E [rt .. an interpolation scheme S for which COI1Sl'..._ choose t1 = = tr. .. Let [a.)/(t .)‘f+"‘ determined as follows. NITH T 0 L . T(N) ARE CALCULATED AS DESCRIBED BELOH UNDER #HETHOD* .. C . A s s U H E D TO BE NONDECREASING.LEFTMK.. IF IFLAG ..ARRAY OF LENGTH N+K CONTAINING THE OPTIMAL KNOTS READY FDR USE IN OPTIMAL RECOVERY.2.I-1.J.-. ALL I...N—K ) FOR I-1.TAU(N).. THEN T..K. c(I.ooo001 O O O O O O O O O O Oilfi ifi fi fi fi i Cifitz fi INTEGER IFLAG.+TAU(J+K—1))/(K-1) .. THEN K ... N . J=1. THEN THELNEXT NEHTUN ITERATE Is OF THE FORM xI(J) + (-)**(N—K—J)#X(J) . .I3) '00 TO ass -1.. T(N) AND NOWHERE ELSE IN (TAU(I) .. i .N.ND. SPECIFICALLY. OR ELSE AFTER N E H T H x ITERATIONS .OOOOO1/ NHK .. OR N .. K.2 1 PRINT ac1.2sH IN SPLOPT IS LEss THAN K =.LLHIN. LET xI<J) BE THE CURRENT GUESS FOR "T(K+J).K 601 F0RHAT(13H ARGUMENT N =. SCRTCH.INDEX..NUHBER OF DATA POINTS . ALL I.sUH # .ARRAY or LENGTH (N—K)(2R+3) + 5K + 3 .LLMAX. Spline Interpolation SUBROUTINE SPLOPT ( TAU. HITH B(I) THE I—TH B-sPLINE or ORDER K FOR THE KNOT SEQUENCE TAU... = T(N+K) = TAU(N) .KP1.5 .LT.ToLRTE..ORDER OF THE OPTIMAL RECOVERY SCHEME TO BE USED ._n_-1.SUM ( (—)**(N—K-J)*B(I.B(I)(xI(J)). IF IFLAG I 1.N-K. nBL.. J=1... .N-1.NA. J-I.sIcNsT.L. OR A CERTAIN LINEAR SYSTEM HAS FOUND TO BE SINGULAR.. HITH TAU(I).LEFT 1.55. T(N+K) DATA NEHTHx....ALL I. ##### H E T H O D ###### THE (INTERIOR) KNOTS T(K+1)... J=1. THE VARIOUS CONTENTS ARE SPECIFIED IN THE TEXT BELUU .. N.KPN. K. ... = TCK) = TAU(I) AND T(N+1) I .NNK.. I.TULRTE-/ 10.. ITERATION TERHINATES IF HAx(ABs(x(J))> .sIcN.. FEE ##### H O R K A R R A Y ##### O U T P U T ##### SCRTCH.KPK.J) . HERB..LT. ###### IFLAG.ID.. T o L .. TAU(N)) IS ORTHOGON- AL TO THE SPLINE SPACE SPLINE( K ...NX REAL scRTcH. T(I) = . T(N) ARE DETERMINED BY NENTONS METHOD IN SUCH A HAY THAT THE SIGNUH FUNCTION WHICH CHANGES SIGN AT T(K+1).nELHAx.LL.LENH.INTEGER INDICATINO sUccEss (=1) OR FAILURE (=2) . CURRENTLY. ALL J.NHKH1. HITH A(I) . TAU ) ON THAT INTERVAL .N—K. 3.KPKM1. ***** P R I N T E D O U T P A COMMENT HILL BE PRINTED IN FAILED TO CONVERGE IN‘ N E N ###### I-P‘ [Tl IFLAG I 2 OR NEWTON ITERATIONS I-ICICI 350'-l >4 ITERATIONS .iN )*(TAU(I+K)—TAU(I))/K. . HITH X THE SOLUTION OF THE LINEAR SYSTEM C#K I D .LT. AND A(N) .xIJ DIMENSION sCRTcH((N-K)*(2#K+3)+5#K+3).ToL.-IN ..N-K IF (NHK) 1.NEHTON.NEHTMX...KM1. .T 0 L R T E #(TAU(N)-TAU(I))/(N—K) ..FLcATH.LT.. IFLAG ) CALLS BSPLNB.I4.T. TOLRTE / 10. NEHTHI.. T.TAU(I+K). CONTAINING THE INTERPOLATION POINTS.. AND D IS THE VECTOR GIVEN BY 0(1) ..N. (sEE CHAPTER XIII or TENT AND REFERENCES THERE FOR A DERIVATION) THE FIRST GUESS FOR T(K+J) Is (TAU(J+1)+.. NHILE THE N-K INTERIOR KNOTS T(K+1).194 XIII.NB.Ka1...suH( -A(J) ...NC. .TAU)(xI(J)> ... BANFAC/SLY COHPUTES THE KNOTS T FOR THE OPTIMAL RECOVERY SCHEME OF ORDER K C FOR DATA AT TAU(I). C###### I-'l' Z ‘U ##e### HUG DI-lF LENGTH C TAU.. NEWTON =.I=1.5 ' c START NEHTON ITERATION....KH1 9 sun = sun + TAU(J+L) 10 scRTcH(J+Nx) .NHR sun = 0.l' I E DO a J=1.XIJ.K scRTcH(J) .Is.1 FLOATK = K KPK = K+K KP1 = K+1 KN1 = K-1 KPKM1 = KPK—1 KPN = K+N c c c c c sIGNsT = -1.N 22 SCRTCH(I—1+NA) = 0.N+K+K NX = N+KPK+1 scRTcH(I+Nx> = xI(I). SCRTCH(LEFT+1))GO TO 25 LEFT = LEFT + 1 IF (LEFT . KPN) GO TO 23 LEFT = LEFT — 1 CALL BSPLUB(SCRTCH...0. I=1.. IF (NHK .N—K+1 NA = Nx + NNK + 1 scRTcH(I+NA> = -A(I). LENH = KPKH1#NHK c EXTEND TAU TO A KNOT SEQUENCE AND STORE IN SCRTCH.K 602 FORMAT(13H ARGUMENT K -.. no 5 J=1... C J=1. ' 20 no 21 I-1... no 22 I=2.TAU(I) 5 scRTcH(KPN+J) = TAU(N) E E .J).GT. scRTcH(Nx> = TAU(I) SCRTCH(NNK+1+NX) = TAU(N) no 10 J=1.GT....NHK 23 C C C 25 XIJ = SCRTCH(J+NX) IF (XIJ .TAU(I))/FLOAT(NMK) c START NEWTON STEP COHPUTE THE 2K—1 BANDS OF THE MATRIX c AND STORE IN scRTcH(.K.SUM/FLOAT(KM1) c LAST ENTRY OF SCRTCH (.27H IN SPLOPT Is LEss THAN 3) Go TO see s NHKM1 = NHK .. 2) GO TO 3 PRINT 602. AND THEREFORE FOR 195 .J). I=J—K.+NA> ..--i E1- i Optimal interpolation 2 IF (K . SIGN = sIGNsT LEFT = KP1 no 2a J=1.. scRTcH(N+NA) .N-K...I=0...—A.. no a L=1..N—K NB = ND + NNK scRTcH(I+NB) = BIATx(I).1. I=1.+Nx) = xI .K+1 NC = NB + KP1 c SCRTCH(I+(J—1)*(2K—1) + NC) = H(I.N s SCRTCH(K+J) = TAU(J) c FIRST GUEss FOR SCRTCH (..J+K.LENH 21 ScRTCH(I+NC) . c AND COHPUTE THE VECTOR scRTcH(. scRTcH(I) = TAU-ExTENBEB(I).+Nc).SCRTCH(1+NB)) THE TAU SEQUENCE IN SCRTCH IS PRECEDED BY K ADDITIONAL KNOTS THEREFORE...LT.1 ~_ TOL = TOLRTE*(TAU(N) . SCRTCH(LL+NB) NOH CONTAINS B(LEFT—2K+LL)(XIJ) HHICH IS DESTINED FOR C(LEFT—2K+LL.... I=1.LEFT..N ND = NA + N SCRTCH(I+ND) = x(I) OR D(I).J) = C(I—K+J.+NA> = — A IS ALNAYE ..LT. (NHK/2)*2) sIGNsT = 1. sIGN .IN SPLOPT Is NOT INYERTIBLE) RETURN GDNPUTE SCRTCH (.14H NENTUN STEPS.196 XIII.KH1.NP1.TAU(1) 5? T(N+I) .+Nn) .LEFT.NPNH1. NENTHN) GU TO 20 PRINT a5s.N—LEFTHN) LLHAX = MINO(K.K T(I) .AHAx1(DEL. IF NEcEssARY.(scRTcH(I+1+Nx)-scRTcH(I+Nx))/3. . N—LEFT+K = LLHAY . DO 25 LL=LLNIN.KH1.NMK 49 scRTcH(I+ND) = SCRTCH(I+NA)#(TAU(I+K)—TAU(I))/FLOATK CDMPUTE SCRTCH (.AHIN1(DEL. CALL IT A DAY IN CASE CHANGE IN XI NAs sHALL ENDUGH OR TOO MANY c STEPS HERE TAKEN.ABs(DEL)) IF (DEL . MODIFY.sIGNsT DO 53 I-1.CHANGE IN II .— A . Spline Interpolation H(LEFT—K—J+LL.LE.GT.ANAx1(DELHAx. N—K OR LLNIN = 2K—LEFT .(scRTcH(I-1+Nx)-scRTcH(I+NI))/3.) GO TO 52 ~ 51 DEL . 45 I=N 4s scRTcH(I~1+NA) = scRTcH(I—1+NA) + scRTcH(I+NA) I a-I-1 om :r: OF IF (I . ALSO.+ND) .LEFTHH-NP1) LLNIN -_1 — HINO(O. TO c PREYENT NEH XI FROM MOVING HDRE THAN 1/3 OF THE HAY TO ITs c NEIGHBORS.D FROM SCRTCH (.TAU(N) RETURN 999 IFLAG I 2 RETURN END . c BEING OF ORDER N—K.NAxD(1. 1) GO TO 45 DO 49 I=1.+ND) = I .IFLAG) GO TO (45.LE. CALL BANFAC(SCRTCH(1+NC). LL .I3.LE.NENTHx 553 FORHAT(33H NO CONVERGENCE IN SPLOPT APTER.J)= SCRTCH(LEFT—K—J+LL + (J—1)#KPKH1 + NC) SINCE HE STORE THE 2K—1 BANDs OF c IN THE 2K—1 R O H THE NDRK ARRAY H. AND H IN TURN Is STORED IN s c R -1 HITH N(1.SIGN*SCRTCH(LL+NB) 2s sIGN = -sIGN .LE.) G0 TO 51 DEL .NHK.LE. IF (DELNAN .NN DEL = SIGN#SCRTCH(I+ND) DELMAX .KP1 ID = ID + 1 2? scRTcH(ID+NA) = scRTcH(ID+NA) .+NA) . TOL) GO TO 54 NEHTDN = NENTDN + 1 IF (NEHTDN .LLHAx 25 scRTcH(LL+INDEN) = scRTcH(LL+NB) A A CALL BsPLvB(scRTcH. THEN ADD TO XI TO OBTAIN NEH NI -IN scRTcH(.) 52 sIGN = -sIGN 53 scRTcH(I+Nx) = scRTcH(I+Nx) + DEL .N—LEFTHK) . cALL BANsLv(scRTcH(1+Nc).KN1.LEFTHK-KP1) DO 27 LL=LLNIN.2.44).KH1.+Nx). DELHAI = 0. 0.1) = scRTcH(1 + Nc) .GT. nooo LEFTHR = LEFT-K INDEN = LEFTHK—J + (J—1)*KPKH1 + Nc LLHIN .NHK _ 55 T(K+I) = scRTcH(I+Nx) 56 DO 57 I=1.KPKM1.xIJ.LT. NE NUULD NANT 1 .) 54 DO 55 I=1.IFLAG 44 PRINT s44 544 FORMAT(32H C. LEFT—2K+LL .scRTcH(1+ND)) COHPUTE scnrcn (.scRTcH(1+NB)) ID = HAx0(c.NMK. 1(1). i = 1.TAU(N) . We pick 12 data points somewhat more densely distributed around the peak and use optimal interpolation.IPICK(N).5/ .5.606. IFLAG ) IF (IFLAG .GTAU(49).601.2.668.) at T.s1.. The following subprogram provides these value-s_(except that the second .169. Lx ) ~ DO 10 I=1.LX.611.GT.SPLOPT(BSPLFB. GTAU...sa...GT.TAU(49).LENSCR=(N-K)#(2*K+3)+5#K+3) INTEGER I.6OB/ N = 49 DO 10 I=1.LX 2D '*" **.672.T(17).NTITAN PARAMETER (N=12. N.907.59S...211. INTEGER N. THEY HAVE BEEN USED EITENSIVELY AS AN EXAMPLE IN SPLINE APPROXIMATION HITH VARIABLE KNOTS.NTITAN=49. 0 ) scRTcH(I) = GTITAN(I) — GTAU(I) - .615.BANFAC/SLV).. A. SCRTCH. T.639.21. A.K /12..2?..710.IFLAG. CALLS TITAND.603.SPLINT(*).649..BB1. IFLAG ) IF (IFLAG .663.49. LENSCR = (NeK)(2K+3)+5K+3 IS THE LENGTH OF SCRTCH REQUIRED IN GOO SPLOPT ..IPICK(12).679..... ="|.GTITAN(49) DATA GTITAN /.638.N.746.SCRTCH(LENSCR). C C C SUBROUTINE TITAND ( TAU. . = 585 + 1011.6OT U1:-I=\UJI"J ..1..763.. K.62T..655..622. TEST OF OPTIMAL SPLINE INTERPOLATION ROUTINE C ON TITANIUM HEAT DATA ..Example: "Optimal" interpolation need not be "good" (29) Example: "Optimal" interpolation need not be "good" 197 We consider a function g that describes a property of titanium as a function of temperature and whose values g('r.663. I REAL GTAU(49)...GTITAN(NTITAN).664).601.. EXAMPLE 3 .075.676.644 should have been .BVALUE(INTERV) C DATA N.. K.. . INTEGER K. N.336.812. SCRTCH.676. ..IPICKI. N.1.*FLOAT(I) 10 GTAU(I) = GTITAN(I) RETURN END A plot of these data (see Figure (30)) shows g to be quite fiat (~ ...NMK * REAL A(N).X(NTITAN) C INTEGER I. T.45.TAU(12) C * 10 .GTAU(NTITAN)..1. we know from a table (experimentally determined).67B.652.11.s5.N IPICKI = IPIcN(I) TAU(I) = x(IPIcKI) GTAU(I) = GTITAN(IPICKI) CALL SPLOPT ( TAU.1= l'»-Iv+=:.LENSCR.SCRTCH(119).644..T(N+K). GTITAN.1.49/ cALL TITAND ( X.K=5. CHAPTER XIII..6) except for a peak around 905 where it rises to a value of ~ 2.. K.730.40.657.IPICKI.601.1..694. 2.646.652.6B3.LI. + 10. .. .2s..916. 1) STOP CALL SPLINT ( TAU. 1) STOP DO 20 I=1. .NMK C REAL A(12).IFLAG.603.2.044..644.X(49) DATA IPICK /1.N TAU(I) = 5s5.609.. GTAUI N ) THESE DATA REPRESENT A PROPERTY OF TITANIUM AS A FUNCTION OF TEMPERATURE.*'- - GTAU(I) = BVALUE ( T.699.GTITAN(49).EB6.. s)) STOP END Ll OPTIMAL KNOTS .41s44o4ao asu.sa54125ss 2 va4. more information about the fiat part I .193 XIII.o5a5oa217 s07.I=1. Spline Interpolation Optimal quarlic spline interpolant 3 2 .l 976 .F1o.GTAU(I).E11. having been set off by the peak.Lx) 620 PGRNAT(41H I.-P‘.Fs. II O -1 -2 -3 500 SOD (30) FIGURE.(I.-. 7OO BOO temperature QOO 1UOO 11OO An optimal quartic spline interpolant (solid) to given data (a) at twelve points taken from a data sequence (o) of 49 points.4. INTERPOLANT.T(K+I). we give here a picture (Figure (30)) showing data and approximation.x(I).. ERROR// 2 (Is.. DATA. PRINT s20.o. Clearly.__.Pa.P15. DATA POINT.41a?51s24.NMK) 521 P0RNAT(///15H OPTIMAL KNOTS -/(I5.I-1.(I..5 1 1ao.a14oass14 ess. ’ -go h QIIII ' -‘J iofigoo ‘ "T -. s44. The points of interpolation are easily picked out since the approximation oscillates so badly around the flat part.G004aa2a1 "~lO'IUl|-I=\l'.N-K PRINT 621. 751708984 Instead of the full output.GTITAN(I).4.scRTcH(I).s)) NMK . T. de Boor [1976]4) that there is a smallest 0: for which FC. El The optimal interpolation scheme was also derived independently by Gaffney 3. . For the promised questioning. . Micchelli. b] with It derivatives that agree with the given function g at T and whose lath derivative is uniformly bounded by 0:. T. . among all in- .. Gaffney 32: Powell [1976] investigate in detail the following question posed earlier in more generality by Golomb & Weinberger [1959]: Given that we know the values g(Tl). for which FD. .. An f G F. . then it contains two function fl and fl with the property that. to be nonempty. . Gaffney 8-: Powell came to it by a way of “envelopes”. T. It is clear that we cannot make 0: arbitrarily small in general.. . what can we say about the value g(... It can be shown (see Favard [I940]. Tl-l)? The answer turns out to be surprisingly elegant: (31) Theorem (Gaffney & Powell [1976]).T) of g at some site :1: (other than T1 . the term “optimal interpolation" for it is due to them. . ||f“")|l S <1} be the set of all functions on [a .+. for anya: and any f G Fa. we want to make 0: as small as possible._. Gaffney 82: Powell come to the optimal interpolant by the following device.]g/ls! = g(“)(Q) for some Q in the interval containing Tl.+. |(D“fl)(:1:)| = |(D“f2)(T)| = a. is not empty. namely the notion that making a derivative smaller makes the function smoother..T) and f2(:r). . that is.. as it turns out. the average converges and.. its limit is the optimal interpolant N2 S g to g discussed earlier. In fact. we would need lcla 2 max. f(a:) lies between fl(. Let Fa =={f=f('»"-. its center. . too (see Example XVI(17)). and is.Example: “Optimal” interpolation need not be “good” 199 needs to be made available to the approximation process (see Problem 5).is a “best interpolant” for g in the sense that. . . [T.-:)=g('e). . . . If Fl. .) and the bound [|g(“) jg 0:.5 Powell [1976].: Winograd [1976] call it an “optimal recovery scheme”. for F. ...-. For example. of“ := min{a : Fl. Using a lower order spline would help. . g(T.---. through. in a sense. as 0: grows without bound.. This average or center does depend on Cr.-_. 75 ill}. that is.. by divided difference Property I(vii). Both fl and fg are perfect splines of degree ls with n — It knots. is not empty. is not empty. but. Rivlin 8. . |[T.i=1. . both are splines of order k+ 1 with n — ls simple (interior) knots and with absolutely constant lcth derivative. For each 0:. and we now discuss this idea briefly since it gives us an excuse to question the basic notion underlying the optimality aspects of spline interpolation.]g| since.12.+l. . all 2:. the average (fl + fg)/2 of the two envelope functions fl and fg is also in F. _ ' Osculatory spline interpolation As in polynomial interpolation (see Chapter I). the price being paid here for a uniformlysmall 5th derivative (we took I-c = 5 here-as in Example (29)) is a “smooth” oscillation. '5"-5 -10 -15 -20 -25 5OO (32) FIGURE. But. BOO TOO BOO temperature QOO 'lOOO 11OO All “best” interpolants to the selected 12 from the given 49 data points must lie between the upper and lower envelope (solid lines) shown. we are looking for the interpolant that is most polynomial-like.200 XIII.'it and all other best interpolants would have to lie between the envelope for F..1838 >< 10*“ is very close to 62* for the data actually interpolated in Example (29). terpolants to g. Spline Interpolation 15 Flange ol possible values ol interpolants with smallest 5tn derivative /'\ 10 5 D A one IIIII IIII oeoll "' ” Ii-II neon no-. that is. since a zero 5th derivative implies that the function is 5. its kth derivative is as small as possible. better than best) among them. I am indebted to Patrick Gaffney for the information that the value ct = .. polynomial of order 5. ~. it is possible in spline interpolation to let some of the inter- l l ll ._.. Farvard’s best interpolant and all other “best” interpolants must lie between those strongly oscillating boundsll Clearly. we are ignoring the reasons that led us in Chapter II to piecewise polynomial functions. Such interpolants were first studied by Favard [1940] who developed (as explained in complete detail in de Boor [1976].._l) a reasonable way for picking from the possibly many best interpolants one that is best (or. The envelope function for that value of at is shown in Figure (32) along with the Titanium Heat data fron1 which it is taken. In effect.. namely complete spline interpolation.. In this scheme. I: =1 2m.to the mth derivative ofg.g)(1=))2 da: 5 /6 ((D”‘g-—-_f)(s:))2 da: for all f e $.__|_1=---=1-"__|_k=Ib_ with t.._l that agrees with-g at T = (T)? := (t....-. a matching to value and some of the derivatives... A simple proof of this theorem can be found in de Boor [1976]l. = (t... one chooses the knot sequence CtI=t1=---=t..)"f with T.l.. that agrees with g at T if and only if Tl G supp B.t.|_1 = .. and the data site sequence is a := Tl = -—. Given the nondecreasing sequence T = (T...-. T-fold interpolation at a point T means matching of derivatives from the zeroth up to but not including the rth at T..‘. We take the occasion to prove here its best approximation properties.t.l_.. =: b._<t..._|_l < .. a = tl = '5 tn < t-n__|_]_ = Z tl-l_|_k "-7. Ikg is the unique element in $l.+l 3 t. Let t = (t._._)‘f+"'° with A = 2m.. that is.+2 5 < t£+m I-Urk 3 5 Denote by [A9 the complete spline interpolant to g from 8..)j.< ‘T._|_1="'=T»i_[_..l.'..Osculatory spline interpolation 201 polation sites coalesce and so achieve osculatory or repeated interpolation..-_.. The condition for existence and uniqueness of an interpolant stays exactly the same as in the case of simple interpolation points.+..- . Correspondingly... for any smooth function g..= T. (33) Theorem (Karlin 8: Ziegler [1966])._..n--lc (=n——2m). < t.<It.. < T.-.. It is not hard to extend the subprogram SPLINT to construct osculatory interpolants. (34) Theorem (Best approximation properties of complete spline interpo- lation)._._|_1<"'<t.. there exists exactly one f G $. Instead.g of the interpolant is the least-squares approximation from $.-. the order is even. that is. ..Ola-Ildti = tl.. This is the customary generalization of complete cubic spline interpolation discussed in Chapters IV and V. < T. Then: (1') The mth derivative D""I. Then..=-T.). (35) jb(n"*(g-1.. that'is. all i...."_]_'T.. To recall. all i.= T.l. we discuss briefly a limiting case of even order spline interpolation at knots. but we do not talte the time for it here.. i=1.. assume that tk'<:T-l._l.tl_|_.-=tj_[_1="'=tj+5'<t-“+1 IIHPIIGS ‘l"'-I-S5_k.. .$._ —.._+.2 O2 XIII. ..]_f = jB. To prove (ii)...+..g..+. ... ' th derivative (ii) Also ..l.. .-l-. once again. - Dmltg E {D'""f = f e $t. among all functions f with a piecewise continuous Tn that agree with the function g at T..1)![T.T. ...._.... the particular function Ikg is smoothest in the sense that it uniquely minimizes b I (D”“'f(:t')) 2 dz. The proof parallels the arguments given in Chapter V for complete spline interpolation. T. orthogonal to D”“.. use the fact t a l.. g. Now.t} =-—.n I -ii til - II I I I This shows the mth derivative of the error to be orthogonal to the linear ' to $. In particuliar.... ‘I1’. ._.»r (on la . [ (Dorm-c>)2 d=»+ f (Dm(9--ltgll-T-‘Ell at b I b 2 valid for all g with a piecewise continuous mth derivative.T-. the proof relies on the following transcription (36) [T. in particular.T. ..)('l'Tt —.._.. this proves that Dme is... . P R0 OF._-l-(s)(D”"'f)(s) ds/ml of IX(6) using IX(5). ' span of (B. Spline Interpolation with equality if and only iff = D""*Il.]e = 0. . and so we obtain.. . ._. ..... Apply (36) to the error 6 i: g — Iltgi a function that vanishes at Tl.. on the other h"an d . Since. L (D"v<w>)’ <14 = . to prove (i). -.. a special Instance of Pythagoras eorem: l I l- 5 (37) I 1 i ' I I .__1-(s) (D'”'e)(s) ds = (Tl_..I. that agrees with g at T. to get that I) j B. i 1.q-)1 . substitute g — f for g in (37) and f*-Igforanyf use the fact that h tI El Ikf = f for f E $l. that 1s.... . P .bl)..l_..-. .-.n. all i. on [a .. function I We can always choose a polynomial p of order It so that the 5 Go) == Po) + f o .. If t = (ti)'[‘+” is in [a . (39) Corollary. . for-many.. the function g is continuous.l). El . tl.1 times continuously differentiable. . which proves the lemma. strictly increasing. El The following corollary is of particular interest. b _f(. then there exists E = (§i)‘[‘+1 in [a . ' (38) Lemma. I have bothered to mention them here only because the proof brings out the important connection (36) between divided differences and B-splines. Since G is also It -—. by (36).. PROOF. Further. .. t _ S l‘"'"*‘*+*lG =1 it hence vanishes by assumption. . . b]. G vanishes at all points of t.1._. Consequently.Osculatory spline interpolation 203 These best approximation properties of complete spline interpolation are still. for all i.... Lemma (38) says that 511+: f . . the major justification for using splines.T:)g(T) da: =0 for all f G $. if g is continuous then it must vanish somewhere in each of these n disjoint intervals (Er . then there exists T -= (Ti)? strictly increasing._l.1)! vanishes at tl. n. . (It — 1)-fold application of Rolle’s Theorem proves the existence of a strictly increasing sequence 5 =4 (§'["+1) with ti 5 Ei ‘_§ ti_l_i. In preparation for the next chapter. b]. . g(T) da: == 0 £1-_ for i = 1. ._.. .i.. that IS. .. PROOF.Eii-1). at which 1 b D”'1G =_const +/ (.i_i. with ti < ti_. i = 1.s>’1-19(5) di/(A . . b]. . .— s)'§]_g(s) ds 1 G- vanishes. i = 1. in addition. we now indicate the following important consequence of (36). so that g(Ti) =0.. hence. with ti § {fi § ti+li_ l (any equality holding only in the trivial case when ti = ti+i. nondecreasing. .n -i. and the integrable function g is orthogonal to $. so that g is also orthogonal to $1 é-. If..i. all i. with ti < Ti < ti+. s5l|I9ll/llgll = on .. ti+_i)/(I: — 1). and use earlier material to verify that [Ti. § t. to some continuous function g can also be gotten by spline interpolation (apply the corollary to the error in the least-square approximation) at some appropriate n sites that depend on g._.. For comparison. all U.(Ti)) by induction on the order It._. 1 is not totally positive. construct the optimal interpolant of order 5.)) under the stronger assumption that t...(T. tj+k_1) I-l (‘T-l‘_ . for some '-v.. Problems i (Another proof of the Schoenberg-Whitney Theorem) i) Prove: If B.:(‘T‘i)) follows from the invertibility of the two smaller matrices (B_. In a way. but bring in more data points from the fiat part.-(Ti))'_:_1’h..(T.) = 0.-(Ti)) form a linearly dependent sequence. least-squares approximation is a very reasonable way to choose the interpolation sites. conversely..T. (Hint: Write Ig = o¢iBi. instead..£nh-I"._.+..+l or t.-.ti_1 — 53* I (55: . ‘U + 1.) = 0 for 1 g T g ‘U 5 s § n.. that t. Spline Interpolation This corollary proves that any least-squares approximation from $. . i ' 3. (Hint: Show that the invertibility of (B_-..) Now assume.204 XIII. (Hint: Assume without loss that T.-_. .k-1(§t)l 5 at .(T. then is not invertible. Also.. if ‘T...=1 and (Bj(Ti))§fj=. 3 t.. Give a proof of Lemma (11). 1 is totally positive._i. all i. Ti_|_1. 'Ti_|_1) -75 SIIICE llflll S Dtmlllglll one sets from this 2(A'o)‘1 = H1319 ll'R.l_| show that then B. 2. .i-. 3 T.. all '0.+1 in case Ti.. using (ii) and Rolle’s Theorem. while then \(DIg)(a)|=|(1= — 1) Z Bi._.+ l § T2.. A di I= tj+-. the data sites at knot averages. conclude that columns ‘U.B. < Ti. and ._. especially from the two -In-I rlflit.._._l..- .+ii. that is. or t. § T.+i. (i) Show that the tridiagonal (square) matrix with general row 1. that is..1)Di=l~=-Q/dililflli ea) 4. = 5._l]g = [Ti.1)ll-all/di. l. .+l._.) (iii) Prove the invertibility of (B.. .-(Ti)) -.. Use Lemma (11) to show by an example that the choice of knots at data site averages does not avoid large [II Show also that the lower bound for [[1 in that lemma stays bounded when we choose. 4. n of (B.-.Ti+l](Ig) = (DIg) (fii) for some fii between Ti. when Ti = ti}. § ti. construct the optimal interpolant of order 3 and of order 4 in Example (29)._. < t.n+1l9l/l|9|| 5'._. 1. In other words. (ii) Use Theorem (7) to show that the tridiagonal matrix with general row 1. ' ' (ii) Show that it is sufficient to prove the invertibility of (B. g t. there isn't all that much difference between interpolation and least-squares approximation if one knows which sites to choose. mamk — 1)/di)Dt.. .i.i. -) the matrix inverse to the matrix (B:'(Ttl)- i (iii) Use Theorem (7) to show that the Hi. that is. Iii.T:) := |Ci(:r:)| the Lebesgue function for the process. alternate in sign. Rewrite SPLINT to make use of CWIDTH (see the Appendix for a listing. With Ahg := (g(a + h) —.Problems 205 transition regions next to the peal-t. do you think. 8.|. that is.-) = 6. for j 75 i. with (fli.)(iv) Given that Ci changes sign only at the sites T.. 61-11%._i satisfying Ci(T_.. I ‘I. Prove that any ‘isolated’ zero of f G $. the computed value of Ahg is not “large” (as maintained on page 185) but. 172) is an isolated zero of f. set up a program to calculate (approximately) ||I = Then use it to get as large a lower bound for maxt llfiill as you can. 0. 9. For what kind of knot sequence t. invariably. B. it l . (—)i+j5tl 2 0-. by definition. Prove that the norm ]|I for spline interpolation at T by f G $1.g(a))/h. but that the converse does not hold.3-. all j. is this maximum taken on? 7. can be calculated as ||A||. any point z that is the sole site in some neighborhood of z at which the function f vanishes. but change it to inhibit pivoting) since this would require roughly only half the storage used by BANFAC/SLV. show that.-.i (as defined on p.-. for any particular choice of g and a and all small h. An isolated zero of a function f is. 6. with A(. Ci is the unique element in $i. (ii) Prove that Ci = Z5.-. - ‘r I .i _i iii ii l—— F || 1 .1’ I‘ 1| ‘I I J r l I . LZAPPR Interpolation is efiective as a means of constructing spline approximation only if sufficiently accurate function values are available. . .2. turns out to be a spline of order ls: := 2m. 1) (to be chosen somehow). and satisfying the “natural” end conditions r. it is clear that. .XIV D Smoothing and Least-Squares Approximation. SMOOTH . . . we try to recover g from these data by constructing the function f = f.§i><w1) = r. minimizes 1'3‘ .-.. or.1: . by the minimum property of spline interpolation (see Problem 1). we need only consider f G $22. since._. Minimization of (1) establishes a sort of compromise between our desire to stay close to the given data and our desire to obtain a smooth function. £I'IN_ l. other methods of approximation must be used. for any choice of f. . Otherwise. . substitution of its unique interpolant at x in for f in (1) leaves the sum unchanged while possibly decreasing the integral. with simple knots at IE2.§§>(w~) = 0 for 1“ = m. 207 . TIN. The solution f. . we discuss the computational aspects of cubic smoothing splines. The smoothing spline of Schoenberg and Reinsch Given the ap- proximate values yi = g(:1:i) + si of some supposedly smooth function g at data sites IE1. and of (discrete) least squares approximation by splines of arbitrary order.' ‘ti =J42 (-P?-%i_5“51"l)2+<1-1») (r<""><o)2d¢ over all functions )5 with Tn. . and an estimate ciyi of the standard deviation in yi. derivatives. .. In this chapter. for a given parameter p G (0 . fr G Indeed. and the choice ofp depends on which of these two conflicting goals we accord the greater importance.. for short. . . in minimizing (1). that. unless S(f. have mlmi __.) strictly decreases as p goes from 0+ to 1". :r:i_l. hence we denote the latter by fl_ .. with N <2) 8(1) == (oi — 1(a))/wt)”. .5. Nevertheless. _. To be precise.. Set [Ii :2 fp(I. We can describe _f.) := Z. and jg at sci and :ri+l (see Problem IV."-'-" Z1i---. since (1) is only semidefinite when p = 1 . converges to the 1:2-&ppI‘OXIITl&I1i3 (with respect to the inner product (g. for given S. forsimplicity. hence has many minimizers. converges to the “natural” spline interpolant to the data y in $fif'.. apparently quite independently..i). that is. Reinsch [1967]... in II. would have to be in $232.. then fg = f. to a value of 0 at p = 1 (see Problem 2)...._.. hence has infinitely many minimizers. Correspondingly. we encourage the reader to construct a two-dimensional smoothing routine. as incorporated in the subprogram SMOOTH and its subroutines below. Smoothing and Least-Squares Approximation As p approaches 0.ri)/(6yi)2) from l'I. and even provided an ALGOL program for the construction of cubic smoothing splines that is. C.'($N) = 0.’(:1:l) = f..) = 0 for all p. incorporated as the program ICSSCU in the IMSL Library [1977]. f.. g 1 . S(f.. the function f5 that minimizes If (f('"")(:r))2d:1: over all those f for which S(f) 3 S simply by finding the smallest p in [0+ ... to the data y..l... but may also use fl for it.-.l] completely once we know _f.[ Ci I". We present this variant here. As p approaches 1.-. We already pointed out that _f.(. f.. since (1) is only semidefinite when p = 0.1_] for which S(f. we will also use '_fQ for it. It is therefore possible to determine.208 XIV....'.h. hence we should denote the latter by f@+ rather than by jig. Perhaps one should call f. _. for simplicity.) 5 S.N- Then the “natural” boundary conditions and the requirement that f. for example. I’) Cl?) with f. only considered uniformly spaced data sites and proposed to use the sum of squares of mth differences rather than f(f("'")(:1:))“ dzr: as a measure of smoothness. and for it we need to redo Reinsch’s algorithm somewhat. VVhittaker.. in_I _ -. proposed the same scheme and worked out the solution for m = 2 in explicit detail. the mathematics entering the construction of the cubic smoothing spline is as follows.6).1:i)h. In Chapter XVII. on [sci . This idea was picked up again by Schoenberg [1964] who realized that the above simple solution could be given to Whittakeris smoothing problem when _f(f("")(:1:)) da: was used instead of the mth differences.. ' Briefly. g(. but the essential idea on how to balance the two conflicting goals of accuracy and smoothness (which make up the problem of smoothing) is there.‘. a Whittaker spline since the proposal to smooth data by minimizing (1) goes back to W'hittaker [1923]. 2) >< N with general row I/AII'Ii_1. . so that (1) can be written entirely in terms of a as (5) Po . i=2. at f = f.I'. But.'i_. and c. i=1 i= In matrix form.. For any straight line E..2 + 13.then we can write (3) in matrix form as (4) Rc = 3QTa with R the symmetric tridiagonal matrix of order N — 2 having the general row £\I. If we take c := (ci)§”"1 and a := (ai)i” — note that c has length N — 2 while a is an N-vector . A117-i and QT the tridiagonal matrix of order (N —. by (4). . .. 6yN_[..) + 12(1 .. we express (1) in terms of a. (IN = O for the ci’s in termis of the ai’s..N—I.The smoothing spline of Schoenberg and Reinsch 209 a continuous first derivative combine to give the linear system C1 (3) = 0 Ci—1A1-I-it--1 -|-f-‘t2(A11'»‘t-1 -l-A117-1)-I-¢t+1A1I?-I = 3(A(Ii/A111‘-5-AC1-lj. +¢?.-1-1 + A117-i).-4. 2(A$-. A:ti(c§ +oo+.). c = 3R"1QTa. .p)<R"‘QTa)TR<R"‘QTa>- Since both D'“ and (R“1QT)TR(R“'1QT) are (symmetric and) positive definite._1/AZI3i_1). /Oh (Raf d-A .3. Next..1. 4(1 -2) "H P2 Z. (1) has the value N 111. this reads T -2 2 T P(3"“3~l D (N-H)+§(1—1>)<= RC with D the diagonal matrix [6yl. (5) is minimized when a satisfies —2pD"'”(y . I/A1715. -1/A11?-l'__1— I/A117-l‘.(A/3) lace)? + @<0>@<h> + <@<h>>2]Therefore..a>TD:2<y — =1) + 60 .p)(R"‘1QT)TR(R"1QT)a = 0 . .(:r:..)/2)Aw. From this. in summary.=1) = llDQ¢\l%.) once we know c. by (6). 2 S(-fl’) = (Y . .(f. Smoothing and Least-Squares Approximation 01‘. we multiply both sides of (6) by 3QTD2 and then use (4) to get p(3QTy .pR)<= = 3PQTyi..'. which allows us to compute S(_f. In order to obtain a linear system for c. <9) i a = y — sci — pwzcu.)2 fgmi) =__ em rF f.Re) = 60 — P)QTD2Qc OI‘ "(@<1 . <7) (Bu . with := 2.”(:1:g')/6)(A$.a>TD-gs -—.. we obtain the information for the ppform of fp as follows: (10) fP($i) = ‘Ii f.”(w$') = (fg($i+1) — f.P))2HDQ11ll€.|2.._($._) = Aai/Ax. Now let u be such that l c = 3pu.p>Q'-‘"D%2 +. J.p)c2TD2c2 ‘+ pR)u -= QTY and i (8) l Sm) = (60 .I-I-Z-I"-" — - 210 - XIV. using the fact that R"1 = (R“1)T and simplifying.(f.’(="vi))/ AI-=1 '\ .. |b. while.. Then. ""' "' i--1 i - -_'-a I ‘-iIn—-—-$-—-§-—'l. (6) ' PD“2(¥ — =-1) = 2(1 — P)Q¢- In particular. I. in SMOOTH and its subroutines. I=1.X(NPOINT) INCREASING . HOHEVER.. Ofi fi fi fi fi fi fi tgfi fi tafi ifi fi fii fi . THEN P = D .. 1 S. As DONE IN THE ORIGINAL FEREIDN OF TEIs PROGRAM.D. DN REcDEEENDATIDN FRDN c.NPDINT ) ... 1 for given S.UPPER BOUND ON THE DISCRETE WEIGHTED HEAN SQUARE DISTANCE OF THE APPROXIHATION F FROM THE DATA . NPOINT.. A S S U H E D . THEN P = 1 .. NPOINT.. .. .E.E.)) = 6*P#U . s . sINcE 1/SORT{SFO} Is NDNDTDNE INCREASING AND CLOSE TO LINEAR FDR LARGER Q . cAN BE VERY SLUH AND Is INFLUENCED BY THE UNITs IN EHIDE x AND Y ARE NEAsURED. TEE SHOOTHING sPLINE F (FDR THIS CHOICE DF SHOOTHING PARAHETER P ) Is DETAINED IN TEE sENsE TEAT -. I=1. DY(1). INsTEAD. V. I=1.o1ss . FRDN U .GT. ' HITH sFQ(Q) == sF(Q/(1+Q)).Y — 6(1—P)D**2nQ:U AND 1 F"(X(...... IF sF(o) .NPDINT. ‘T(1). IF s = O. A S S U ME D TO BE POSITIVE . tteer M E T H U D ##1##: TEE NATRIcEs Q-TRANSP*D AND O—TRANSP*D**2*Q ARE c0NsTRucTED IN s E T U P Q FROM x AND DY .4. term: I N P U T route: X(1)i---..Y(NPDINT) DATA ABSCISSAE.J) = F“(J—1)(X(I))..3....1/SQRT{S} . THE sEcANT NETEDD Is USED TD LocATE AN APPRDPRIATE P IN THE DPEN INTERVAL (0 .. EEINscE. TEE sEcANT NETEDD Is APPLIED TO TEE FUNCTION G:Q -> 1/sqRT{sFQ(Q)} ..... FOR cIvEN P .7) A..NUMBER OF DATA POINTS.. TEEN.DY(NPOINT) ESTIMATE OF UNCERTAINTY IN DATA. As Is TEE vEcTOR QTY = Q—TRANSPrY .. ONE sTARTs AT O = 0 HITH A NEETDN sTEP. J=2.. HEEEE DsFq .. EEIcH EAs As sEALL A sEcDND DERIVATIVE As POSSIBLE EEILE s(F) = sUN( ((Y(I)-F(X(I)))/DY(I))**2 .CONTAINS THE SEQUENCE OF SMOOTHED ORDINATES ...LE.. ###** H O R K A R R A Y S V. ITERATIDN TERHINATES As s0DN As ABs(sF .UF SIZE (NPOIHT.. Q_1 = -c(u)/s=(0) HITH c*(0) = —(1/2) sFq(0)*{-s/2} DSFO. As c. A NOULD HAVE TO BE TRANSPOSED BEFORE IT COULD BE USED IN PPVALU . EEERE F Is TEE SHOOTHING sPLINE As IT DEPENDS DN P . REAL FUNCTION_SHOOTH ( X.. .._ F(x(. TEE sNDDTEINs PARAMETER P Is FOUND (IF PDssIELE) so THAT sF(P) . Y.4) ***** #### U U T P U T meet: A(. DY.UF SIZE (NPOIHT. TEE vEcT0R U Is DETERMINED IN c H 0 L 1 D As THE SOLUTION OF TEE LINEAR SYSTEM (6(1-P)Q—TRANSP*D*#2*Q + P#O)U = QTY . s . q_o .. .LE.s .. A ) CALLS SETUPQ.—12*U—TRANSP*R*U AND u As DBTAINED FOR P = D . THE FIRST THREE DERIVATIVES OF THE SHOOTHING SPLINE F AT THE LEFT END OF EACH OF THE DATA INTERVALS . REINscE EAs POINTED OUT..(10) form the basis for the construction of f5 (= fp for appropriate p in [O .Y(I)).NPOINT-1 . A(I. sTRAIcETFDRNAED APPLICATION OF THE sEcANT EETEDD. DTEERNIsE. H A R N I N G . 1) . S.. CHOLID C cDNsTRUcTs THE cusrc SHOOTHING sPLINE F TO GIVEN DATA" (x(I).. I...)) ..s) . RITE sF(P) = s(F) .The subroutine SMOOTH and its subroutines The subroutine SMOOTH and its subroutines 211 Equations (7) .LE.1)... A S S U H E D TO BE STRICTLY CORRESPONDING DATA DRDINATES . J-_l./sQRT(s) A OOSF .NPDINT .1)*DY(I))**2 SFQ I SFQ#36.A(1. .*P _ DD 62 I=1.00ss.A(1.sIxP.NPOINT A y as SFQ = SFQ + (A(I.NPH1 REAL A(NPDINT.0.1)*DY(I))**2 SFO = SFQ*36.1.NP0INT 25 UTRU .|Ii l-Li.s).P. _ IF (SFQ ./SQRT(SFQ) A CHANGE .1)) sFu .3) .NPDINT.OOSF ITERCHT .1))/v(I.D .GT.4) = (A(I+1.212 c c c XIV. 21 SFQ .l-|.2) .4).SIX1HP*DY(I)**2*A(I.4) 1 .+q).?).A(1. DD as I-1.+Q) cDRREcT VALUE OF P EAs BEEN FOUND. .A(1. s) so TO so UTRU . c ITERcNT fi 0 PREVQ_= 0.x(NP0INT).4).s.B))/v(I.LE.*V(I.4)) IF (s .4). cALL cE0L1D(P. COHPUTE POL.1) .DY(NP0INT).v.4)._I_| |-I\-_-.q. . so SMOOTH = SFQ c IF (TEsT) TEEN c PRINT A.D.1)) .0 .1) sIxP .1-i 59 P = Q/(1.T(I) .1.3)*SIXP NPN1 .UTRU + V(I-1.3)+A(I.*UTRU*DOSF) A c sEcANT ITERATIDN FOR THE DETERMINATION OF P sTARTs HERE.(A(I.|[email protected] A(I.A(1.A(1.UTRu cALL sETUPQ(x.A(1.cEANcE PREvsF ./(1.3).1.3)**2) OOSS . " PREvsF .00sF.NPDINT./(1.sIx1NP.-_.4))/2-*V(I.NPOINT 61 A(I.D./SQRT(SFQ) D . D.COEFFICIEHTS FRDN awn (IN A(. DO 25 I-2.3))+A(I.+Q)*#2 c IF (ARs(sFq—s) .+q) DO 61 I-1.v.6.LE. ITERcNT c END IF sIx1NP = 6.NP0INT.v.SFQ .4)#(A(I—1.DY. DO 21 I=1.HPOINT .o1~s) GD TD 59 OOSF .NP0INT 62 A(I.A(1.) INTEGER ITERcNT INTEGER NPDINT.TRUE.s).1)-A(I.NPDINT.A(I. *NUNEER OF ITERATIONS = 1.OOSF so cALL cE0L1D(Q/(1. I.(A(I+1.1)).1)) sFu .v.3)+A(I.4) RETURN END ‘h1I_al-I1.PREvsF.(Q—PREVQ)/(OOSF-PREVSF)*(DOSF—OOSS) PREVQ ..A(1.4)/3.Y. Smoothing and Least-Squares Approximation LOGICAL TEsT PARAMETER (TEST = .) A so TO 20 10 P = 1_ cALL cEDL1D(P.3)*(A(I—1.cEANsE.-(OOSF—OOSS)*SFQ/(6.1.O.A(1.SFO + (A(I.1 DO as I-1.ITERCNT + 1 co To so 3-iv.1.0.Y(NPDINT) A .4) as A(I. _ co TD so 20 P . Q .B)—A(I.v(NP0INT.PREvn.1.sFn. 4) = V(NPDINT. INTEGER NPOINT.NPN1. L P 1s V(I—2.2) v(I.2) = SIX1HP*V(I. NCOL. Y.NPH1 v(I-1. QTY. 13 14 GO TO 14 DO 13 I=3.1) O CONSTRUCT Q-TRANSP . 3) .#(D**2)*Q + P*R.3)*V(I.X(1) DO 11 I=2.7).3) = SIX1HP*V(I.5) + THOP*(V(I—1.1) = SIX1MP#V(I. NPOINT. ' P INTEGER NcDL. IN V(I.LT.4) V(I.NPDINT. * Y IN QTY.1) V(I.5-7) .v(NPDINT.X(NPOINT).*(D**2)*Q SIIIHP = 6. I. PUT THE TEREE BANDS OF Q—TRANSP#D INTD v(.2)**2 + V(I.?) 16 v(NPE1-1.3)*V(I. U.NPH1 v(I. NPOINT. Q Is THE TRIDIAGDNAL NATRIR OF DRDER (NPDINT-2. OF C THE MATRIX 6*(1—F)*Q-TRANSP. I.The subroutine SMOOTH and its subroutines SUBROUTINE SETUPQ ( I.Y(NPOINT).*Y IN QTY GOO TO-OBTAIN THE SOLUTION IN U .QTY(NPOINT).4) V(I. V.NPOINT-1.3)**2 IF (NPM1 .NPM1 V(I. AND PUT TEE TEREE BANDS OF (DIQ)-TRANSP*(D*Q) AT AND ABOVE THE DIAGDNAL INTD v(.4) DO 21 I=2. V.J).1) = U. DY.*P DO 2 I=2... I=2.SIX1MP. 4) DO 15 I=4. DECOMPOSITION AND STORES IT ALSO IN V. J=1. THEN COHPUTES ITS L*L—TRANSP.3) 11 12 = X(I+1) — X(I) = DYCI-1)/V(I—1.NPDINT) fifififififififi WITH GENERAL RON 1/DELX(I) . HERE.?) PREv.3.*(1.PREV NPH1 = NPOINT P 1 V(1.T).V(HPOINT. -1/DELX(I) .NPM1 DIFF = (Y(I+1‘*Y(I))/V(I.LT.NPM1 v(I.2)*V(I.) INTD v(. QTY ) TO BE GALLED IN s N D D T H PUT DELI = x(.RC.1)**2 + V(I.+1) .4) — DI(I)/v(I-1.NPH1 REAL DY(NPOINT)..5) .DTYcNPDINT).—P) C + P*R THOP = 2.6) =O U(I—1.4)) 2 VCI.6) + P*V(I.1) §. THEN APPLIES FORWARD AND BACKSUBSTITUTION TO THE RIGHT SIDE Q-TRANSP.?) v(NPE1. _ r DIFF. PREV = (Y(2) — Y(1))/V(1.Du(NPDINT>.4). V(I—1.6) = IF (NPH1 .u(NPDINT). DU 12 I=2.?) = V(I—2.RATID ..2) V(NPM1. .NPH1 ~ O. QU ) C TO BE CALLED IN S M O O T H CONSTRUCTS THE UPPER THREE DIAGS.DY(I)/V(I.4) = X(2) .4)+V(I.1-3).4) QTY(I) = DIFFJ~ PREV PREV = DIFF 21 RETURN END - GO TO 16 SUBROUTINE CHOL1D ( P.4) = .V(I.THOP ' NPM1 = NPOINT — 1 CONSTRUCT 6*(1-P)*Q-TRANSP.1/DELX(I+1) I 1/DELK(I+1) AND D IS THE DIAGONAL MATRIX WITH GENERAL ROH DY(I) .NPN2 REAL P. is a good estimate for the standard deviation of the ordinate 3.GE.U(NPN1)/V(NPN1.s)/V(I.2) .V(I. then one might as well dispense with it altogether and twiddle the smoothing parameter p directly.RATIO G G FDRVARD SUBSTITUTION U(1) .2 IF (HPH2 . we consider now the smoothing |f}| . (11) Example: The cubic smoothing spline In order to gain SOl"I1e feel for how this smoothing technique works and just what the effect of choosing particular values for S might be.1) .V(I—1.GT.1) V(I+1.RATIO#V(I.DU(I) .RATIO*V(I.V(I+2.3) . A V(1.s) . UCB) . Of course.QTY(I+1) — V(I..UCI)/V(I.4) qU(I-1) . u(2) I QTY(2)/V(2.1) 1 I . if one really has no idea how to choose 5'. S represents a knob that one may set or turn to achieve a satisfactory approximation to the data.2)#U(I) . 1) ‘ GD TD 40 G CONSTRUCT Q*U : 41 PREV -‘D.O.0.U(I-1))/V(I-1.V(I.0.RATID RATID . u(2) .V(I+1.PREV so PREV . Else. GO TD 41 G FACTORIZATIOH I 10 DO 2O I-2.214 XIV.1 IF (I .2)-U(I+2)*V(I.RATIO~V(I. then one should change the program so as to find the p appropriate for such a satisfaction.1.-QU(HPOINT) RETURN END The number S has to be chosen somehow. More naively.HPH2 .2) V(I+1.3) 2D V(I.(U(I) .1) .1) . u(NPN1) . 2) G0 TD 1O u(1) .I .qTV(2) so U(I+1) . if one can make precise what constitutes a “satisfactory"_ fit to the data in terms other than the function AS ( f ). Reinsch [1967] proposes to choose S somewhere within \/TV of N in case 6y.HPOIHT OU(I) .3) V(I.NPN2 RATID .s) .V(I+1.2) . Smoothing and Least-Squares Approximation NPH2 I NPDINT .3)#U(I~1) c BACK suEsTITUTION U(NPDINT) . ' DO 5O I-2.2) .O.DU(I) Du(NPDINT) .2)/V(I.1) V(I+2. 40 g(I) .1) .0.1) . Craven 8-: Wahba [1977] propose a much more sophisticated choice for S based on an estimate of the noise in the data obtained by a process called “Gross validation" .1)-U(I+1)*V(I. ||||.3 O. _ 4 | optimal.2 O 2 S=3D . An S between 30 and 60 seems -.3 -O.-1..5 ' O —0. fx O. —-| "i- 1. 1 -O. 1.2 O O —-O. i O. O5 O.2 —O.1 . 1 O. ii sf.4D 2 4 s ssaa 3 2 1 ' ' O -1' - -as . 1 .Example: The cubic smoothing spline S-OOOOO 1 S I OOOO O.15 O.4 0'5 215 0.3 ' 4 6 S = O 2 6 S = BO 0._- D ( 12) FIGURE.4 O 2 4 6 O.2 6 $='iO 0. ..D -a1 -a2 4 “-1 0 -O.5 _o_4 --1 —-O. 2 6 -2D 2 4 s Error in the second derivative of the smoothing spline fg to noisy data as an approximation to the second derivative of the underlying smooth function g for various values of the smoothing parameter S.15 O 4 -D.2 D2 0.1 -O.6 O 2 0.2 -O.3 D i _2 4 s E=a 0.1 -O.05 -O. 2 O. sFP.GDEFsN(4.7.TH POINT.4. various values of S are input. equally spaced on [O . for S.DELY.NS) 5OO FORHAT(2I3/(E10.. NS = 7.<2 . f5 is simply a straight line. 6] with mesh spacing 1/10 and obtained from the B-spline of Examples X(7).4*6. = ..CHOL1D) G VALUES FRDN A GURIG B—SPLINE ARE RDUNDED TD N D I G I T PLAGEs G AFTER TEE DECIHAL PDINT.BCOEF. GUEIG sNDDTEING sPLINE A cALLs EsPLPP(ssPLVB).216 XIV. SMOOTH(SETUPQ.1.J..1. while the error decreases until 5' = 30. S = (600000.g. and X(30) by rounding its values to a certain number of places. we choose 5.. and this roughness increases as S decreases further.r(61) EDUIVALENGE (sGRTGE.I2.4).LSH.NS. In addition.21E DIGITs AFTER DEGINAL * .BREAK./) . of size ~ 2. For large S . PPVALUcINTERV). with NDIGIT input. and.GDEF(4. _ _ Figure (12) gives the error in the second derivative of the smoothing spline f5 (as an approximation to the second derivative of the underlying noise-free function g) as a function of the smoothing parameter . 6.COEF. . becomes a better approximation to g” (note that the plotting scale changes).60). 60.(S(I). An input of NDIGIT -= 2.4).NDIGIT.L) NPDINT A s1 READ 500. Precisely.5 and looking like the noise it represents.5’. CHAPTER xIV.5]/10hTDI(‘-IT..1. indicating that we are approximating the noise more and more.GDEFsN) DATA T /4#O..SCRTCH. Smoothing and Least-Squares Approximation of certain data. The error therefore is just the second derivative g” of the underlying function.3.IS. ff.NS REAL A(s1.BREAK(5). X(20).4)) PRINT 600./ GALL BSPLPP(T.scRTGE(42?). indicating that the smoothing spline smooths out these “rough spots" in the B-spline g.EcDEF(7). But. These points are knots for. there is already some roughness for S = 60. 60000. Correspondingly. As S decreases.I=1.HDIGIT Q 600 FORHAT(24H EXACT VALUES RDUNDED TD. 6000. The data for Figure (12)i were supplied by the following program which also provides the printed output below in response to the input NDIGIT = 2. Notice the spikes in the error at :I: = 3 and :1: = 4. INTEGER I. clearly demonstrating that g is a cubic spline with simple knots.5 =1-= 1D""“°I".HDIGIT. the error remains pretty much as shown. we use yi = Lg($£) * 10HDIGIT + .s(2D). .L. TEEN sNDDTEED VIA -s N O D T H FDR G VARIDUs VALUES OF THE GDNTRDL PARANTER s . EXAMPLE 1. for example..DY(61) A .x(s1).T(11).NPOINT. For S = 6 the second derivative error is already as large as it was for the simple approximation fg = 0.4.TENTDN. 600.6). A11 4:. would round the function values to two places after the decimal point./ DATA BCOEF /3*O.3*O. SCIS).5) 62O FORHAT(15H PRESCRIBED S =.c#NDIGIT DELV = .137+O6 VALUE AND DERIVATIVES OF SMOOTHING SPLINE AT CORRESP.4).E10.I} = A(I.9000OOO+OO O.J=1.L.7H POINTS/(I4. 2562500+OO O 4125000+OO O.2000OO0+OO 51 O.J).GDEFsE. S(SMOOTHING SPLINE) = O. OQOOOOO+0O -O.13000OO+O1 41 O.Example: The cubic smoothing spline TENTDN = 10. S(SHOOTHING SPLINE) .J=1. 26Q??O5+OO -D 1671850-O1 O OOOOOOO+OO O OOOOOOO+OO 21 O.0000000+OO O. 2530047+OO -O.?)) DO 2O IS=1.1 DO 16 I=1.4.2000OO0+OO 46 O.N S i SFP SMOOTH ( X.5 A DO 18 J=1 . 19T?749+OO —D 1565041-O1 O OOOOOOO+0O O o0OOO00+o0 7 .NPOINT.(I. 2614206+OO -O.NPOINT.D) V(I) = FLOAT(IFIX(Y(I)*TENTON + .NPOINT.3000OOO+OO -O. DY.2000OO0+OO PRESCRIBED S = O. 2056005+OO -O..LSM DO 16 J=1 . (I. 2212827+OO -D 15T6Q47—O1 O OOOOOOO+OO O OOOOOOO+OO 51 O. 1572163-O1 O OOOOOOO+OO O 0OOOOOO+OO 56 O.L 4 x(I).3.55000OD+O0 -O.25000OO+OO O.7H POINTS/(I4.I=1.6999999+OO 16 O. OOOOOOO+OO 0.5 DO 15 J=1 .J) DO 18 I=1. 2134389+OO -O. POINTS 1 O . 2371033+OO -O.5) 615 FORHAT(52H VALUE AND DERIVATIVES OF NOISEFREE FUNCTION AT SOHE * .1999999+OO —O. 164484?-O1 O OOO0OOO+OO O OOOO00O+OO 31 O. 1041667-O1 D 625000O—O1 O.5000OOO+OO -0.x(I).s))/TENTDN 10 DY(I) = DELY DO 15 I=1.0000000+OO 6 O.40000OO+OO -O. 266666T+OO -D 4000OOO+OO O. 2291455+OO -D 15?71?O—O1 O OOOOOOO+OO O OOOOOOO+OO 46 O.(A(I.LsN..200000O+OO 56 O. 627OS34+OO D 2125000+OO -O. 8333334—O1 D 25000OO+OO O. SFP. 65000O0+OO -D 15000OO+OO -O. 465666?+OO D 4000OOO+OO —O. 1125000+OO -D 225000O+OO O.5000OOO+OO 11 O.13000OO+O1 36 O.(A(I.4.6999Q99+OO 31 O. 2B65339+OO -.GDEF.23H.E1O 3/ * 54H VALUE AND DERIVATIVES OF SHOOTHING SPLINE AT CORRESP c . Y.J-1) 15 I I I I PRINT 615. 1565324-O1 O OOOOOOO+OO O OOOOOOO+OO 61 O.I=1.4E15. A ) LSM NPOINT .1000OOO+OO —O.4).5000OOO+0O 6 O.?)) | J EN D A STOP EXACT VALUES ROUNDED TO'2 DIGITS AFTER DECIHAL POINT.NPDINT X(I) = . 3333333—O1 _0_ 1000OOO+OO D. VALUE AND DERIVATIVES OF NOISEFREE FUNCTION AT SOME POINTS 1 O OOOOOOO+OO O OOOOOOO+OO 0.4 16 COEFSH(J.0000000+OO 11 O.4 18 A(I.5/TENTON DD 1D I-1.NPOINT. SCRTCH.4 ACI J) = PPVALU(BREAK COEF.6999999+OO 21 O.6Q99999+OO 26 O .20000O0+OO 61 O 2980232—O7 O OOOOOOO+OO O . 4166633—O2 "O.15000OO+OO —O. 1604510-O1 O OOOOOOO+OO O OOOOOO0+OO 41 0.1-1) 20 PRINT 620. 1718161-O1 O OOOOOOO+OO O O0OOOOO+00 26 O. NPOINT.4E15.J) = PPVALU(x. 2499998-O1 O.x(I). 2949416+OO O 1681417—O1 O .1*FLOAT(I—1) T(I) = PPVALU(EREAR.2qDDDDo+DD —O.2500000+OO O.600+O6. 2450134+OO -D 15B2173—O1 O OOOOOOO+OO O OOOOOOO+OO 36 O. 4895S34+O0 -D 43T5000+OO -O.S(IS).0_ J6B576S—O1 O OOOOOOO+OO 0. 27B1245+OO —D 1674324-O1 O OOOOOOO+OO O OOOOOOO+OO 16 O.J). 1427211+0U 51 0 1657661+0D 7798635-D2 1053300-02 0 -0 —0.1095352+DD 16 0 29453B1+00 -0 5473658-01 0290301-01 -0 0.2195B54+D0 6 O 2649403—D1 916255B—01 -0 1311077+00 0 0.127B7B3+UD 11 0 23459B2+00 641126B—01 -0 5174045-01 -0 0.1163412+UD 26 0 55?7974+00 D 2512339+00 4215109+0D -0 -0.11?220B+00 6 0 1512B13—D1 D 0 D 1D74531+D0 D.3996694+00 41 D 2740B52+0D 0. SCSHODTHINGSPLINE SPLINE) =connasp.1145922+0D 51 0 34942U6—D1 0 2464721+DD 0.7783630-D1 4513534+D0 U. 29145B0+UU 2192190+D0 0 -0.145T925+00 61 0 2067093-01 605+04 PRESCRIBED s .1B97625—D1 61 -0 1190371-01 603+02 NG SPLINE) = 0 PRESCRIBED S 1 D.1453501+DD 0.2554220+UD —0.0DUODOD+0D 0 1 -0 2963135—01 0 .8773695-D1 —D.25B6523—D1 1 0 8416147-02 0 0 D 5643039+D0 230D497+0D 0 D.36B6439+0D 36 D 4B452D2+00 D 5534UB3+00 0.3840763+DD 41 0 2B75099+00 0 4325990-01 D.3214137+00 16 0 302096B+00 4661664+0D -0 210B194+D0 -0 0.2373B65+0D 46 0 113314D+0D 0.133D21?+DD 46 D 235DB07+UD 25D9925—01 0 1067000-01 -0 -0.2533469+00 46 0 1252274+00 0 2802214+00 D. S(SHO0THING SPLINE) I 0.3B56237+00 16 D 2695D77+0D D 7647599+U0 —0.-Squares App1'O){in‘1E1I.2B72458—01 26 U 36B1B09+0D 22B3935—D1 0 10s5237+00 -0 —0.0.7462048—01 36 O 343B94B+D0 6117421-O1 0 s??77g2—01 -0 —D.22?997D+DO -0.17233?U+D0 26 0 6D94426+DD D 4416D12+D0 —D.2677240+0D 36 0 46621B9+00 D 4074625+00 3059394—U1 0 -0.3141730+00 41 O 3153B33+00 -0.7594109—01 21 O 3415664+00 2177846—01 -0 -0 10454s5+00 U.1455DD3+0D 56 0 9353174-D1 6470B01—03 0000000+00 0 0 —0. 1B59542+UD 3303DB3+D0 0 -0.1344B5B+DD 6 0 16B6429+00 5U135BB—D1 -0 2a05??5—01 -0 0.4U62449+00 -0. Smoothing and Least.13BB132+DD 31 O 619DU19+0D D 9618?05+0D —0. POINTS VALUE AND DERIVATIVES OF SHDUTHING O 251TOB2+DD D00000D+DU .?4446B4+DD 21 0 467B741+UU 0.5597129+D0 D.163B9D1+0D -0.13B4746+00 -0 0000000+00 24?US36—D1 -0 5500094-02 0. 0 POINTS AT VALUE AND DERIVATIVES OF SHDDTHING B301824—U1 0 000000D+D0 .3D71B2B+00 —0.2556B2D+DD 11 O 1052970+00 D 6319BU2+0D -0. POINTS 31627BO—D2 1 O 101034B+00 0 .0.2573432+DD —0.1694264+DD —0.4132321+0D 36 O 4B7BU75+00 0 5556258+D0 2466919+D0 0 —0.99B2967—01 31 0 5622612+0D 0 5341B90+00 2242713+D0 -0 -0.6D0+D2. S(SHOUTHI SPLINE AT CDRRESP.iCm PRESCRIBED S I 0.1993473+00 D 5304460+D0 7221369+00 -0 —U. S(SHDDTHING SPLINE) = D S VALUE AND DERIVATIVES OF SHDDTHING SPLINE AT CDRRESP.3973D49+0D -0 2159979+DD 721B559+00 D 594D326+00 -0 26 D 6247162+00 0.563+05 VALUE AND DERIVATIVES 0F SHDDTHING0 SPLINE AT cognnsp.25D4269+D0 11 D B925421#01 -.366182B—01 66 0 1165251-D3 O 7557644-01 O000000+D0 D —0.2021496+0D 1 0 7?1659B—01 0 D 1BB6?32+00 0 0 B1B31B5—D1 0.251?5B1—U1 31 0 3691794+00 0 553961B—01 070702?-01 -0 —0.3713391+0D U 4664122+D0 21 0 4544454+D0 -D.1B60341+00 .9931158-01 51 O 3150354-D1 D 2136636+DD 9219799-D1 0 —0.e00+04. 643DB17+DO 15?62?0+DD 0 16 O 2591429+D0 0.218 XIV.2747B74+0D 21 O 45591B7+00 2156D6?+DD -0 4057107+DD -0 0.2602?29—01 56 0 2944320—U2 D 916YB75—D1 0 0UDDO0D+D0 -0.2193?56+00 0.1522276+DD 31 O 6391436+DD D 12BB554+D1 253D46S+U0 -0 ~0.752924B—D1 6 D 1195798-01 0 2171Q?5+00 41B3564+00 0 0.6137666-D2 61 O 30653B2—02 .600+05.2780035+00 11 0 149B199+00 4003466+00 -0 0 1600463-D1 0.615328D+0D —0.1114196+0D 41 D 2967495+0D 4636624—D1 0 2963? 0-01 -0 -U.97D7B1D—01 D 0 0 D 1705B36+0U 16D7977+0D 6B529UB—D1 DO0UODD+D0 D B7D1154—01 D 1504202+00 O 192B409+00 0 5974?86—01 46 0 1695B1B+00 51 0 6311121—01 56 -0 5010B76—02 61 -O 5553601-D1 60D+D3 PRESCRIBED S I 0.110BB45+DD -D.3274755+DD 0. POINT 1881339+00 D.60D+03. thus making the pp function f5 left-continuous (see Problem VlI. fg should be constant. Reinsch [1967] would pick S between 50 and 72. be combated easily by going to higher precision arithmetic. The first derivative of the smoothing SpllI'16. 2499736+00 D 4002945+DD O . The smoothing spline is chosen from an approximation family with slightly more degrees of freedom than there are data points. POINTS 1 0 1190162"05 D 160B201—D3 D DDOUOUD+UU 9?04943—U1 6 10663?0—01 D 3943658-01 0 165Q509+D1 1B82163+U2 11 8046399—01 0 24999?6+D0 0 1445260+D1 18914?9+D2 16 2599986+0D 0 40001B2+00 0 441147?-02 4853381-D1 21 4704916+DD 0 399262B+00 0 459B409+00 1B90B9B+02 26 629?976+DU D 259144B+00 D 12D8435+01 2333732+01 31 6500599+00 -0 1500207+D0 O 976986B+00 2431476+01 36 4893048+00 -0 459B495+00 0 1666B94+D1 3546511+02 41 27DD603+00 -0 399B543+0D 0 2349750—D1 235?399+D1 46 1106943+DD -0 2600034+00 0 166B7B1+01 213?029+02 51 2947696—D1 -0 9997959—01 0 46?1Q30+O0 213162D+02 6650722~D3 -0 6054529—D1 D 16551D?+01 56 18BB451+D2 61 6?15251—D7 -0 4D705B4—05 D 0UO0DDO+DU 54?5B27—D2 6 11 16 59155D4—01 0. and the approximation for S = 60 seems indeed reasonably close to the original noise-free data. in value and derivatives. that is. though. S(SMDOTHING SPLINE) = 0.3257304-02 0 0DUUDOU+00 2954947+00 119648?-D1 811395?—D1 259723B+00 4704U15+D0 62B7B5?+00 64904B?+D0 48822BB+DD 2690169+0D 1116D?5+0D 29803B9—01 223B924—D2 2720560—04 0 D 3677506+0D 1B2394B+01 0 62B937D+DU 2U46229+01 O 4620?01—01 723?461+00 21 O 4443??4+00 1941344+D1 26 D S2310B0+UD 2U05794+01 31 D 9929BB2+DD 1608B02+U1 36 -0 445046B+00 D 4194268+00 620?655+D1 41 -0 403B542+DU 0 152B473—01 2161185+01 46 -0 :2s?221s+00 0 3930041+00 2912464+00 51 -0 993D097—01 D 3888U30+U0 47B223?+00 56 -0 4050564-D1 0 413365?+DD 2117302+01 61 0 1763557—O3 0 0DDUO00+DD 10049B4+0D PRESCRIBED S = 0.5' is not as “continuous” as it could be. This is quite evident for S = 600600 in which case f5 should be a straight line.e05+01 VALUE AND DERIVATIVES OF SHUUTHING SPLINE AT CUHRESP.e00+01. and comparing with the output listed above. one can make this discontinuity evident by rerunning the calculations but using the routine PPVLLC instead of PPVALU.4D34437+0D D. POINTS 1 _ 7999242*D4 -0 ._f. is to me a symptom of a conceptual dificulty with the smoothing spline. this means a loss of over threedecimal digits of accuracy in these slopes. in the last column) of the cubic smoothing spline as the value of S is decreased toward 0.2). For smaller values of S. of course. S(SHDDTHING SPLINE) = 6D3+D0 VALUE AND DERIVATIVES OF SHDDTHING SPLINE AT CDRRESP. El This slight trouble.600+0D. its (admittedly redundant) ppform consists of about 4N items . This-magnification of rounding errors becomes less prominent as S is chosen smaller and could. There is a sign of slight trouble. yet fg fails to be constant by an amount of 2 =+= 1O'"4.Example: The cubic smoothing spline 219 PRESCRIBED s = 0. though.2456323+0D D 15D5DB9+00 This output shows the increasing roughness (see the third derivative values. Since the calculations were carried out in better than 7 decimal digit arithmetic and the function values are of order 1. . but not enough to approximate also the faster varying noise. for convenience. »z= 2.. innerproducts of the form _ N (13) (Q= '1) == Z 0('e)h('e)wi11:1 _ Here. we will discuss here only discrete inner products. The sequence w = (w. A typical choice is AT1/2. but do appear. and we will assume it to benondecreasing. Smoothing and Least-Squares Approximation compared to the 2N original data items. (14) w.1 ATN_1/2.220 XIV. These many degrees of freedom are held in check by the presence of the _f(_f(:1:))2 dz term in the expression to be minimized. I [H g(:r:)h(:1:)d:i:. that is. The quotes here con- stitute an asseiiting nod to the alert reader who is about to protest that ll ' ll2 is only a seminorm since there are many functions it other than the 0 function for which Hhllg = 0.<h..-_){“' of weights is assumed to be nonnegative. .. There should be enough degrees of freedom to approximate the underlying function g well. We use the customary symbol nhug 1.h>*/2 for the ‘norm’ induced by the ‘inner product’ ( .N . in which case (g...)/2. b].. == (A1-. Least-squares approximation is best approximation with respect to a norm that derives from an inner product. h) is a reasonable approximation to the continuous inner product TN . + A1-.-. It strikes me as more straightforward to approximate noisy data from an approximation family with many fewer degrees of freedom than there are data points. In this.. the given data gr ~ g(1-i). or confidence in. Other choices for w are used to include trends in the data and /or to reflect the varying accuracy of. to cause the rounding error trouble mentioned earlier. splines are very efiective as an approximating family and least-squares approximation should be considered first since it leads to a banded and linear system of equations to be solved. for instance. While -much of the development below is valid for any inner product. T is a sequence of data sites in some interval [c . b].r> = t(2<r. all f E $. that is.f‘) and sufiiciently close to O (since t2 goes to zero faster than t). The function f"‘ is aibest approximation from $ to ‘g’ with respect to ll ' lie if and only if the function f " is in $ and the function ‘g’ — f". In effect. in case the error ‘g’ — f * is orthogonal to $. "I-TFT-=:'IW'F?" "i'U'. for all such t.l’__ :i____ fllz-‘"9 1:2 f ||2+||f 1r___ 2 file in case (17) holds. The finite dimensionality of $ guarantees that such an _f* actually exists.i Least-squares approximation 221 We will use the Cauchy-Schwarz-inequality (15) K0. i El | . We have put g in quotes here because we do not know g. we intend to use the approximate value gs whenever the value g(r. the error. For any function f E $.I_'IfI'T 1- F II ||‘g’ . Then 2<e. But then. |'|I ‘-7. (f.f’||§ + 20" — fig’ — f’) + llf’ —. f 1 Or a1fE$.—-_ -|-r . We seek a best approximation from $ to ‘g ’ with respect to the ‘norm’ . ‘g’-— f‘) = O. (17) for all f E $.J-"*>) > tgllflli = lliflli I for all nonzero t of the same sign as (f. i ll 9 i___ 1|: 1° H2 1 ' I i__ I}'g§1ll9_ J°||2 . Fill S llQll2 Wille- Let now $ be a finite-dimensional linear space of functions.-_) is called for. . if . that is. we seek an 1°” G $ so that ' .f“Q Z [|‘g’ — f"‘[|2. ( 16) Lemma. ‘g’ — 1"’) 75 O. (f.. f* + tf E $ is a better approximation. . indeed. PROOF.t—r- Conversely.-1. that is. ii__ H9 2l."2 1 that is. ‘9’ .filie$ Therefore. we get from (18) (with —tf substituted for f —— f. Hence. all on [a . for some f E $.<1’. we compute ||‘9’-flli = |l‘9’—f* + f"‘—f||§ (18) =l|‘. is orthogonal to $. with equality iff ||_f" —:_f||2 = 0. hence with f replaced by f"' + tf G $) that - ll‘!-Y’ " (f" + ifllli < ||‘9’ -' f"||i= showing that then. ‘g’ is an equivalence class of functions. ‘g’ —. assume that. Instead. Ti. If the inner product _1 ah) = [0 ge>h<1=> dz . A classical example is the basis (p-. Then we know that (17) has a unique solution _f* in $.-<.-‘la. Assume now that [I ' llz is indeed a norm on our linear space $ and that (pi)? is a basis for $.. If we have somehow succeeded in choosing (<p. in terms of the basis (cp. Smoothing and Least-Squares Approximation This proves. usually written 1'1 (21) for i= 1»---="= Z(<Po<P. . Forsythe 8.. I J=1 I has a unique solution (on).-) =0. so that (wt.: Moler [1967]‘IT or the book Lawson to Hanson [1974] on "Solving least-squares problems —i. .p.Z. for the linear space II. the linear system y 1.n.-’) = 9 for i at J1 then it is quite easy to solve the normal system. . if and only if the only function fin $ for which [[_f[[3 =0 is f =0. that is. These latter equations constitute the system of normal equations. for example. hence this latter system of equations has a unique solution f “‘ E $._ _. f"' has a unique representation asp. we might be unlucky and end up with a basis (<..‘g’ — _f*) = 0.o.222 XIV.03.“ on the interval [0 . . . ) in its second argument.-i=(<P. i = 1.:i=1 using the linearity of the inner product ( . that is. asp. incidentally. that the difference between best approximations l'iB.-. . represented of widely varying sizes.—-j-_-_ -. hence. therefore shows that g has a unique best approximation in $ if and only if ll ' l|2 is a norm on $. . . one easily verifies that (17) is equivalent to (19) for i = 1.) for $ we happen to have chosen. It depends on what particular basis (90.._. for whiph relative changes of a certain size in the coeflicient vector (on) may result in relative changes in the function 2. 1'1 (<.=) that is badly conditioned.:=‘9’)/(<P.) to be orthogonal. is used.. the solution is then simply Q. then the coefficient matrix for the normal system (21) is the Hilbert matrix.k. . the textbook example of an illconditioned matrix. l[i[ (20) for i= 1. Also. The determination of _f"' via the normal system may or may not be a good thing.S ’l‘io1'm’"U. (<.n.-----»"»- On the other hand.i)= J'=1-.'. 1].. Further.‘g’-Z:cr.)’{’. = 49059’) .(£1'£) = :r:’°'i.o. ‘P. i . . The reader to whom these considerations are unfamiliar is urged to consult a text on the numerical solution of linear systems.»mP. that is.. . From the Schoenberg-Whitney Theorem (Theorem XIII(2)). i (23) Lemma. We must verify that our discrete ‘norm’ is. the symmetric matrix A is factored into LDLT. . Furtherdetails can be found. We can therefore solve (22) by Gauss elimination without pivoting. > 0..t if and only if. Bj)Cl'5j = (B-5. This process is also called “regularization” and is also used to rescue ill- . for all i (with wi 75 0). and.. and the normal system (22) is singular. .].+. it has been proposed to select a “best” least-squares approximation by the requirement that it be smallest in some sense among all least-squares approximations. is a norm on $a. with L a unit lower triangular matrix and D a diagonal matrix.c’t 223 For the specific linear space $ = $1. all i. The“~‘norm’ ||f||2 == (Z. with any two solutions agreeing at all the T-5:3.j| Z la...4.. the B-spline basis (Bi)? seems 0011venient since it is relatively well conditioned (see Cor. and. . ‘g’). Since |[_f[|2 = O implies that. we have at once the following lemma. These calculations are carried out in the subprograms BCHFAC/BCHSLV given below.(f(r. the matrix is positive (semi)definite. we can carry this out within its lower diagonal bands. .=). a norm on $.:) = 0 for a: ¢ [t.t if we want to make certain that the normal system (22) has exactly one solution.. we are asking for conditions on ‘T’ that ensure that (_f(r. If the condition of this lemma is violated.w. In sucli a situation. by Lemma (16). XI(8)). The triangular system Ly = b is then solved for y.i=1 has bandwidth less than It in the sense that (B.) nondecreasing. finally. for some 1 3 3'1 < ' ' ' < jfl 3 Ni i ti<Tji<ti+k. the singular problem is made nonsingular by the imposition of additional conditions on the solution. without pivoting and for a symmetric matrix. the coefficient matrix for the normal system ‘H'- (22) SB-5.. since the matrix is symmetric.. this allows one to store it by storing just its it lower diagonal bands.Least-squares approximation from $.i.t Least-squares approximation from $. This follows readily’ from the fact that B. .(. and (T. This version of Gauss elimination. this implies that it has many solutions in this case.) = 0..))2)’/2 with w.i))'is also symmetric. Further. Further.. is called Cholesky factorization: In its squareroot-free form. in Forsythe 3: Moler [1967].B_. the triangular system DLTx = y is solved for the solution x of Ax = y. for example.i.))“) 1/2 fails to be a norm on $1. Since the matrix ({B. indeed. B_. with t = (t.¢.)) = 0 implies that f = 0.= (rs) = 0 for all as. 'l= 1. hence |i — j] 2-_ It‘ implies that Bi(:r::)B_. _f(r. Since the normal system always has solutions. of splines. In effect. t. = O for |i . at least for moderate it. then f i—-> wi(_f(r.-)’f"". Tl. . I=1.. B(J)}....:..A HORK ARRAY OF LENGTH ****** I N P U T VIA C O H M O N N ROWS ARE USED C . I..N. BCUEF(N) THE B—SPLINE CDEFFS.NTAU... AND THE I N N E R P R O-D U C T OF THO FUNCTIONS F AND G IS GIVEN BY (F.. . ARE . .. AS IS THE ARRAY G T A U G(TAU(I)). that is. 0.J) := .. THE assrarcrrou K . . B(I). The approach taken in the subprogram below is somewhat difierent. BUT IS N 0 v H E R E c H E c K E D FDR...NTAU ARE THE CORRESPONDING HEIGHTS ...) The subroutine L2APPR (with BCHFAC/BCHSLV) susaourrus LZAPPR ( T.. I=1. CALLS suspaocntus ssptvs.. the B-spline basis (B..NUHBER OF DATA POINTS (TAU(I). seem: I N P U T moose: T(1).G)...i—-u — i-Hflflw nfjflfi fi fi fiflfi fi iaoOfi ofi fi flfi oCafi fi fi fi fgfi fi ' LINES I I IJQ‘U _ C . -in -ru..n—|-|—| CONTAINING THE SEQUENCE ri-—i-u_.....THE ORDER w A R N I N c . UTION OF THE NORMAL EQUATIONS ARE DETERMINED AS THE SOL" SUM ( (B(I)..N) F ‘F’E ... HEIGHT(I). GTAU(I) ). If || .J=1. DENOTES THE FUNCTION TO BE APPROKIHATED.---. B(I) DENOTES THE I—TH B—SPLINE..t. THE RELEVANT FUNCTION VALUES O SUPPLIED BY THE SUBPROGRAH B MFG 11H THE COEFF. /DATA/ #*##*# NTAU..... OF THE L2-APPR. over 1'.NTAU. K.. scnrtc/stv c cousraucrs THE (HEIGHTED orscnsrs) L2—APPRDXIMATION BY SPLINES OF ORDER c K urru KHOT ssnusucs r(1). ##1## H E T H O D ttttee THE B—SPLINE COEFFICIENTS OF THE L2-APPR.G) := SUH ( F(TAU(I))*G(TAU(I))*HEIGHT(I) : I=1. problems.. WITH (B(I).’s to equal zero. or nearly singular. T(N+K) THE KNOT SEQUENCE N.t fails to be linearly independent over ‘T. ttrtte U U T P U T snore: BCOEF(1).LEI KHAX (= 20) IS IMPOSED BY THE ARBITRARY DIMENSION STATEMENT FOR srtrx BELOW.N. THE B—SPLINE COEFFICIENTS B c 0 E F OF THE APPRDIIHATING SPLINE ARE DETERMINED Fnou THE uoautt EQUATIOHS_USING cuotssxvis usrsoo. USED IN BCHFAC . I = 1....-)‘i" for $. . then. N .. eeooe H D R K A R R A Y 3 euros: .224 XIV.....A WORK ARRAY OF SIZE (AT LEAST) K*N.. I=1. N. linearly on the Bis preceding it in the sequence... . scosr ) c r0 BE CALLED IN mars PROGRAM L 2 H A r n . I=1.THE DIHENSION OF THE SPACE OF SPLINES OF ORDER K HITH KNOTS T. (See Example (26) below. G = (E(I). ..B(J))*BCOEF(J) = J=1.....GTAU(I)). ITS FIRST K FOR THE K LOWER DIAGONALS OF THE GRAHIAN MATRIX DIAG. one or more of the Bj’s depends. r(n+x) T0 crvsu DATA POINTS ( TAU(I)... arts.HATRIX C(I.[|2 fails to be a norm on $i.. We choose a “best” least-squares approximation by forcing the coefficients corresponding to these dependent B.NTAU) THE ARRAYS T A U AND H E I G H T ARE GIVEN IN COHHON BLOCK D A T A . Smoothing and Least-Squares Approximation conditioned. ... I=1..NTAU ARE THE NTAU DATA POINTS TO BE FITTED . s(LEFT-x+HH)). K. N. SINCE B—SPLINE VALUES ARE H0sT EFFICIENTLY GENERATED BY FINDING srHULTANEDUSLY THE VALUE OF E v E R Y NDNZERU B—SPLINE AT 0HE POINT.HH + 1 . BrATx ) BrATx(HH) CONTAINS THE vALUE OF B(LEFT-x+HH) AT TAU(LL).LEFTHK. T<LEFT+1)) 00 T0 15 LEFT = LEFT+1 LEFTMK = LEFTHK + 1 15 c0 T0 10 cALL BSPLVB ( T.Q(x.HTHAx=200) REAL Bc0EF(H).cTAU(HTHAx).T(1).T.TAu.LEFT-x+HH) SINCE (LEFT—K+JJ) .LL. LEFT.orAo(H). HENCE.xHAx. HTTH DH == BIATX(HH)*HEIGHT(LL).JJ. TAU(LL).. THEN USE - .HErcHT DIMENSION T(N+K) .HTAu.R q(r.LT. LEFT = K LEFTMK = 0 . 0F Q ).HH. DIAG ) ' CALL BCHSLV ( Q. INTEGER K. TAu(LL) IN (T(LEFT). THE HUHBEE DH#GTAU(LL) rs A SUHMAND IN THE INNER PRODUCT A (B(LEFT—K+HM).(LEFT—K+HM) + 1 .JJ .TAu(LL) SIMULTANEOUSLY AND ADDING THEM T0 ALL RELEVANT ENTRIES. DD 20 LL=1.K ow = BIATX(MH)*UEIGHT(LL) J .N.NTAU L0cATE L E F T s. AND STORE X IN BCOEF .J) = 0.HIHD(I+K-1. BCOEF ) RETURN END C IN Q . THE ENTRIES 0F c (I..ou. K. CALL BCHFAC ( Q.N. srATx(KHAx).J).N) AND THE RIGHT SIDE _ (B(I)..J) fififififififi 2O fififififi I = I-+ 1 CONSTRUCT CHOLESKY FACTORIZATION FOR IT TO SOLVE THE NORMAL EQUATIONS C*X = BCOEF FOR X . (B(I).H).E.J.B(J)) = C(I.K Q(I. 7 C 00 7 I=1. J=I. 1. THEREFORE CAN BE SPECIFIED BY crvrus rTs K BANDS AT OR BELOH THE DIAGONAL. ARE GENERATED BY COMPUTING.. HE sT0RE . 00 20 HH=1. s ) IN sc0EF(I) .E0. COMMON / DATA / NTAU. r.LEFTHK + MM" Bc0EF(J) = DN#GTAU(LL) + Ec0EF(J) r = 1~ DD 20 JJ=HH.J) IN n(I-J+1. N.The subroutine LQAPPR fifififififi OF THE NORMAL EQUATIONS rs SYHHETRIC AND (2*K~1)-HANDED.. ALL THE TERMS INVOLVING .HTHAx PARAMETER (xHAx=20... N) cu T0 15 IF (TAU(LL) .T(LEFT+1)) 10 IF (LEFT . 0) HHICH’GDES INTO BCOEF(LEFT—K+MH) AND THE NUMBER BIATJC(JJ)*Di-i[!IS A SUI-{HAND IN THE INNER PRODUCT (B(LEFT—K+JJ). K.LEFT.. FDR EACH LL.HErcHT(HTHAx) DO 7 J=1. INTD 0(JJ-HH+1.J) = BIATX(JJ)*DH + 0(r. FOR I=1.. TAu<HTHAx).N Bc0EF(J) = 0.cTAU. I.N)+DIAG(N) . HAVING H(1.226 XIV. PRECISELY. NROH. HBANDS. W(1.. B ) . O. HAVING N B A N D S DIAGONALS AT AND BELOW THE HAIN DIAGONAL. I=1. AND THE ENTIRE N-TH RON IS DECLARED TO BE LINEARLY OEPENDENT ON THE PRECEDING ROWS.W(1.E... W(1. DIAG ) CONSTRUCTS CHOLESKY FACTORIZATION C I L * D * L-TRANSPOSE HITH L UNIT LOHER TRIANGULAR AND D DIAGONAL.. RATIO IF (NROH .NBANDS.GE. THIS HAS THE EFFECT OF PRODUCING x(N) .STORE DIAGONAL_OF C IN DIAG. H(I. JUsTIFIcATION FOR THIS IS AS FOLLOHS..GT. OIAG(N).§ORHAL EQUATIONS FOR SOME LEASTSOUARES APFROIIHATION PROELEH.NBANDS.. HITH THE MAIN DIAGONAL IN ROW 1 .N). FOR EXAMPLE..N)+DIAG(N) . NROW.O WHEN SOLVING csx .N) CONTAINS THE NORM—SQUARE OF THE ERROR IN THE LEAST-SQUARES APPROIIHATION TO THE NTH BASIS FUNGTION BY LINEAR GOHEINATIONS OF THE FIRST N—1 . THIS ELEMENT HAS BEEN REDUCED BY ABOUT A WORD LENGTH.1) RETURN ' .J)..JMAI.J..I) CONTAINING 1/D(I.CONTAINS THE CHOLESKY FACTORIZATION £20000##### H(1..NROW.. I..NROH....IS A WORK ARRAY OF LENGTH NROH . AT THIS POINT..) H(1. IS EFFEGTEO BY THE SUCCESSION OF THE FOLLOWING T W O CALLS: GALL BCHFAC (IN. ###### GAUSS ELIMINATION.. IN CASE C IS (SYMHETRIC) POSITIVE SEMIDEFINITE AND B A N D E D .. ADAPTED TO THE SYMMETRY AND BANDEDNESS OF C .J). J=1. DIAG(N = c(N. WITH AND I=2. NBANDS. NBANDS .B FOR I.DIAG(NROH).1) = 1. INTEGER NBANDS.. IN CONTEMPLATED APPLIGATIONS OF THIS PROGRAM. H(I. FOR GIVEN MATRIX C OF ORDER N R O H ... ALL N...I) C = L*D*L—TRANSP.J) CONTAINS C(I+J-1. VIz.NROH). AT THE NTH ELIMINATION STEP. As THE RESULT OF PRIOR ELIMINATION STEPS. DIAG ) . (‘JO I’ ***#* O U T P U T ###### H. IF W(1...N) GIVES THE NORM—SQUARE OF THE N-TH BASIS FUNGTION. Is USED .N REAL H(NBANDS.J) H E T H U D CONTAINING L(I-1+J..N) IS SAVED INITIALLV IN DIAG(N).LEA'DIAG(N)).IMAI. IS COMPARED HITH ITS ORIGINAL VALUE.GT. NBANOS. C(I...1-i .LE. NEAR ZERO FIVOTS ARE HANDLED IN A SPECIAL WAY. NROW. REGARDLESS 0F B... 1) GO TO 9 IF (H(1. AND. TO SGLVE FOR I. IF. THE GURRENT PIVOT ELEHENT. Smoothing and Least-Squares Approximation SUBROUTINE BCHFAC ( W..INDICATES ITS BANDHIDTH.NROH)‘ CONTAINING THE NBANDS DIAGONALS IN ITS ROHS.N) . OIAG(N§ SIGNIFIES THAT THE N—TH FUNCTION IS LINEARLY DEPENDEHT TO HAGHINE ACCURACY ON THE FIRST N—1 FUNCTIONS. THEN THE PIVOT IS DE- CLARED T0 BE ZERO..i-1-u-—u-—-I-—'I i . —. THE INTERESTING ENTRIES OF A SEVEN DIAGONAL SYMHETRIC MATRIX C OF ORDER 9 WOULD BE STORED IN W AS 11 22 as 44 55 SS 7? as as 21 32 43 54 65 T6 B7 es 31 42 53 64 75 B 41 52 63 T4 B5 9 O O O O O O FJO O 97 ALL OTHER ENTRIES OF H NOT IDENTIFIED IN THIS WAY WITH AN ENTRY OF C ARE NEVER REFERENCED .IS THE ORDER OF THE MATRIX C ./H(1. DIAG. u—u-|. THE DIAGONAL ELEMENT c(N. NBANDS.HORKARRAY OF SIZE (NBANDS.J) I O FOR I-J . THE GIVEN EQUATIONS ARE THE. ‘ H. T0 GET FACTORIZATION CALL BGHSLV ( H. CEOOOOO##### I N P U T eaten: NROH... (I.E. THERE FORE CAN SAFELY BE LEFT OUT FROM THETEASIS OF APFROIIHATING FUNCTIONS THE SOLUTION OF A LINEAR SYSTEM S Cox = B no on on on o n n o no .1) . N) DO 17 J=1.N+I) I H(J.. DIAG(N)) GO TO 15 DO 14 J=1. GONTAINS THE CHOLESKY FACTORIZATION F0R c .P’ The subroutine LQAPPR 227 9 DO 10'N=1. l Y-" '-1"r-FI . THE TRIANGULAR SYSTEM IS L*Y = B IS SULVED FOR Y (FORHARD SUBSTITUTION). NBANDS.NsNDH1 REAL H(HsANDs.1 W(I+1.GT.N)*W(1.IHAI RATIO = H(I+1. THEN THE TRIANGULAR SVETEH L—TRANSPOSE#I = p**(—1)*Y IS SULVED FOR I (BACKSUBSTIT— L OOFJOOO UTION) INTEGER NsANDS.-"''~F.. As OUTPUT FROH SUBROUTINE BCHFAC (OU0 VIDE).NROH 1O DIAG(N) = W(1.. l IEDOOOOOOOOOOOO ####* ‘E I I ‘I oint: * ##### RumHe -4 §-...NROH IF (W(1.. B > FROM * A PRACTICAL GUIDE'TO SPLINES A BY c. .INDIcATES THE BANDWIDTH OF c . J.\'"-.NROW .. W. cwcR -S M E T H U_D ###### OF LENGTH N R O W CONTAINING THE SOLUTION./W(1. ###### WITH THE FACTORIZATION C = L#D*L—TRANSPOSE AVAILABLE.IS THE ORDER OF THE MATRIX C .N)*RATIO JMAX = JMAI .N.1) RETURN . NBANDS.NROH.E(NR0H) IF (NROW ..NROH). C DO 20 N=1.N) THAI = HINO(NBANDS—1. ... . 1) G0 T0 20 15 JHAK = IMAK DO 18 I=1.JHAI.N) = 1.N) FACTORIZATION .N) = RATIO CONTINUE RETURN 17 18 20 END SUBROUTINE EGHSLV ( W. NROW. I N P U T ###### NROH.F [I r ii. THE VECTOR Dm#(-1)#Y IS COMPUTED AND STORED IN B. THE VECTOR OF LENGTH N R O W CONTAINING THE RIGHT SIDE. H.N) IF (THAI .NBANDS W(J.N)+DIAG(N) -GT. Y IS STORED IN E..JHAI W(J.LT.W(J+I.0 14 - GO TO 20 H(1.N) .... DE BOOR SOLVES THE LINEAR SYSTEM csx =-s 0F ORDER N R O W FOR I PROVIDED W CONTAINS THE CHOLESKY FACTORIZATION FOR THE HANDED (SYMHETRIc> POSITIVE DEFINITE HATRII C AS CONSTRUCTED IN THE SUBROUTINE E c H F A C (OUO VIDE) ###### F .N+I) . .. 1) G0 TO 21 B(1) = B(1)*H(1. WHERE L UNIT LOWER TRIANGULAR AND D IS DIAGONAL. N)*B(N) CONTINUE ' BACKSUBSTITUTION. and coordinated in the main program LQMAIN. L2KNTS and L2ERR. IS TYPICAL FOR PROGRAMS CONSTRUCTING A PP APPROKIMATION TO A FUNCTION GIVEN IN SOME SENSE.N)*B(J+N) 40 N .GT. THE NUMBER N T I M E S ‘IS READ IN IN THE MAIN PROGRAM.LT.N) JHAI .NROW—N) IF (JMAX . SOLVE L*Y = B FOR Y. including the calculation of a series of approximations with varying number and location of knots. and calculate and print out various measures of the error.x = D**(-1)*Y FOR x. ON THE AVERAGE. THE SUBPROGRAM L 2 A P P R .NROW JMAX = MINO(NBNDM1.NROW as B(N) . ADDBRK I . SPECIFYING BOTH THE DATA TO BE APPROXIMATED AND THE ORDER AND BREAKPOINT SEQUENCE OF THE PP APPROXIMATING FUNCTION TO BE USED.L2KNTS. construct the appropriate knot sequence from a given break Sequence. FOR INSTANCE. Smoothing and Least-Squares Approximation C C FORWARD SUBSTITUTION. ADDBRK KNOTS ARE TO BE ADDED PER PASS THROUGH NEWNOT. 0) GO TO 39 RETURN END LQNAIN and i115 subroutines For the calculation of least-squares Spline approximation.HINO(NBNDH1.N—1 _ IF (N . We therefore need a program to coordinate all these activities. S E T D A T IS EXPECTED TO T E R M I N A T E THE RUN (FOR LACK OF FURTHER INPUT OR BECAUSE I C O U N T HAS REACHED A CRITICAL VALUE).BCHFAC. evaluate the approximation. BO). for example in the examples to follow. IT SPECI FIES THE NUMBER OF PASSES THROUGH THE KNOT IMROVEMENT ALGORITHM IN N E W N C T TO BE MADE.LT. STORE IN B.JO ('JC'fJ( 'JC O NTIMES .NEWNOT THE PROGRAM.34 WOULD CAUSE A KNOT TO BE ADDED EVERY THIRD PASS (AS LONG AS C'J( ')C!'OC')(J' (J' <J(' . SOLVE L-TRANSP. . N .LT. COULD EASILY BE REPLACED BY ONE CARRYING OUT INTERPOLATION OR SOME OTHER FORM OF APPROIIMATION.PPVALU*.JHAx V _ 35 B(N)-= B(N) — W(J+1.BCHSLV). All this is carried out in subprograms SETDAT. FOR EXAMPLE.JMAX 25 C c 30 E(J+N) = B(J+N) — H(J+1.NROW—N) IF (JMAX .B(N)-H(1. STORE IN B. 1) GO T0 40 DO as J-1.L2APPR(BSPLVB.L2ERR(PPVALU(INTERV)). listed below. 1) GO TO 30 DO 25 J=1. ##### _ I N P U T ###### IS EXPECTED-IN S E T D A T (QUO VIDE). FURTHER. THOUGH OSTENSIBLY WRITTEN FOR L2—APPROXIMATION. we need to read in the data.BSPLPP(BSPLVB*) . C MAIN PROGRAM FOR LEAST-SQUARES APPROKIMATION BY SPLINES CALLS SETDAT.228 XIV. ALSO. 21 NBNDM1 = NBANDS — 1 DO 30 N=1. A D D B R K IS READ IN TO SPECIFY THAT. F10.(COEF(II+J).NE. (BCOEF(I).EREAR.o0rfl'u zougw = ‘ON’ GIVES PRIHTOUT OF APPROXIMATION AND ERROR AT EVERY DATA POINT.TDTALH.LL=2.10)) IF (PRPCO .Ic0UNT. N. K.TAU.L II 12 N T I H E S LBEGIN = L NT = 0 THE E—SPLINE COEFFS. IT IS UP TO SETDAT PASSES THROUGH SETDAT .LL.NTIMEs. = ’ON’ GIVES PRINTOUT OF PP REPR.NEIGHT(NTMAX).PRPc0.LBEcIN. BREAK. OF APPROXIM.J.LZMAIN and its subroutines 9 N T E D 0 U T P U T ****** 1"‘ gbd BY THE THREE PRINT CONTROL HOLLERITH STRINGS = ’ON’ GIVES PRINTOUT OF B-SPLINE COEFFS.5/3A2) THE INTEGER fiflffiflfl COMMUNICATION HITH THE DATA-INPUT-ANDT D A T . ON) co TO 15 PRINT 611 FORMAT(/' PP—REPRESENTATION FOR APPROxINATION') DO 12 I=1. CALL BSPLPP ( T.TOTALH COMMON /APPROX/ EREAK(LPRMAx).cTAU. T.4E20. IT IS INITIALIZED TO 0 TO IS BEING CALLED FOR THE FIRST TIME.ON.L. THE ORDER K .LTKMAx.EQ.PREcO. AND THE INTERIOR BREAKPOINTS ARE ALWAYS PRINTED OUT AS ARE (IN L2ERR) THE MEAN. PRINT soo soo FORMATC’ NTIMEs. MEAN SQUARE. COEF. AND MAXIMUM ERRORS IN THE APPROKIMATION.ADDRRR . OI FIO FIOUFJ INFORMATION ABOUT THE FUNCTION TO BE APPROXIHATED AND ORDER AND BREAKPOINT SEQUENCE OF THE APPROXIMATING PP FUNCTIONS IS GATHERED HY A -A 1 CALL SETDAT(ICOUNT) *' C C C BREAKPOINTS ARE TRANSLATED INTO KNOTS.’ ON '.cOEF. BCOEF ) IF (PRECO .a.N) FORMAT(//’ R—sPLINE COEFFICIENTS’/(4E20.I3.10/(11x.NTMAx.PRPUN. (BREAK(LL).NTAU A . HTIMES PASSES ARE MADE THROUGH THE SUBROUTINE NEHNOT.LPRMAX. R.PRPcD PARAMETER (LPRMAx=1oo. B c 0 E F OF THE L2—APPRnx.BREAK(I).L. K.4E2o. ARE OBTAINED HY A CALL L2APPR ( T.Ec0EP(LPRNAx).LTRRAx=2ooo) REAL ADDERR.NT. N ) C OF 10 609 C C 610 611 613 AND THE REAL P # c0NvERT THE B—REPR.PRBCO.scRTCH(NTNAx) * . N. O.F10. EREAKPOINTS -'/(4E20. THE NUMBER OF PIECES L.II. I3.R. AFTER TO USE ICOUNT FOR KEEPING TRACK OF THE . R. I l I N ARE REQUESTED AS HELL AS THE PRINT CONTROLS P R B 0 0 ' ca wnu Run w:n cum c~ AND * P R P U N .LNEH.’ INTERvALs. OF THE APPRDIIRATIUN TO PP REPR.J#1. *uw:w www wwmo :'. AND THE NUMBER B—SPLINES TO BE USED IS OBTAINED BY A CALL LZKNTS C BREAK.N.R DATA OH /’ON’/ C ICOUNT = 0 I C O U N T PROVIDES TERMINATION ROUTINE S E SIGNAL TO SETDAT WHEN IT THAT.wEIcHT COMMON / DATA / NTAU. OF APPROXIMATIOH.I=1. L ) PRINT 610.PRFUN 500 FURMAT(I3.ADDBRK.PRPuN -? (I3. PRRc0.L) FORMAT(//’ APPRuxIMATI0N BY SPLINES OF ORDER’. scRTcR.PRPCO.5/3A2)') J READ 500. L.10)) C C ‘ vi PRINT 613.c0EP(LTRRAx).Q(LTRNAx).K) P0RMAT(P9. ON) PRINT 609.NTIHES.T(NTMAx).1o)) C -n. TAU(NTMAX). *#### C IS G Ci ||" Clfiifi ffilfififl I INTEGER I. L.NTMAx=2o0. Q.GTAU(NTMAI). BCOEF. HITH AN INCREASE OF ADDBRR KNOTS FOR EVERY PASS . EACH THEREFORE.. Smoothing and Least-Squares Approximation COHPUTE AND PRINT OUT VARIOUS ERROR NORMS BY A CALL L2ERR ( PRFUN.BREAK(1) K TIMES..H — 1 DO 5 I=1. FROH THE CURRENT APPROX. I=2. N I K-1 + L. IF (NT . N ) NT . ..T(N+K) HH1 ... R‘.KM1 . TRY IT AGAIN TO OBTAIN. T(1)..L. THEN BREAK(L+1) K TIMES .BREAK(1) DO 6 I=1. LNEH. ONCE. T. LNEH. I.BREAK(L+1) THE BREAKPOINT SEQUENCE ##### U U T P U T ###### INTEGER K.T(1)DIMENSION BREAK(L+1). SCRTCH. HITHOUT THE ADJUSTMENT THAT NEHNOT PROVIDES. K. GOOCEOOOOCEOOOODOO C REAL RREA1<(1). . A POSSIBLY IMPROVED SEQUENCE OF BREAKPOINTS HITH' ADDHRH MORE HREARPOINTS (ON THE AVERAGE) THAN THE CURRENT APPROXIMATION HAS.. XIV. OF A PP FUNCTION OF ORDER K HITH K-2 CONTINUOUS DERIYATIYES AS A SPLINE OF ORDER K HITH RNOT SEQUENCE T . 23O C .. L.LBEGIN + FLOAT(NT)*ADDBRK CALL NEHNOT (BREAK.T TO ALLOH THE REPR. A FARE NEHNOT ROUTINE COULD BE USED HERE HHICH HERELY RETURNS THE EREAKPOIHTS FOR L N E H EQUAL INTERTALS ....L. H3 ###-## ..T(N+K) THE KHOT SEQUENCE N THE DIMENSION OF THE CORRESP. THEN EREAK(I).NT + 1 FJOOGOOOOO GO TO 10 END SUBROUTINE LZKNTS ( BREAK K. T.R 7 T(N+I) = BREAK(L+1) END :3 ~ A p .RETURN .KM1 + L DO 7 I-1. CONVERTS THE BREAKPOINT SEQUENCE B R E A K INTO A CORRESPONDING KNOT SEQUENcE. SPLINE SPACE OF ORDER K . N ) C TO BE CALLED IN HAIN PROGRAM l"l" IO H A I N . THIS MEANS THAT " T(I). ###‘-### ET! L THE NUMBER OF POLYNOHIAL PIECES. COEF. K..L 6 T(KM1+I) . BREAK(1). IF ONLY AN INCREASE IN BREAKPOINTS IS HANTED. SCRTCH.KH1 5 T(I) .. NTIHES) _ GO TO 1 LNEH .N. T ) CALL L2KNTS ( SCRTCH.GE. Q ) 15 IF NEHNOT HAS BEEN APPLIED LESS THAN N T I H E S TIMES.BREAK(I) N .{ {. T(N+K) . ON REAL FTAU(1).6)) RETURN END 3 . ALL I. K.ERROR(NTAU) PARAMETER (LPKMAx=100. THIS MAKES THE PRINTED OUTPUT MORE ILLUSTRATIVE. ’ON’ .LTHMAx=200o) COMMON / DATA / NTAU.HEIGHT DIMENSION FTAU(NTAU). O ) ERROR(LL) . 1’DATA POINT’.ERRMAx S15 FORMAT(///’ LEAST SQUARE ERROR =’.PPVALU (SHEAR.ERRL1. HITH FTAU(I) THE APPROIIMATION F AT TAU(I). .SCALE.E20. IT PRINTS OUT THE AVERAGE ERROR E R R L 1 . IE.LT. IF (ERRMAX#SCALE .HEIGHT(NTMAx).. ERRUR(1). DO 10 LL=1.FTAU(LL).=APPROxIMATION AND SCALED ERROR CURVE’/71.GTAU.ERRDR IS GREATER THAN 100 SOMENHERE.. . ###** Q U T P U T ###### FTAU(1).I1/ 2(I4.NTMAx=200. -TO THE GIVEN DATA CONTAINED IN COMMON BLOCK DATA . ERRL2 = O. AND THE MAXIMUM ERROR E R R M A I . OCUFMOITfiflfi i pflifiFJCMQIUCMDI FIO INTEGER PRFUN. S C A L E EQUALS 1.TOTALH COMMON /APPROx/ DREAH(LPHMAx). ALL I.L. L.L..6//) IF (PRFUN . TAU(NTMAx).NE.LL.LL=1. OTHERHISE.ERRL2 # .F17.LPHMAx.H DATA ON /’ON’/ » ERRL1 = O.3X. NITH ERROR(I) = SCALE#(G — F) AT TAU(I).GTAU(LL) .COEF(LTHMAx).ERRL2. IO. EREAH.ERRMAx. ON) RETURN F: SCALE ERROR CURVE AND PRINT ## IE = O SCALE = 1. OR THE AES. 10. IF PRFUN = ’ON’. IF (ERRMAX .NTAU) S20 FORMAT(///14x. FTAU .7X.’DEVIATION x 10*#’. HERE.NTAU.9 SCALE = SCALE*10.FTAU(LL) ' ERR = AES(ERROR(LL)) IF (ERRMAX . VHOSE PP-REPR.8.GE.IE.NE. ERRMAX = O.(LL.S/ 1 H _ C 2 ’ MAXIMUM ERROR =’.F16.TAU(LL). IS CONTAINED IN COMMON BLOCK APPROx .. S C A L E IS SUCH THAT THE MAXIMUM OF AES(ERROR)) OUER ALL I LIES BETWEEN 1O AND 100.) GO TO IS 17 CONTINUE IS DO IS LL=1. ERROR ) C THIS ROUTINE IS TO BE CALLED IN THE MAIN PROGRAM L 2 M A I N . IN CASE PRFUN .ERRL1.ERR.0/ I AVERAGE ERROR =* .ERROR(LL).’APPROXIMATION’.ERROR(1).GTAU(NTMAx). E2O. ERR) ERRMAX = ERR ERRL1 = ERRL1 + ERR*HEIGHT(LL) 10 ERRL2 = ERRL2 + ERR#*2*NEIGHT(LL) ERRL1 = ERRL1/TOTALH ERRL2 = SQRT§ERRL2/TOTALU) PRINT s15. THE L2—ERROR E R R L 2.NTAU FTAU(LL) .GE.LTRMAx.H.8. THE ROUTINE PRINTS OUT THE VALUE CF THE APPROXIMATION AS HELL AS ITS ERROR AT EVERY DATA POINT.. ERROR(NTAU). COEF.F16. FTAU(NTAU).. TAU(LL).NTAU 19 ERROR(LL) = ERROR(LL)*SCALE PRINT S20.TOTALH.TAU.) GO TO IS DO 17 IE=1.NTMAx. CALLS SUEPROGRAM PPVALU(INTERV) THIS SURROUTINE COMPUTES VARIOUS ERRORS OF THE CURRENT L2-APPROxIHATION .L2MAIN and its Subroutines 231 SUBROUTINE LZERR ( PRFUN .COEF. ##### I N P U T ###### PRFUN A HOLLERITH STRING.E20. . the error must have at least n Sign changes. ' (26) Example: An approximation with fewer sign changes in the error than perhaps expected We calculate the discrete least-squares approximation in the specific case g(E) = I2 + 1 and $1.232 XIV. .1). that is.. i = 1.. This implies that the (rectangular) matrix A A 1: (Bi-(”'§))?=1§§....kA = n)..)){v n (weak) sign changes. I By taking account of the bandedness of the matrix A.3/4.2"B.7/8.1. . ..2__5 f‘1C[0.I1lCA g S+e. that is.. we know that the error e must be orthogonal to $.._t (that is. = 1.7) 1' = (0.1/2.‘g’-— _f* in the least squares approxiniation to g fi'om has at least $1. S+e denoted the number of week sign changes in the sequence e. . Smoothing and Least-Squares Approximation The use Of LQHAPPR We begin with a discussion of an important diagnostic aid.. the sequence (e('r. namely the number of sign Changes in the error E:=_igi___J¢-1|: of the least-squares approximation f* from $. ran. one proves (25) Lemma. . The matrix A is totally positive by Theorem XIII(7).. = lI..r-—-___- 1 .. hence.1 ...An appropriate subroutine SETDAT.1 maps the N-vector e :--= (e('r_.e) == O for all f G $k. . as in continuous least-squares approximation (see the end of preceding chapter) from an n-dimensional spline space. Harlin [1968:Theorem V2. to be used in LQMAIN. for example.t. (24) If-:l. with the ith of these n sign changes occurring “in the support” ofB. . by a strengthening of Proposition XIII(6).. Then ... We first prove that.)w_. For a proof of (24). . is then Ii-. all i. the maximal number of sign changes achievable by an appropriate assignment of signs to the zero entries of e. By Lemma (16).’.-){" to zero. we must have (_f.2]. and that the error e =. is not identicall ' y zero on 1' .1] with £=(('£—1)/6:*£=1. ' unless e is identically zero. see.n. Here. Assume that |] -‘H2 is a norm on $. w.t. . I C O U N T IS EQUAL TO ZERO HHEN SETDAT IS CALLED IN L 2 M A I N FOR THE FIRST TIME.5**(I—1) TAU(NTAU) = 1.F10.L. I.I=1..ADDBRK . DO 10 I=1..1666G66716+OO 0.143915S797+01 0. IT HOULD HAVE TO BE REPLACED HY A SUBROUTINE READING IN NTAU. TAU(NTMAK).HEIGHT PARAMETER (LPRMAx=1OO.NTMAx=2Oo.Example: Sign changes in the error - O OCJO OQO O ' 233 SUBROUTINE SETDAT(ICOUNT) TO BE CALLED IN MAIN PROGRAM L 2 M A I N ./FLOAT(L) STOP K = 2 DO 11 I=1.0000000000+OO 0. IT IS UP TO SETDAT TO USE ICOUNT FOR KEEPING TRACK OF THE PASSES THROUGH SETDAT . PRBCO.H.PRFUN =? (I3.. L..NTAU). .6666666BB5+OO ‘ O.TOTALH.PRPCO.125000OOOO+O1 .K IF (ICOUNT .HEIGHT(NTMAX}. TAU(I)..0000000000+OO O. AND HEIGHT(I). O..199S644S29+O1 APPROXIMATION BY SPLINES OF ORDER '2 ON O.NTAU AND READING IN OR SETTING K.1000OOO000+01 0.LTHMAx=2OOo) COMMON / DATA / NTAU. RREAH(I). INTEGER ICOUNT.NTAU S GTAU(I) = TAU(I)**2 + 1.1635S41441+O1 0.NTAU 10 NEIGHT(I) = 1.LPKMAx....LP1..50000OOO0O+O0 O.LTKMAx.sTEP. ONONON B—SPLINE COEFFICIENTS . TOTALN = NTAU L = 6 LP1 = L+1 sTEP = 1.NTAU.. THIS ROUTINE IS SET UP TO PROVIDE THE SPECIFIC DATA FOR EXAMPLE 2 IN CHAPTER XIV. - gt NTIMES.NTAUM1.GT.NTAU. AFTER THAT..S333333731+0O 6 INTERVALS. GTAU(I)..L+1. DO 9 I=1.COEF(LTKMAI). As HELL AS TOTALN = sUM( HEIGHT(I) . THIS IS IMPORTANT SINCE L2MAIN RELIES ON SETDAT FOR T E R M I N A T I O N .I-1.TOTALH COMMON /APPROI/ BREAKCLPHMAK).TAU.GTAU..NTAUM1 a TAU(I) = 1..GTAU(NTMAI).. I-1. BREAKPOINTS O. I=1. 0) ICOUNT = ICOUNT + 1 NTAU = 1O NTAUM1 = NTAU-1 DO S I=1. FOR A GENERAL PURPOSE L2—APPROXIMATION PROGRAM.5/3A2) 0 O.CORF.NTMAI REAL HREAH.3333333433+OO O.L.LP1 11 BREAK(I) = (I—1)#STEP RETURN END Here is (input and) output from LQMAIN and its subroutines for this particular choice of SETDAT. T500000O. This shows that least-squares approximation is perhaps not the method of choice for the approximation to a smooth and exactly known function.h 234 XIV.93T50000 1 178535 93999422 0.00000000 1. is identical with the So-called “best” least-squares approximation). though not usually at some of the given data sites.00000000 1 Til Our spline space in this example is of ‘dimension n == 7 (= Z + k — 1).000 0.333 0.99609375 1 551712 1 13.988T5000 1 254414 98931958 O. 001192 56250012 O.18T6820803+01 0.It also points out that the leastsquares spline approximant could have been gotten. ' Lemma (25) provides a simple check that a program for least squares spline approximation works correctly. in principle. We would therefore expect at least seven Sign changes in the error.0000000000+00 0.0UJ"~l0'i01| P'0JlQl-A 0.167 0. 82741? 76404226 1 0. as described in Chapter XIII. in this case.99218750 1 893013 99131346 O. since the construction of an interpolant.75000004T7+01 0.116994-O2 o.0000000000+00 0.1480095744+01 O. by interpolation. A closer look at breaks and data sites shows that B2 and B3 in the B-spline Sequence for t vanish on 1'. that-is. and ('24) only promises five sign changes under these circumstances.re linearly dependent on the others in a trivial way.50000O0O 1.875000OO 372339 88134348 O. Thus..567 0.8000000000+01 0.500 0.24aT2a—O2 APPROXIHATION AND SCALED ERROR CURVE DEVIATI ON X 10**4 ROKIMATION DATA POINT APP 000000 0O000000 0. 1. 000000 25000000 O.833 O. we get only five. 99864483 1.1134952684+01 0.0000000000+00 0. In fact. is considerably cheaper and just as effective provided one has a reasonable way for choosing . Smoothing and Least-Squares Approximation PP—REPRE8ENTATION FOR APPROXIHATION 0. even if we take the first two entries in the error vector to be zero (as they would be in exact arithmetic) and so obtain three weak sign changes in the first four entries of the error vector.1685841441+O1 LEAST SQUARE ERROR AVERAGE ERROR MAIIMUM ERROR - I-5 Oi. a.___1.1. El This example also illustrates that the subprogram BCHFAC/BCHSLV is equipped to deal with such singularity oi the normal system.1000000000+01 -0..1439158T97+O1 0.125000000O+01 0.9843T500 1 538298 98398221 O. is only of dimension 5 when restricted to 1'.i.sss149-03 O. but also Shows that you may not like the result (whic. $. Example: The noise Plateau in the error 235 appropriate interpolation sites. Least-squares approximation is very suitable for the recovery of a smooth function from noisy information. In this case, one thinks of the data g, as being of the form _ 9i = g(Ti) + 51. with g some “smooth”, or “slowly varying”, function to be recovered and the sequence (6,) quite “rough”, or “fast varying”, distributed around 0, but of smaller magnitude than g. The trick is to approximate from a function class $ that is flexible enough to approximate the underlying information g while still orthogonal to the noise, that is, unable to follow oscillations in the sequence (6,). In this situation, one would expect the error vector of a successful fit to look like “noise”, that is, to have many more sign changes than the approximating class has degrees of freedom. One would also expect the error not to change much in size when increasing the available degrees of freedom slightly. In fact, one would expect the error to decrease in size initially as one approximates from subspaces with an ever increasing dimension until one reaches a point at which the error consists essentially of noise. Of course, going much beyond this point will eventually lead to zero error since, with sufficiently many degrees of freedom, one can simply interpolate. These considerations are illustrated in the next example. L. (27) Example: The noise plateau in the error We construct the least-squares approximation to rounded values of the function g(:r:) = ei” at 65 sites in [O. .3] from parabolic splines with uniformly spaced simple knots. We start with no interior -knots and then increase the number of knots by 1 each time, using a fake subroutine NEWNOT which merely outputs the new breaks uniformly spaced. Here is an appropriate subroutine SETDAT. SUBROUTINE sETDAT(ICOUNT) TO BE CALLED IN MAIN PROGRAM L 2 M A I N . ' THIS ROUTINE IS SET UP TO PROVIDE THE sFEcIFIC DATA FOR EXAMPLE 3 IN CHAPTER XIV. " GOOD INTEGER ICOUNT, I,R,L,LPRHAx,LTNMAx,NTAU,NTMAx REAL BREAK,COEF,GTAU,STEP,TAU,TOTALH,NEIGHT PARAMETER (LPHMAR-100,NTMAx=2oO,LTRMAx=2Ooo) COMMON / DATA / NTAU, TAU(NTMAx),GTAU(NTMAx),HEIGHT(NTMAx),TOTALH COMMON /APPROx/ BREAR(LPRMAx),COEF(LTRMAx),L,R ROUND(x) = FLOAT(IFIX(X#100-))/100. IF (ICOUNT .GT. 0) STOP ICOUNT = ICOUNT + 1 NTAU = as STEP = 3./FLOAT(NTAU—1) DO 10 I=1,NTAU TAU(I) = (I-1)#STEP GTAU(I) = ROUND(ExP(TAU(I))) 10 HEIGHT(I) = 1. 236 XIV. Smoothing and Least-Squares Approximation . . pk ®® @s Iliiifiiiii G, G; Ililll -I (28) FIGURE. As the number of intervals (or polynomial pieces) increases, the least-square error decreases until it reaches a plateau whose height is determined by the noise level in the data. TOTALN I NTAU L - 1 BREAK(1) - TAU(1) SREA1<(2) - TAU(NTAU) ' K - 3 RETURN END 4- The output for this example is Summarized in Figure (28) where the logarithm of the least-square error is plotted versus the logarithm of the number D. of intervals. According to Theorem XII(6), ear (g,$3,1,) ~ 0 (ma) . We would therefore expect the error to decay initially like O (TF3). .We have drawn in, therefore, for comparison, a straight line with slope -3. Note that the error reaches a plateau around n =- 10, of height ~ .0025. This corresponds nicely to the fact that we rounded the exact values to 2 digits after the decimal point. Note also that we eventually have enough degrees of freedom to approximate the noise as well; there is real improvement again around D. = 50 while, for n. Z 65, the error is 2 =1-= 10"’, that is, roundoff. El i Example: Once more the Titanium Heat data (29) Example: Once more the Titanium Heat data 237 In this example, we use the “optimal” knotsderived in Example XIII(29) for interpolation to some of the data points of the Titanium Heat Data. But this time, we construct a least-Squares approximation to all the data. We also increase the number of knots repeatedly, each time by 2, using NEWNOT to obtain a good distribution for them. Here is an appropriate version of SETDAT. GOOD SURROUTINE SETDAT<ICOUNT) TO BE CALLED IN MAIN PROGRAM L 2 M A I N . CALLS TITAND THIS ROUTINE IS SET UP TO PROVIDE THE SPECIFIC DATA FOR EXAMPLE 4 IN CHAPTER xIV. INTEGER ICOUNT, I,R,L,LPRMAx,LTHMAx,N,NTAU,NTMAI REAL sREAH,RRHFIC(S),COEF,GTAU,TAU,TOTALV,HEIGHT PARAMETER (LPKMAX=100,NTMAX=23C,LTKMAK=2000) COMON / DATA / NTAU, TAU(NTMAR),CTAU(NTMAx),HEIGHT(NTMAx),TOTALH COMMON /APPROx/ RREAH(LPHMAI).COEF(LTHMAx),L,R DATA BRKPIC/595.,730.9B5,794.414,S44.476,880.06,907.814, A 938.001,9?6.752,1075./, N/9/ _ IF (ICOUNT .GT. O) STOP ICOUNT = ICOUNT + 1 CALL TITAND ( TAU, GTAU, NTAU ) DO 1O I=1,NTAU 10 VEIGHT(I) = 1. TOTALH = NTAU L = N-1 H = S DO 11 I=1,N 11 EREAH(I) = BRKPIC(I) RETURN _ END Instead of a printout, we show data and approximation in a picture, with an enlarged plot of the error (dashed) superimposed. The error is plotted in the scale indicated on the right. The breaks used are also indicated, as diamonds on the zero line for the error. The approximation (see Figure (30)) is considerably better than that achieved in Chapter XIII by interpolation (See Figure XIII(30)). But, the error curve still has quite regular behavior and the plot of the approximation itself also indicates that it does not as yet contain_ all the information in the data. In particular, the error has 12 sign changes, just equal to the dimension of the approximating spline space. _ After four passes through NEWNOT, we have twice as many intervals, and approximation and error now look quite satisfactory; see Figure (31). In particular, the error now has 28 Sign changes while the dimension of the approximating spline Space is only 20. It seems reasonable that a less smooth approximation, for example, a spliiie of order 3 or 4 or a spline of order 5 but only C(1) or Cm), would havebeen more effective for these data (see Problem 7). We alert the reader to Chapter 5_ of Hayes [I970], written by M.J .D. Pow- ell, for a different approach to least-squares (cubic) spline approximation (see Problem 8). . _., ________ _ _______ _- 1 I Hm XIV. Smoothing and Least-Squares Approximation 238 8 O O ' I ‘ll I + IIII 1" Ii '|IlI- ' " I: : I llgii "" I : " \ : .25 : "‘ : I" _ ‘UH’ ‘I , H " 0 C‘ : I‘ '-'_i'.' I» _ 0 O - \, ""_ .25 cl-l-l':.~lI""' ..\ ‘--flfllri-.-I|flI—--' (30) FIGURE. .|--_|_:=‘-I-I‘-‘I-II’: Least-squares approximation (solid) to data (o) by quartic ' ' ' ' h t he err or also splines-wlth seven 1nter1or knots (0), wit shown along with its scale. I 1 1,1 ' .03 I1 .I'L ‘I I in ""' ‘I ‘F -I ‘I ... I - -I: fl' ...‘ J Ir \ 1|‘! -I A ‘ii I I IF,‘ -*' IQ J: "0 -' ‘I -1|,‘ I I | - 1r I‘ I -I : iiIf '\- - "' "H -I -I gin — -I I; II I‘-I r _ _ _ _ 1 : I - I-. ‘I " In x II-I t -F I-ll“ ll lb -qr = ii ‘I’ : II. I 0 ‘ -I —- U Ii J * I fi — -' II: 11 r -Ir I I hf —' .1-|I"':|-Ii -Z -I ‘F .-..fl||III--.—':":"-I"-':-.-ll:-*—~II'III" ‘hi. "' "'-:-=1':£:-T.-'5';-3 I H (31) FIGURE. Same as previous figure, except that approximation has fifteen interior knots, chosen by NEWNOT. I \\ ' .04 II" 1|. in \"’ II Z1 1‘I ll 3 I'\ ‘ ""'\ r P 1,5‘-\'I\ I’J I‘U : ""' " I’! J‘ I \- (32) FIGURE. I " -I‘ '1 | '-'1 " -I 1 - '- - r i E — I F-I I‘ -nI_ -gr == " "'1-u I‘. "‘I : "* - ' -"HI H’ I ; -.""' I O 1": |-' In \ -04 i Least-squares approxiipation (solid) to data (o) by cubic " ' - ' e error in splines with five free (1nter1or) knots (0), also th , its own scale as shown on the right. C] Example: Least-square approximation from $-=:|.,s Least-squares approximation by splines with variable knots 239 We bring up once more the topic of best approximation by splines with variable knots, this time in the specific context of least-squares approximation. This means that we consider least-squares approximation from the function class (BB) $».,.. 7=U{f€$k,t3t1="'=tk=(1=tn.+1 =*~=»r..+i.=b}. There are many difiiculties in constructing best approximations from this class, all stemming from the fact that this class is nonlinear, that is, the sum of two functions in $;,_-H, is, in general, not in $;._-,1. This makes it essentially impossible to characterize a best approximation, that is, to give computationally useful criteria by which a best approximation can be recognized and distinguished from other approximations. For the linear case, we did this earlier by showing that a best approximation must satisfy the normal equations and vice versa. It is also possible to give the equivalent of “normal equations” in the nonlinear case. But, while every best approximation must satisfy these, not every solution of these equations is a best approximation. Connected with this is the fact that there may be many best approximations to a given function from $a,-.-.. (If aball merely touches a plane, it does so at exactly one point. But a ball may touch a carved surface at many points.) y The upshot of all this is that it is possible only to check whether a proposed approximation is best locally. This means that one can try, numerically, to improve a proposed approximation by “small” changes in the parameters describing it. A program for calculating such locally best approximations by cubic splines with variable knots can be found in de Boor 8: Rice [I968]. A version of the program is available as code ICSVKU in the IMSL library [I977]. Jupp [1978] has discussed a peculiar difliculty that arises in the numerical construction of least-squares approximations from $;,_,, and has proposed an effective remedy}. Already Chapter XII contains a discussion of the merit of finding best knots. To reiterate, use of a code for finding a (locally) best approximation from $;,,-H is expensive. It is warranted only when precise placement of some knots is essential for the quality of the approximation (for example, when the data exhibit some discontinuity) and an approximation with as few parameters as possible is wanted. Otherwise, an approximation with two or three times Fa many well chosen knots is much cheaper to obtain and, usually, just as effective. (34) Example: Least-square approximation to the Titanium Heat data from $419 In de Boor 8; Rice [l968], a (locally) best approximation was obtained for the data in Examples XII(40) and (29) by splines of order 4 with five simple (interior) knots. Subsequent investigations by J upp [1 978] 240 XIV. Smoothing and Least-Squares Approximation showed this to be very nearly a best approximation. Figure (32) shows the approximation and the error. The approximation is about as good as the one we obtained in Example (29) with quartic splines with 15 interior knots. Note, though, the regular behavior of the error in the first knot interval. Two or three more knots would take care of it. El . i Problems 1. Modify the proof of Theorem XIII(34) in order to establish the following facts about existence and optimality of the “natural” spline interpolant: (i) Using the definition of $§‘,i',','.,f,._,,, given in the text, show that f G $§‘,i'§,§_x if and only if Dmf G $m,x but orthogonal to 1'l<_,.,.., that is, Ii” D”‘f(:t)q(:r) da: = 0 TOT all q G Hqm. (ii) If N Z m, then there exists, for given g, exactly one f G $§‘,i';'.I",, that agrees with g at x = (::c,;)i1V . (Hint: Show that the homogeneous system fB,,.,,,,,(:c)cp(x) dzt = 0, i = 1,...,N — ra, has only the trivial solution (,0 = 0 in $m_x, for example, by Lemma XIIl(38) and its corollary and the Schoenberg-Vllhitney theorem, or, by the linear independence of (Bi,m,x) and Lemma (16). Conclude that the linear system - 1 /B,,,,,,,,(:t)cp(:r) da:/ml = E (_.'\:,;+,.,.,,-—..'1:,)[:1:i,. . . , :c,;.|.,.,.,]g, _ t = 1, . . . , N—m, has ‘a solution cp G $m,,.;, and then construct f $§‘,i',',:,x as f = p + I — s)'l_‘_1go(s) ds/(rn. — 1)! for an appropriate p G l'l._»__-,.,.,._; etc.) (iii-) Conclude from (ii) that f (f(”‘)(s))2 ds $ f (h(”"*))2 ds for any smooth function h that agrees with g at x, with equality if and only if hlml = fl“). (iv) From (ii), develop a computational scheme for the construction of the “natural” interpolant f. 2. Prove that S ( _f,,) (with S given by (2)) strictly decreases as p goes from 0+ to 1"‘, in case S(fg') 56 O. (Hint: Set F,-,(_f) := qS'(f) + (1 -- q)T(f), with T(f) := f(f(”‘)(:c))” d:t'. Then F : p |-+ F,_,(_f,,) is the pointwise minimum of the straight lines q I-+ F,,(f), hence strictly concave. This makes S'(_f,,), as the value at q = 1 of the tangent, q 1-1» Fq(f,,), to F at p, strictly decrease as p increases (and its value at q == O, i.e., T( _fp)1 strictly increase). 3. Study the rounding error effects in the smoothing spline calculations bY rerunning the calculations, but using PPVLLC instead of PPVALU and comparing the first derivative values obtained with those of Example (11). 4. Prove the Cauchy-Schwarz-Inequality (15). (Hint: If then U 5 ||g:l: h"2 implies (g, h) = U. Otherwise, without loss, = = O, 75 O, and Problems 24 1 then O 5 ||g — %%‘%% h||2 does the job.) 5. One way to enforce interpolation to some of the data during leastsquares approximation is to make the weights corresponding to those data points very large compared to the rest. Investigate the effects of a few large weights on the accuracy of least-squares construction as carried out in LQAPPB. and its subroutines. 6. For x G IR", let x* := ((—)i:r;)'f. Prove that S")! + S"“(x"‘) = n -—- 1.. 7. Approximate the Titanium data by (i) parabolic and cubic splines with simple knots (perhaps using the optimal knots for that order and for the 12 data points used in Example XlII(29)) and (ii) by C(1)-quartics (that is, all interior knots are triple; this would require some editing of L2KNTS), and compare with Example (29) and Example XIlI(29). 8. (A test for noise). According to M.J.D. Powell (see Hayes [1970: Chapter 5]), one expects the inequality t Ti-1?"-i. S iT?'-'-g-:'£1-.=p-+-l. li=p q — P + 1 to hold in case the error r, := y-_.; — f(:z:,;), i = p, . . . , q, in the approximation _f to the given data points (:r:,;, yr) is essentially ‘noise. Modify LQMAIN to include a termination criterion based on this test. Then try it, for example, on the data in Example (27) or (11). 9. W1'ite a program that realizes the following variable knot least squares cubic spline approximation algorithm. 1 The interval [a. .51] containing all the abscissae of the given data points is subdivided initially into one or more subintervals; call their collection M. Also, there is a collection M"‘, initially empty. 2 While M is not empty, carry out the following two steps: 2.1 Pick some I E M, and calculate a discrete least-squares approximation pf E 11.-_;4 to the data given in I. ' 2.2If Z Ti-:.~'I"i S Z In-1.:-;€I MEI (with ri := yr -—- p; (.'1‘.'I,;), and n; := number of an in I), then remove I from M and put it into M "‘. Otherwise,a;cut I in two and put both pieces. back into M. ' 3 At this point (is it certain that this point will always be reached?), M "‘ contains a partition of the original interval. If .5 is the break se- quence giving this partition, then we are now certain that the data can be approximated well from 1'I< 41¢-. But, since we want a smooth approximated, we now “pull apart knots”, that is, we approximate the data from 5. £1. with T(f) := f(_f("”)(:c))” dsc..251 €l+. [.251€l+. and T. for T =. .llFor “one-pass algorithms” that g establish appropriate breaks by going through the data from left to right.-1 £1-. with breaks only at the sci.‘..15. with A some nonnegative function.52.751 . §2.].251b1 5. K. see.2515:-. Kiyoni [1977]. F. . It can be shown that.15. of the expression G. A useful extension of the smoothing spline construct can be obtained by considering the weighted roughness measure TAU’) == [In >\('?)(D"“f(*))2 dt.2is'1 $2. (b) Work out the changes needed in SMOOTH in order to handle the special case when A is piecewise constant.‘I.). £1. $1.(f) := S(f) + pT(_f). The standard treatment of the smoothing spline concerns the minimization...) l- l Ir.5).. for example. 3J1d§i+a 1= (1 "' alt-i + 0f§i+1.‘?.? with 15 I= (£1. (a) Show that such fp is piecewise polynomial in case A is the reciprocal of a pp function. oo].. Establish the map p |—-> p(p) for which fp is the minimum for GP9. 11.1 242 XIV.75. (See Kulkarni and Laurent [1991] and Bos and Salkauskas [1992] for good discussions of such weighted splines. and with the smoothing parameter p chosen in [0"' .Ti. over _f. <1. all '1 E [0 . AD’”fp (rather than Dmfp) is in $§.251’-52. Ichida. Yoshimoto. 10. Smoothing and Least-Squares Approximation it $4. £1. _._that is.I r X\/ The Numerical Solution of an Ordinary Differential Equation by Collocation. BSPLVD . just one example. b] that is given to us only implicitly. finite difference methods had derived their earlier superiority from the same source. This outburst was caused by the realization that old standby techniques like the Rayleigh-Ritz method or Galerkin’s method could be made quite effective if one were to give up on using polynomials or other analytic functions as trial functions and used piecewise polynomials instead. We intend to approximate a function g on [a . by being based on piecewise. b] 43 . . as a solution of the differential equation (1) (Dmg) (at) = F(:c. Instead. . polynomial approximation. But an outburst of mathematical and computational work on Galerkin’s method and other projection methods changed all that. In the process. we construct one more basic routine.'1-I li l. or local. as an interpolation process. . that is. . . COLLOC F r1_*—-—-n—\. in a book such as this. I want to discuss the numerical solution of an ODE from an approximation theoretic point of view. this one for the efficient simultaneous evaluation of all the B-splines and some of their ‘derivatives at a site.*-7 _. We show how to use B-splines in the numerical solution of an ordinary differential equation by collocation. g There is no hope. the area called “numerical solutions of differential equations” was thought to be completely disjoint from the area called “approximation theory”.g(. Mathematical background The mathematical background for this chapter. as this conjunction of projection methods and piecewise polynomial trial functions has come to be called. i. In a way. '.L | The entire chapter is. is as follows. Until the late 1960‘s. in effect. (D”“'1g)(s:)). not unlike the interpolation processes described in the preceding three chapters. to give a fair description of the computational aspects of the finite element method.1:). . for at E [a . as found in de Boor & Swartz [1973]. i= 1. We attempt to approximate g by pp functions. but.244 XV. we set 7-(i——1)k+'U :1: lg‘!-+1_l'£'l1 +QU(€5-+1 U = 11"". .'TTI. This means that we determine a pp function f so that it exactly satisfies the differential equation at certain sites. ...)? to a subprogram CULPNT.lk‘. . it may happen that (1)—(2) has many solutions.. Collocation with side conditions (for example.. and distributed the same in each subinterval. Further. .k+m. The particular specimen of COLPNT given below picks p as the zeros of the kth Legendre polynomial. and we will assume it to be “sufficiently smooth”.'i=1 for some constants 1U-|‘__-f and some sites o 5 :01 5 .£ O C("‘_1) for which = F(Ti.m_1) is a real-valued function on IRm"'1. these are sites of interpolation. Specifically.) =: flig = ci. These side conditions are linear. that is. F = F(:c..1'Tl».Q1<Q2<"‘<Qk§1 picked somehow.. we look for f E II<.m. the collocation sites..._j. in contrast to interpolation as discussed earlier. =1. using collocation. bou11dary conditions) ... -with _ ""'1§.6-|jg=C. z. Our hope is to start our iterative scheme (necessary since (1) is nonlinear) within this neighborhood and then have it converge to this particular solution. . Here. fOI' '£=]. say). In a way.f€Z I Here. . .)?! It per subinterval. we choose the collocation sites (T. . certain combinations of function and derivative values. withf --= (§¢)i+1 given breaks (with E1 = a. in general. _f(T-5)._. The reason for this can be found in the following theorem. . . that is.§_ arm 3 b._.. zo.6-§__f=C-5. we could have made these conditions nonlinear as well (see Wittenbrink [1973] and Problem 3). rather. . we do not match function values or derivative values at such sites but. as the Bites that are used win the standard Gauss quadrature rule. (Dm_1f)(Ti)). the side conditions are of the form (3) Zwij(Dj'1g)(:1::. . All we require in that case is that there be a neighborhood around the specific solution g we have in mind that contains no other solution.. .. .. Since (1) is nonlinear. Since we are eventually going to linearize (1) in the computations. 'f'=1..l =11"‘!!- The program below leaves the choice of p = (9.. {H1 = b. ' . 'l+ 1. Note that the choice of p as the Zeros of the kth degree Legendre polynomial allows us to take s = k in the theorem. provided s Z m—i.’s. Thus at the breaks.1li Mathematical background 245 (5) Theorem. .. but does not depend on 5. one might as well forget about the computed approximation and construct instead a new overall approximation by some local interpolation to f from II. i = 0. . . . {H1 (if s > m).. It is shown in de Boor 8. . To talk of better than optimal convergence may sound pariadoxical. Since the overall approximation is then only of order O (|£_f|""+"°). . it.|’°+'“i"<*“**"-">._. Assume that the function F in (1) is sufficiently smooth in a neighborhood of the curve [o . const depends on F..<m+k_£) refers to the overall size or norm of the error. 1] has been so chosen that k All q(I) H(='*= ~ Q-=1)d$ == 0 for every q E l_i. according to Chapter XII.. we obtain 1'8) |D*<g~o<a>| =<»(|=s|“’=) for j=1. . Since Dif is pp of order Tn + k — i. . g. j = 1. _ The approximate problem (4) is nonlinear (in general) and therefore requires some iterative scheme for its solution.. But the bound (7) shows that the approximation is of better than optimal order at the specific sites £1..m. ..D‘f|| is const |:. . Then the solution f (if it exists) near g of the approximate problem (4) satisfies (6) “Dig . matching f m-fold at nearby £.. but isn’t. At the breaks. . D'm'1g(:c)).: Swartz [1973] that (4) can be solved by Newton’s method starting with a F5 l 1 -—- . b] —> lRm+1 :11: r--+ (:r:.2. . . This phenomenon is somewhat dramatically called superconvergence. After all.. .m— 1. namely (7) |Di(9'"' § const |§|k+“. the bound (6) shows that Dif approximates Dig to optimal order. ..g(:c). . we can obtain zero error at certain sites simply by interpolating at these sites. Here. Assume further that the collocatipn pattern p = (pi)? in the standard interval [-—-1 . .H.z+1. the approximation is of even higher order. . . . This does not deny the possibility that we obtain a much better approximation at certain sites. Our statement that the order O (|§|"""""'°) is best possible for dist (g. i= O. . 1. EQBLUK. _‘i<I1T1 The almost block diagonal character of the system of collocation equations. Z5 j = 0.. PUTIT We express the unknown function -y in (9) as a linear combination of appropriate B-splines.. solution f. . and each interior break £2. E3-=1()6-..._.. with the abbreviation Ly := Dmy + Z: '03. and it) that contains each of £1 and £. .. ..1 is + m times. . 9) 3'-cm - iaiyzcii where (10) ’zl':.(D""_'1f-.. (ow-1f. kt. .k+m.: 1. This means that (4) has a. .. . _ =1. .-(:1:):=(g-€)(:1:.=. This gives the linear system (12) E?=1 (LBj)(Ti)(Ij -"= h.m_£ H C("""1) of the linear problem ( (D'"'y)(1'.1= (On l§1 ..|.1 246 XV.)(a)) + Z‘ 1. Then..1<t-z.§£+1l)- ‘ The solution y of (9) can therefore be written in the form 11 Z] = _. ‘I"'—l'C. ..t: 1: that is. .|..Djy 3<m L it-I - l .= lim 2. Collocation sufficiently close initial guess fg (provided F is sufficiently smooth and |§| is sufficiently small).-.r'n'i’: 1. .1 the solution y G 1'I<k. ..’l'TL. '0. .).)(D-lg) (Ti) = h('r. and H<k+m=€ n Cunfil) = $k+m... Explicitly.-_f. n = kl + m. we can determine y by determining its B-coefficient vector o1. .]-1"".)'£"+"°+"‘ be the nondecreasing sequence -(generated in the subprogram KNOTS below from . it times. .)(:1:). and (11) h(a:) == Fa.Bj)(Ij C-5 H ‘= . let t := (t...5. f.f.-(s.‘)(Djf. ’Z-"=l._)(m)). -J C-!jB'§l.. m.m — 1.(11...|.'IJI‘1 with f.. .(:1:).(:1:).-) + Z v_.1. if.»(T-3). x x:-cx®x:-cx x x:-c@x x xx:-c@x xi-c®xx x®xxx ®:-(xxx Matrix for collocation equations for (m. After it elimination steps in the first block.4. We see that the total space required for each block is found by taking . there will be again just one such equation) and adjoin them to the third block. The ith block corresponds to the ith polynomial piece.l. if we are dealing with a second-order two-point boundary-value problem and approximate by pp functions of order 6 with 4 pieces. etc. After that.'.4) (left). an interchange might bring in an equation from the next block. §. given explicitly by (10). So we take all equations in the second block not yet used as pivot equation (in our example above. and the rows of the ith block are made up of the lc collocation equations at sites in the interval (5.+1). We therefore take all equations not yet used as pivot equation (in our example above. the (matrix of the) linear system (12) has the form given in the left half of Figure (13). h by (11)._|_1). that is. The columns of the ith block correspond to the It + m B-splines that have this interval in their support. and in its almost block diagonal form (right). and fir by If the side conditions are appropriately distributed among the collocation equations.. !. then.. The next k steps will take place entirely within the second block. We then continue the elimination process. indicating only the possibly nonzero entries. x x:-cx x x:-cx x :-cx x x:-cx xxx:-c® xx:-c®x xx®xx x®:-txx x x:-cx x x x x:-cx x x x x:-c xxx:-c x x:-c®x :-cx >-:xx®xx:xx®x -cxxi x®xx x x:-cx x x x:-cx x xxx:-c x x:-1: x x:-c®x x x x®x:-cx xx®x x®:-cx x x:-cx x x x x:-cx x x x x:-cx x x:-cx x x:-cx x x:-cx (13) FIGURE.The almost block diagonal character 24'?’ and '0. an interchange might bring in an equation from the next block..k) = (2. . there will be just one such equation) and adjoin them to the second block. together with the (properly interspersed) side conditions (if any) at sites in thisinterval.. This makes sense since these equations now have nonzero entries only in the columns that belong to the second block. Consider now Gauss elimination with partial pivoting applied to the linear system (12). to the interval (£1 . then (12) is an almost block diagonal system. For instance. Here.In an Appendix. - ioino o o on no -1-?rm. OF SIZE (3._. This is shown in the right half of Figure (13) for the above example. The details about the specific differential equation to be solved are left here to: a subroutine DIFEQU. THE ORDER OF THE APPROKIMATING SPLINE LENBLK THE MAXIMUM LENGTH OF THE ARRAY BLOKS AS ALLOWED BY THE DIMENSION STATEMENT IN COLLOC ._. STORED IN ALMOST BLOCK DIAGONAL FORH.. -— . .-Z'L. for the efiicient solution of such almost block diagonal linear systems.I) = NUMBER OF RUNS IN BLOCK I = NUMBER OF COLUMNS IN BLOCK I = NUMBER OF ELIMINATION STEPS HHICH CAN BE CARRIED OUT IN BLOCK I BEFORE PIVOTING MIGHT BRING IN AN EQUATION FROM THE NEXT BLOCK. _ BLOKS THE COEFFICIENT MATRIX OF THE LINEAR SYSTEM.... OF SIZE KPM*SUH(INTEGS(1.-_- » 4-. for putting together blocks and right sides for the linear system (12)._ -- _ 1-+Hr_. STORED CORRESPONDING TO THE ALMOST BLOCK DIAGONAL FORM.M+1) sesame .. NBLOKS.£§ __-in-? 248 XV._.KPM) ussp IN PUTIT. NBLOKS NUMBER OF BLOCKS.I) INTEGS(2. I=1. an example of which is given below in Example (15).I) . .BSPLVD(BSPLVB)) C TO BE CALLED IN C O L L O C C HORK1..‘- mm . Collocation the block formed by the it + m columns and the rows associated with an interval and extending this block toward the top until its left corner element is an element of the (main) diagonal of the whole matrix. cacao H O R K mamas O U T P U T uoax1 uoaxa A R E A S amass: ussp IN PUTIT. . they are filled during the elimination process.-___..I) . N. OF LENGTH N+KPM N THE DIMENSION OF THE APPROXIMATING SPLINE SPACE. I=1.-._.E. The additional rows at the top of each block need not be set initially. DESCRIBING THE BLOCK ono n o n on STRUCTURE. OF SIZE SUH(INTEGS(1. NBLOKS). B ) - Caaaaaa I H P U T a#aa## C T THE KNOT SEQUENCE.I) INTEGS(3. . . * BLOKS. INTEGS(1.. or srzs (KPM. CALLS PUTIT(DIFEQU. LENBLK... KPH = K+H._.-----_. we now give the subprogram EQBLOK and its subroutine PUTIT._... THE ORDER OF THE LINEAR SYSTEM TO BE CONSTRUCTED. HORK2.-... I. -_ ---.. EQUALS NUHBER_OF POLYNOMIAL PIECES B THE RIGHT SIDE OF THE LINEAR SYSTEM.. called SOLVEBLDK. KPH. or srzs (KPM.NBLOKS) INTEGS AN INTEGER ARRAY. _..11.NBLOKS).. we give a listing of a package of programs. SUBROUTINE EQBLOK ( T. INTEGS. ADDING TO THIS THE SIDE CONDITIONS IN THE CURRENT INTERVAL GIVES THE NUMBER ISIDEL . ISIDE.) STOP 49 .LT. IN THE LAST BLOCK. N) GO TO 14 INTEGS(3. T(LEFT+1)) GO TO 16 ISIDEL = ISIDEL+1 16 . HE CAN CARRY OUT (IN SLVBLK) K ELIMINATION STEPS IN A BLOCK BEFORE PIVOTING MIGHT INVOLVE AN EQUATION FROM THE NEXT BLOCK.INDE1B. AND NCOL = KPM COLUMNS. CORRESPONDINGLY.ISIDE q .M.N.ITERMI. NITH ISIDEL = NUMBER OF SIDE CONDITIONS IN THIS AND THE PREVIOUS INTERVALS.LENBLK 699 FORNAT(11H etaaoeetat/23H THE ASSIGNED DIMENSION.I) = KPH 1F (LEFT . FURTHER.NBLOKS. BECAUSE THE INTERIOR KNOTS HAVE HULTIPLICITY K.LENBLK.HORK2. I.I) = K AT THIS POINT.NROH.K.I) INTEGS(2.T(N+K).HORK2(1).N. AND INVOLVES THE KPM B—SPLINES HAVING THE INTERVAL IN THEIR SUPPORT. SUCH A BLOCK HAS NROH I K + ISIDEL ROHS.EQ.EQUATIONS IN THE INTERVAL HITH THE SIDE CONDITIONS (IF ANY) IN THE INTERVAL INTERSPERSED APPROPRIATELY.LT.IsIDEL. ISIDEL = ISIDE—1 15 IF (ISIDEL . ALL KPM ELIMINATION STEPS HILL BE CARRIED OUT (IN SLUBLK).XSIDE COMMON /SIDE/ M.BLOKS(INDEX).K I = I+1 DETERMINE INTEGS(. 1 GO TO 15 NRON = K + ISIDEL INTEGS(1.HORK1.LEFT. XSIDE(10) COMMON /OTHER/ ITERMX.B(INDEIB)) INDEX = INDEX + NROu*KPM 20 INDEKB = INDEKB + NROH NBLOKS = I RETURN 999 PRINT 699.38H FOR END BLOKS IN COLLOC IS TOO SMALL. RHO. M) # GO TO 16 IF (XSIDE(ISIDEL+1) . Ofiflfi fi flfi fi fl SEE THE DETAILED COMMENTS IN THE SOLVEBLOK PACKAGE FOR FURTHER INFORMATION ABOUT THE ALMOST BLOCK DIAGONAL FORM USED HERE. EACH BREAKPOINT INTERVAL GIVES RISE TO A BLOCK IN THE LINEAR SYSTEM.INDEX. 1 INTEGER INTEGS(3.GE..I5 A .KPM. ISIDE—1 GIVES THE NUMBER OF SIDE CONDITIONS INCORPORATED SO FAR.LEFT.1).I) = KPM ISIDEL = M 14 GO TO 16 INTEGS(3. OF COURSE.I) = NROH THE DETAILED EQUATIONS FOR THIS BLOCK ARE GENERATED AND PUT TOGETHER IN P U T I T .K.BLOKS(1)."I41*!- l The subroutines EOBLOK and PUTIT Caameaa H E T H O D aaaaaa . A IF (LENBLK .NROH REAL B(1).RHO(1e) INDEX = 1 ' INDEXB = 1 I = 0 ISIDE = 1 DO 20 LEFT=KPM. INDEX+NROH*KPM—1)GO TO 999 CALL PUTIT(T.HORK1(1). THIS BLOCK IS DETERMINED BY THE K“ COLLOC.KPM. T(LEFT+1)) IN THEIR SUPPORT.DIFEQU(*) c TO BE CALLED BY E Q B L 0 K .M+1 10 c c c c c no 10 J=1. .ISIDE no so IROH=LOHROH.xsInE. THE NEXT COLLOCATION POINT.KPM) . SCRTCH. on TO THE LEFT OF.COLLOCATION EQUATION IS nsxr UNLESS THE NEXT SIDE CONDITION-OCGURS AT A POINT AT.M. c C PUTS TOGETHER ONE BLOCK OF THE COLLOCATION EQUATION SYSTEM C Coamaec I H P U T mecca: T KPM LEFT snow KNOT ssnusncs. O O O O O OCEO OQO O OQO O QO INTEGER KPM.MP1 REAL B(1).NROH IF (LL ..K.ITERMX.1). THE FIRST EQUATION IN THIS BLOCK NOT OVERLAPPED BY THE PRECEDING BLOCK IS THEREFORELEOUATION L O H R O H . .SCRTCH(1). LL .fl XX I KM + DX#RHO(LL) ‘i LL . Collocation SUBROUTINE PUTIT ( T.J.ISIDE.LL + 1 THE CORRESP. IF (ISIDE .K. I. ..(T(LEFr+1)—T(LEFT))/2.NROH.. ) AND INTERSPERSED (IN ORDER) HITH THE SIDE CONDITIONS (IF ANY) IN rurs INTERVAL. or SIZE LEFT+KPM (AT LEAST) onnsn or SPLINE . KM . THE BLOCK Q HAS KPH COLUMNS. OF SIZE (NROH) cameo M E T H U D- ceases THE K COLLOCATION EQUATIONS FOR THE INTERVAL (T(LEFT)-.J) .LOHROH.RHO.KPM). THE BLOCK’S DIAGONAL IS PART OF THE DIAGONAL OF THE TOTAL SYSTEM. KPH.RHO(19) MP1 .T(1). XSIDE(10) cannon /OTHER/ ITERMK. Q. K) co TO 22 MODE = 2 NEXT COLLOCATION POINT IS . ISIDE.250 XV. v ) . LEFT. s ) CALLS BSPLVD(BSPLVB).. . OF SIZE (KPM.. . ox . DX.LEFT. > FOR THE INFORMATION. vrz THE INTERVAL (T(LEFT).1 - Lownov .xx cannon /SIDE/ M.GT. CORRESPONDING TO THE KPH BSPLINES OF ORDER KPH HHICH HAVE THE INTERVAL (T(LEFT).1SIDE(ISIDE) 24 CALL DIFEQU ( MODE.DBIATX(KPM.v(2o>. OF SIZE (NRON.B THE CORRESPONDING PIECE OF THE RIGHT SIDE.T(LEFT+1)) ARE CONSTRUCTED HITH THE AID OF THE SUBROUTINE D I F E O U ( 2.NROH O(I.. xx.LL — 1 22 MODE .M+1) NITH DBIATX(J. usrnc p I F E q u < a.KPM no 1o I=1.0.IROH. xx) co TO 24 LL . Nsov.SUM A . INTEGER INDICATING INTERVAL or INTEREST.Q(NROH.I+1) CONTAINING THE I—TH DERIVATIVE OF THE J—TH B-SPLINE OF INTEREST mecca 0 U T P U T mttttt Q THE BLOCK.3 II .T(LEFT+1)) ' NUMBER or Rows IN BLOCK TO BE PUT TOGETHER mecca H U R K A R E A assume 1 SCRTCH USED IN BSPLVD.xM.(T(LEFT+1)+T(LEFT))/2. DBIATX.LL.GT. OF SIZE (KPMTKPM) DBIATX USED TO CONTAIN DERIVATIVES OF B—SPLINES. M) GO TO 24 IF (XSIDE(ISIDE) .GT.MODE # . HITH LOHROH = 1+ NUMBER OF SIDE CONDITIONS IN PRECEDING INTERVALS (OR BLOCKS). . that is. One can obtain these recurrence relations by substituting a j for the Fr: in each of the exponents in IX(17). CALL BSPLVD ( T. HP1 ) so 26 J=1."D‘lBi. = (k -" ll . we then obtain that k — ‘— 1 (14 ) :17--1? - fi- k ——. One way is to work with the recurrence relation for the derivatives of a B-spline. L..)-3. THE CORRESPONDING EQUATION FUR THE B—CDEFFS BF F THEREFORE HAS THE LEFT SIDE OF (w). -u I. as has been advocated by Cox (see ref.KPH sun = 0. SCRTCH.' - -"--'—". EVALUATED AT EACH OF THE KPH B—SPLINES HAVING xx IN THEIR SUPPORT.' (k .1=-1(~T')+ .- FI E.The subroutine BSPLVD I 251 THE NEXT EQUATION.._'..I} + sun Q(IRUH.=‘3i+k](' — IF)li_'l_1= Ty. 2 of Butterfield [1976]).5).1.HP1 sun = V(I)*DBIATX(J.J) = sum B(IHOH) = v(M+2) RETURN END The subroutine BSPLVD Construction of the linear system (12) for the B-coefficients of a Newton iterate requires knowledge of the values and the first m derivatives of all the B-splines on t of order k + m at ail the collocation sites as well as at all side condition sites.e)-3.+ v(1)*s~*0)P(xx) .‘ = (1: -_ em .+""'"—"'D'lB£+1. DBIATX. KPH. READS (v(H+1)*D**H + V(H)*D**(H-1) +.k-1($l73-I+1:-1 "' ti ti+k . There are two possible ways (at least) for generating their derivatives as well. The subroutine PUTIT above relies for this information on a subroutine BSPLVD that we now discuss.“ I (see Problem X. » (1: .1‘I.73i+1 Another way is to consider a B-spline to be a spline with a particularly . i@_.v<H+2> IN TERMS OF THE INFO SUPPLIED BY DIFEQU . AS Irs KPH POSSIBLY NUNZERO COEFFICIENTS. xx. Since I. LEFT. by applying Leibniz’ formula I(iv) for the kth divided difference of a product to the particular product |.. DU 25 I=1..7')(-)jl'3i1. We already know how to generate the values of the k B-splines of order is at a given site in the (closed) support of these B-splines. A CDLLUCATIUN EQUATION (HDDE I" 2) DR A SIDE (*) OOOOOFJO 25 26 so CONDITION (MODE = 3). DBIATX. X.FKP1HH.. K. access OF ALL THE RELEVANT B—SPLIHES OF ORDER K.1) HHIGH IS USUALLY EQUAL TO NDERIV.LEFT.-.LE. ITS ENTRY VALUE OF (H—1)ST ORDER FOR KNOT SEQUENCE K H E T H O D VALUES AT X DERIVATIVE OF (I. TU CONTAIN B—COEFF .X.H. A.KP1. I. ' mecca Q U T P U T_ mecca: DBIATX mecca AN ARRAY OF ORDER (K. EACH FROH THE PRE-' CEDING ONE OF LOHER ORDER.K) CLOSEST TO IT. A S S U H P T I O N — * .NDERIV). x .l:..K).SUH HHIGH = MAXU(HINO(NDERIV.LE. _ - KP1 = K+1 CALL BSPLVB(T..NDERIV.1.J. THESE ARE STORED IN COLUMN K+1-CURRENT ORDER BEFORE BSPLVB IS CALLED TO PUT VALUES FOR THE NEXT HIGHER ORDER ON TOP OF IT.KP1MH . We have chosen this latter approach in the following subroutine BSPLVD.K. Support for this choice can be found in a rounding error analysis of these two (and other) alternatives as carried out by Butterfield [I976]. OF LENGTH LEFT+K (AT LEAST) C T K THE ORDER OF THE B—SPLINES TO BE EVALUATED X THE POINT AT HHICH THESE VALUES ARE SOUGHT LEFT AN INTEGER INDICATING THE LEFT ENDPOINT OF THE INTERVAL OF INTEREST. ( NDERIV IS REPLACED INTERNALLY BY THE INTEGER H H I G H IN (1.JLON.DBIATX(K. THE OUTPUT IS AS ADVERTISED ONLY IF T(LEFT) ..KP1—HHIGH. ALSO. I=1.H) (LEFT—K+I)—TH CONTAINS B—SPLINE OF T . Collocation simple B-coefficient sequence and use X(15) to express the jth derivative of the spline as a linear combination of B-splines of order k —— j.T(1). THEN.HHIGH REAL A(K.. NDERIV ) CALLS BSPLVB CALCULATES VALUE AND DERIV..252 XV. fi fi fi fifgfiOflfii fi fifgflfi fi fi fi fi fi fi fi H c INTEGER K..LT.._am" r-_ '-. K) . K+1—NDERIV ARE GENERATED VIA BSPLVB AND STORED TEMPORARILY IN _DBIATX .S OF ALL B—SPLINES WHICH DO NOT VANISH AT X C Cmmmmmc I N P U T messes THE KNOT ARRAY ..IT IS ASSUMED THAT T(LEFT) .T(LEFT+1)) ARE TO BE CONSIDERED.K). AN INTEGER INDICATING THAT VALUES OF B—SPLINES AND THEIR NDERI v DERIVATIVES UP TO BUT NOT INCLUDING THE NDERIV—TH ARE ASKED FOR. SUBROUTINE BSPLVD ( T.DBIATX) cc TO es IF (HHIGH ..LDUHHY.IDERIV..£t_L.-FL 1-an_-1|-I -5_a-_. THE B—COEFFS OF THE REQUIRED DERIVATIVES OF THE BSPLINES OF INTEREST ARE GENERATED BY DIFFERENCING. FACTOR. S OF THE DERIVATIVES OF A CERTAIN ORDER OF THE K B-SPLINES OF INTEREST. H*1.X.. T(LEFT+1) DIVISION BY ZERO HILL RESULT OTHERWISE (IN B S P L V B ).LEFT. K B"SPLINES WHOSE SUPPORT CONTAINS THE INTERVAL (T(LEFT). LEFT. T(LEFT+1) .K—1..EQ.NDERIV. _| .) cccmm IH- H O R K A R E A access AN ARRA Y OF ORDER (K . IDERIV = HHIGH H.IL. AND COMBINED HITH THE VALUES OF B-SPLINES OF CORRESPONDING ORDER IN DBIATX TO PRODUCE THE DESIRED VALUES .NDERIV). 1) GOOD THE FIRST COLUMN OF DBIATX ALHAYS CONTAINS THE B—SPLINE VALUES FOR THE CURRENT ORDER.JP1HID. THE. JLOW = MAXO(I.1 ~ I = I . AT THIS POINT. BY DIFFERENCING.. via (9).I) = O FOR J .1 '? FOR I=1.HHIGH KP1HH = KP1 — M FKP1MH = FLOAT(KP1MH) IL = LEFT I=K 00000 c c 24 25 r. C C C DO 40 H=2. AND STORE IN DBIATX(I..1) 11 JP1MID = JPIHID + 1 IDERIV = IDERIV — 1 CALL BSPLVB(T. GENE" RATE THEIR B—REPR. B(LEFT—K+I.J) .J) CONTAINS THE B—COEFFS FOR THE J—TH OF THE K B—SPLINES OF INTEREST HERE... 20 A(I..LT.. A(. STORAGE OF THIS VALUE OVER THE VALUE OF A B—SPLINE OF ORDER M THERE IS SAFE SINCE THE REMAINING B-SPLINE DERIVATIVES OF THE SAME ORDER DO NOT USE THIS VALUE DUE TO THE FACT THAT A(J.K AND J=1.HHIGH (’=’ NDERIV). J Is ussn..K DO 19 J=JLOW.K. that is....A(I—1. COMBINE B—COEFFS A(. consrnucr B—COEFFS OF (H—1)ST DERIVATIVE or B—SPLINES FROM THOSE FOR PRECEDING DERIVATIVE BY DIFFERENCING AND sruns AGAIN IN A(. FUR J=1..I) = O. It . JLOW = I ..15 COLLOC and its subroutines ’ The following subroutine COLLOC over- sees the iterative solution of (4) by Newton’s method..M).IDERIV) = DBIAT1(JP1HID. C'JC'J€"J("JC'JC'l("J JLOW = 1 DO 20 I=1. no 25 LDUHMY=1.K SUM = A(J.I) = 1. THEN EVALUATE AT X..X.I A(I. DO 40 I=1.H) + SUM DBIATX(I.J) .KP1-IDERIV...IN PARTICULAR.DBIATX) 15 CONTINUE AT THIS POINT.LT. TO OBTAIN CORRESPONDING DERIVATIVES OF B—SPLINES IN SUBSEOUENT COLUMNS.COLLOC andi its subroutines 253 | ‘I DO 15 M=2.K DBIATX(J..I) WITH B-SPLINE VALUES STORED IN DBIATX(.H) TO GET VALUE OF (H—1)ST DERIVATIVE OF ITTH B-SPLINE (OF INTEREST HERE) AT X .M) = SUM RETURN 35 40 99 END . K+1—J)(X) IS IN DBIATX(I. I .2.HHIGH JPIHID = 1 DO 11 J=IDERIV.KP1MM FACTOR = PxP1HH/(T(IL+HPiHH) — T(IL)) THE ASSUMPTION THAT T<LEPT)..H) DO 35 J=JLOW..J))*FACTUR IL = IL . THE FIRST COLUMN OF DBIATX IS ALREADY IN FINAL FORH.J) = (A(I.K.J) FOR I=J.LEFT. THE FACT THAT A(I.I)*DBIATX(J. no 24 J=1.K ' OGCJCJO O SUM = O.LT.J) = 0 FOR I .T(LEPT+1) MAKES DENOHINATOR IN FACTOR NONZERO.K 19 A(J.. Q U .ARIGHT. THE RESULTING LINEAR SYSTEM FOR THE B—COEFFS OF AN ITERATE'IS CONSTRUCTED APPROPRIATELY IN E Q B L O H AND THEN SOLVED IN S L V B L K .ISIDE ITER. THEN A BREAKPOINT WILL BE ADDED AT EVERY THIRD PASS THROUGH NEWNOT. ARIGHT ENDPOINTS or INTERVAL OF APPROXIMATION INITIAL NUMBER OF POLYNOMIAL PIECES IN THE APPROXIMATION. EXAMPLE.ERR. EQBLOK(PUTIT(DIFEQU*.LENBLK=NCOEF) REAL ADDBRK. IF ADDBRK = . KNOTS. SLVBLK(VARIOUS SUBPROGRAMS). C NEWNOT V C Ctcummm I H P U T ###### C ALEFT.II.LBEGIN.EREAH.LARGEST B—COEFFICIENT).NDIM. A subroutine DIFEQU must be supplied for each specific ODE to be solved. listed in an Appendix.ALEFT. NEWTON ITERATIOg IS STOPPED IF THE DIFFERENCE BETVEEN THE B—COEFFS OF TWO UCCESSIVE ITERATES IS no MORE THAN RELERR*(ABSOL. LBEGIN IORDER NTIMES ADDBRK RELERR A UNIFORM BREAKPOINT SEQUENCE. THE APPROXIMATION F TO THE SOLUTION G IS PP OF ORDER K+M WITH L PIECES AND M-1 CONTINUOUS DERIVATIVES.INTEGS(3. Colloéili-Lion relies on KNOTS to convert break sequences to knot sequences and uses COLPNT to supply the Gauss-Legendre sites as collocation sites p for the standard interval.G. _A(NDIM).254 XV. SUBROUTINE COLLOC(ALEFT. 1S SOLVED APPROXIMATELY BY COLLOCATION.NT PARAMETER (NDIM=200.LNEW.ELOHs(LEnELK).NBLOKS T r # .IS CHOSEN.assa4.LBEGIN. and uses the package SOLVELOK.IFLAG. DIFEQU(PPVALU(INTERV)).ASAVE(NDIM) c . THERE IS AN OPPORTUNITY TO ATTEMPT IMPROVEMENT OF THE BREAKPOINT SEQUENCE (BOTH IN NUMBER AND LOCATION) THROUGH USE OF N E W N O T .AMAX.Dx. It uses EQBLOK with PUTIT to put together the linear system (12).NCOEF=NPIECE#KMAX.KMAX.KMAX=20. XSIDE(10) COMMON /OTHER/ ITERMI.N. F IS DETERMINED BY THE REQUIREMENT THAT IT SATISFY THE D. A TOLERANCE.NPIECE. I.RHD. A PROGRAM DESIGNED TO SOLVE A L M U S T B L O C K D I A G O N A L LINEAR SYSTEMS EFFICIENTLY.T(NDIH) * I TEHPL(LEnELH) TEMPS(NDIM) xsIDE I EQUIVALENCE (BLORS.ARIGHT. THIS USUALLY NONLINEAR SYSTEM OF EQUATIONS FOR F IS SOLVED BY NEWTON’S METHOD.M.NTIMES.NPIECE).NNCOEF. ##### M E T H U D ###### THE M-TH ORDER ORDINARY DIFFERENTIAL EQUATION HITH M SIDE CONDITIONS. E.RELERR) CHAPTER XV. AT K POINTS PER INTERVAL (TO BE SPECIFIED IN C O L P N T ) AND THE M SIDE CONDITIONS.cOEF. COHF(NCOEF). L. TO BE SPECIFIED IN SUBROUTINE D I F E.NTIMES. AND OF THE ERROR AT SELECTED POINTS.RELERR. ****# P R I N T E D O U T P U T ****** CONSISTS OF THE PP—REPRESENTATION OF THE APPROXIMATE SOLUTION.E(NDIH).L.TEMPL) I "- ~1 COMMON /APPROX/ BREAK(NPIECE). SOLUTION OF AN ODE BY COLLOCATIONCALLS COLPNT.K. ORDER OF POLYNOMIAL PIECES In*THE APPROXIMATION NUMBER OF PASSES THROUGH n E W n 0 T TO BE MADE THE NUMBER (POSSIBLY FRACTIONAL) OF BREAKS TO BE ADDED PER PASS THROUGH NEWNOT. ISIDE. C BSPLVD(BSPLVB)))).IORDER. to solve (12).K.KPM.E. BSPLPP(BSPLVB*)..ITERMX. O O O O Oflfi fi flilflfi ilfi fl flfifl OD INTEGER NPIECE PARAMETER (NPIECE=100) INTEGER IORDER.ADDBRK.NCOEF. It also calls on NEWNOT (of Chapter XII) for possible improvement of the chosen break sequence.RHO(KMAX—1) C .KPM COMMON /SIDE/ M.LENBLK. GT. BREAKPOINTS -/(5E2O. O) .N. so 630 ess I es? —— Igill-“I F-A.IFLAG) ITER = 1 IF (ITERMX . IN CASE THE DE Is TO BE SOLVED BY ITERATION ( ITERHx . HPH. RHO ) AAA THE FOLLOWING FIVE STATEMENTS COULD BE REPLACED BY A READ IN ORDER TO OBTAIN A SPECIFIC (NONUNIFORM) SPACING OF THE BREAKPNTS. LBEGIN.KPM) FORMAT(F9.B) CALL SLVBLK(BLOKS.KPM... AND COMPARE WITH OLD. TEHPs > AAA OBTAIN THE K COLLOCATION POINTS FOR THE STANDARD INTERVAL.INTEGS.ALEFT)/FLOAT(LBEGIN) TEHPs(1> = ALEFT DO 4 I=2.B. KPM .BREAK.. IN ASAVE . DO 26 I=1. BREAK(I).> CALL BSPLPP(T.N 25 ASAVE(I) = A(I) CALL EQBLOK(T.3H OF.L. 1) GO TO 3O ### SAVE B-SPLINE COEFF.2OH ALLOWED ITERATIONs. THE REQUIRED KNOTS T(1). NCOEF) C C C C C C C GOOD C'Jf'JC']C'] GO TO 999 AAA SET THE VARIOUS PARAMETERS CONCERNING THE PARTICULAR DIF. cALL DIFEQU <1. IN KNOTS. 1O CALL EQBLOK(T. ARE MORE THAN RELERR APART (RELATIVELY} OR IF NO.L) FORMAT(47H APPROXIMATION FROM A SPACE OF SPLINES OF ORDER.A. OF CURRENT APPROX.L) PRINT es? FORMAT(46H THE PP REPRESENTATION OF THE APPROxIHATION Is) DO as I=1.6.(COEF(II+J).N. BASED On CURRENT c EREAHPOINT SEQUENCE. TEHPs(1).-f -.3) 255 .B) CALL SLVBLK(BLOKS.TEMPL.GT.COEF. A .INTEGS.I3.A.N.INTEGS.LBEGIN 4 TEMPS(I) A TEMPS(I-1) + Dx TEHPs(LsEOIn+1) = ARIGHT AAA GENERATE.EQU.A.KPM.(BREAK(I).L) DO 25 I=1. OBTAINING THE B-REPRESENTATION OF THE APPROXIMATION IN T .N.I4 ./13H OF DIMENSION.KPM.TEMPS. O) PRINT 635. CALL KNOTS < TEHPs.11H INTERVALS.4H On .ABS(A(I))) 26 ERR = AMAX1(ERR. ITERMX) GO TO 20 c AAA ITERATION (IFAANY) COMPLETED.P" COLLOC and its subroutines KPM = IORDER IF (LBEGIN#KPM .LENBLK. n > NT = 1 ### GENERATE THE ALMOST BLOCK DIAGONAL COEFFICIENT MATRIX BLOKS AND RIGHT SIDE B FROM COLLOCATION EQUATIONS AND SIDE CONDITIONS.L II = (I-1)*KPM PRINT ess. Dx = (ARIGHT .TEMPL. THEN SOLVE VIA SLVBLK .1O)) IF (ITERHx .T(N+KPM). IF COEFF. T. THEN TRY TO IMPROVE THE SEQUENCE. PRINT OUT APPROX.N AMAX = AMAX1(AMAX.BLOKS.ITER..ITERMX FORMAT(6H AFTER.KPM. CONTINUE ITERATINGA .B.A.A.LE.LT.TEMPS.GT.I3.ABS(A(I)-ASAVE(I))) IF (ERR . INCLUDING A FIRST APPROx. THEN GET NEH APPROX.E13.COEF.1sH.INTEGS. OF ITERATIONS IS LESS THAN ITERMX .NBLOKS.N. 20 CALL BSPLPP(T.BREAK. AMAX = O.IFLAG) ERR = O.NBLOKS.TEMPS.BLOKS.I=2.TEMPS.NBLOKS.I3 .M cALL COLPNT ( K.LE.NBLOKS. H = KPM .1OE11..|-Innan- as ess A A PRINT 630.KPM.I3. N .J=1.3.A. RELERRAAMAX) GO TO 30 ITER = ITER*1 IF (ITER .LENBLK. .—|.T(N+KPM) BREAK(1) KPM TIMES THEN BREAK(2) BREAK(L) EACH K TIMES THEN FINALLY BREAK(L+1) KPM TIMES iittt I N P U T BREAK(1) ##1##: BREAK(L+1) BREAKPOINT SEQUENCE L NUMBER OF INTERVALS OR PIECES KPM K + M ORDER OF THE PP FUNCTION OR SPLINE mama: T 1) O U T P U T T(N+KPM) L#K + M tctcms THE KNOT SEQUENCE DIMENSION OF SPLINE(K+M T) fi fifgfi fi fgflfi fi fi fl INTEGER L KPM N ISIDE J JJ JJJ K LL M REAL BREAK(1) T(1) XSIDE COMMON /SIDE/ M ISIDE XSIDE(10) KPM N = L*K + M JJ = N + M JJJ = L + 1 DO 11 LL 1 KPM T(JJ) BREAK(JJJ) 11 JJ = JJ DO 12 =1 JJJ = DO 12 LL=1 K T(JJ) 12 BREAK(JJJ) JJ = JJ 1 DO 13 LL 1 KPM T(LL) BREAK(1) RETURN D -1-n. . .—-un.-.256 XV CDll0C&Tl0H ### THE FOLLOWING CALL IS PROVIDED HERE FOR POSSIBLE FURTHER ANALYSIS OF THE APPROXIMATION SPECIFIC TO THE PROBLEM BEING SOLVED IT IS OF COURSE EASILY OMITTED CALL DIFEQU ( 4 TEMPS(1) TEMPS ) I-1. . IF (NT GT NTIMES) RETURN ### FROM THE PP-REP OF THE CURRENT APPROX OBTAIN IN NEWNOT A NEW (AND POSSIBLY BETTER) SEQUENCE OF BREAKPOINTS ADDING (ON THE AVERAGE) A D D B R K BREAKPOINTS PER PASS THROUGH NEWNOT LNEW LBEGIN + IFIX(FLOAT(NT)*ADDBRK) IF (LNEW*KPM GT NCOEF) GO TO 999 CALL NEHNOT(BREAK COEF L KPM TEMPS LNEW TEMPL) CALL KNOTS(TEMPS LNEW KPM T N) NT = NT + 1 GO TO 1O 999 NNCOEF NCOEF PRINT 699 NNCOEF 599 FgRflAT(11H AAAAAAAAAA/23H THE ASSIONED DIMENSION I5 T I 25H FOR COEF IS TOO SMALL ) RETURN END SUBROUTINE KNOTS ( BREAK L KPM T N ) TO BE CALLED IN C O L L O CONSTRUCTS FROM THE GIVEN BREAKPOINT SEQUENCE B R E A K THE KNOT SEQUENCE T SO THAT SPLINE(K+M T) PP(K+M BREAK) WITH M-1 CONTINUOUS DERIVATIVES THIS MEANS THAT T(1). ?ss55 54774.RHO(3) RHO(2) = 0.RHO(4) = . BUT PRINT WARNING PRINT 699.BO).) FKM102 = FLOAT(K-1)/2.9061? 98459 38664 = — RHO{5) = 0.1ss4s 45424 — RHO{5) . FKMIO2 IF (K GT. INTEGER K.86113 63115 RHO(1) = .RHO(5) . 8. OTHERNIEE.9491O 79123" 42759 .LE.60. UNIFORMLY sPAcED POINTS ARE GIVEN.93246 95142 03152 RHO(1) = .23861 91860 83197 RHO(3) = — RHO(4) RHO(5) = .405s4 51513 77397 .?415s 11555 99394 .50. 1) ARE sUP~ PLIED HERE AS THE zEROs OF THE LEGENDRE POLYNOMIAL OF DEGREE K . PROVIDED K . RETURN RHO(4) = . J REAL RHO(K).RHO(5) .I2.1 END RETURN 257 _--1.K RHO(1) = O. 8) GO TO es GO TO (10. 19H IS GREATER THAN 8. RHO(5) RHO(4) RHO(6) RHO(3) RHO(7) RHO(2) RHO(8) RHO(1) C = = = = = = = = .I COLLOC and its subroutines SUBROUTINE cOLPnT(H.RHO) THE K COLLOCATION POINTS FOR THE STANDARD INTERVAL (-1.5255s 24099 .66120 93864 66265 RHO(2) = — RHO(5) RHO(6) = . RHO(3) = .9602B 93554 — RHO(8) RETURN 95650 16329 1362? 97536 RETURN F K . . USE EQUISPACED POINTS.RHO(4) RHO(4) RHO(2) RHO(5) RHO(1) RHO{s) RETURN 94053 RETURN = .RHO(6) = RHO(3) = RHO(6) = RHO(2) = RHO(7) = RHO(1) = RHO(5) .RHO(7) .20.RHO(7) RETURN RHO(4) = 0. rh—-m .K 699 FORMAT(11H ccmcsmmmmmf 49H EQUISPACED COLLOCATION POINTS ARE USED SINCE K =.33998 10435 84856 RHO(2) = — RHO(3) RHO(4) = .30. 5 .?0.40.?7459 66692 41483 RHO(1) = .K 100 RHO(J) = FLOAT(J-1)/FKM102 .57?35 02691 RHO(1) = — RHO(2) RETURN 89626 RETURN RHO(3) = . DO 100 J=1. RHO(2) = .RHO(5) .53846 93101 05683 = .GT. RHO.S2OVEP.becomes E?J”(T-i) + 'vO(T-£)?J('T-.NCOEF. . The following subroutine DIFEQU incorporates this information in a form expected in COLLOC and PUTIT.|.EP1.L.X.FACTOR.XK.contains the above formula for g.L.-. SUBROUTINE DIFEQU ( MODE.<A>. INITIALIZATION EVALUATE DE AT XX SPECIFY THE NEXT. Collocation (15) Example: A second order nonlinear two-point boundary-value problem with a boundary layer '%his example is taken from Dodson [1972] who took it from Carrier [1970]. -The function to be approximated is specified by Eg”(2r) + [g($)]2 = 1 on [0 ./E) which cannot be evaluated on a UNIVAC 1110 in single precision (roughly 8 decimal places) without underflow in (case E is much smaller than 10"2 / 2.K.M.ISIDE.KMAX.. BREAK.1k£1 y’(°) = 11(1) = 0.ERROR. NCOEF=NPIECE*KMAX) REAL V(KMAX). SEE COMMENTS BELOW 009000000 Dll. The linear problem (9) for the determination of y = f. with 110(3) = 2.a) = (HIT).-+1 from the preceding iterate j'.l INTEGER MODE.(==>1 + 1.ITERMX. '5 == 1. KMAX=20.XSIDE COMMON /APPROX/ BREAK(NPIECE).FACTUR..EPS.EP2.COEF. V ) CALLS PPVALU (INTER-V) C TO BE CALLED BY C O L L O C .KPM COMMON /SIDE/ M. XX. I.UN.XSIDE(10) COMMON /OTHER/ ITERMX.COEF(NCOEF).S2OVEP . ll Q"(°) = 9(1) = 0For small E.SOLUTN * .NPIECE PARAMETER (NPIECE=100.ISIDE.(2r) := (\/2+ \/E’:-)2 exp ((1 :l: :II)\/5.. C -'1: ’ -m u—r -1: r . the solution g is given approximately by NA-> A 12[A+(=v)/(1 + AAA->>* + A-(A)/(1 +A_<A>>21 — 1 with _ E.25B XV. 2 he-> = [r.RHO(KMAX¥1) SAVE EPS. P U T I T C INFORMATION ABOUT THE DIFFERENTIAL EQUATION IS DISPENSED FROM HERE C Cmmmqmm I-N P U T ##A### C MODE AN INTEGER INDICATING THE TASK TO BE PERFORMED. It also .KPM.K..SIDE CONDITION ANALYZE THE APPROXIMATION XX A P Pl Eiih-OJIAJI-A AT WHICH INFORMATION IS HANTED emcee O U T P U T ####A# V DEPENDS ON THE MODE . *UN V(1) -III _ V(4) m — UNAA2 + 1. SET THE ORDER M OF THE DIF. V(1) 0. C GO TO (10. COEF(1) = -1..32. AT XX THE DIF.M+2.30. V(4) GO TO 38 0. C C COEF(3) = 2.20..I=1. PRINT 610 EPS 510 FORMAT(’ EPS ’.) + SQRT(3 ))AA2 FACTOR S2OVEP = sORT(2 /EPS) *** INITIAL GUESS FOR NEWTON ITERATION.S ARE GIVEN AND ANYTHING ELSE NECESSARY. (sORT(2.ISIDE 1 31 V(2) 0.EQU. PROBLEM’) EPS = ..XX.40).L. L = 1 Y BREAK(1) = 0. V(M+2) IN TERMS OF THE QUANTITIES V(I). READS V(M+1)D*#M + V(M)D*A(M—1) + . + V(1)DAAO OOOOO C C A v(H+2) IN TERMS OF THE QUANTITIES V(I)..KPM 16 COEF(I) = O.COEF.KPM.S AND RIGHT SIDE AT SPECIFICALLY. 0. " V(2) UN: PPVALU(BREAK..E20. fiflflfl 10 M = 2 XSIDE(1) = 0. TO BE SPECIFIED HERE NOTE THAT V(M+1) = 0 FOR CUSTOMARY SIDE CONDITIONS.MODE INITIALIZE EVERYTHING I. V(1) 0 V(4) 38 ISIDE = ISIDE + 1 RETURN 39 CALCULATE THE ERROR NEAR THE BOUNDARY LAYER AT 1. G(X) AND G(X)-F(X) AT SELECTED POINTS’) X = ..EQU..S NONLINEAR PERTURB. 40 CONTINUE PRINT 640 640 FORMATL’ X. THESE CONDITIONS ARE OF THE FORM V(H+1)DAAH + v(H)DAA(H-1) + .Example: A boundary layer problem DIFEQU 259 C THIS SAMPLE OF IS FOR THE EXAMPLE IN CHAPTER XV.10) ### SET CONSTANTS USED IN FORMULA FOR SOLUTION BELOW.. PROVIDE THE M ' RETURN SIDE CONDITIONS. 30 V(M+1) GO TO (31.I=1.75 . OF POINTS AT WHICH SIDE COND.. C ### PRINT OUT HEADING PRINT 499 499 FORMAT(’ CARRIER.E.M.. XSIDE(2) = 1.M+2.5E-2.. ITERMX = 10 RETURN PROVIDE VALUE OF LEFT SIDE COEFF. DO 16 I=1..39). IT IS A C NONLINEAR SECOND ORDER TWO POINT BOUNDARY VALUE PROBLEM.1.. TO BE COMPUTED HERE 2O CONTINUE EP S V(3) 0.. THE NONDECREASING SEQUENCE XSIDE(I).. 32 V(2) 1.O) 2. + V(1)DAAO OOOOO = XX . UN(X) = X*X ...I=1. 486-03 0. even when the next approximation is to have a different knot sequence. NEHTON ITERATION IS TO BE STOPPED WHEN TWO ITERATES AGREE TO 6 DECIMAL PLACES.L.000+00 -0.. but the number of sign changes in the error is increased from 2 to 5.0) PRINT s41. Not only is the size of the error reduced.x./(1./(1.000-0..2500000O00+00 0. SOLUTION OF A SECOND ORDER NONLINEAR TWO POINT BOUNDARY VALUE PROBLEM ON [0 .sOLUTn.750-0.250-0. OF DIMENSION 18.609+05 .PPVALU(BREAK.4..676+01 -0.500-0. 1] . note the detailed picture of the approximate solution provided by the ppform: the sharp change of f near 1 is quite evident.692+00 0.101-04 -0. 2 PASSES THROUGH NEWNOT ARE TO BE MADE.477-01 -0.10) x = x + .7500000000+00 AFTER 5 OF 10 ALLOHED ITERATIONS.KPM.2.252-02 -0.6.452+01 -O.139+02 0.X.260 XV.659-01 0.ERROR FORMAT(3E20.195+02 0.629-01 0.188+03 0. THE PP REPRESENTATION OF THE APPROXIMATION IS 0.991799+00 0.S NONLINEAR PERTURB. BY COLLOCATION WITH PP FUNCTIONS HAVING PIECES OF ORDER 6 . This is due to the fact that the program always uses the most recent approximation to the solution as the current guess f.+EP2)AA2AEP2 ERROR . BREAKPOINTS 0.100000+O1 0.112-02 -0..COEF.+EP1)AA2AEP1 + 12.5000000000+00 0.9 EP1 = ExP(s2OvEF*(1.280+C4 0.2L5+O4 0.SOLUTN .999944+00 0.1. Finally. Note also the decrease in the number of Newton steps required.163+00 0.+X))*FACTOR SOLUTN = 12. Collocation 541 41 DO 41 I=1. WITHOUT ANY KNOTS BEING ADDED.O3125 RETURN END The following driver sets the calculations into motion and produces the output listed below.100000+01 0. GOOD ("IO MAIN PROGRAM FOR EXAMPLE IN CHAPTER XV. CALL COLLOC(0. PROBLEM EPS 0.381-04 0.0.1. CARRIER.4999999888-02 APPROXIMATION FROM A SPACE OF SPLINES OF ORDER 6 ON 4 INTERVALS.132+01 0.—x))AFAcTOR EP2 = EXP(S2OVEP*(1.E-6) STOP END The error printout shows the improvement near the boundary layer brought about by the repositioning of the breaks through NEWNOT.. 8125000OOO+OO -0.2211332321-04 O.3328919411-O3 O. OF DIMENSION 18. Estimate the work involved in setting up the collocation equations (that is.550+03 0.000-O.9021227360+00 -O. BREAKPOINTS O.138-O1 -O.679-O.875000OO00+0O -0.198-O2 0.770+O3 0.944220+OO 0.90625000OO+OO' -O.9847788215+00' -0.199+O2 -0.4159959555+O0 -0.4159959555+O0 -0.261+OO O.000+0O -0.1836419IO6-03 O.999983+O0 0.555+OO 0.8125000OOO+0O -0.9716256857+00 -0.6719498634+00 -0.9472073317+0O -0.365-03 -0. that is.242+05 0.8437500000+0O -O.1661181450-03 0. BREAKPOINTS 0.1000OOO00O+O1 0.445-O.6529041529+00 0.8465198278+00 AFTER 1 OF 10 ALLOWED ITERATIONS.9918430448+0O -O.3410220146-02 O.9310245514-04 O.111+01 0.9472073317+0O —0.9375000O0O+O0 -O. O.394-01 0.1000OO+O1 0.8197249174fiOO 0. OF DIMENSION 18.0000000000+00 0.6934404373-O3 O.0000000000+O0 El Problems 1.0000000000+OO APPROXIMATION FROM A SPACE OF SPLINES OF ORDER 6 ON 4 INTERVALS.968750000O+OO —0.156+O6 X.4417714477+00 0.9375000O0O+O0 -O.339-03 -0.155+01 O.9375000O0O+O0 -O. by Gauss elimination with attention being paid to the special structure).990+O3 0.3032088280-O3 O.7538199425-03 O. If E is uniform.425+O2 -O.291+05 -0.9918430448+0O -0. . THE PP REPRESENTATION OF THE APPROXIMATION IS 0. THE PP REPRESENTATION OF THE APPROXIMATION IS 0. 2.3337860107-O4 O.9472073317+0O 0.130-01 -O.461+02 0.3850460052-04 O.000-0.969+02 0.1260221004-02 O.8125000O00+OO -0.938+00 -O.9847788215+0O 0.9918430448+0O -0.820+03 0.1047730446-O2 O.248+O2 O.3274083138-03 0.653-0.3465056419-O2 0.75000OO00O+OO -0. then the generation of the collocation equations can be made more efficient by calling BSPLVB only in the first interval.5564689636-O3 O.293-O3 0.6973743439-O5 O. the labor done in EQBLOK and PUTIT) and compare to the work of solving the resulting equations (in SLVBLK.84375000O0+O0 -O.1883506775-04 O.831-0.670—O6 -0.999981+OO 0.4141330719-O3 O.75000O0OOO+OO -0.234-01 O.781250000O+00 -O.8197249174+00 -O.1000O00O0O+O1 0.274+02 O.7812500000+OO -O.220+0O 0.4159959555+O0 -O.10000OOO00+01 0.100000+O1 0.75000OO00O+OO -0.1868605614-O3 O. G(X) AND G(X)-F(H) AT SELECTED POINTS .1472234726-O4 O.254+06 X. G(X) AND G(X)-F(X) AT SELECTED POINTS O.235+O5 -0.9716256857+00 0.96875000OO+OO —0.9021227360+00 -0.998027+OO 0.331-O3 O.149+O1 0.4450708628+OO O.998827+OO 0.9716256857+00 0.84375000OO+OO -O.781250000O+OO -0.9847788215+00 -0.108-01 0.Problems 261 X.6719498634+O0 O.8197249174+O0 0.442-O.231+O0 O.253+O2 -0.847-O.968750000O+OO —0.0000000000+00 0.9062500000+0O -0.9021227360+00 0.8399486542-03 O.8314099312+O0 AFTER 2 OF 10 ALLOWED ITERATIONS.875000OOOO+OO -0.315+O2 -O.0000000000+00 0.351+O5 0.4374980927-O4 O.6789402366+00 0.821+00 0.3129243851-04 O.875000000O+0O -O.0000000000+00 APPROXIMATION FROM A SPACE OF SPLINES OF ORDER 6 ON 4 INTERVALS. G(X) _AND G(X)-F(X) AT SELECTED POINTS O.6719498634+00 0.9062500000+0O -0.161+O1 -O.958661+OO 0. _. in case .dA=h<A> on la--bl of the second kind for g by collocation from II... §..-intervals.__5 H C("'“'1)? L..(Dm'_1g)(1I2'i)) =2 ..g = g(i"1)(O).. Identify the_ above collocation method with implicit Runge-Kutta methods. .-5(1I1'§. . Set up the relevant equations fdilr solving the integral equation b go->+ f K<A. Discuss the proper treatment of nonlinear side conditions. Let In = 2. it = 4. is a smooth function of its arguments)? (Hint: How was (9) obtained from (4)?) 4.m.. .1+1. ‘Ii: 1.-3 that agrees with the ¢0110¢E\i3i0I1 flPPI‘0XiIT1fll3i0I1 f to 9 all (ii-11-€A~1=€iA€i=~‘.. TH.6._. 6. . . ._1 .A>g(A>. and some have their support on only one Af-interval. N C..€A+1. .|. .5.-. What would the relevant equations be for solving (1) by Galerkin’s method using II. . 7. 8._|_2) is an C7 (If-|8)-approximation to g on [§.. . certain savings can be effected in EQBLOK and PUTIT due to the fact that every B-spline involves at most two cf... Prove that the polynomial p E l'l. . Collocation (ii) Even if E is not uniform. *5 = 1.-. Rework COLLOC and its subroutines to make -use instead of the subroutine CNIDTI-I given in the appendix which requires less storage than does SLVBLK. . Specifically.-. " . if (2) is replaced by . .. EH2]. 5.262 XV. 3.g = C-..5. what would be the appropriate explicit formulation of (9) (assuming that G.€i+2.g($-1). But.XVI Taut Splines. such user complaints are at times as unreasonable as they sound and can then be dealt with simply by requesting more data in the area where the approximation was felt to be wrong. yet the intended user of the approximation protests that it doesn’t look right. but begin with the second problem. In effect. The second problem is lack of data. or. Of course. Two aspects of this problem give difliculty. making use of the data provided. that is.cy(s)) : a ii s § b}. Cardinal Splines and the Approximation of Curves. splines in tension. forsome interval [a. But. We will discuss each of these problems in turn.some means. Lack of data This is'an intuitive and imprecise term that is meant to describe the following situation. namely the approximation by periodic splines with a uniform knot sequence. with the exception of taut splines. all is amplification of earlier material. TAUTSP In this chapter. the data provided were not suflicient to convey to the approximation scheme the user’s wishes. or. cy. A curve or function has been approximated by. leading us eventually to a side issue. there is justification for complaint.b] and some (usually continuous) function pair cm. We will deal with planar curves. y)-plane of the form Cc := {(cI(s). The typical computational problem concerns the construction of a curve Cc that contains a prescribed point sequence (Pi)? in the plane in that order. Periodic Splines. we discuss various details concerning the approximation of curves.. with point sets in the (:1:. It fits the data. . This we discuss now in some detail for the case of interpolation to a function rather than a curve. “in at least one situation. and this is in the case of “extraneous” inflection points. 263 . One is the proper choice for the parametrization. that she would have drawn it differently. . this means that the interpolant is piecewise cubic. for example. have the form (1) f(:t) = Ara. with p the tension parameter. Spath (see. = O._|.1 each piece of the interpolant‘ is a linear combination of the four functions 1. for each '21. In the limit.g(T. . that is.-.y Z 0. Spath deals with more general interpolants that.-:<Pi('v-) + -D-tip-£('U) 1. 114._1 .'r_.. In mathematical terms... + B-i'U + C-.. Algorithms for the construction of such a tensioned spline have been published in Fortran by A. 'r. e"P*.264 XVI.1). that is. . .'r_. then a “good” interpolant should be convex (concave) on the interval [11..1) extraneous if 5i5. . on the interval [Ti . his book Spath (1974)) has generalized this to allow the tension parameter p to vary from interval to interval. with a very strong pull. with5t I= [Ta 'Ti+1]9 — [Ta ‘Ti. In effect. For p = O. In constructing this spline. Let f be a smooth interpolant to these data.))"f' to be interpolated. This prescription allows only one interpolant on [1".-__|_1 > 0. Spline in tE.. that is. in the open interval ("r. the differential equation (D2 ___ p2)D2._1 .)'..-1]Q= there must be a sign change in the second derivative of f. We know from I(vii) that. T-£+1]g = f”(m)/2Therefore. namely a straight line.'I‘lSlOI‘l. eff. he was guided by the physical notion of the (graph of the) spline as an elastic-band that goes through rings at the interpolation points in the plane and that is pulled until all extraneous kinks have been straightened out. an inflection point of f. one obtains the broken line interpolant. just the customary cubic spline interpolant de~ scribed in Chapter IV= But. there is a site 17._1 . 1'.. He proposed the tensioned spline as a remedy. Schweikert’s tensioned interpolant has two continuous derivatives and satisfies. Cline [I974].—-1u—1iii-r1. Periodic Splines.Schweikert [1966] was the first to deal with the problem of extraneous inflection points. T-1. thus making the procedure more responsive to the local behavior of the data. . . for p > 0. between interpolation sites.]. We call an inflection point of the interpolant f in the open interval ('r. Cardinal Splines “Extraneous" inflection pOll‘|tS We are given data (T. "r. In fact.-+1].-. we insist-that the interpolant preserve convexity / concavity of the data in the following sense: if the broken line interpolant to the data is convex (concave) on the interval (1". 1:.._|_1] in case 6. corresponding to each sign change in the sequence (6. Taut Splines._1.I|-1 :1-i—n—-|._|_1) so that [n-1. The piecewise tensioned spline fits into this scheme with the choice r. As it turns out. Specifically. A different scheme has been proposed by R. whether the same effect. f'(O) = --[Li-no. very close to the site of difficulty. ni to be chosen appropriately.'Z) = Aifi + Bil) -i. who uses an interpolant that. we give the additional data point (. Soanes. But. v := 1 — u. then a “very large” slope. . ' (2) Example: Coping with a large endslope following data f(O) = O. Vi/'hile the Schweikert—Spath tensioned spline has its tension parameters chosen interval for interval. The trick is to use a cubic spline with additional knots placed so that the interpolant can make sharp bends where required without breaking into oscillations as a consequence. The only real objection to these and other schemes is that they use exponential functions instead of polynomials. . .04. . Soanes chooses the ratio mi_1/ni data point for data point. If we really insist on an infinite slope at O. We help it along by adding just one knot. namely preservation of convexity/ concavity in the data. The choice mi = ni = 3 reduces this scheme to cubic spline interpolation. But now complete cubic spline interpolation to these (modified) data produces an interpolant with two inflection points. and (.oi(O) = goi(1) = O. if this is merely a design curve.s. will do just as well.Example: Coping with a large endslope 265 with n := u(:1:):=(:1: — Ti)/Ari.. this is indeed possible.s sinh(pi).03)..lr. could not be had while sticking to cubic splines as interpolants. In effect.oi(s) = . f"(2) = -1/2. r. there is no way of solving this problem with polynomial splines. say f’(O) = 20.oi(s) = sinh(pis) —.Ciitmf -|— Diflnfi with the possibly fractional exponents mi. we supply “missing data". The new interpolant is also shown in Figure (3). and are to construct a concave interpolant. [I976].93 —. I-1 = We are given the = 1. The transition from the large endslope to the mild behavior in the rest of the interval could easily be made less abrupt by supplying more data. has the form f(.oi’(1)2. one recovers the cubic spline. the cubic polynomial in the first interval cannot bend fast enough.i_|_1]. on the interval [Ti . on some minicomputers. for example by taking points from a spline cur-ve that fits the original data. thereby making evaluation of the interpolant more expensive and.V. it is concave. l with pi the tension parameter for the ith interval.'. all s. and cpi a function on [O .of(O)“ =. even impractical.é (. One wonders. see Figure Quite simply. 1] with c. For (. therefore.I. 0. _ We begin with the following special‘ case. _f’(1) = s1. one chooses the abscissa and then experiments with the function value until the curve is satisfactory. f(1) = 0.A taut CUlJlC spline It took a lit-[tle experimentation in Example (2) to find the appropriate additional data point. f”(9) = "'2(2$o + $1). In the following. as (2 — 3z)(1 — 3z) 5 0.sq). Periodic Splinw. Cardinal Splines 4 35 3 25 2 1 15 1 O5 O -95 (3) FIGURE. 1. we get at once that _ (4) f(I) = $01‘-'1 . . 1) if and only if (230 + s1)(sg+2s1) *3 0. We are to interpolate to the data f(0) = 0. Typically.266 XVI. or. Taut. dividing through by (S0 --$1)“ and using the abbreviation z := s1/(s1 -—. . hence an inflection point in (0 .1) would be extraneous in case S031 <1 0. f has no (extraneous) inflection points in (0. we describe a more systematic way of introducing additional knots where required.—s0. . Spline interpolation to -a large endslope without (thin) and with an additional knot. . U U5 1 15 2 _. On the other hand. Splines. From IV(3)-(4). f”(1)== 2($0 + 81)- Thus. We can write this condition also as (2(s0 —s1)+3si)((si. U [-1. 1]f = s1. 1]f = -. [0. f’(0) = sg. by a cubic polynomial.—— s1)+3s1) <3 0.(230 + $1)?-=2 + ($0 + $1)?- We have [0. | l. The resulting function (.o(. as we will see in a moment. We take both Q and cu "to be continuous monotone functions of z.. Then the interpolant is required to bend near 1 more sharply than a monotone cubic can.I:. . .i among the four: :12.. Z) == M3 + (1 — Q1) with Q = ((2) the additional knot and 0: = cz(z) a number in [0.j. The condition that f have no extraneous-inflection point in (0 . namely 2:3.if and only if the coefficients of <p and (1 — :12)“ are of opposite sign.:12) + C<. <. l J‘ Slightly rearranging. the interpolant now reads f(:r) = As: + B(1 —. and go” Z 0 on [0. Consider first the case z > 2/ 3.1]. for I'I./(1 -—. -‘A = C = (30 + 231)/(3(2P " 1)) ' "B = D = "((3.1]. 0. In terms of this new basis.()4. 1]. by a cubic spline go with one knot that bends more sharply near 1 than does :23.29 — 1)8o + $1)/(3l.2:) 5. among other things.2P — 1)) and P1: <P’(1. and with Q(1_) = 1. (1 —:r)3. with o¢(2/ 3) = 1 in order to connect continuously with the usual cubic when z 3 2 / 3. 1) (in case sosl <2 0) thus becomes ((319 -— l. 3:3.0 is given by v>(I) == <P(I. 1 —:r. .()3) + D(1 —F l This is of one sign in [0 . we propose to change the interpolating function as follows.C)- ‘ It follows that _f”(:::) = 6(C(cz:r + (1 — o:)(:r —. 1] if and only if C and D are of the same sign. z) + D(1 — 3:)“ where .o(1) = 1.o(O) = <..)Sg —l— S1)(S(] —l— 231) 5 0.3. we also insist that <. We therefore replace the one basis function.ity/ concavity of the data only if s Z I= S1/(S1 — SQ) g For values of z outside this range.-Z)/3 = (1 + (1 -— <1»)/(1 . This ensures. dividing through by (si. that the interpolant has an inflection point in [0 .A taut cubic spline 267 It follows that the cubic interpolant in this case reproduces the convex. and using again z :== s1/(s1 — sg) produces the equivalent condition that ((3p —— 1) -— 3pz)(1 —. For the sake of uniformity.0"(0) = qo”(0) '= 0.i. — s1)“. that bends most sharply near 1. then. f (1) = fl. and changes the quantities so and s1 used above into so —— (f1 — fg) and s1 -— (fl — fi. This also shows that we need l 3(1—z)Z1——Q to make certain that or 2 0. f’ (1) = s1 is reduced to the present one by subtracting first the straight line fg + (f1 — fg)$.268 XVI.z)+D<.i"3.3 5.). interpolation to data f(r_i) = fi.2: § (3p — 1)/(3p). 3].o determined as in the case . In terms of cu. Taut Splines. Preservation of convexity/concavity of the modified interpolant therefore demands (even under the weaker assumption z 2-_ 1/3) that . we get the formula Thus. .1/3} ' for some '7 E [0 . even more generally.1—z) with 3 3 $'"'§ w(I. with the basis function (1 —— rs)“ replaced by qo(1 — :13. The more general case of interpolation to data f (0) = fg.@)(T-_7E)+ (6) l<I==(~*=) == (1 —'r/3)/C ((2) := 1 —-q/min{ 1 -—. the relevant quantities are -9-t '. 3p Z 1/(1 — z).i+1lf- We make use of these considerations in the construction of a “taut” cubic spline interpolant to given data ((ri. j = i.[Ta-'1'i+1lf and 3-£+1 "‘ l'1'riT. g('ri))){‘l by choosing the basis in each -—i-ml _i-j i .o(1—$. The overall effect is one of increased “roundness” for increased '7. We can combine these various cases conveniently into one by considering the approximation to be of the form _ (5) f($)=A:r—l—B(1—-:::)+C'q0(:r. f'(0) = sq. As '7 increases. Cardinal Splines The second factor is negative since we are considering the case z > 2/3. Periodic Splines. . both oz and Q‘ decrease for fixed 2:.i + 1 isconsidered. f"(r_i) = si. This condition is satisfied for the choice 1 — C( z ) ='7(1-z)aslongasq/$3 ‘ The case 2: < 1/3 is handled analogously. This subtraction does not affect questions of convexity and concavity. this condition reads 0: 5 [1 — (1 — Q)/(3(1 -— choosing ct to be as large as possible.2. If.2. 1 — 2:) and <. Note that o:(2 /3) = 1 regardless of Q. that is.Z) == Cw + (1 . instead of '39 and s1. . .I an . This means that the interpolant has the form ' (7) Ai + Bin + C'i<p('a. j = i. and the number h := Ari. . [Ti . This gives. at each interior data site ri. This means that a small change in the data that changes the sign of some dic‘.-"1.ri)/Ari z = z-1 '-= '5i+1/(51 + 5r+1l 1/2 if 6i6i+1 2 0. 1 We determine the vector ( ff’ so that the resulting interpolant has two continuous derivatives.ii_|_1 may change the interpolant drastically.|.__ Z ___ Z‘ l5i+1l/(l'5il '1' l5i+1l) ] 1/2 11l'5-=1l+l5i+1l > 0 otherwise which removes an obvious source of discontinuity. otherwise '51 —l— 5i+1 75 0 where 635 1: ll’-j1Tj+1l. 'i". the interpolant has the coefficientsll _ At = fr — Dr. ' iv D1: = h'2.T-i..z) = in .'ri] f and the role of si_|_1 played by [Ti_|_1.A taut cubic spline 269 interval [Ti . W (111 '" Ki) - ‘Z-=2i. In terms of the quantities fj..o”(1. (8) (9) := (zr -—. the equation f1(1'i#) = f1(Ti+)= 91' I I _[_ (A7-i__1 <P (1=1 — Z-s—1) _[_ <P (1I‘z‘1"'1) + A71? iv fi+1=6i.fi /<P”(1.ij_|_]_]. with the role of si played by the slope ['ri_1. hence <12) - 1/v"<1.lV. . 1 — 2:) OI].7-1 asbefore. z) + Di<. the program below also allows the modified choice ___ (10) i . (11) r Bi = h[Ti1Ti+1]f -" (Ci — Di.z) = 6(a+(1 -—o:)/(1—(_')“).) I C1: = h2f£'+1/<P’ (1. For this reason. i + 1.f — l:Tj:Tj—1lf'.02 + (1 -ea).Wesetz=1/2incasei=1 ori=N—1. Z). 'ri_|_1] in the above manner. The particular choice (9) of z makes the interpolant discontinuous as a function of the data.2] f.. 1 — Z)- Note that <.02/(c»<1 .0(1 — u. z) =' 6 ~<»<1'-"<72‘+"<1'"-T) Evaluation of the coefficients in (13) in the manner of (12) and (14) ensures accuracy as Q —+ 1.i) _ (1 _ O.(1.. Periodic Splines..__.. 1 — -=12) s@”(1. . then (12) and (14) show that (13) reduces to (A’*"i—-1/5)fi11 + (A'1'¢-1/3 -l" Ati/3)f-if + (A11/filfiii = 5% the equation for cubic spline interpc-llation familiar from Problem IV. Of the several choices of boundary conditions discussed in Chapter IV...-]A. Finally. the first of these reads or + I1’)/N1 = ‘ A12‘ l '1 and the second looks similar. Note that "(la ) _ (15) @=(1-02+ (1-01) $"’(1.@”’(1.i-. .fill = . §P'(1.1.(i=____-el Hr ._. Splines... For this reason.1 I 270 XVI. Taut.. Cardinal Splines Note that (14) .f”’More explicitly.-in y I H _ . a detailed analysis shows that these equations should be the second. This means that we adjoin the two equations jump-rif”’ = 0 =i'-11'I1P-r. we write the boundary equation in the form (p”(1i1"_z) (p. with an analogous version for the equation jump. . by (7) and (11). if oz --= 1 throughout. that is. 1 _ n.. in the total system in order to avoid the necessity of pivoting. f”" = 0.-Z)-1 1—C (3@—1)(1-C)+3(1—@=i s@”(1. If no additional knots are introduced. <.O3 + (1 — C-=)’ so that the equation is in computational difliculty if 22 = 0.1 _ (16) I ll‘ A?':2(f§ '.6. we consider here only the “not-a-knot” condition.-}c(1 —.. We need two more equations to obtain N equations in the N unknowns (ff . respectively the second last. UNDER CERTAIN CONDITIDNs UN THE CIvEN DATA AT PUINTS I-1. . 2/s.. F Is JUST A CUBIC PULYNDMIAL UN THE INTERNAL I. H(. IN CAsE THE DENUMINATDR vANIsHEs>.5 FDR CAMMA Is TYPICAL. MERE.LE. UK = 2.s) = U .ALPHA)*(MAX(((U—ZETR)/(1—ZETA)).TAU(I+1>>. THIS AvoIDs'ExTRANEDUs INFLECTIUN PuINTs TYPICAL or CUBIC sPLINE INTERPDLATIDH AT KNOTS To RAPIDLY CHANGING DATA. UP SIZE (NTAU. cTAU(I).5) = Z = INDICATUR CF ADDITIDNAL RNOTs s(.GAMHA*HIN((1 . INPUT HAs INCDRRECT.I) +(Dx/2)(COEF(s.).NTAU. NTAU. NITH U = U(x) = (A .s.. SEE DESCRIPTION OF METHCD BELDN.GT...0)**3 ALPHA(z) = (1-CAMMA/3)/ZETA zETA(z) = 1 . L. 0.. _ ----—— M E T H U D -----DN THE I-TH INTERvAL.BREAK(I) AND I-1. SEE BELDN. CDEF.DERIvATIvE OF F AT TAUCJ). GAFIHA... z = z(I) = ADDc(I+1)/(ADDC(I> + ADDC(I+1)) (= . IT HAs DNE ADDITIUNAL KNUT.I) +(DI/3)CDEF(4. AT TAU(I) + ZETA*DTAU(I) . CUEF.UPPER DIACUNAL IN LINEAR SYSTEM s(. FDR BREAK(I) . UUTPUT BREAK. A PRINTUUT SPECIFYING THE MIsTARE HAs MADE. NITH ADDC(J) = ABs(DDs(J)). CAMMA INDICATES HHETHER ADDITIDNAL FLEXIBILITY Is DESIRED.1—Z) . I+1.s). x ..Z) + D*H(1—U. As z APPRoACHEs 1.LE.. THE INTERPDLANT CETs RDUNDED UITM INCREASING GAMMA.. A vALUE DP 5. ' s(. A vALUE DF 2. No ADDITIUNAL KNUTs IN (0.. A KNUT Is ADDED IN THE I-TH INTERvAL. IFLAC = 1. . 1/3) THUS. sAME .z) HAs AN INcREAsINcLY EHARP BEND NEAR 1. K GIVE THE PP-REPRESENTATIUN OF THE INTERPULANT. (TAU(I).NTAU-2. * BREAK.TAU(I))/DTAU(I>. HDRREPACE s Is REQUIRED. MUsT BE AT LEAsT 4 .. 271 . UTHERNIsE. GTAU. PARAMETERE INPUT TAU EEQUENCE or DATA PCINTs. IF GAMMA .e) = 1/HsECND(1. NTAU NUMBER OF DATA POINTS. THE INTERPDLANT HAs THE FURM F(X) = COEF(1.5 FDR CAMMA Is TYPICAL. IN (s.L .1) = DTAU = TAU( +1) . MUsT BE STRICTLY INCREASING. THE INTERPULANT Is UP THE PURM (*) F(U(X)) = A + B*U + C*H(U. I=1. sPECIFICALLY. IFLAG ) coNsTRUcTs CUBIC sPLINE INTERPULANT TD GIVEN DATA c TAU(I). CTAU CORRESPONDING sEqUENCE CF FUNCTIUN vALUEs. L. THE INDIVIDUAL cDLUMNs DF THIS ARRAY CUNTAIN THE FULLDNINC qUANTITIEs MENTIUNED IN THE HRITEUP AND BELUN. DDG(J) = DG(J+1) — DG(J). I=2.CTAU(J))/DTAU(J) H(U. z ..I) +Dx(CUEF(2.I))) HITH Dx = x .3. ExcEPT THAT MNDTs MICHT ALsD BE ADDED IN INTERVALS IN HHICH AN INFLECTIDN PUINT HDULD BE PERMITTED. ADDITIDNAL KNOTS ARE INTRODUCED HMERE NEEDED TD MAKE THE INTERPCLANT MDRE FLEXIBLE LOCALLY. HAHELY THE SECDND DERIvATIvEs DF INTERPULANT AT TAU s(. = 0. AND I+2.Z) = ALPHA#U**3 + (1 ..LE. THUs ALLDNINC F To TURN RAPIDLT NEAR THE ADDITIUNAL RNDT. BREAR(I+1). FDR 1/3 ..4) = R = RICHT sIDE FDR LINEAR SYSTEM (INITIALLY) = FsECND = SDLUTIUN UF LINEAR SYSTEM .LE...z). K.2) = DIAG .x) NITH I = Z DR = 1-2.... AND NITH CIO O O O O GOCI O CIO O QO O DC(J> = DIvDIF(J) = (CTAU{I+1> . S. I. .). IN TERMs or F(J) = CTAU(J) AND PsECND(J) = 2.DIACDNAL IN LINEAR SYSTEM s(.A taut cubic spline SUBROUTINE TAUTSP ( TAU.TAU s(.5. NTAU. Z = TEMP/DENOH IF (ABS(Z — .) GO TO s HETHOD = 3 GAH = GAM .15H ARE DISORDERED) TO 999 610 6 s(I+1.S(I.LE.CAH * I * .0NEHZT.FACTOR.5) 1e 's(I.4)) GO TO 19 DENUM = ABs(S(I.. ---. GOOD I = 2 s(2.D) C = FSECND(I+1)*DTAU(I)**2/HSECND(1.SIITH.TAU(I)..4)) + TEMP IF (DENOH .I=1.4) .NTAUM1 s(I. IS FIXED.) GO TO 6 ‘PRINT 610. Cardinal Splines THE COEFFICIENTS FOR (*) ARE GIVEN As A = F(I) . IF (NTAU ./6.12).2E15.4) = S(I+1. SHOULD BEGO .LE.LT.L. _ DO 7 I=2.272 XVI.1—Z) HENCE CAN BE COMPUTED ONCE FSECND(I).1)/s. I.EQ. — GAH/3.D B = (F(I+1) .) METHDD = 1 IF ( CAM .NTAU. C c 9 ONEHG3 = 1.1) = IAU(I+1) — TAU(I) IF (s(I.—.Z. NE DETERMINE FSCND(.RATIO.) .. METMDD = 2 CAM = CAMMA IF (CAM .1 DO s I=1. 3.ENTRY3.Z) D = FSECND(I)*DTAU(I)**2/HSECND(1.I3.NTAUH1 7 S(I.4) .S(NTAU.4) = (GTAU(I+1)—GTAU(I))/S(I. FJFJDFJFJQFJOFJFJQFJOQ INTEGER IFLAG.TAU(I+1) FORHAT(7H POINT .LOOP OVER I ———— —1O CONTINUE Z = CONSTRUCT 2(1) AND zETA(I> _ ' 5 GO TO (19. Periodic Splines.K. F I s AUTOMATICALLY CONTINUOUS AND HAs A CONTINUOUS SECOND DERIVATIVE (EXCEPT HHEN Z " — O OR 1 FOR SOHE I) .ONEMG3/I) c C THERE MUsT BE AT LEAsT 4 INTERPOLATION POINTS. 4) PRINT 600 NTAU GO TO 5 Ii—u. 0.F(I)) — (C .I4. 4 ..‘-—- soc PDRMAT(aH'NTAU = .3. SIXTH) GO TO 19 Z = .) TO 999 C CONSTRUCT DELTA TAU AND FIRST AND SECOND (DIVIDED) DIFFERENCES OF DATA C 5 NTAUM1 = NTAU .—.GAHHA.LE.6.GT.NTAUH1 REAL BREAK(1).HETHOD 11 IF (S(I.X. THIS LEADE To A STRIC DIAGONALLY DDMINANT TRIDIACDNAL LINEAR SYSTEM FOR THE FsECND(I) WHICH NE SOLVE BY GAUSS ELIMINATION WITHOUT PIVOTING. THERE IS ONE CONTINUITY EQUATION.20H. O. Taut Splines. IN ADDITION.TEHP.) FROM THE REQUIREMENT THAT ALSO THE FIRST DERIVATIVE OF F BE CONTINTLY UOUS.ZT2 ALPH(I) = AHIN1(1.5) == Z O.6).2) = s(1.) 12 TEMP = ABS(S(I+1.ZETA. AT EACH C CONSTRUCT SYSTEM OF EQUATIONS FOR SECOND DERIVATIVES AT T INTERIOR DATA POINT.4)#S(I+1.GE.5 I . sIxTH = 1.13H AND THE GO NEIT.1) .HETHOD.4) - AU.GTAU(NTAU). AT THE FIRST AND THE LAS T INTERIOR DATA POINT THERE IS AN ADDITIONAL ONE FOR A TOTAL OF NTAU EQUATIONS IN NTAU UNKNOUNS.1).TAU(NTAU) ALPHA I C I D I DEL I DENOH I DIVDIF..1).11.ONEHG3. O.COEF(4.FACTR2.ENTRY. HE REQUIRE THAT THE THIRD DERIVATIVE BE CONTINUOUS ACRUss TAU(2) AND ACROSS TAU(NTAU-1) .I.GE. 3> = RRTIO*ENTRY3 + s(2..4) = s(2.4) + s(I. S(I.ONEHZT ALPHA = ALPH(zETA) FACTOR = ONEMZT/(1.5) = . 2) GO TO so s(1. s(I. SINCE THEN ALSO U(I—1) = L(I+1) = O. s(1.RLPHA*ZETA*(1.2B 26 FACTR2 = ZETA*(ALPHA#(ZT2—1-J + 1.4) i s(2.2) = s(2.2) = s(2.3) s(1.4) = RATIO*S(1.3) = S(I. .1.5) 1 26.zEIA zT2 = ZETA#*2 ALPHA = ALPH(DNEMzT) FACTOR = ZETA/(ALPHA*(ZT2—1-) + 1.2) = RATIO*S(1.2) = FACTR2#S(2. . IF (s(I. ELIMINATE (I—1)ST UNMNDNN PRDM THIs EDUATIDN 3(I.s) = s(2.1) + s(1. ******THE FIRST THU EQUATIONS ENFORCE CONTINUITY OF THE FIRsT AND OF THE THIRD DERIvATIvE AcRDss TAU(2).3) + s(2.) s(I.-ALPHA#DNEMzT)*FACTDR/2. s(I. S(I.2) = s(I.0.3) C IF (z .1)/s(1.A taut cubic spline C C ******SET UP PART OF THE I-TH EQUATION HHIcH DEPENDS ON THE I—TH INTERVAL IF (z — .3) = S(I.2) s(2.*ALPHA*S(2.2) = s(I.1)/6.2) = S(I.6) = ZETA*FACTOR/6.27.1) s(2.4) GO TO 35 so CONTINUE ##$#**THE I—TH EQUATION ENFORCES CONTINUITY OF THE FIRST DERIvATIvE ACRDss TAU(I).1)/3.+ONEHZT)) s(I.2a 21 ZETA = CAH*Z DNEMZT = 1.5 .6)*S(I.22.1>/s.2) = s(1.2) s(2.1) GO TO 29 27 RATI0 = s(2.1)*6.2) = 1.5) A 21.2) .s(I. s(1.4) C i 273 . ITs VALUE DOES NUT MATTER. .3) = -s(1.3) = —FACTR2*S(1.1)/S(1. GO TO 25 23 ONEMZT = GAH*(1. THEN D(I) .1) GOOD OFJOOCJ s(2.R(I) . ELIMINATE FIRST UNRNDHN PRDM SECOND EQUATION 2s s(2.2) + s(I.1)/5(1. . REsET D(I) = 1 TO INsURE NONZERO PIvDT IN ELIMINATIDN. C C C - s(I.3) + S(I.Z) C C zETA = 1.1)/3.2) s(2.2) s(I. .) S(I.2) = RATIO*S(I-1.1)/6.a) = S(I.6) AT THIs PDINT.GT. O.1) + s(1.2) s(2. GO TO 25 22 s(I.3> = -$(1.) RATIU = FACTR2*S(2.s) = DNEMZTAPACTDR/5. THE FIRST THC EQUATIDNE READ DIAG(1)*X1 + U(1)*I2 + ENTRY3*X3 = R(2) —RATIO*DIAG(1)*X1 + DIAG(2)*I2 + U(2)*I3 = 0.2) + s(I.2) ENTRY3 = s(2.1) CD TO 29 2s RATID = s(2.2) + s(I.s)) IF z = O AND THE PREVIOUS z .1) s(2.1>*((1.1) + S(1.1) 25 IF (I . IT HAs BEEN sET UP IN sTATEMENTs 35 UP TO 40 AND 21 UP TO 25 AND READS NON —RATIO*DIAC(I~1)*XI-1 + DIAG(I)*II + U(I)*II+1 .LE.)/(ALPHA*(ZETA*ZT2-1-)+1.4) = RATIO*S(I-1. END or I LOOP --—-—- C 40 I I I+1 IF (I .5) 61.4)-ENTRY3*S(3.L) I GTAU(I) COEF(3.2) s(I+1.4) .S(I.S(I.6)*ALPHA/S(I-1.(s(I.4) C C C C C C -----.) RATIO I FACTR2*S(I.-.3) + FACTR2*S(I—1.1) I IFACTR2#S(I-1 I 1) ' - .2) 50 S(I.2) l| I £1 S(I+1.4) I s(NTAU..-ZETA*ALPHA)*FACTOR/2. Taut Splinw.2) I S(I.3) + S(I. . NTAUM1) GO TO 10 S(I.3)*S(2.4) . s(I+1. ENTRY . GO TO 40 37 RATIO = -($(I.1)/5-)/$(I.(S(1.)+1.ss 35 IF (Z .1)/3.62.2) I s(I.) it-i 1- .1)*6.BACK SUBSTITUTION ----sl S(NTAU.2) s(I.2) S(I+1.5) I .RATIO*S(I-1.1)/S(I-1.4) RATID = —ENTRY/S(I. 4]] s(I+1.2) --—--I CONSTRUCT POLYNOHIAL PIECES ------1I-urn— _-. OOOCI 41 RATIO I S(I.1)/S(I—1.LT.6)*S(I.5) GO TO 65 61 IF (Z .1) + S(I.GT.)/ I (ALPHA*(UNEMZT**3-1.1) GO TO 45 42 RATIO I S(I.L) I S(I.4) + S(I+1.—S(I.3)#S(I+1.4)-$(1.1)*((1. s(I+1.4>/s(HTAU. BREAK(1) I TAU(I) L I 1 DO TO II1.NTAUH1 COEF(1.1) S(Ip3) — -S(I-1:1) GO TO 45 43 FACTR2 I OHEHZTI(ALPHA*(ONEHZT*I2-1. GO TO 40 as RATIO -—.4) + s(I.1)/6.63 IF (Z .s)) -----.2) S(I+1.RATIOIS(I—1.4))/S(1.RATIO*S(I—1. 1 )/ 6 .5 ---.1) S(Ii3) I -S(I-1.4) .4) I (S(I.1)/S(I.*S(I-1.1) Z I S(I.274 C XVI. Cardinal Splines *###*#SET UP THE PART OF THE NEXT EQUATION WHICH DEPENDS ON THE C IITH INTERVAL.4) I RATIO*S(I—1.2) . _ s<I.3) + s(I.1)/3.3) + S(I.2) I RATIO*S(I—1. O.S(I.2) S(I.2) I = I 1 GO TO 50 IF (I .4) DIVDIF I (GTAU(I+1)-GTAU(I) )/S(I. AT THIS POINT.2) .LAST THO EQUATIONS INUITY OF THIRD DERIVATIVE AND THE LAST THO EQUATIONS ENFORCE CONT OF FIRST DERIvATIvE AcRDss TAU(NTAU-1).2) +’s(I.)+1.3T.3) + s(I+1. 1) S(1.2) I RATIU*S(I. 35. Periodic Splines.2) I RATIO#S(I—1.1) + S(I-1.) /s(I2) .4) I RATIU*s(I.EQ.2) .5) as RATID . THE LAST THO EQUATIONS READ DIAG(I)#XI + U(I)sII+1 I R(I) —RATIO#DIAG(I)*II + DIAG(I+1)*II+1 = R(I+1) OOOO ELIMINATE II FROM LAST EQUATION 45 s(I.2) S(I. -41 42 43 IF (Z -5) _ .1) + S(I—1.1)/3.4))/S(I. 6) D = s(I.1) BREAH(L+1) = TAU(I) + DEL CDEF(2.s(I.L) 65 A K = 4 IFLAC = 1 # - '\.L) CDEF(1. GO TO 55 DEL = ZETA#S(I.ZETA C = S(I+1. # 6.—3. as L = L + 1 TO BREAK(L) .L) .4)*S(I.*(C*ALPHA — D)/S(I.L) CDEF(2.*(D#ALPHA*ONEMZT + CIZETA) 6.L—1) DIvDIF + S(I.I(C . .)#(COEF(3.L—1)) GO TO 55 COEF(2.4)/C. Then.1|-1' \-.L) = (s(I+1. we interpolate by a cubic spline to the same data used in Example XIII(29).)+C#ZETA*(ZT2- CDEF(2.1) BREAK(L) = TAU(I) + DEL ZT2 = ZETAII2 ALPHA = ALPH(DNEMzT) FACTOR = ONEMZTIIQIALPHA CDEF(1.*(1.L) CDEF(3.1 = CDEF(2. 0. once again.5.L) CDEF(4.1>*<2.L) = CDEF(s.4)/6.4))/6.*FACTOR)+C*(3. . First.DEL*(COEF(3.L—1) COEF(2.1)*ONEHZT**3) COEF(3.L) = COEF(4. using the “not-a-knot” end condition and obtain. #\.4>)/s(I.DIALPHA)/S(I.L—1)+DEL*(COEF(3.L) DIVDIF — S(I.Example: Taut cubic spline interpolation 275 ZETA I GAHIZ UNEMZT = 1.*D + C) 6.1) CUEF(4.—ALPHA)/(DELIZTQ) = CCEF(2.—ALPHA)*C/(S(I.L-1) COEF(2.L) —(DEL/2.L—1) + DEL#COEF(4.L—1) L = L + 1 +(DEL/3.L) = GTAU(I) + DIVDIFIDEL I + S(I.*s(I. RETURN 999 IFLAG = 2 RETURN END (17) Example: Taut cubic spline interpolation to Titanium Heat data As an example.DNEMZT ALPHA = ALPH(zETA) C = S(I+1. D = S(I.L—1)) COEF(1.L) = CDEF(4.)*COEF(4. we also construct the taut spline with '7 = 2.L—1) + 6.L—1))) Ill’ GO TO 63 ‘I DIVDIF 0.L) = DIvDIF . — Z) IF (DNEMZT .L) CDEr(3.EQ.J"--I DNEMZT = GAH*(1.TAU(I+1> L = L .*ZT2— l. we picked the Titanium Heat Data which caused the optimal quartic interpolant in Example XIII(29) to oscillate so wildly.1)*(2.L—1)+(DEL/2. O.1) GO TO es 52 53 \.*D*(1.) ZETA = 1.L) CCEF(4.1)**2*(D*ONEMZT*(FACTOR-1.6) L = L + 1 DEL = ZETA*S(I.)mCOEF(4.L) COEF(4. 1 . CcEF<4.6.)*COEF(4.L) .L—1)+(DEL/2.4)-s(I.4) + S(I+1..1) = COEF(4. .L—1)+DEL*(COEF(2.1)*(D*(1.4)*S(I. some oscillations (see Figure (18)). Cy) that it should take on certain values Pi = (zri. We note that lVlCAllister & Roulier [1978] also use carefully placed additional knots to interpolate correctly to data that are both monotone and convex. b] for which Ci = ii.5.6 . e could enlarge the set of possible parametrizations further by allowing the interval [a .4 2.3 . . N. but |-1-It|. He develops a cubic spline ' ' ' ' ' d uces a c_u_rv_e in tension that has only one continuous derivative but pio with continuous tangent and continuous curvature when applied to the two components of a curve.2 I 2 1. ‘.6 1..6 1. Pro P er choice of parametrization A curve may.2 ‘ I 1 O. for a given curve Ci. Hence. there are infinitely C’ W many continuous function pairs (dii-. The program for this example differs little from that in Example d with XIII(29). BOO TOO BOO BOO 1000 1 1 OO The ordinary (dashed) and taut (solid) cubic spline interpolant to some points of the Titanium Heat Data.4 500 (18) FIGURE.di. I"-‘I: - --I D‘ -'—' ‘ll OB 0. . Taut SIJIIIIES. . . be parametrized in many ways. instead of using SPLINT and BSPLPP.with CAI-ll-1A = 0.) on [a . 1. b] to change as well.-_. We simply call on TAUTSPi once .4 1. . of Course.‘.u-— -—-_. Periodic Splines.. Cardinal Splines 276 2. Nielson [1974] w o iscu a surprising alternative to splines in tension. we know of the interpolation pair (cm. ' h d' sses We also alert the reader to the paper by G. once El Further details about the taut spline can be found in de Boor [I980].XVI. . With this we are back to the discussion of curve approximation.-_ . that is..' In Iifl. and do now take up the first problem mentioned in the beginning of the chapter. yi). i = 1. an GAMMA = 2. 301.NPIECE).11x.sCRTCH(4.5). and take from it the data points Pi = c(si).5).3)? as the Curve Ci..T(i2).8..N T T(I) = S(I+2—K) was INTERPOLATE TO XICOHPONENT CALL SPLINT(S.KP1.4.IFLAG.s(a). with (3.X.D(N.T(NPR).L.BCOEF.T.Y(N) * GOO A # ..HPRM1). the parameter interval [a . used when one has no idea from what curve the data have Come from.BREAH(NPIECE).5.N.4) . c.s/ ' C ### CDMPUTE Y—COMPONENT AND SET ’NATURAL’ PARAHETRIZATION DO 1 I=1.Q(s. 5 DO 5 I=1.xCDEF(4. .BANSLV#. . .QiBCOEF.x(a).x(N).3. .XCOEF. indeed.r.I). (19) Example: Choice of palrametrization is important We treat (the graph of) the function f(:r) = (2:-— .KP1.N.(s) = f(s).Ds.YY(NPOINT) INTECER I.NPIECE).s(N). We choose (i) the parametrization used in the definition of the Curve. ' In the program below.. note that only BANSLV is used and not the entire SPLINT when it comes to interpolating the second Component.also use a straightforward parametrization that might be.sCRTCH(R.ss.4. NPIECEI6.3. .H. and -indeed is frequently...NPOINT DATA K.1.<i. THU PARAMETRIZATIONS OF sDME DATA cALLs SPLINT(BSPLVB. NOTE THAT sECDND AND sECDND C LAsT DATA ABsCIssAE ARE NOT KNOTS.1HT) ICOUNT = 1 C ### CONVERT DATA ABsCIssAE TO KNOTS. .L) I.BSPLPP(BSPLVB*).1.2.K T(I) = 3(1) 6 T(N+I) = S(N) KP1 = K+1 C DO T I=KP1.3D1. .Example: Choice of parametrization is important 277 -I we have to Choose somehow the sites (si){"' in the parameter interval (and.K.2. . i = 1.HPOINT /4.ICOUNT.R) * .1Mx. EIAMPLE 3.>.L REAL BCDEF(N).Ix(NPDINT).. i = 1.N.b] itself) at which we would like to have (c. . 1 l ..BREAR(5).IFLAG.IFLAG) CALL BSPLPP(T. with ci(s) = s.xCDEF(K.NPOINTI21 C INTECER I.s.YY(21) DATA I /C.KPKM1=7.3)I=|-2 s(I) = X(I) _ PRINT 601 501 FDRMAT(25H ’NATURAL’ PARAMETRIZATIDN/5x. N = 8.<s.KPKM1.BREAK.N 1 YII) = (X(I)—.ICOUNT. . . . .YCOEF(K.KPKH1.BANFAC/SLV).SCRTCH.K.YCOEF(4. N=B. .Ix(2i).Ds.Y(s) .>> = (as). But we.N. namely (ii) the “uniform” parametrization Pi = c(i).ss.NPKI12. . . L I I CHAPTER xvi.5...¢.PPVALU(INTERV) C PARAMETER K=4.)? = (0.6).21/ REAL BCDEF(C). .K—1. ./(A111-i)2 + (Ayi)2. but if you don’t like little kinks in the curve.SS.4.BREAK. SINCE DATA ABsCIssAE AND KNOTS ARE C THE SAME FOR BOTH COMPONENTS.i)2) 1/4 .. . 2) STOP C ### NON REPEAT THE HHOLE PROCESS HITH UNIFORM PARAMETRIZATION ICOUNT I ICOUNT + 1 DO so II1.BCOEF.O) YY(I) .o> 20 ss I SS + DS PRINT s20.BCOEF) CALL BSPLPP(T. yi) = (i/10.(II(I). we get a kink or loop in the resulting interpolating Curve (solid). 10'"6) is inserted. Periodic Splines. A. .2...NPOINT)' 520 FORHAT(2F12. — 3) /10)“). then you’d better pay attention to the parametrization.YCOEF.L) C ### EvALUATE CURVE AT SOME POINTS NEAR THE POTENTIAL TROUBLE SPOT. then it is better to use Eugene Lee's [1989] centripetal scheme (21) 81 =0. For the parametrization (i).1HX. of course.-_. True.N so S(I) I FLOAT(I) PRINT 530 630 FORHAT(/26H ‘UNIFORM’ PARAHETRIZATION/611. If the resulting sequence S of parameter values is not very uniform. Cardinal Splines C III INTERPOLATE TO Y—COHPONENT. argue that we are only given the data points (Pi)? and nothing else and therefore one way of filling in the curve is as good as any other.TCOEF.CE.01). between the points (.L.278 XVI.I=1.H.YY(I). For the “uniform” parametrization.KPKH1. Instead of the printed output.PPvALU(BREAR. Splines. El One can.N 1O BCOEF(I) I T(I) CALL BANSLV(Q.N.7) IF (ICOUNT . N -— 1. it usually suffices to Choose 1" (20) s1 = 0.ICOEF.H. = A.)2 + (Ay. Experience has shown that any parametrization that approximates the arc length of the resulting Curve is suitable. as is done in cscvri of the SPLINE TOOLBOX (de Boor [1990]2). C THE FOURTH AND FIFTH DATA POINTS.K.ss.SCRTCH.. + ((aa.K-1. 1: 1. . . SS I s(3) DS I (S(6) -S(3))/FLOAT(NPOINT—1) DO 20 II1.11X. 1: 1. .ll-IY) _ GO TO 5 END The data points are approximately unifrihmly spaced.301. . we Show in Figure (22) the piece of the resulting curves.NPOINT 11(1) I PPvALU(BREAR.N. (rri. si_|_1 = si + 1.01) and (.N. Taut. Although considerable effort and much iteration can be put into a program for making the parametrization exactly equal to the arc length of the resulting curve.1. HE ONLY NEED TU USE BACKSUBSTITUTION DO 10 II1. except that an additional point (. we expect and get the original curve since both components are polynomials of order 4.L. '00) and some invertible matrix [ 3”‘ 2"" ]? Ideally. 11:1: uy we would like our approximation process for curves to be invariant under l‘ -TF.‘ .26 0.rI—If-I.32 0.-. This brings up the question of how the approximation might depend on the particular coordinate system in which we chose to measure the curve.38 0. = (C. What if we had used the (ii. that is.) then becomes the curve CA. The approximation Of 3 curve In the Construction of an approximation to a curve.c. = (Aci. D)-coordinate system instead. Acy).. Any process of approximation to functions can be applied to the two components of a curve.2 __.y) |—> ('u.3 0.301.34 0.36 0. __ 0._. Our approximation to the Curve Ci. but nevertheless uniformly parametrized..0) and (.== no + biiizi: + hwy 1-1 = V0 ‘l' bu:-I + biryy 1 all (I1 for some fixed point (110.24 0. 0. 'u.3. one is not limited to interpolation processes.v) afiine.4 Part of a Curve (thick) obtained by interpolation to data taken from a parabola (thin) and approximately uniformly spaced (with Azri = ..1) except for the pair (.10_6).22 (22) FIGURE.25 1. with the transformation B : (:i:. 0.F‘ The approximation of a curve - 279 1-3 12*“- 10 O 5 4 2 0 _2 0. Suppose we apply the approximation scheme A that produces the approximation f = Ag from certain information about the function g. 280 XVI. Taut Splines‘; Periodic Splines, Cardinal Splines such changes of coordinates since the choice of a particular coordinate system is often arbitrary and a Curve exists, in some sense, independently from the coordinate system that we happen to use to draw it. (23) Lemma. If the approximation process is linear, then the approximation curve C,.i,_, to Ci, is invariant under an affine change of coordinates B. Explicitly, then C',.i(B,,) = BCAC. PROOF. We are to prove that it does not matter whether we first go over to the new coordinate system and then approximate the two components or first approximate the two components of a curve and then go over to the new coordinates. ‘In the former case, we look at Ci in the new coordinates, as the curve Cii with d = Bc, that is, d'u.-Z '1-10 ‘l’ buses ‘l’ bnycyi do U0 'l‘ b'IJ..TCJ‘..' 'l‘ bvycyi -= and then get the approximation C',.i,,i. But then, ' /11(d'u)= 110 ‘l' bu:-'rA(1-is) ‘l' buy/1(@y)i A(d.,,)= no + b,,,$A(ci) + b,,,,A(a,,), by the linearity of A which shows that CAd = B(C',.i,,). El Spline interpolation and discrete Least-squares approximation, as discussed in Chapters XIII and XIV, are linear approximation processes, as are the many local Schemes discussed in Chapter XII. But taut spline interpolation discussed above is no.t linear since the location of the additional knots depends nonlinearly on the given data. Taut spline interpolation is homogeneous, that is, A(o:g) = o:(Ag) for any scalar Ct. Therefore, a curve approximation scheme based on taut interpolation is, at least, invariant under scaling, that is, under coordinate transformations of the form (:12, y) |-—> (biizil, buy). I Nonlinear splines Any discussion of spline curves requires at least a mention of nonlinear "spline interpolation in which one attempts to solve the original problem of spline interpolation exactly, by the construction of a curve with minimum curvature that contains the given points in the given order. Such a discussion was initiated by Even Mehlum in Mehlum [I964], and further elucidated in Mehlum [I974], and has also been taken up by others, e.g., Malcolm [I977], Brunnett [I992], Linner [I996]. In the present context of planar curves and in the present notation, the mathematical facts are as follows. Let Ci,-be a planar curve parametrized by arclength. This means that C; = (c‘,T,,,c[,) has unit Euclidean length everywhere, that is, l(7L(8)l == i/(¢’a)(8)2 + (¢§,)(S)2 = 1, 8 E l9 - - Ll, WI -in-.I-1_1.ri-r_I| :I Nonlinear splines - 281 with L the total length of the curire. Then its (normal) curvature at the curve point Ci_,(s) is given by I-a:(s) := s E [0 . . L], that is, equal to the reciprocal of the radius of the circle that has secondorder contact with the curve at that point. Non-linear spline interpolation seeks to determine such a curve that is smoothest in the sense that its strain energy, that is, the integral (24) _ [UL 11(5)” ds, is as small as possible among all curves that pass through the given Sequence P1, . . . , PA; of points in IR2 in that given order, Starting at P1 and ending at Pia, and satisfy an additional condition, like taking on a prescribed tangent, at these two endpoints. i A first difliculty with I1OH—l1I1t=38.Ji|T'[SpllI1E! interpolation concerns the length of the curve, that is, the choice of L. If we leave L as one of the parameters to be determined by minimization of (24), then, as already pointed out in Birkhoif & de Boor [I965], it is possible to make (24) as small as one pleases, by the simple device of allowing the curve to form huge near-circular loops between successive points. This device works because the curve given by the rule C(s) := o + R(cos(s/R), sin(s/RD: s E [0 . . 27TR], has constant curvature, 1/R, (evident from the fact that it is just a circle of radius R), and length L = 27TR, hence (24) evaluates to 27TR(1/R)2 = 2rr/R, and this goes to zero as R —> Co. One therefore looks, more precisely, for interpolating curves that minimize (24) either for a fixed length, L, or with L bounded by some given constant. In the latter case, one then looks, more precisely, for ‘critical’ values for L. Between each pair Pi, Pi_|.1, a minimizing Ci, can be shown to have to satisfy the differential equation ' —CQ” + AC; = a, for some constant A and some constant vector a, and this leads to an explicit description of that segment of Ci, in terms of elliptic integrals that depend on /\ and a and on constants of integration, and requires the determination of all these constants from the requirement that the curve Segment connect R with Pi_|_1 in such a way that a smooth curve results when these various segments are concatenated. The above-cited literature details the resulting difficulties and how they might be overcome in various waysil for example by approximating, as does Mehlum, the exact solution by a Sequence of properly chosen circular arcs. With this, we are back to the topic of approximating a given curve. 1. ! J I 282 XVI. Taut Splinw, Periodic Splines, Cardinal Splines Pel’lOdlC splines If the curve Ci, to be approximated is closed, then its component functions Ci, Cy are periodic and it makes sense to approximate them by periodic Splines. Periodic sphnes of order it on some interv [a differ from other Such splines only in that they satisfy the periodic boundary conditions _ _ - 1 f(3)((I.+) = f<@>(t"'), A I all |' . - j = 0,...,k - 1. In contrast to other boundary conditions discussed earlier (in Chapter ._IV1 . . an d XIII) , p eriodic boundary conditions are not separated. The typica linear System for the construction of periodic splines therefore fails to be ' ' t' s. banded‘ the first few unknowns will also appear in the last few equa ion Still it, is possible to modify programs such as BANFAC/SLV XII. (See and fli in ' tl BCHFAC/SLV in XIV appropriately to Cope with this fact e cien y also the discussion of periodic splines with uniform knot sequences below.) ' directly ' ' ' ' If we nee d a basis Periodicity can be built into the B-spline basis. for §2=={f€II..%ii‘£li,2l)jf(€il') =Djf(€;+1),j=0,...,V1 -1] for some positive integer I/1, then we would modify the construction of the ' ' IX(50), as follows. We ch oose .. £1 and Q i_|_1 to be knot sequence as given in knots of multiplicity It — I/1 only and obtain the remaining end knots by a periodic extension of the interior knots.,.Precisely, we would set l r..,,1=-~~=A.=a and would then determine the remaining end knots by it = tn—i11+i '- (€i+i -' £1), 3-11 '5- I T1 this waY1 we obtain a basis for II,-;ii,_¢_=,,, in which the (§i_|_1 -£1)-periodicity is mirrored by the (n -— I/1)-periodicity in the B-spline coefhcients: o f‘-_='-EC!-i'_B-i,ES 1' i‘ Cl!1',=OI-n__i,1+-5, _ ?.=‘=l.,...,I/1. In many situations, though, periodicity can be handled to sufficient accuracy merely by extending the data -periodically and. approximating on . . . h. . itbvi_ an interval somewhat larger than the interval of periodicity. T is 1S o ously true in Case the approximation process is local. See Chapter XII for ' ' ' ' o ess is me examples But this is also true in case the approximation pr c SO . essentially local. This imprecise term is meant to describe the situation ' ' ' h f tion where the effect on the approximation Ag of a change in t e unc g on Some “small” interval [oi . . B] becomes less and less noticeable as one ' ' d an ins ' tance in Chapter moves away from the interval -[Ct . . ,8]. ' We discusse VI and brought out the importance of this notion in connection with knot Cardinal splines 283 placement algorithins in Chapter XII. A typical example is Cubic spline interpolation at knots to data at uniformly spaced Sites Ti = ‘T0 + ih, all i. If one writes the interpolant in Lagrange form, ~49 = Z:9('*'i)Ci=- ~ then the function Ci is a cubic spline with Ci (*r_i) = c‘.ii_.,.-, all j , and it tells us explicitly how a change in the datum g(Ti) affects the approximation Ag. It can be shown (see Birkhoff -it de Boor [1964]) that, in this case, lc-i(-T-')l E /\_j 101‘ I C [T1-3' '1'-i.+_;,r], with A = 2 + \/5 = 3.732... (see Problem V1.6). Cardinal splines It often happens that the approximation problem to be solved can be handled well by splines with equally spaced knots. Such splines have been called cardinal Splines by Schoenberg, and many facts about them have been gathered in Schoenberg’s [I973] beautiful monograph. Because of their simple knot structure, such splines can be studied in much more precise detail and there are many computational advantages Connected with their use. The advantages of Cardinal splines over others are typified by the fact that, for cardinal splines, there is essentially only one B-spline of a given order. All others of the same order are (dilated) translates of this one. Explicitly, let Qii denote the B-spline of order it with knots 0, I, . . . , k, that is, ' (25) Qi,(:.r:) == t[0, . . .,k](- - A)’;-1. Then, for the knot sequence t = (ti; + ih)§§_,,,,,, <26) B==.A.i<I> = one - A)/hi. - all Among the consequences of this fact are the following: (i) ‘Conversion fi-om B-form to ppform is much cheaper than in the general case. If f = Z:cciQii((- — ti)/h), then D""r<r.> = ZeD"Qt(<i. - tr)/h)/hf, hence 1 k:- 1 h"'D"'f(t_,) = Z o<,._iD"'Qi,(i), -.- = 0, . . . ,1 - 1. i=0 The matrix (DfQii(i))f:?_;'_i_0 is constructed once, and then applied to the appropriate section of the B-coefficient vector or to produce the polynomial coefficients. 284 XVI. Taut Splines, Periodic Splines, Cardinal Splines (27) Example: Conversion to ppform is cheaper when knots are uniform Computer aided design people are using Schoenberg S variation diminishing spline approximation XI(33), typically with Cubic splines, and with a uniformly spaced data sequence. If the resulting function f ='-“ Z:9(1i)B-A4 is to be evaluated extensively (as it would if it were to be graphed), then it pays to convert to ppform. If the spacing of the data sites is ti == to + ih, all i, then f(t.) 1/6 2/3 1/6 g(1:._A) h2f”(t_,) 1 -2 1 g(1,...,) ' l13f”"(13A) -1- 3 ‘"3 hm.) 2 -1/2 0 1/2 9(1A-2) |-1O1_:DC1 9055) _ El For this and other values of lc, the matrix (D"'Qii directly from BSPLVD. If = i, i = I, . . . , 2k, then ' CALL BSPLVD (T, it , TUE) , ls, SCRTCH, can be obtained DBIATX, ls) produces the array DBIATX of order (lc, ls), with DBIATx<r+1,A-»r).-=D"Q,,(r), £=r=0,...,k—1. , (ii) In typical approximation problems, the coeificient matrix is (almost) Toeplitz. If not only the knots, but also the interpolation conditions are uniform, then the linear system for the B-coeficients of the approximation is a Toeplitz matrix, that is, is of the form (C'1"_j)'1'ij for some fixed sequence It is possible to give explicit formulm for the inverse of such a matrix, but this has no practical application. The chief benefit in computations lies in the fact that such matrices are easy to generate. Also, the matrices are usually only almost Toeplitz since the end conditions usually spoil things. (28) Example: Complete cubic spline interpolation at uniformly ti, . . . ,t,.,_|_1 has as its linear system for the B-coefficients 5P aced sites of the interpolant the following: -(I1 £I'i—1 ‘_C11ri.—2 + (13 + 411i + C1111-|-1 "l‘ an = 2hg’(t4) Z 6g(ti-I-2)! = 2h'g’(t'r|.+1) 21' Z 21 ' ' ' 1 T1’ W 1-1 Periodic splines on uniform meshes 285 assuming that t, = tg +ih, all i (see Problem IV.5). The matrix is therefore Toeplitz except for the first and last row. In Schoenberg’s [1973] investigations of cardinal splines over a biinfinite knot sequence, the various matrices that occur are biinfinite Toeplitz matrices. The fact that their effect can be easily analyzed with the aid of the Fourier transform is at the basis of Schoenberg’s successful and elegant analysis. It is possible to recapture the spirit of such analysis in the practically important case of Periodic splines on uniform meshes We take a biinfinite uniform knot sequence t = (ti) with t, = tg + ih, all 21, and 3_ ;,_, .- =1, and consider all 1-periodic splines of order is with knot sequence t. We denote their collection by S. If f E $,t,_-,, then f E S if and only if its B-coefiicient sequence is"nperiodic, that is, f = ZCI1;B»g‘k1t CEi+-n_ -'= C1511, ‘Ii. 1 This shows S to be a linear space of dimension n. El For a given 1-periodic function g, we construct an approximation Ag D from S by the requirement that (29) Mr/49 = H19, ' 3-11 ii with (30) my = #90 + ih), all @- For instance, if we choose /lg = g(a) for some fixed site a, then pig = g(a-+'£h,), and our approximation process is nothing more than interpolation at the n equispaced sites a + h, a + 2h, . . . , a + nh. Again, least-squares D approximation to a 1-periodic function g from S fits into this pattern since the approximation Ag is then characterized by the fact (see, e.g., Lemma XIV(16)) that H /B,(x) (Ag) (rr) da: = /_B,=_(a:)g(:':.:) Cl;'L', £= 1, . . . , n, 1 I _'__l it 236 XVI. Taut Splines, Periodic Splines, Cardinal Splines and this is of the form (29) with _ ' ‘.1 pg = f.B@<=1=>g<w> cu. because of the uniform knot sequence. 1- D The corresponding linear system for the B-coefiicients or of Ag G S has the form 2(mBr)fl§ = my, 5 all @- But, because of (30) and since B5 (:r:) = Bq(:r: — jh), we have MB; =P»B§(' + ih) = HB0(' + (1 — .’llh..l=1bi—jThe linear system for the coefiicients therefore reads Z b-;_5'C.l!_.,' -—-" pig, all ‘ll. 3' U We now bring the fact into play that Ag G S, that is, tr, = o:,_,_.,,, all i. Then (31) reduces to the nth order linear system Tl- (32) 20,5-4:1,: = pig, J'=1 - i= 1, . . .,r;., in with 1 1',» C-53' I-= Zb,'___7'_,--R, 1' -'=' 1,...,T't. 1"‘ In the typical situation, p. has its support in the open interval (to . . tl,) _' B 0( Ellldl-l1E!I1l?-i-'=].L-5 B 0-11. _' -- O 11I1l€SS (T9 t;,)fi (TY.,_.. ll-_g+_r¢:l 75 Q, that is, unless \i| < lc. If then also 2k —— 1 $ n, then each of the sums in (33) has at most one nonzero entry. _ The coefficient matrix C := (c,,=) in (32) is a circulant, that is, c;;;=cr_., ifi-j=r-—s(modn). This means that the ith row of C . . entries of the . . are obtained . from 1thet (i —— 1)st row by Shlflilllg all EtI113I‘16ShQI1B to the right and putting the as entry of row '5 — 1, force d out now, back as the first entry of row 1., hence the name “cirCulant". . . t . The theory of circulant matrices parallels that of Toeplitz ma rices (which is not too surprising in view of (33)). Conslder the vector V0“) := (w”)':=1, with LU := e2"i/" (recall that i := This shows the basis (y(")):. In particular. with a. C) to consist entirely of eigenvectors for C’. But since B0(tg + gh) = Q.. This suggests the following way of solving (32): (i) Express the right side B := (mg)? in terms of the basis (v("))'f. Note that step corresponds to constructing a discrete Fourier transform of the vector .6 into VHB/rt. is even around is/2. then (see Problem 5) its inverse is also a circulant. that is.r““" = 1/of‘.n.. with corresponding eigenvalue sequence (p(o:")). (iii) Convert back to standard coordinates. _ 'r= 1. convert . if p(o:") yé O for r = 1. .). we can write p(o:") in the form Pl‘-J) = Z Bola . and step (iii) corresponds to constructing its inverse. := r0+kh/2.jh’)(L"ir)ji JFGQZ making use of the fact that o. 287 _ - (c'v(1"))j = 2 cjswrs = p(wr)wr3 : p(wr)(V(r))j 3 with _ ‘Tl- I= 2 C]_jI. either at the knots if is is even. For appropriate ‘values of n. . construct the vector D. .. if C’ is invertible.(k/2-j) cos(2'rrr'j/'n. . .Example: Periodic spline interpolation Then ... . (35) Example: Periodic spline interpolation to uniformly spaced data and harmonic analysis We choose pg = g(a. we get the formula p(w‘") = Z lil-Tl'=/2 Q. with its diagonal entries equal to the values of its associated polynomial at the nth roots of unity. . that is. if we go over to the basis (v("))T' for C"... that is. . r = 1.6. then every circulant goes over to a diagonal matrix.. .=1 and VH the conjugate transpose of V.. In other words. with V := (v§T))§'_. 11.(y) (see (26)) and Qi. or halfway between the knots if is is odd.). Our approximation process then becomes periodic spline interpolation.IIJ— 1 :i=1 the associated polynomial for C’.‘=1 for C" (as a vector space over the complex scalars. . For n Z21: -— 1. and if q is the associated polynomial of its inverse. . Van Loan [1992]) is therefore applicable in this process. the Fast Fourier Transform (see for example. premultiply by V = (V3/-a)"1.'?=1.. then q(o:") = 1/p(ufl"). ... n. to get the solution (34) *1 = VD§1VH(1-Lia)/H of (32). . that is. (ii) “Divide” by DP :== [p(o:1).1 VH/5’/n.p(o:"')]. given by -_- (37) W r *u=—oo Tr ‘T ll/E0 T-i-'U'J'1.) He found that o.i31V6S.. Cardinal Splines These cosine polynomials already play a basic role ‘in Schoenberg’s fundamental paper Schoenberg [1946]. it is interesting to note that the first substantial applicati on of s pline functions was carried out by Eagle [1928] in his work on numerical harmonic analysis.(g) in the simple form i I l (36) I d Cr(-49) : Trérlgli with the so-called attenuation factor 1". For instance. therefore ' Tl- A9 = 29011 + 2‘h)<3'(.-(g) :=‘/0 g(:i:)e"””"'“d:1: for r 2 n. then Tl v”.)) '-' fort-**=. Taut Splines. for a 1-periodic ' ' ' ' ' ) = 0( r _”) as r becomes function g with it continuous Cl61‘1V3. d these functions “lath functions” . He recognized.-(g) = E:. Since pig = g(a + jh).1r'1r" 'n. while.£O(I11od n).@/R = ‘ TI- Z901 +jh)@”"“"’“) r J:=1 1"=1 In this connection. that the number _ -~ 1 n - . all j.(Ag) could be obtaine from Z. EaSle P roposed as a remedy to approximate e. E:n+. . We can write the interpolant in Lagrange form. Periodic Splines..interpolant of the present example. (Eagle called ..-(Q l 31'Ele. / ( ( “ ._c. For.(Ag) mstea .288 XVI.(g) for all r.2'11) i=1 . The fact that the discrete Fourier transform of the interpolating spline ' " ' d e to the is obtainable so simply from the “cheap” approximation or is u _ symmetry of the situation. ‘H- Ag =1 2 g(Ct "l" _ i=1 But the “Lagrange” splines Cj are translates of each other.(g) by o. as others had before him. M9) == 5 Zslihle 2 "f j=1 is a poor approximation to the Fourier coefficient 1 c..—. 1 for r = Qlmod nil. we compute explicitly in step (i) the cusf th 1 eriodic tomary approximation to the discrete Fourier transform or e -p function g. with Ag the periodic spline . Use TAUTSP to constructan interpolant f to the cubic polynomial g(:i:) = :r(:r“ — 1) at -3. . U Forfurther information about attenuation factors (and a proof of (36)) see the detailed paper by W. 4. o This shows that 1‘l ». _0 1 2 3 4 5 0 0 . Supply numerical evidence for‘ the fact that least-squares approxima- .-. 1]. also on discrete harmonic analysis. To be sure. Use spline interpolation to gi_:i:) = sinzr over [-rr . . = n f C(:i:)e'“””'“ d:i:. + 1 equally spaced sites using TAUTSP. 3] at 'n. Problems 1.f = O (T1-4) if we interpolate g on [-3 . see Quade 8. hence with the discrete Fourier transform. all 3'. Can you make the interpolant convex through proper choice of 7'? 2. O. is of prime importance.001 -Y 10. Use TAUTSP to interpolate the convex data . A final word. nevertheless. .: Collatz [1938]. I do not advocate using the discrete Fourier transform (fast or otherwise) merely to construct an approximant such as the periodic spline interpolant of Example (35). 3. Show numerically that. for the derivation of asymptotic error expansions and for practical harmonic analysis. ||g . 1. Then check to what an extent the interpolant on [0 . 21r] is 21r-periodic.. . 311'] on 21 sites (using. 2. . 33. 21. For another substantial early paper on splines. -1. Consequently.</-19> = Z go + 3+») f co .Hi. Gautschi [1972]1.) dx 1 =nii. the connection between periodic splines on a uniform knot sequence and circulants.2'h)@'°”“"“‘ do J U ' 1 = 2 Q01 + jh)e-""Z1rirjh. the not-a-knot end condition). ' 1 @. -2. for example. 3. for theoretical investigations.f 3 O _ 3-h)e—21rir(:::—jh. the bandedness of the linear system to be solved makes it cheaper to solve the‘ linear system directly. Aside from the restrictions on n placed by the FFT. How badly does TAUTSP fail to reproduce g‘? Is f G Cl“)? Pay special attention to the interval [-1 .-(g)/S C'(:t)e'“”'”'“ dzr. But.-oblems 289 for the fixed function C’ G S with C(o + jh) = 503-. (y) dy =‘Q. ll \.)"f and with vi’) := (u2"5).290 XVI. . ‘I I if i F" . .(:I: + §)e"'”“ dzr = )“. (Hint: Show that VDVH is a circulant in case'D is diagonal.. Periodic Splines.v("). .) 6. Conclude that the inverse a circulant is a circulant..(:i: — y)Q. Taut Splines. ca := e2“'i/". Conclude that the equations for least-squares approximation by splines of order is and those for interpolation at knots by splines of order 2k have the same coefficierit matrix in case of uniform knots. Prove that I Q. for some vector or ? (cx.?=1. .. Prove that fQ..+.. -r = 1.. Prove that the nth order matrix A is a circulant if and only if AV“) = a.. Cardinal Splines tion by splines is essentially local. n.) 7. 5.(:i:). (Hint: Use IX(6). .]g. on the same domain X on which g is defined. Applicability of tensor product methods is limited. . i = 1. . as in the area matching approximation scheme in Chapter VIII.XVII Surface Approximation by Tensor Products In this chapter. but only on the linear span ‘H- F == spars)? == {Zea =-<1 e 111"} :i=1 291 . i= 1. i = 1. .)l. ‘Hweattempt to construct an approximation Pg in the form Zj=1 O! j fj... . We construct the specific approximation by interpolation with respect to linear functionals.. . . . by_ the requirement that (1) /\£Pg=/\. Again. = Bight.g = fJ“+‘ g(:i:) d:i:. .n.. but when their use can be justified. . with fl. . . . fr. . .r. i = 1. . certain fixed functions. . least-squares approximation. The approximation problem does not depend on the individual functions f1.. . we take a slightly more abstract view of linear approximation methods in order to show how to generalize them to functions of several variables by the tensor product construction. .n (to stick to the spirit of this particular book) and choose Aig = g(Ti). . the interpolation functionals. we might choose f.. This is ordinary interpolation. for certain fixed linear functionals A1..n. . An abstract linear interpolation scheme Most of the linear approx- imation schemes discussed in the preceding chapters (such as interpolation. .. For the given function g.g = [T1. . that is. n for some T1 < < Tn. . . . For instance. Or. allowing for osculatory interpolation.. An.. nor on the individual interpolation functionals A1.g. we might use )l. we might take }\. The reader should be able to supply many more examples (see Problems 2—4). . even collocation to a linear differential equation) fit into the following abstract framework. . then these methods should be used since they are extremely eflicient compared to other surface approximation techniques. . . f. Lemma(2).. that have all partial derivatives 3*+jf/5:1:'i'5y5 with i.-. b] with it continuous derivatives on the interval [a . b].A¢ : or G lR”} i=1 of the interpolation functionals.—. all defined on the same domain X . . that is. we have dealt with the linear space U = G(X) of functions continuous on the set X = [a . We can therefore phrase our linear interpolation problem or LIP as follows: to find. also A. . Here is the basic lemma concerning correctness and numerical solution of the LIP. requires that the sum of any two functions in U and any scalar multiple of a function in U be also in U. a statement that makes no reference to the individual fj’s any more. Here. .292 XVII. b]. We say that the LIP given by F and A is correct if it has exactly one solution for every g G U.g= Aih. In a moment.Aih for all or G IR”. and U contains F. In the preceding chapters. Linearity. we will deal with the linear space C(”"“)(X x Y) of all functions f of two variables on some rectangle X >< Y = [a. Surface Approximation by Tensor Products of the fj’s and the linear span A := span(Ai)T := {Za. j jg it continuous. U is so_me nebulous linear space of functions. i= 1. . We have also considered the linear space U = C("‘l(X) of all functions on X = [a . The-I1: (i) The LIP given by F and A is correct if and only if the Gramian matrix (3) A 3: ()\-ifjli1=1§?=1 is invertible. n = m is a necessary (but not a suificient) condition for the correctness of the LIP. Let (jg)? be a basis for F and let (Ag)? be a basis for A. to recall. .n if and only if ZctiA¢g = Zn. But.... for given g.b] >< [c. f_. In particular. to be in F. an f G F so that ' Af=Ag forall AGA... This is quite clear for the fj-‘s since we require the approximation quite explicitly to be of the form Z ct. that is.(:r:)'u('y).i=1 PROOF. with or = A"1(A. that A is not invertible. the LIP with g = O has more than one solution. ‘then there exists a nonzero vector or so that (IT/l = OT. ajfj is a solution of the LIP for g if and only if ‘i 2:=1i'--in’: J that is. The LIP for this function g then fails to have any solutions since Ag =. if and only if AC1: = (A1g)"f. .-\.. the correctness of the ‘LIP depends only on F and A and does not depend on the particular function space U in which F lies and to whose elements g we wish to interpolate. then we only need to have a way of evaluating the interpolation functionals A1. El Note that all the action takes place in the interplay between F and A. Since (. A being nonzero.)'f' is a basis for A. But then. . . Tensor product of two linear spaces of functions The tensor prod- uct of two (or more) algebraic structures is a well understood construct in abstract algebra. that is. Assume. For each it G U and ‘U G V. and also provides the formula (4). A :== Z. But then. this means the existence of a nonzero vector or so that Ao: = O.-. we have that f = Z5.é O = Af for all_choices f G F. An on a function g in order to interpolate it from F. Let U be a linear space of functions. . crj fj in F is different from the zero function. then the interpolant Pg G F can be constructed as (4) Pg = Zcrjfj. we give now a short discussion of this special case in order to spar-ii the reader an excursion into an abstract algebra text. If in Z n. But since we only need a few notions concerning the ten- sor product of two linear spaces of functions. a linear space of functions defined on some set Y into IR. and let V be. yet interpolates to the zero function. <1.[1 Tensor product of two linear spaces of functions 293 (ii) If the LIP given by F and A is correct. If in 5 n. hence exactly one solution f G F. it follows that the function f := Z5. Invertibility of the Gramian matrix A therefore guarantees exactly one solution vector (I. all defined on some set X into the reals. .-1.y) := 'u. hence we have A f = 0 for every f G F. the rule w(:i':. (:1:. similarly. vanishes at every fa. On the other hand. Once we have established the LIP to be correct. (A-5)? being a basis for A. there must be some function g G U for which Ag 75 O.g). since ( is a basis. .\.y) G X >< Y. for the converse. - which saves a little writing.. V = IR” considered as the linear space of functions on Y := {1.. ® t-. U®V= {E'i'. the map \- U><V—iU®V:('u. that is.)(Z o. One defines A ® p.. considered as functions onX >< Y={(i..all 1'.. . and.'m.n}.. be linear functionals on U and V..j=1. we easily recognize U ® V as the linear space l'I<a. if A ® it is a map on U ® V satisfying (5).... as functions on Y = IR. In this case. 1 i=1.. similarly. A simple and important example is furnished by polynomials in two variables: Taking U = H4-h.t1®U-1.2. But.GlR. the linear space of polynomials of order h..). . Let now A and p. considered as functions on the plane X >< Y = IR”. is a linear functional on U ®V.. as functions on X = lR.'v)+——>'u. . .. . the set of all finite linear combinations of functions on X >< Y of the form it ® '0 for some ‘U.””'. 1 and U ® V is a linear space (of functions on X >< Y).m}. .®'o is linear in each argument: (aiui + C-¥2'U»2) ® ‘v = 0¢1('H»i ® v) + EI2('b‘-2 ® '11).u¢GU. _ 'li®(i51'U1 +1521’-'2) =l61(u'®U1)'l'l62(u'®V2)'i In particular. then A ® )1.. One verifies that the tensor productis bilinear.)(.. U ®V is the linear space of all in x n matrices. GV.®v1):o:-i. some n}..i= of all polynomials in two variables of degree < h in the first variable and of degree < it in the second variable. (5) requires some discussion before we can accept . all Z o.. the linear space of real in-vectors considered as functions on X := {1. :'u.io.'u-1GV. e U and some v G V is called the tensor product of U with V and is denoted by U ® V.'v. Thus. 2.. respectively. .G__U.n }.. .294 XVII.. e ts) == Z(>m. A second simple example arises with the choice U = lR.n. n - U®V :={Zoa(u. ‘Ii i 1 Clearly..j) :i== 1. Surface Approximation by Tensor Products defines a function on X >< Y called the tensor product of ‘it with ‘U and denoted by 1 ‘Lt ® Further... and similarly V 7: 11:1. by the rule 1 (5) (A a ]J. 'w'= E it-1 ®'LJ-11. .. On the other hand. and it = n1 +'a2. that is.®v or 11. by the definition of ii. ‘Lug. t for some (u1. m = u®v. an element w G U ® V may be written in many different ways. The notation is correct./)’1t-..£’s and 'u1’s used to represent m since my depends only on m.v¢)’s in U x V... then. and to compute it as (5) qt Awe = Evil!/)()\1*¢)= -Z‘! . all :1": G X. in particular.)w. that is. If. ' my = Z’Uy(:!_. then we can write m as 'u. For. The doubts just raised can be dispelled as follows. On the other hand. If m is any function on X x Y.1) ®o1 -l-U2 ®o. the function on Y defined by m.1. _ i This shows that my G U.(I. Let now mg. using the linearity of A.y). mi. be the A-section of m.1 ®*u+'u. i whenever m = E t it-1 ® ‘U-5.Tensor product of two linear spaces of functions 295 it as defining a map on U ® V.-_ ® ‘U1-1. can be computed by (6) as mi = ()\'1t-1j)'U-1. all jg G Y. to define A-® p. depends only on m and A and not on the particular 'u. If. the rule (5) would give (>W»)(/Iv) O1‘ (>W1)(/Iv) + (/‘~'v»2)(/Iv) O1‘ (3A1¢1)(#v1)+(>W»2)(/-W) (among others) for “the” value of (A ® p. (5) makes use of the particular form of Z.(y) := Amy.{:l_.. 'u. on the function Egan ® oi. 'l. hence allows us to compute the number Amy. while ‘U = 31:1.2 ®o or even as (311. the jg-section of m. Correspondingly. defines a function my on X .. for example. and y is a particular point in Y. ® oi.£./). then wy(:i:) := m(:i:. that is. we can compute 'wy(:i:) as my(:i:) = 2. of the particular ufs and *uy’s.l'I)'?)-1'. to m(:i:.i1.V = Cf“) (IR).."> = m 1-1 (3"+“m/(3:I:“3y“))(a. the space of bivariate functions with all derivatives of order §_ (ls. (11. t all '0 G C'(“).w.)) is the identity matrix and. . Here. in particular. A ® ii agrees with the linear functional 1» == a§f. To give a simple example. ' o e U.i/) dy.)(ny. for some a and b. e = 5t” .1 jg’ 111. for every linear functional A on U and every linear functional ii on V. 1i and the function w = Ei to ® or and not on the particular constituents (it-1).) for V.(Au1)(. for all m G U ® V.)'_w = Amy = p. and to = *u(“)(b).. let U =.. it follows that the Gramian ((A1 ® . and let A = 6?-. Further.l<:). and this linear functional satisfies (7) (A ® p. with (A1) a sequence of linear functionals dual to a given basis (it-1) for U (meaning that the Gramian. for every ii. (5) defines a linear functional on U ® V.2). and to compute it as " Hwx = I-"(Z:()“-ii)'v-i) = Z:()l-'u*i)(/-"'l»'-£)This shows that the number Z:.1) depends only on A. In particular. my(:r) is the result of applying p. We conclude that. s 3 it. (oi) of its representation. that is. on U ® V.) is a basis for U ® V. hence allows us to compute the number aw1.® o1.io. A ® ii agrees with the linear functional 1/ given by the rule i/m =j (Ur/3:r")m(a..L-SE!Cl§IlOI1 of m. Then U ® V is contained in C'("°"'°)(IR.. By this we mean that Au = o<"> (a). my is the ]. t) since.296 XVII. jg) as a function of y for each fixed at G X . t all w E C(lc. and some integers r. ._. (Ayuj) is the identity matrix) and also (ith) dual to a given basis (111. Surface Approximation by Tensor Products This shows that my is an element of V.. = s<*>(@>'»<*'><b> = (>w)(1w)With [1 changed to pro := J *u(. 'u G C'(“) yrs e 1») = <@*+*/(o='@r>>~<1=>»(s>: 1.y) dy. all o e v. ls) continuous. .->1‘ and M == $P@-H(#t)i‘- . scosr. TX (NX+KX).t(b) = I1/WA. . and use the same notation as in the one-—va.. ... . . . KY. . LEFTY. Am of linear functionals on U is invertible.t(3l)i we can accomplish this by factoring out appropriately. Suppose that the Gramian matrix A := (A1 _f_.. The basic facts are contained in the following theorem. xx. in U and the sequence A1. V = $1. '\ wlfli 5) = ‘1-o5i. CALL IHTEHV ( TY. 0) VALUE = BVALUE (TY(LEFTY—KY+1). so that the LIP given by F := span(_f.B-£3. . .. b).. A. .The tensor product of two linear interpolation schemes (8) Example: Evaluation of a tensor product spline. 297 We take U = $1.k. 0) 11 .-y-) and for Bij (1131 U) 3= Bi. . using the second formula because of the way arrays are stored in Fortran.1.t. 0) so TU 11 no 10 J=1.= [a].-) for the sequence f1.h. . to be inian array ALPHA. an linear functionals on V.ue. that for the y—variable is TY(1)..h. for some coefficient matrix ((1. B. (9) Theorem. _f.KY 10 BCDEF(J) = BVALUE ( TX. or J with A . ALPHA(1.= [t].)‘i”' and A := span(A¢)T“ is correct. ._-j. Thus.. . assume that B := (fl--1:93‘) is invertible. HFLAG ) ‘ vntus = 0.. .. NY. .is added to indicate the variables.. gr.s(@) =-"c Amp wlfli ll’) = aij-Bi. . . B. and wish to evaluate the tensor product spline w G U ® V at the point (a. KY. the knot sequence on the :i:—variahle is TX(1). We assume the B-coefficients oi.3‘ (J!1. .“. 1.i=. .. TY(NY+KY). E] The tensor product of two linear interpolation schemes We are new ready to consider the product of two univariate interpolation schemes. “ IF ( MFLAG . Since m = 211._. with g1. '1 ' The following program fragment carries out this evaluation with the aid of the function subprogram BVALUE. in V and 11.LEFTY—KY+J).riable case except that the letter X or Y.s(a))-Bj... . Similarly. . Explicitly. and set G == spw(g. . KY.k.s($)Bj.t(b))Bt. i)n o 9.t ® U) = (A-11._. Surface Approximation by Tensor Products Finally. for a given matrix L and a given m G F ® G. does not depend on the particular representation (13) . hence dimF ® G = (dimF) (dimG) = mn..j) := i/iy.(1._.(i.-) i.! (1') (f. = L if and only if the coefficient matrix I‘ for m with respect to the basis (fr ® g.y= for the (i. assume that (vij) is a matrix (or double sequence) of linear functionals on some linear space W containing U ® V so that I/y'_-.-) of F ® G satisfies r = A"1L(BT)'1. (iii) for given w G W.s._-i _ This shows that (AFBT) (r. this implies the uniqueness of the expansion (13) for w. all <r.(BT)"1 and (12) L.. 1')1'.293 XVII. we have L-. j)th entry of the matrix D. := A_1L. Here and below.’U) E U X 1.j.' all i. for some matrix I‘.s).i) 1'. therefore showing It follows further that. and since Ly.. 1) (xii) (its. or d.1. Remark._.m".1. e Q.) (].-_ ® gj) is a basis for F ® G. we write D(i. Since both A and B are invertible by assumption.: with (11) I‘ := I‘. 5) = (Ar e now = Z re.. then w = Z1"e.L_-'51)) fO1‘ all Then: and all (’Lt. (13) If m e F ® G.. = AFBT.i)A(ni)B(5..i = ZF(i. . _ El Paoor or THE THEOREM. the interpolant Rm can be computed as (10) Rm = Ere.. But then Lie... ‘ t Ly._. (ii) the LIP on W given by F ® G and span(iey=) is correct. = -is . proving (ii) and " I El . 3') rather than Dy.for m but only on m.. This gives a total cost of ' U (ma + mfn + ?'7't'l"t2 + n“) for computing the coefficients I‘ via (11). . a fact difficult to exploit in a direct attack on (14) whatever the actual ordering of I‘ into a vector might be. we have followed established procedure and solved such a linear system All = b by constructing a triangular factorization A£Au = A for A and then computing the solution x in two stages.g)‘f‘ = Ly.applying the substitution process to the n right sides L1. the computational savings in the construction of the interpolant Rm to be had by using (11) instead of solving the linear system (I-f'. We can obtain the jth column of the matrix product A"1L by applying A"1 to the jth column L_. . Of course. followed by back substitution. Assume that INTERA(A. for a total of 0 (mfn + mnf) operations. which is precisely the operation we have to carry out when constructing the interpolant Z. . Forsythe S-t Moler [1967] for the facts concerning the numerical solution of a linear system). Ln. getting y := Azlb. by forward substitution. but that would be wasteful and less accurate compared to the following procedure.. compared to 0 ((mn)3) for the direct attack.- The calculation of a tensor product interpolant The calculation of a tensor product interpolant 299 We come now to the heart of the matter. Equation (11) offers us the alternative of forming the product of an 77?. the construction of I‘ in a program would proceed as follows. In the preceding chapters. The computational cost for this is C? (m3) operations for the factorization. that is. getting x = A. by computing xm := A—1Lj. Q.sgj)F(ii = Lw(Ti 5): all T151 iii directly for the coefficient matrix I‘. b. x) . 11:2“ ) _f.f1(AE1b) = A'_1b. Its straightforward solution by Gauss elimination therefore would require C9 ((mn)3) operations (see.of L._. an m >< n.But such an operation corresponds to solving the linear system AX(“) I Lj for x(jl. to the data (A.'f-1y = A. we also have to produce the matrices A-1 and B“1. The savings are even more significant if (as is typical for the interpolation schemes in this book) A and B are band matrices. for example. and 0 (mfn) for. The straightforward thing would be to construct these matrices explicitly. x in. .. m. Equations (14) constitute a linear system of mn equations for the mn unknowns. Schematically. and an n >< n matrix. but stores the resulting n columns of A'“1L. involves the same interpolation scheme. denotes the ith row of I‘ taken as a vector. Assume further that BSDLVE. using the data vector b of length in and returning the coefficient vector x. I‘(1..I‘(-.'m. m. note that I‘ could be stored over Ly. I‘(i. The whole process of constructing I‘ could then be accomplished by just two calls. CALL INTERA ( A.. we propose here the following alternative procedure: ll/Iodiiy the interpolation routine INTERA slightly so that it works on all the n right sides L-y_. the specification GAI-ll-1A(I . b. Also. I‘(i. woax) CALL INTERB ( B. _ CALL INTERA ( A.1). 20 CALL BSDLVE ( Q. One can. I‘(-. while the Fortran specification GAMI-lA(1. Q.1‘) ) CALL INTERB ( B.-)._. ( Q.-) ) Here. J ). does indeed refer to the jth column of the matrix GAMMA as a vector. in the n rows of some work array WORK to be output. The following program sketch then would produce I‘ from Ly..1‘). Q. .y(-.n) in the same call. INTERA and INTERB could be the same routine if interpolation in :1: and in 1. n.1). mm.(-. ) produces from the factorization for A in Q and from the right side b the solution vector x = A"1b. at a place in an argument list where a vector is expected.(-. n. similarly. which would have further ramifications in subroutines called by INTERA. x. together with the factorization for A in Q. In particular. of course. j) denotes the jth column of I‘ taken as a vector.-).y(-. 1) does not perform the same service for the ith row of GAMMA.. m. Ly.1) ) DU 10‘ j --= 2. woax. m. . This would change our model-routine into something like INTERA ( A. For a proof. in practice. I‘(1. But.n 10 CALL BSULVE ( Q.300 XVII. Q.nQ. woax ). N. Ly. L.-) ) DD 20 i = 2. and. m. m.. Q.. see de Boor [1979]. L. But._. Surface Approximation by Tensor Products carries out the first univariate interpolation process (with INTERB constructed similarly for the second). 1"(-. 1" ). 1"(i. adjust to this by introducing an additional argument ISTEP to deal with a vector whose entries are stored ISTEP apart in memory. L. rather than play such games. By the Schoenberg-Whitney Theorem XIII(2). Once P is computed.. consequently.|¢'t l ll = (t£)?+k._|_. .. and U =C(X). . each of the three matrices on the right has row index i and column index j.. the linear space of continuous functions on the interval X.. Also. = Z I‘u(’ll. the linear space of continuous functions on the rectangle X >< Y..n of the given rectangular mesh..+. &I1d pi = [T5].'r. .. i= 1.t.5 ® Bjlkrt.. ® pi coincides (on U ® V) with the linear functional I/53' I ‘LU I--+ 'LU(0'5. The theorem therefore gives us. i = 1.. we take G = $. .]. we follow the above discussion and produce an expanded version of SPLINT of Chapter XIII. all i. Y = [t1. Similarly..._+. Ti) of evaluation at the point (o. and A.)'i"'+h. with r strictly increasing and ti < '1". we take X =[s1. U 12>-lb V is contained in Vl=F=. < 0. Additional editorial changes (principally changes in comments and . Then.=) G X >< Y. Further.... and We consider We have A.Tj). this problem is correct if and only if s.. .m with or... for given w G C'(X >< Y).. .+. Also.-th... with s -= (s.j)B-|‘_‘h. It differs from SPLINT only in that it accepts and works on several data vectors at the same time and.. := C(X >< Y). -Q t.]. < s. this interpolant can be written in the form R11. with F = (B... . We call it SPLI2D.m. puts out several sets of Bcoefficients.1=('c))_1Here. a condition we assume now.. exactly one spline function Rw G F ® G that agrees with w at the points (o..7'L. j = 1.s(¢'i))”1(w(<%'G)) (Br.1=. We have marked the essential changes with stars in columns 73-76. < < om. = 1. = [0. the interpolant could be evaluated as in Example To carry out the calculation of 1".]. all i.s.Example: Tensor product spline interpolation 301 ( 15) Example: Tensor product spline interpolation the following specific situation in Theorem F = $h__. . and V = C'(Y). M . J=1. OF LENGTH N IFLAG.HTAu(I)). BANFAC noes so PIVOTING.NP1 REAL BCOEF(H.J).N HITH THE SAME DATA AsscIssAE CAN BE OBTAINED WITHOUT corms THROUGH ALL THE CALCULATIONS IN THIS ROUTINE. _ THE B—COEFFS FOR THE IHTERPOLANT or AN ADDITIONAL DATA sET (TAu(1). N + K . T. N . BANFAC/SLV C THIS IS AN EXTENDED VERSION OF SPLINT . scosr > BCOEF. Q.N.._2*K=1. IN THE R O H S OF THE ARRAY Q . GTAU(...AN INTEGER INDICATING SUCCESS (= 1) OR FAILURE (= 2) THE LINEAR SYSTEM TO BE SOLVED IS (THEORETICALLY) INVERTIBLE IF AND ONLY IF T(I) . H. mamas: TAU...LT. CONTAINING DATA POINT ABSCISSAE. srscs THE ToTAL POSITIVITY cs THE MATRIX A MAKES THIS UNNECESSARY. GTAU.1 KPKH2 == 2-v-K141 . U U T P U T *##* #**# #### momma: ARRAY or sIzE (2*K—1)#H . IFLAG ) CALLS BSPLVB. CONTAINING THE TRIANGULAR FACTORIZ— ATION or THE COEFFICIENT MATRIX DP THE LINEAR srsrsn FOR THE BCOEFFICIENTS or THE SPLINE IurEEPoLAHT.ARRAY OF LENGTH N .. N. NP1 J N + 1 KM1 = K . to keep the record straight.) or THE SPLINE or onnsn K wrrn KNOTS T (1)..N).. HENCE.. WORK. K.. SEE connssrs IN THE PROGRAM sELow... FoLLouEn BY A cALL To BANSLV (wares THEN OBTAINS THE SOLUTION BCOEF BY suasrrrurros). B(I) I GTAU(I).302 XVII.. 1=1.Q(2*K-1. Surface Approximation by Tensor Products use of a work array instead of the temporary use of BCOEF) are marked by dashes in columns 73-76. LEFT = K **** TAUI**** * ..TAU(N). I=1.KPKM2..CORRESPONDING ARRAY OF LENGTH N CONTAINING DATA POINT ORDINATES...ILP1HX. SUBROUTINE SPLI2D ( TAU. ALL I. SIMPLY BY LOADING HTAU INTO scosr AND THEN EXECUTING THE cALL BANSLV ( Q. TAU(1+K)..LENQ.T(N+K). ALL I. .. HITH THE MAIN DIAGONAL GO— ING INTO sow K . ..T) ORDER OF SPLINE NUMBER OF DATA SETS ISFFZPQ ###** *#*# iii-III Pl 52 ‘U 1G T town: HORK A R E A amass: N FHE FrflEv?CURF7 OF'LENGTH aammm O.THE B—COEFFICIENTS OF THE INTERPOLANT.S' BCUEF(J. I=1...1) AT TAU (1). J=1.H.N).GTAU(N.H).. K-1...JJ. I.. AND A IS A BAND MATRIX WITH 2K—1 BANDS (IF IT IS INVERTIBLE).J.... DIAGONAL BY DIAGONAL. 1-1.. N... TAU(I) .H KNOT SEQUENCE. BCOEF.. FOR THE USE IN TENSOR PRODUCT INTERPOLATION. . . OF LENGTH N+K NUMBER OF DATA POINTS AND DIMENSION OF SPLINE SPACE S(K..HORK(N). SPLI2D PRDDUCES THE B-SPLINE CDEFF. TAU IS STRICTLY INCREASING A S S U H P T I O N . THE HATRIX A IS GENERATED ROW BY RON AND STORED.N..LT..K.LEFT. wares TAKES on THE vALuE cTAu (1. momma M E T H U D commas THE I-TH EQUATION OF THE LINEAR SYSTEM A*BCOEF = B FOR THE B—COEFFS OF THE INTERPOLANT ENFORCES INTERPOLATION AT TAU(I).... K-1. €3CHDC1 hfiCU MO(UCPOIUCMQCUFJCHD€UCPO(§CiOW3CPOC1 M?(§CP9ifif bfiflflfiig fih fflfi INTEGER IFLAG.KM1.. THE BANDED srsrsn IS THEN sotvsn sr A cALL TO BANFAC (wares cossrsucrs THE TRIANGULAR FACTORIZATION FOR A AND sroass IT AGAIN IN Q ). VIOLATION OF THIS connrrrou IS CERTAIN To LEAD To IFLAG = 2 .. KM1.I) IF (TAUI . KM1. WORK ) WE THEREFORE WANT WORK(J) = B(LEFT —K+J)(TAUI) TO GO INTO -—-- DIMENSION STATEMENTS) -"—- A(I. WORK ) no so I=1. WE TREAT Q As AN EQUIVALENT oNE-nIHENsIoNAL ARRAY (BECAUSE oF FoRTRAN REsTRIcTIoNs oN ENTRY . HENcE A(I.LENq s o(I> = o.J).(LEFT+J)-K) SINCE A(I+J.K.4). sToREn AcAIN IN o. T(LEFT)) co To ass IF (TAUI . K. N.. T(LEFT+1) MATRIX Is sINoULAR IF THIs Is Nor FossIsLE LEFT = HAxo(LEFT. T(LEFT+1>) co To ass ### THE I-TH EouATIoN ENFoRcEs INTERPOLATION AT TAUI.LE.J.E. T(LEFT+1)>.I+K-1] SUCH THAT T(LEFT> .J) CALL sAHsLv ( Q. KM1. K+KH1. IN WORK (USED FOR TEHP. c ### LooF oYER I To CONSTRUCT THE N no so I=1. INTO Q(I—(LEFT+J)+2#K. LEFT. IF WE coNsInER o As A TWO—DIM.N BCOEF(J.LEFT ACTUALLY MIGHT BE NoNzERo. TAUI..1 IF (TAUI . IN THE PRESENT PROGRAM.. .J> Is To co INTO Q(I+K.N O O QO O Q I-II 41 so ess ess ess WORK(I) = oTAU(I.M no 41 I=1.LEFT—K+J). cALL BANFAC ( Q.N TAUI = TAU(I) ILFIHA = HINO(I+K. BY THE FOLLOWING CALL BSPLVB ( T.LT. WITH 2*K-1 Rows (SEE coHHENTs IN BANFAC). oNLY THE K ENTRIEE WITH J = LEFT—K+1.NP1) c c c 15 INTERFoLATIoN EQUATIONS _ ### FIND LEFT IN THE CLOSED INTERVAL [I.co To 16 LEFT = LEFT + 1 IF (LEFT .GT.K JJ = JJ+KPKH2so Q(JJ) = woRK(J> c C ###OBTAIN FAcToRIzATIoN oF A . KM1.STORAGE HERE). 1.999). I.J) = B(J.LT. TAU(I) . N. THEsE K NUHEERs fififififi 16 ARE RETURNED.I) = WORK(I) RETURN IFLAG = 2 PRINT ess FoRNAT(41H LINEAR sYsTEH IN sPLINT Nor INYERTIELE) RETURN IkIiI'Ifi—lI1I #### #### ##** #### END We make use of SPLI2D in the following simple example of interpolation to a tensor product spline by tensor product splines of order (3. Q . K+KM1. JJ = I—LEFT+1 + (LEFT-K)*(K+KH1) no so :=1. ARRAY . ALL I. IFLAG ) " co To (40.T)(TAUI). ALL J..Example: Tensor product spline interpolation C 303 ZERO OUT ALL ENTRIES OF Q LENQ = N*(K+KH1) no 5 I=1. WE THEREFORE WANT WORK(J) TO GO INTO -—--—-- I -(LEFT+J) + 2*K + ((LEFT+J) — K—1)*(2*K—1) = I-LEFT+1 + (LEFT —K)*(2*K—1) + (2*K-2)*J or Q . IFLAc c wee SOLVE A*BCOEF = cTAu BY BACKSUBSTITUTION 40 no so J=1. ILPIMX) co TO 15 LEFT = LEFT ..LT.LT.. (TAUY(I).N cALL SPLI2D(TAUY.J) = o(TAUx(I).WORK1(?.s) ### CONSTRUCT B—COEFFICIENTS OF INTERPOLANT cALL sPLI2D(TAUx.TAUY(J)) — A BVALUE(TY(LEFTY—KY+1).EcoEF(1.Nx no 41 JJ=1.J) = G(TAUX(I).TAUY(I).IFLAG) ### EYALUATE INTERPoLATIoN ERRoR AT MESH PoINTs AND PRINT our .o) 45 WORK1(I.HY).NY 22 TY(I) = TAUY(I—KY+2) ### cENERATE AND PRINT our FUNcTIoN YALUEs -PRINT s2o.s.6).WORK3.NY) A _ s4o FORHAT(//’ INTERPoLATIoN ERROR’//6F12.WORK3.TAux(Nx) KP1 = KX+1 C C C C C C C C .o.WORK2.(TAUY(J).Nx 1o TAUx(I) = FLoAT(I) Do 11 I=1.KX.Nx Do 31 J=1.scoEF. UsINc NOT—A—KNOT END coNDITIoNDo 2o I=1.NX. Surface Approximation by Tensor Products cHAFTER xvrr.TAUY(J)) 32 PRINT sa2.TY(NY+HY) A .TAUx(?).IFLAG.Tx(Nx+Kx).J.NY=s.WORK2(7).Kx.4/ REAL EcoEF(?.0.KY.KY _ TY(I) = TAUY(1) 21 TY(NY+I) = TAUY(NY) KP1 = KY+1 no 22 I=HP1.xx.Y) = AHAX1(X-3.I=1.WORK3(NX*HY) INTEGER I.TADY(NY).(NoRR1(I.JJ. INTERPDLATE AT KNOTS BY CUBIC sPLINEs.WORK1.Kx Tx(I) = TAUx(1) 11 Tx(Nx+I) .)**2 + AMAX1(Y—3.J.KP1.HFLAo) Do 4s I=1.NY 31 BCOEF(I.KY.KY.NY) s32 FoRHAT(F5.LEFTY.IFLAG.KN=s.BVALUE(BSPLVB*.TAUY(e). ENAHPLE 2.LEFrY-NY+JJ).WDRK2(NX).WORK2.N '-¢P'€ NY.1) Do 32 I=1.TAU1(Nx).0) no 4s I=1.NY=4) REAL EcoEF(NI.TAUx(I).Nx 4s PRINT ss2.1.Nx.NY+1.Tx. BIVARIATE sPLINE INTERPoLATIoN cALLs SPLI2D(BSPLVB. no 12 I=NP1.LEFTY.1) Do 4s J=1.NY 2o TAUY(I) = FLoAT(I) DO 21 I=1.s).HFLAG.5.INTERV*) GOOD INTEGER I.NY).eE12.WORK2.J=1.TY(1o) t .J).J=1.TAUx(I).WORK1.O.NY cALL INTERv(TY.MFLAG.KY.)**3 C ### sET UP DATA POINTS AND KNUTE C C IN x.TAUY(J).NY) o2o FORHAT(’ GIYEN DATA’//6F12. INTERPoLATE BETWEEN KNOTS RY PARAEoLIc sPLINEs.TADY(J).PRINT s40.J).KY /?.WORK1(NX..KY 41 NoRK2(JJ)=EvALUE(Tx.NK.(EcoEF(I.NY) sToP END - .NY DATA Nx.Nx 12 Tx(I) =_(TAUx(I—Kx+1) + TAux(I—Kx+2))/2. IN Y.INTERV. USING NoT—A-HNoT END coNDITIoN Do 1o I=1.TY.NX.BCOEF.JJ.NY PARAHETER (NH-7.304 XVII.WDRK3(42) G(X.J=1.NY.LEFTY.BANFAC/SLV).Tx(1o).KX.IFLAG) F15‘? --¢H . .-+1).DDDDDDD DC-‘ICTCID D 1. a tensor product. . = 1.)€+1 for f G $.h.74. it.h 1 I 1 p=1H.00000+OO OOOOO+OO OOOOO+OO . i = 1.473?O-14 0...11842-14-O.fi|-I5-IAJRJI.'JTl"). if the subprogram BSLPP produces _the break sequence (§._p.¢)€+1 of breaks in each variable.A ® $1. not unexpectedly.6. for ‘LU G $A.. consists of the integers E. since they usually lead to one more or more numbers. I.-(f) := _f("1) (§_. .(f)E. giving the number of pieces and the order for each variable. the tensor product of the ppform for univariate splines._. indeed.. . since c. as the polynomial coefficients of f on the jth interval Q.e ® $k.. 1 The ppform of a tensor product spline is. The output shows the error to be acceptably small (for 27 binary digit floating-point arithmetic) except in the last row and the last column.11S42—14-O.£ 1 r A jiljiiliik.j.00000+OO 0. we are led into trouble once'again_ by our use of a right continuous BVALUE where we should be using a left it continuous one when evaluating at the right most knot.The ppform of a tensor product spline 05 INTERPOLATION ERROR “~lC1(.q(f ® g) = c-. they then must consist of evaluating one or more linear functionals on the tensor product w. .00000+OO OOOOO+OO OOOOO+OO OOOOO+OO 44409—15—O. .. Correspondingly. Q.00000+OO 19073-O5 OOOOO+OO 19073-O5 OOOOO+OO O. .(g) := g("i"‘1) ({. _ (ii) the two sequences (§.. we should take the last it knots greater than the last Interpolation site. . thus providing a rectangular grid..)f+1 for g G $1“.11Q21—O6 29802-OT 0.0 6. 44409-15—O.._.0 5.. . h..)€"'1 and (§.00000+OO 0. . I-Iere. This is. j = 1.6..47684-O6 O.00000+OO OOOOO+OO OOOOO+OO 95367-O6 OOOOO+OO OOOOO+0O OOOOO+OO 0.t- The evaluation of a tensor product spline from its ppform The typical operations one might perform on a tensor product w are linear and. j = 1.0 2. qiliii-hie +_1 1 S-q) .. 9536T—O6 0. . ..w I ‘y Q-+ 1 (P =1H... and E. The tensor product of this information.0 3.(g) for every f ® 9 € $A.0 OOOOO+OO O.0 4._.. Specifically.").14305-O5 OOOOO+OO 19OT3—O5 O. assume that the subprogram BSPLPP produces the break sequence (Q-. k. . or we could first convert to ppform as is done later in 1 Cl Example (16). Else. then it also provides the numbers c'i. It then also produces the numbers c.. . OOOOO+OO—O..95367—O6 0._ '—1Dj~'1.11921-O6 O OOOOO+OO O OOOOO+OO OOOOO+OO OOOOO+0O OOOO0+OO-O. (iii) the four-dimensional array Ii __ f c1pIJIq\w) L__lD1 . .. This brings up the point that evaluation of a tensor product at many points is done most efiiciently whenthe sites lie in lines parallel to the coordinate axes. and. preferably on lines parallel to the y—axis. K. .. KY for w as follows (assuming that P: . crgj. L. It is also clear that the big calculation in the DO loop need not be repeated if we only change b. that is..CDEF(1. COEF.KXxnr) VALUE = PPVALU(BREAKY(LEFTY). KX . for each j.J. LX.LEFTY. if _v = A ® 11 on F ® G.q(w)1 irpr . and we must have a way of calculating Af. to the jth column of the coefiicient matrix (crij) for w.COEFY. then it has a representation w = EC!-jJ'f-5 ® g. LY. Therefore. for all 1. LY.306 XVII. we apply our scheme for evaluating A f from the coefficients (ai) for f to the specific coefficient sequence cr1_.7-1 ll ' cALL INTERv ( BREAKY. 1/ = A ® 11. then We can evaluate I/(11)) by forming the tensor product of the codes for the evaluation of A and 11. as long as b remains in the same break interval. .g_. j ) returns the number (D-I f) (rt) if the ppform for f is in BREAK. then we have 1 Aw = Z e. say f = E ou.___"_ID.-) for g to this particular coefificient sequence.-. Then. we must have available a representation for f. We then compute Af by Z:cr. MFLAG ) no 10 J=1. To pursue this point a bit further. Therefore..-. If now w E F ® G (with F :=-= span(f. COELF. BREAKY.o. one gets the univariate B-form along that line.()\f.] J ‘I- In efl"ect.KYJxs) Note the similarity with the program sketch in Example It is clear that it would be more efficient to work out -an expanded version of PPVALU to combine the various calls to PPVALU in the DO loop into one. converts it to ppform via BSPLPP and then uses PPVALU.(p.) and G :== span(g. COEF. we apply our scheme for producing pg from the coefiicients (Q. L.=_). because of Fortran.~. This procedure was illustrated in Example We now give the evaluation from the ppform as _a second illustration.LX.'w(o. we calculate pg in the form Efl_. K. thus producing a number 465. b) ‘from the ppform BREAKX..).-)). We know that A PPVALU ( BREAK. (1. in order to evaluate the linear functional A on some function f. that is..p. Surface Approximation by Tensor Products If such a linear functional 1/ can be written as a tensor product.j._-.1. Rather.-(>~A) (#95) =4 ZQ: 0-'-ij>\f4)#Qj1-. . we can calculate the nuniiber D. it does not pay t0 produce the storage consuming ppform.7-I = ci.=_f. Similarly.. as long as LEFTY remains unchanged.-.1.LEFTY). More explicitly. in such a circumstance.KY 10 CUEFY(J) = PPVALU(BREAKX. . N. WORK.BSPP2D (TX. KX. .WORK2. i SUBROUTINE BsPP2D ('T.LENCTH OF BCOEF AND DIMENSION OF SPLINE SPACE SPLINE(K. K OF SOME SPLINE INTO -—-C ITS PP-REPRESENTATION BREAK... . LY. K.. . OF LENGTH N+K ' BCOEF(. BREAKY. i= O.LY) Here is such a routine BSPP2D. .BREAKY...BSPP2D (TY.. L...J) B—SPLINE COEFFICIENT SEQUENCE. COEF. BREAK. KY is accomplished by just two calls to this routine. E: ) from the B-form for w. _ -With such a routine BSPPZD handy. in one fell swoop.. much as we generate all the B-coefiicients of the interpolant from the data vector by one call to SPLINT. We generate the corresponding univariate information (Di f) (§. We have again addeclstars and dashed in columns 73-76 of those statements modified in the original BSPLPP to accommodate a whole matrix of B-spline coefficients as input rather than just one vector. J=1..ORDER OF THE SPLINE "—-- W A R N I N G .. BCOEF(.LX) CMll.J=1. BCOEF.'. . COEF.). LX.NX*KX. . In this.. through a CALL BSPLPP ( T.COEF. COEF. L ) 1' which returns in COEF('£. M . NX.. . ) the pp—coefIicients for the function whose Bcoefficients are in BCOEF(. ...l').K.NX.Conversion from B-form to ppform COFIVCIFSIOFI from B-form 120 ppform 307 is another example of eval- uating tensor product linear functionals on a tensor product since it involves the calculation of the numbers D5111) ((. BCOEF. BCOEF.BCOEF.KNOT SEQUENCE... BCOEF.. TY.WORK1.. —*—* C Coocroo c I N F U T **#### T.BREAKX.LE. NJ. K . p= 1. OF LENGTH N . scRTcH.. T = 1. to a routine BSPPZD ( T.WORK1. SCRTCH.M). M #*o## OOQGGGOOOOOGO NUMBER OF DATA SETS W U R K A R E A **** mucosa SCRTCH OF SIZE (K. the conversion from the B-form in TX.NY. ..NY. coEF) **** cALLs BsPLvB c THIs Is AN ENTENDED vERsIoN OF BsPLPP FOR USE WITH TENSOR PRODUCTS -—-C CONVERTS THE B—REPRESENTATION T. K. THE RESTRICTION K . . namely by ' (HHJ.M 2' ..h— 1. N. KMAX (= 20) IS IMPOSED BY THE ARBITRARY DIMENSION STATEMENT FOR BIATK BELOW.. N. COEF(J. KY to the ppform BREAKX. KX. ll/I. BREAK.1).[. We therefore take here the tack of enlarging BSPLPP appropriately...l' .£.J). N. NEEDED TO CONTAIN BCOEFFS OF A PIECE OF THE SPLINE AND ITS K-1 DERIVATIYES FOR EACH OF THE M SETS **** ——~— . K. L ).WORK2. we follow entirely the suggestion made earlier concerning the formation of the tensor product of two interpolation schemes. H. BREAK. BUT IS N O W H E R E C H E C K E D FOR.KY.KX. NY....T) K. . JP1. Surface Approximation by Tensor Products C Commons U U T P U T commas BREAK.1) .. . DO 2D JP1=2.KMJ..308 XVII.S (IN scRTcH(.BREAK(N+2-K).S RELEVANT TO CURRENT KHOT INTERVAL IN ' 9 scRTcH(..K.JP1. D. 1.DIFF. IF (T(LEFT+1) . THEN cDHB— INE NITH THE B—sPLINE COEFF.H).J.. I. . OOOOOOOCEOOOOO C C c INTEGER K.LE..H..K.) ARRAY OF SIZE (K.H).SCRTCH(K.BREAKPOINT SEQUENCE.LSOFAR. .KHAK.I.LSOFAR) = BCOEF(LEFT.s RELEVANT TO CURRENT KNOT INTERVAL FOR THE J-TH DERIVATIVE BY DIFFERENcINc THOSE FOR THE (J-1)ST DERIVATIVE. DO 1O I=1.HH) — SCRTCH(I. CALL BSPLVB ( T.H SCRTCH(I. COMPUTE THE K—J B—sPLINE cDEFF.H..H. BIRTH ) DO 25 HH=1.J) = (I—1)ST DERP **** IVATIVE OF MM-TH SPLINE AT BREAK(J) FROM THE RIGHT.. MM=1.J...K DO 1O HH=1.. 1.T(N+K) #**a # . USING BSPLVB REPEATEDLY TO OBTAIN THE VALUES OF ALL B—SPLINES OF THE APPROPRIATE ORDER AT THAT POINT.K .HHJ DIFF = (T(LEFT+I) .T(LEFT+I . LEFT..LEFT. THE K. OF LENGTH L+1.N FIND THE NEXT NONTRIVIAL KNOT INTERVAL. T(LEFT).H—J) ) FOUND EARLIER TO COMPUTE THE (H—J—1)sT DERIVATIVE AT T(LEFT) DF THE GIVEN fififififififi 25 SPLINE.SUH LSOFAR = O BREAK(1) = T(K) DO 5O LEFT=K.M ###* cacao M E T H U D cocoon FOR EACH BREAKPOINT INTERVAL.1. RELEVANT B"COEFFS OF THE SPLINE ARE FOUND AND THEN DIFFERENCED REPEATEDLY TO GET THE B—COEFFS OF ALL THE DERIVATIVES OF THE SPLINE ON THAT INTERVAL.K—1. THE SPLINE AND ITS FIRST K-1 DERIVATIVES ARE THEN EVALUATED AT THE LEFT END POINT OF THAT INTERVAL.) co TO 2o -—-- OOOO 1s 2D -DO 15 HH=1.HH ###* PARAMETER (KHAK = 20) REAL BCOEF(N...H.BIATX(KHAX).HH) *#*# GO TO SO STORE THE K B-SPLINE COEFF.T(N+1) COEF(MM.HH))/DIFF CONTINUE **** ###: ###: FDR J = D.N+1—K).HH) **** **** .HH) = “ _.MH) 1O *##* #### FOR J=1.COEF(M. T(LEFT)) GO TO SO LSOFAR = LSOFAR + 1 BREAK(LSOFAR+1) = T(LEFT+1) IF (K .M coEF(HH. AND STORE IN SCRTCH(. WITH COEF(MM. 1) GO TO 9 ' DO 5 HH=1.FKMJ. KHJ = K — J FKMJ = FLDAT(HHJ) ' DO 2o I-1.J.GT.1 .HH) = BCOEF(LEFT—K+I.N).LsDFAR) = scRTcH(1.J+1) ..1.' (scRTcH(I+1..KHJ))/FNHJ -—-IF (DIFF . H-1... CONTAINS (IN INCREASING ORDER) THE DISTINCT POINTS IN THE SEQUENCE T(K).. FIND THE VALUES AT T(LEFT) OF THE J+1 B-sPLINEs DF ORDER J+1 WHOSE SUPPORT CONTAINS THE CURRENT KNOT INTERVAL FRDH THOSE DF ORDER J (IN BIATX )..J = JP1 .EQ.M A scRTcH(I..M #### 5 COEF(HH. MFLAG) DD 45 I=1. in order to convert to ppform. 2.KY 41 HDRK2(JJ)=PPVALU(BREAKI.TAUY(J).0) .KMJ.NY CALL INTERV(BREAKY.KK.4 PPVALU{BREAKY(LEFTY).TAUY(J).Nr no 41 JJ=1.JJ.LEFTY).LY.CUEF(1.KY.NY).CUEF) after the calls to SPLI2D.KY ' 41 NDRK2(JJ)=BVALUE(TX.J) = G(TAUX(I).KY.J) = G(TAUX(I).LSDFAR) = SUM CONTINUE RETURN 28 3U 50 ###-‘i Ii-‘### ##1## END (16) Example: Tensor product spline interpolation (continued) We add to our program for tensor product spline interpolation in Example (15) a few additional lines to convert the B-form of the interpolant to its ppform before evaluation.LEFTY.HURK5.sc0sF. LY = 3 for the parameter setting given in Example (15 ).KMJ. that is.KX.BCDEF(1.BREAKY.KY.TAUX(I). This requires (1) additional storage.TAUY(J)) " * BVALUE(TY(LEFTY—KY+1). REAL * BREAKK(LX+1).w0nK4.MFLAG) no 45 I=1.WDRK5(NY.NX#KX) with LX = 5 .K1.NY.WDRK4(KX.TAUY(J). T(LEFT).NY CALL INTERV(TY.1.KY.HDRK2.WDRK6(KY.WDRK6.LI.LEFTY—KY+JJ).BnsAKx.Ni.MH) + SUM CDEF(HH. DD 28 I=1.NY+1.TAUY(J).0) 45 HDRK1(I.D) by the corresponding statements using PPVALU: D0 45 J=1.1. JP1.L%#KI.TAUX(I).BREAKY(LY+1).CUEF(KX. (iii) replacement of the evaluation statements involving BVALUE DU 45 J=1.K CALL BSPLVB ( T.KX.KY.NX.NK DD 41 JJ=1.LY) .Kx.KY. BIATX ) KHJ = K+1 — JP1 DD 30 HM=1.JP1 SUM = BIATX(I)*SCRTCH(I.voaK5) CALL BSPP2D(TY. LEFT. (ii) insertion of the two calls CALL BsPP2n(Tx.LEFTY.0) 45 wnaK1(I.Example: Conversion to product ppform 309 C DU 3U JP1=2.LK).H SUM = U.LI.nx.TAUY(J)) .HURK2. a function f from $14.n.0 4.g. the error is suitably small everywhere.00000+00 17764-14 0.)g. This is.®. Thus. .. there is no advantage to be gained from using tensor products directly over other function classes when this requirement is not satisfied. then. along any other lines. E. we can adjust to it efiiciently. . Still. by local methods. But should this feature run along a diagonal line. + ls: — 1.t is a pp function of order h along lines parallel to the :1:-axis. _ Limitations of tensor product approximation and alternatives Approximation by tensor products is limited to situations where it makes sense (or. i = 1. Again..23B42—06 00U00+00 U.95367—06 5.14901-U7 0UO0U+00 0.11921-06 00000+00 0. in the form ()\.. .310 XVII.23B42—06 UOU00+00 0. in order to approximate well to it. at least does no harm) to have preferred directions in the app1‘0}<1—imant. interpolation to data given at some points in the plane cannot be handled directly by tensor product methods unless these sites happen to form the set of mesh points of a rectangular grid.r—axis.0 2. ..71054-14 00000+U0 0.19073—05 3.23B42—06 UO0U0+00-0.0 00U00+00 0. running along a line parallel to the :.476B4—06 00000+00 0. and a pp function of order ls along lines parallel to the y-—axis. while. a peak say. . for example. There is no hope of giving an adequate description of these techniques in a few pages. for some univariate linear functionals (Xi) and (pi)...m. ®$.476B4—06 00000+00-U. a waste in degrees of freedom and therefore in storage and computing time. that is. Alternatives to tensor product methods use the finite elements.59605-07 28866-14-0. if the function g to be approximated has a difficult feature. . for example. but do list the matrix of interpolation errors produced by it. we must have a fine mesh everywhere :1: and y. then. . at the very least. This time.1_. Another severelimitation of tensor product methods is the requirement that the information about the function g to be approximated be in tensor product form. Surface Approximation by Tensor Products We do not list again the entire program here.. if this is possible. . By this we mean that. This means that we end up having a fine grid even in regions where the function to be approximated is quite smooth. approximating functions that are piecewise polynomials over triangular subdivisions. the computational advantage of using tensor product methods is so large that it pays to bring a problem into this form. j = 1. INTERPOLATION ERROR wcnonocnxaw D€DCHDC)O€D OiDCJU4DC)O 1.0 95367-06 95367-06 00000+00 00000*00 47684-05 19073-05 38147-05 6.0U000+00 00000+00-0. that is. it is a pp function of order I1.0 38147-05 57220-05 00000+00 57220-05 22888-04 38147-05 15259-04 El 1“. by proper refinement of the mesh in the y-—variable.0 00000+U0 0.71054-14 00000+00 0. We refer the . or quadrilateral subdivisions. and describe the interpolation conditions. and to two specific. for any linear projector P on U with ranP = F . COEF. Show that. JDY) of PPVALU. let O <1 j -< ls. for given g G U.). Prove that then pi : f 1—> oi is a linear functional on F and consider A-..") (Dig) (:... Identify least-squares approximation as a linear interpolation scheme.=.. Take the difierential equation X)/(1)—(2) to be linear.. JDX. b] i=0 . <1 t..7T1.J.E.r: G [a . useful examples. Schumaker [I976]. Write an expanded version PPVAZD ( BREAKX. Construct an expanded version of L2APPR.Problems 31 1 interested reader to the survey articles by L. say). This makes it necessary to make the data arguments (rather than having them come into LQAPPR via BLOCK COMMON). Let Ir. in the paper by C. ' Then identify the collocation approximation f in $m+. and R..|. and PgG F - for g G U is a linear projector onto F .)"f is a basis for F. i. Lawson [1977] and the paper by M. (Dmg) (:13) = T5j1p..t and give a description of the interpolation conditions for the corresponding interpolation scheme (on U = C(IR). Problems 1.e..)? by elements of $. Show that the resulting map P given on U by the rule )\Pg=)\g. LX. Powell [1974]... Y. LY. Also.r:) for :. but then should allow the construction of a least-squares bivariate spline approximant to data on a rectangular grid by just two calls to this expanded routine. all AG A.D.. denote interpolation at 1' = (T. of the LIP given by F and A. (Hint: Look at the proof of Theorem XIII(34). KY.t to the solution g as an interpolant to f.. and ti <1: 1". 5. conversely.-_ o:.f.-'__Q'=C-.t. all i. 'Il=1. X.1 I: 2'. (Consider an expanded BCHSLV for this purpose.(:. BREAKY.Barnhill [1977]. (Hint: If (f. with t = (t.f)(-ii) is a linear projector with range $. then every f G F can be written uniquely as f = E.)‘f'+i° strictly increasing.6-.) . . KX..__..L. Prove that the map f(-ii) :—> (I. 6.) 3. 4.. a linear idempotent map with range ran P = F. Assume that the LIP on U given by F and A is correct.. there exists a linear subspace A of linear fu11ctionals on U so that Pg is the solution.¢'. Demonstrate that a spline interpolant in 1' variables can be constructed to data on a hyperrectangular grid by just -r" calls to.312 7. 8. (See de Boor [1979] if you have difficulties.) . XVII.the routine SPLI2D given in the text and try it for 1' = 3. Surface Approximation by Tensor Products Produce an expanded version of SMOOTH for the smoothing of data on a rectangular grid. a fully developed theory of best approximation by splines with fixed and with free knots in the uniform norm := max{[f(a:)[ : a 3' tr: _~'§ b} on some interval [a . has produced much elegant and. for example. Again. The same holds for the related topic of best approximation of linear functionals. and the work of Golomb 31: Weinberger [1959]. spline approximants obtained by interpolation (in the general sense described in Chapter XVII) are sufficient. Schumaker [1958].L. Schumaker is in the process of completing a thorough monograph on splines in which the variational approach to. piecewise rationals. In short. This reflects ‘my judgement that most of this material is not practical (as yet). especially optimal quadrature. . starting with Sard’s work as summarized in Sard [1963]. At least a third of the existing spline literature is concerned with the fact that splines are solutions to interesting variational problems. It seems somewhat harder to defend the omission of best approximation in norms other than those derived from an inner product. splines is fully documented.5 Vllinther [1979] for a recurrence relation for trigonometric B-splines. at times. hard mathematics. with the exception of Theorem XIII(34) and a stab at optimal interpolation. perhaps.i Postscript on Things Not Covered This is a brief discussion of some items that a book about splines might well have been expected to cover but that this one did not. But.. for most practical purposes. We refer the reader to Spath [1974] and to Schaback [1976]. An exception should have been made for piecewise exponentials and. which. I have 11013 CllSC1lSSB(l such matters in this book because l5 am convinced that.this variational aspect of splines is not mentioned in this book. Schumaker [I969]. b]. see Rice [1967]. The decision to leave out the above mentioned material was made easy by the fact that L. yet. and most recent developments concerning the calculation of best uniform spline approximants can be found in Cromme [1976]. There is. the many generalized splines that arise naturally if one pursues the variational aspect of splines have found no place in this book. the additional 313 Pi . aside from the fact that I have no practical experience with the construction of best spline approximants (in norms other than L2). and also to Lyche 3. (Cubic spline interpolation has gotten a lot of . by their presence. it does model such a spline only for small slopes. I . and thin-plate or. I have no defense but weariness for the failure to provide a fully detailed discussion of nonlinear splines (see pp. box splines. the. Dr"-splines are three very successful. On the other hand. although the easy generalization to multivariate problems by tensor products is given a chapter. and practical results.) I also regret not having included a discussion of constrained approximation. multivariate spline concepts. it is hard to find a multivariate definition of “spline” that fully corresponds to the univariate one adopted in this book. more generally. least-squares method and other residual reduction methods. but very different. Varga [1971]. but those properties easily recognized as "nice" such as monotonicity or convexity are not all that easy to control.314 Postscript on Things Not Covered accuracy gained in a best spline approximation over an available good one is usually not worth the considerable effort required to construct it. see. This is to me the most painful omission since multivariate approximation is.'In fact.publicity out of the claim that it models the configuration of a thin elastic beam-constrained to go through certain points in the plane. contributed greatly to the resurrection of various variational methods for the solution of ordinary and partial difierential equations. such as the (RB-yleigh—Ritz—)Galerk. at present. This is an area filled with mathematical and computational difficulties. 280f) that arise when one takes the problem of modeling the draftman’s spline seriously. are already available. Tensor products of univariate splines. Not only is it hard to give a mathematical description of what people consider “nice” in a fit. The book contains only one instance of the use of splines in the solution of functional equations. for exalmple. The book covers only univariate spline approximation. I. an exiti]ng area of research. particularly from the finite element method _and from Computer Aided Design.in method. It should be emphasized that splines have. namely the solution of an ODE by collocation. page reference. I have tried to keep the argument lists short and consistent. The list is organized as follows: name of program.l.be1l—1abs . list of programs calling it. within each of these groups. no advantage is taken of FORTRAN 90 features.Fortran programs Fortran programs All the Fortran programs in this book (see the list below) are presently (1998) available via netlib as the package pppack which also contains the example programs that are not explicitly listed here. I do not claim. while their present versions do make use of various FORTRAN 77 features. They follow the pattern input. for example. (Names in parentheses refer to programs not listed in this book. send email to netlib@research. arrays precede the integers (if any) specifying their dimensions.990]g). I have taken care to test them. com.) 315 . and version 3 of that toolbox contains two GUIs that make experimentation with the basic spline approximation algorithms very easy. I have not made them foolproof. l_lSt Of FOFEFBH programs Here is a list of Fortran programs connected with this book. a supplement to MathWorks’ MATLAB. certain variables retain their meaning from program to program. K is_ always the order of some pp function while L is always the number of polynomial pieces that make up a particular pp function. in the SPLINE TOOLBOX (de Boor [. though. These Fortran programs also served as the starting point for the SPLINE TOOLBOX (de Boor [1 990]g). In bringing them to their present stage. In addition. that these Fortran programs are production software. To get started. with the body of the letter just the two words send index. though. to provide them with comments (much more extensively than I had planned originally) and to make them reasonably efficient. output and. work area(s). if any. followed by the name of a corresponding command. Also. followed by a brief statement of the purpose of the program. SPLUPT. XIIIEX3.8) solves an almost block diagonal linear system with constant block width L l DIFEQU.1I8. spline.(XVIIEX3).fnval generates value of spline or of one of its derivatives from B-form (CHBINT). XIIIEX2.spap2 constructs least-squares approximation to given data .COLLOC. (Problem XII.CULLUC. 46. - constructs the Chebyshev form of the polynomial interpolating at the Chebyshev sites (CHBVAL). XVIEX3. (XVIIEX3). csapi. XVIIEX2. SPLINT.(XVIIEX1).248. (Problem XV.L2MAIN.74.I2I.213. BSPPZD.257.BVALUE. SPLIZD. XIVEX1.316 Appendix: Fortran Programs BANFAC/SLV. (VIIIEX1) .226/7.CULLUC sets up collocation equations for COLLOC INTERV. PPVALU. 16. left continuous version of BVALUE BVALUE.sorted locates a site within an increasing sequence of sites (INTRVL).xvExAMPLE main routine for the solution of an ODE by collocation COLPNT.I77. XEX3.9). xsxi.SMOOTH ' subroutine used in SMOOTH coLLcc. LZAPPR.spcol _ generates values and derivatives of all B-splines at a site common to their support BSPP2D. LZMAIN.PUTIT. fn2fm(f.128. 326.258.XEX4.fn2fm(f.8).’pp’) conversion from B-form to ppform BSPLVB.L2APPR.252. solution of a banded system with positive definite matrix BSPLPP. (XVIEX4). BSPLVD.BSPLPP. XIIIEX1.SPLINT. evaluates a polynomial at a site from its Chebyshev form CHOL1D.111. SPLIZD.COLLOC generates the knot sequence for the approximant in COLLOC L2APPR.254.256. XIIEX4.COLLOC “ provides the collocation site pattern for COLLOC CUBSPL.77. xsxi. PUTIT specifies difierential equation and side conditions for COLLOC EQBLUK.28.224. XVIIEX2. version of INTERV suitable for left-continuous pp functions KNOTS.’pp’) extended version of BSPLPP for multivariate work (BVALLC).csape constructs cubic spline interpolant to given data and for various end conditions Cl-JIDTH.307.spcol generates value of all B-splines at a site common to their support BSPLVD. (Problem XIII. SPLOPT. (XIIEX3). XIIEX2 . XVIEX3 solution of a banded linear system without row interchanges BCHFAC/SLV. XEX2. XIIIEX1.XIIIEX1 adds noise to the data in that example SETDAT. L2MAIN error evaluator for L2MAIN L2KNTS.(XIVEX2). generates the knots for optimal spline interpolation TAUTSP. LZERR.XIIIEX1.spaps calculates the cubic smoothing spline SPLI2D.319.79. (XIVEX5). DIFEQU.slvblk solves an almost block diagonal linear system SMOOTH.235. . XVIEX3. The B-form of a cubic '4 |'-‘i 1 .newknt knot placement algorithm (PCVALU).237.COLLOC. (XVIIEX3).XIIIEX3. ROUND. Runge example with cubic Hermite interpolation (VIIIEX1).211.233.titanium provides the Titanium Heat data used in various examples IIEXAMPLE.184.77.197. XIVEX1.SMOOTH sets up a certain matrix Q SLVBLK. XVIEX3. (xrvEx4).194.-jp of its derivatives from its shifted power form if .EQBLOK sets up one block of equations for EQBLOK (PVALUE).spapi extended version of SPLINT suitable for multivariate work SPLINT. the smoothing of a histogram by parabolic splines IXEXAMPLE. evaluates a polynomial or or.List of Fortran programs 317 L2ERR.COLLOC. . XIIIEX2. evaluates pp function or! one of its derivatives from piecewise Chebyshev form PPVALU. XIIIEX2. 72. left-continuous version of PPVALU PUTIT.41. xrrrsxs.104.L2MAIN provides the specific data for L2MAIN SETUPQ.18.L2MAIN I generates knot sequence for approximant in L2MAIN L2MAIN.213.302.77. Runge example IVEXAMPLE.XIVEX1. (XIVEX4). XEX3. (XIVEX5) main program for least-squares spline approximation NEWNOT.(XVIEX2) constructs a taut cubic spline interpolant to given data TITAND. LZMAIN.176.228.spapi constructs a spline interpolant of arbitrary order SPLOPT.XVIIEX2.250. xrvsxs).XIIIEX3.230.csaps. LZMAIN.159.271.77.fnval evaluates a pp function or one of its derivatives from its ppform (PPVLLC).optknt . xrrsxz. 231. ' cubic spline interpolation at knot averages XIIIEX3.difeqdem solution of a second order ODE with a boundary layer (XVIEX2). a failure for CUBSPL XIIEX4. .183. Math.1._ bivariate spline interpolation continued .127. two parametrizations of some data XVIIEX2. bivariate spline interpolation (XVIIEX3). 121. Weiss. 80-87.161.bspline to plot B-splines XEX2. Listing of SULVEBLUK package ‘Listed below is an extensively commented version of the SOLVEBLOK package which appeared in C.260. taut cubic spline interpolation to Titanium Heat data XVIEX3. Software 6. with applications to spline approximation and the numerical solution of ordinary difierential equations”.275. (1980). This package is needed in Chapter XV.1" 318 Appendix: Fortran Programs XEX1. “SOLVEBLOK: a package for solving almost block diagonal linear systems. - ' qua. plotting a B-spline via its ppform XEX4. 309. a failure for NEWNOT (XIIEX3).1s5. 277.168.304. ii cubic smoothing spline XVEXAMPLE. .115p - plotting the polynomials that make up a B-spline XEX3.si—interpolant with good knots XIIIEX1. de Boor 35 R.165.197. ACM Trans.113. - l plotting a B-spline via BVALUE XIIEX2. ' optimal spline interpolation to Titanium Heat data xrvsx1. a large norm amplifies noise in interpolant xIIrEx2.215. I = 1.THE FIRST FIVE ARGUMENTS ARE AS IN SLVBLK. SBBLOK (BLOKS.X) SOLVES THE SYSTEM Aux = B ONCE A IS FACTORED.NRoH INTEGs(2.NE.IFLAG) FACTORS THE MATRIX A .IPIVOT. INTEGER = (—1)*#(N0. cERTAIN or THE ENTRIES ARE ARBITRARY. GoNTAINs THE BLOCKS or THE ALMOST BLOCK DIAGONAL MATRIX A . INTEGS. CERTAIN or THE ENTRIEs INTo BLOKS ARE ARBITRARY (WHERE THE BLOCKS ovERLAP).DETSGN. STEPS IN BLOCK I = LAsT I = 1.I) . THE ARGUMENTS ARE ALL AS IN SLVBLK.319 SLVBLK SUBROUTINE SLVBLK ( BLOKS. or ELIM.OCKS IS Hbiki = A-mlFE NBLOKS) I Nsaovs .I) NUMBER or BLOCKS RIGHT SIDE or THE LINEAR SYSTEM.suH( INTEGS(1.DETLOG) COMPUTES THE DETERMINANT OF A ONCE SLVBLK OR FCBLOK HAS DONE THE FACTORIZATION.scRTcH. INTEGER ARRAY CONTAINING THE PIVOTING. B.NE. IPIVOT. THE PLU FACTORIZATION METHOD IS IMPLEMENTED HERE TO TAKE ADVANTAGE OF THE SPECIAL STRUCTURE OF SUCH SYSTEMS FOR SAVINGS IN COMPUTING TIME AND STORAGE REQUIREMENTS. ON OUTPUT. THE ARRAY INTEGs (sEE BELOH AND THE ENANPLEJ DESCRIBES THE BLOCK STRUCTURE.I) = NO.IFLAG.IPIvoT.NBLOKS.I)*INTEGs(2.INTEGs. BUT SUBSEQUENT SOLUTIONS MAY BE OBTAINED FOR ADDITIONAL B*VECTORS. BLOKS INTEGS NBLOKS B IPIVOT x IFLAG PARAMETERS A 0NE—DIMENSIONAL ARRAY. LENGTH Is NRRovs ON ourpur. 0) LENGTH Is N. IFLAG ) THIS PROGRAM SOLVES THE LINEAR SYSTEM A*X = B WHERE A IS AN ALMOST BLOCK DIAGONAL MATRIX. NBLOKS. DTBLOK (BLOKS. CONTAINS THE COMPUTED SOLUTION (IF IFLAG .B. or LENGTH SUM( INTEGS(1. N = sun ( INTEGS(3. DETSGN = SIGN OF THE DETERMINANT DETLOG = NATURAL LOG OF THE DETERMINANT GE1CIOUJ FGCTHDJOUC IGTJflC1HFifiC!O(§fJ1iWHCJG(§fiEUCiO15fi(§}fCHDfi{ . CORRESPONDING T0 Rows or THE BLOCKS NHIGH ovERLAP (SEE BLOCK sTRuGTuRE AND THE ENANPLE EELov). or Revs or BLOCK I . 0). EXCEPT FOR SCRTCH = A NDRK ARRAY or LENGTH HAx(INTEGs(1..2. or INTERGHANGEs DURING FACTORIZATION) IF A Is INVERTIBLE = 0 IF A -IS sINGULAR _ AUNILIARY PROGRAMS _ FCBLOK (BLoxs..NBLoKs.IPIVOT... CONTAINS CORRESPONDINGLY THE PLU FACTORIZATION or A (IF IFLAG .. INTEGER ARRAY DESCRIPTION or THE BLOCK STRUCTURE or A .SEQUENCE USED. AND Is USED FOR THIS PURPOSE IN SLVBLK. ON OUTPUT.NBLOKS. SUCH ALMOST BLOCK DIAGONAL MATRICES ARISE NATURALLY IN PIECEHISE POLYNOMIAL INTERPOLATION OR APPROXIMATION AND IN FINITE ELEMENT METHODS FOR TWO-POINT BOUNDARY VALUE PROBLEMS.I)). ARRAY or LENGTH NBRoHs. THIS IS DONE AUTOMATICALLY BY SLVBLK FOR ONE RIGHT SIDE B.INTEGS. ON OUTPUT.INTEGS.I) = N0. ITS ARGUMENTS ARE AS IN SLVBLK.NsLcxs THE LINEAR SYSTEM Is or ORDER NBLOKS ).NBLOKS ) ON INPUT.I) = N0. INTEGs(1.I) = BUT THE TOTAL NUMBER or Revs IN H. X. or COLUMNS or srocx I = NCOL INTEGS(3. NCOL2 = 3 31 32 33 34 LAST1 = 2 3 43 44 45 53 54 55 NRDN3 = 3.EXAMPLE AND TEsT DRIvER ----—THE TEsT DRIVER FDR THIs PACKAGE CONTAINS AN EXAMPLE. B. THE FIRST BLOCK HAS ITS (1.1)-ENTRY OF THE NEXT BLOCK (THE (I+1)ST BLOCK ) CORRESPONDS TO THE (LAST+1. AND BELOW IT ARE THE FIVE NROW1 = 3. A LINEAR SYSTEM or ORDER 11.LAST+1)-ENTRY OF THE CURRENT I-TH BLOCK. IN THIS.I)) AND FOLLOWING IMMEDIATELY IN B THE CORRESPONDING PIECE FOR THE RIGHT SIDE OF THE PRECEDING BLOCK. NGDL3 = 4 LAST2 = 3 es 5? as ea NROW4 = 3. EVERY BLOCK STARTS ON THE DIAGONAL OF A ..I) AND NOTE THAT THIS MEANS THAT A. THE (1.1)-ENTRY AT BLOKS(INDEX(I)). THIS STORAGE IS USED BY SLVBLK) 11 12 13 14 / as as as / 66 6? 63 69- / so as we so 21 22 23 24 / 43 44 45 / rs 77 78 79 / 31 32 33 34/ 53 54 55/ as 5? as 59/ 44 #* ## so / er as as ac! INDEX = 1 INDEX = 34 INDEX = 13 INDEX = 22 / 151* 111* ll‘-III III! 11* Illlll ##- #1!‘- 08 09 00 01 18 19 10 11 INDEX = 46 ACTUAL RIGHT SIDE VALUES WITH *1 FOR ARBITRARY VALUES B1 B2 B3 #* B4 B5 B6 B7 B8 **'#* B9 ## oi B10 B11 0 no 0 0 0 no 0n o n on on (IT WOULD HAVE BEEN MORE EFFICIENT TO COMBINE BLOCK 3 WITH BLOCK 4) . THEN INDEX(I+1) = INDEI(I) + NROW(I)*NCOL(I) .. IN THE FIRST BLOCK IN WHICH THE EQUATION APPEARS.. WITH THE RIGHT SIDE FOR THE FIRST BLOCK STARTING AT B(1) . THE BLOCKS ARE PIECED TOGETHER TO GIVE THE INTERESTING PART OF A AS FOLLOWS. THEY ARE OVERHRITTEN DURING ELIMINATION. THE ROWS OF THE (I+1)ST BLOCK WHICH ARE OVERLAPPED BY THE I-TH BLOCK MAY DE ARBITRARILY DEFINED INITIALLY. RECALL LAST = INTEGS(3.. IF THE I—TH BLOCK HAS ITS (1. NCOL5 = 4 86 87 88 as LAST3 = 1 97 98 as so LAST4 = 1 08 05 co 01 18 19 10 11 LAST5 = 4 ACTUAL INPUT TO BLOKS SHOWN BY ROWS OF BLOCKS OF A .2. NCOL4 = 4 rs 77 rs 79 NROWS = 4. (THE‘## ITEMS ARE ARBITRARY.320 Appendix: Fortran Programs -----. THE BLOCKS OVERLAP (USUALLY). THE RIGHT SIDE FOR AN EQUATION NEED ONLY BE SPECIFIED ONCE ON INPUT.1)*ENTRY AT BLOKS(1). NEXT TO IT ARE THE coNTENTs or THE INTEGs ARRRAY HHEN THE MATRIX Is TAKEN T0 BE ALMOST BLOCK DIAGONAL WITH BLOCKS. AND. -----.BLOCK STRUCTURE OF A ——---—THE NBLOKS BLOCKS ARE STORED CONSECUTIVELY IN THE ARRAY BLOKS . NCOL1 = 4 11 12 13 14 21 22 23 24 NRDH2 = 3.NBLOKS—1. WHOSE NONZERO ENTRIEs ARE INDICATED IN THE FOLLoHING scHEHA BY THEIR RDN AND COLUMN INDEx MODULO 10. FOR I = 1. NBLOKS = 5. THE RIGHT SIDE FOR THE EQUATIONS IN THE I-TH BLOCK ARE STORED CORRESPONDINGLY AS THE LAST ENTRIES OF A PIECE OF B OF LENGTH NROW (= INTEGS(1. FOR COLUMNS 1.I)) INDEXB = INDEXB + NROW ' Ill GD TO 1D END H ii 321 .IPIvOT(INDEIB).NCOL.SCRTCH(1) IFLAG = 1 1 INDEXB INDEXN 1 . NI1." COED AND I N T E G S ."'fi 58¢» FACTRB = SUBPROCRAM WHICH CARRIES OUT STEPS 1. OTHERWISE.NROW REAL BLOKS(1).LAST OF GAUSS ELIMINATION (WITH PIVOTING) FOR AN INDIVIDUAL BLOCK.INTEGs.NCOL.NBLOKS). I .LAsT.B.NBLOKS.NROW.. IFLAG ) CALLS SUBROUTINES F A C T R B AND S H I F T B . INTEGS. OF LENGTH MAX (INTEGS(1. AND DN RETURN cDNTAINs THE conPUTED FACTORIZATION OF A ..IFLAG.I) NCOL INTEGS(2.NBLOKS).INTEGs. . C BLOKS(INDEXN).. AN INTEGER ARRAY OF DIMENSION sUN (INTEGs(1.INDEX.X. C SUPERVISES THE PLU FACTORIZATION WITH PIVOTING OF D S OF THE ALMOST BLOCK DIAGONAL MATRIX STORED IN THE ARRAYS ??1'. AN INTEGER ARRAY DESCRIBING THE BLOCK STRUCTURE OF A .. I.IFLAG REAL BLOKS(1). CALL FACTRB(BLOKS(INDEX).I). WORK AREA REQUIRED.X(1) :1 IN THE CALL TU FCBLOK.FUi.. I IS LOOP INDEX 10 INDEX = INDEXN NROW INTEGS(1.N) . OUTPUT PARAMETER.NBLOKS. I = 1 LOOP OVER THE BLOCKS.I) ' CARRY OUT ELIMINATION ON—THE I*TH BLOCK UNTIL NEXT BLOCK ENTERS.LAST. X IERUEED FDR TEHPDRARY sTDRAGE. THE NUMBER or BLOCKS IN A .INTECS(1.INDEXB. NBLOKS.NBLOKS) WHICH. SCRTCH. CONTAINS THE PIVOTING STRATEGY USED. 0 . ON RETURN.NCOL.LAST OF I-TH BLOCK. I..N) .SCRTCH..INTEGS(2. .X) C RETURN END SUBROUTINE FCBLOK ( BLOKS.IPIVOT. cALL FCBLOKCBLOKS.INDEXN. 0) RETURN CALL S88LOK(BLOKS.SLVBLK INTEGER INTEGS(3.IPIVOT(1). IR U1 I=ICDO’?! l"l..OR. #LAST.IFLAG) IF (IFLAG .. N-1.IPIVOT.NHOW.IPIVOT(INDEXB).IPIVOT(1).EQ..EOI NBLOKS) #RETURN I=I+1 INDEXN = NROH#NCOL + INDEX PUT THE REST OF THE I—TH BLOCK ONTO THE NEXT BLOCK CALL sHIFTB(BLOKs(INDEX).. IPIVOT.EQ.B(1).E.NBLOKS).I) LAST INTEGS(3. SHIFTB = SUBPROGRAM WHICH SHIFTS THE REMAINING ROWS TO THE TOP OF THE NEXT BLOCK ‘U ARAMETERS BLOKS INTEGS NBLOKS IPIVOT SCRTCH IFLAG AN ARRAY THAT INITIALLM CONTAINS THE ALMOST BLOCK DIAGDNAL MATRIX A TO BE FACTORED. (—1)**(NUMBER OF RDN INTERcHANGEs DURING FACTORIZATION) ("JGfi fi fi fi fifl fi fi fi C C C C INTEGER INTEGS(3. #IFLAG) CHECK FOR HAVING REACHED A SINGULAR BLOCK OR THE LAST BLOCK IF (IFLAG . = O IN CASE MATRIX WAS FOUND TO BE SINGULAR. IPIvI. REDEFINE IFIvoT<R) APPROPRIATELY AND REGDRD THIS INTERCHANGE BY GHANGING THE sIGN OF I F L A G .IFIvx. D DO 1D I=1.IFLAG.. I. FDR THE NATRII w DF DRDER ( N R D w . IN _ CASE NO ZERO PIVOT WAS ENCOUNTERED. AND THE PARTIAL FACTORIZATION ON OUTPUT.LAsT.IFIvDT(x) IPIVOT(K) = IPIVK IFLAG .ABs(w(IPIvI.NcDL.1 - OOOQDD 11 C As PIvDT Row FOR K—TH STEP.RATID. IFIvDT. OTHERWISE.IFIvoT(J) IPIvDT(J) .. K) IPIVK . NROW) GO TO 21 J . L A 5 T IN GAUss ELIHINATIDN.. DO 9 J-1. EOUALS IFLAG ON INPUT TIMES (-1)#*(NUMBER OF ROW INTERCHANGES DURING THE FACTORIZATION PROCESS).NRDw IFIvDT(I) . FROM Rows IPIvOT(KJ..0..coLNAx. IFLAG = 0 ON OUTPUT.RDwHAx I GAUss ELIHINATIDN wITH PIVOTING DF EGALED Rows.-IFLAG GDNTINUE i so To 15 . D.NcoL 9 ROWHAX = AMAX1(ROWMAX.LAST. ' NCOL NUMBER OF COLUMNS OF W.x. D O CJOCJ O GO O QOCJ C C INTEGER IFIvDT(NRow). IPIVOT AN INTEGER ARRAY OF LENGTH NROW CONTAINING A RECORD OF THE PIVOTING STRATEGY USED. NRDH.322 Appendix: Fortran Programs SUBROUTINE FACTRB ( w. . CORRESPONDING TO STEPS 1. IFLAG ON OUTPUT.LAST K .E.ANALYSIS* BY CDNTE—DE BOOR CONSTRUCTS A PARTIAL PLU FACTORIZATION.. ABS(W(I.ELIMINATION STEPS TO BE CARRIED OUT. ‘ NROW NUMBER OF ROWS OF W._PIOR_AMONG THE Rows NDT YET UsED.132 OF *ELEMENT.J))) IF (ROWMAX .J. . N C D L ). IF THIs Row DOES NDT TURN OUT TD BE Row IPIvOT(K). I. IFLAG ) ADAPTED FROM P.NRDw ‘ . THE DNE wHosE K—TH ENTRY (COMPARED To THE Row sIzE) Is LARGEST. IFIvI — IFIvDT(I) F AWIKDI .. LAsT.EQ. LAST NUMBER OF. UsING PIvoTING OF SCALED Rows.I ROWHAX .NUMER.EQ.LE.K KP1 = K+1 COLMAX = ABs(w(IFIvK.. AwIKDI. NCOL.NCOL) MATRIX TO BE PARTIALLY FACTORED ON INPUT. LOOP ovER K=1. I=1. THEN..IPIVOT(NROW)..KP1 REAL W(NROW.K))/D(IPIvI) IF (AwIHDI_.. COLMAX) GD To 15 15 15 COLMAX = AWIKDI J .NCOL).IPIvDT(K) IF (K . D.EQ. D A WORK ARRAY OF LENGTH NROW USED TO STORE ROW SIZES TEMPORARILY. IPIVK ..RDwNAx INITIALIZE IPIvOT.I GDNTINUE IF (J . ROW IPIVOT(I) IS USED DURING THE I-TH ELIMINATION STEP..) GD TD see 1D D(I) .x))/D(IPIvx) FIND THE (RELATIVELY) LARGEsT PIvoT DO 15 I-HP1.D(NROW). PARAMETERS W CONTAINS THE (NROW. NRowI1. PICTURE DRIGINAL sITUATIoN AFTER LAsT = 2 COLUMNS HAVE BEEN DDNE IN FAGTRE (ASSUMING No REsULTs IN A NEW BLOCK I+1 GREATED AND READY To BE FAGTDRED BY NEXT FACTRB CALL. NCOLI1 3 sHIFTs THE Rows IN CURRENT BLOCK.J) = RATIO#W(IPIVK. DO 20 I=KP1.. sAvE THE HULTIPLIER IN ITS PLACE.K)/W(IPIVK.. D(IPIVK)) GO TO 999 OTHERHISE. WITH COLUMN LAST+J OF AI GOING TO COLUMN J .N.K) RATIO = -W(IPIVI..E. I...LE.NROW IPIVI = IPIVOT(I) W(IPIVI.. SUBTRACT THE APPROPRIATE MULTIPLE OF THE PIvOT ROH FROM REMAINING ROWS. CHECK NOW THAT PIVOT ELEMENT IN LAST ROW IS NONZERO. NoT UsED AS PIVOT ROWS.J) + W(IPIVI.OR.JHAx. THE REMAINING COLUMNS OF THESE ROWS OF AI1 ARE ZEROED OUT.JMAX=NCOLI-LAST. IPIVOT. J=1. NROW .LT..GT.-- 1 X1 1 K1 1 1x X x X x1 1--—----------1 1 GO fifl fi fl fi fl fiCi fi fl fl fi fl 01 1 01' INTEGER IPIvDT(NRDwI).323 SLVBLK C C IF PIVOT ELEMENT IS T00 SMALL IN ABSOLUTE VALUE.LT. 4 AI1. ONTO THE FIRST MMAX = NROW—LAST ROWS OF THE NEXT BLOCK. AI. LAST..JNAxP1.LAsT. I. IF (K .K) DO 20 J=KP1.NcoLI1) HHAI = NRowI . ROWS IPIVOT(LAST+1). JNAI .IPIVOT(NROWI). AI1. NRowI.LAST JHAI = NcDLI .J) K = KP1 CHECK FOR HAVING REACHED THE NEXT BLOCK. IF " ANY..NcoLI). INTERcHANGEs OF Rows) 1 X O BLOCK I NROWI = 4 NCOLI = 5 LAST = 2 0 0 X 1X 1 X 1X ' 1 0 1X 1 0 1X X X X X X X X X X 0 X X X X X X 0 X X 0 X X 0 0 1X 1 0 1X 1 X X 0 11 1 IX X I X I I I X X I X I 1X 1 1X 1 I X I ------------------------------BLOCK I+1 NRowI1= 5 1 NcoLI1= 5 1x X X X x ----------------------------..LAsT IF (MMAX . IPIvOT(NROH).NROW))+D(IPIVK) .EQ.K))+D(IPIvK) .E.K) = W(IPIVI.LE. NCOLI. 21 IF( ABS(W(IPIVK. IF. D(IPIVK) ) * RETURN SINGULARITY FLAG SET see IFLAG = 0 RETURN END SUBROUTINE SHIFTB ( AI. THE ROHS IPIvOT(K+1)... * GOOD C C C C IF (ABs(W(IPIvK. 1) RETURN NEW BLOCK I+1 . TO MAKE K-TH ENTRY ZERO.. DECLARE MATRIX T0 BE NUNINVERTIBLE AND QUIT.NHAx REAL AI(NRDwI.J.. LAST) GO TO 11 RETURN IF LAST . 1 .NCOL 20 W(IPIVI.AI1(NRowI1. x(1) FORWARD SUBSTITUTION PASS INDEX = 1 INDEXB = 1 INDEXX I 1 DO 20 I=1. INTEGS.INDEXX.IPIVOT(INDEIB).LAST.1 DO PFIJJ AND 'S U B B A K .3 24 C Appendix: Fortran Programs PUT THE REHAINDER OF BLOCK I INTO AI1 DU 10 M=1. STORED CORRESPONDING TO THE STORAGE OF THE EQUATIONS.IPIVOT(1). B THE RIGHT SIDE.LAST.J. 1 X(INDEXX)) RETURN EN .I) NCOL INTEGS(2. IPIVOT.LAST 30 CALL SUBBAK(BLOKS(INDEX).J) = 0. X SOLUTION VECTOR Ofi fi fi fi fi fi INTEGER INTEGS(3.I) LAST = IHTEcs(3.J) = AI(IP. ‘U ARAHETERS BLOKS.INDEXB.JHAI 10 AI1(M.NROH. NBLOKS. X ) CALLS SUBROUTINES S U B F O R AND S U B B A K .I> CALL SUBFOR(BLOKS(INDEX).INDEX. # 20 C C C X(INDEXX)) INDEX = NROW#INTEGS(2.NRON INDEXX = INDEXX .EQ.NBLOKS H I = NBP1 — J NROW IHTEGS(1.I) INDEX = INDEX — NRON*NCOL INDEXB = INDEXB .LAST Ill C C C NBP1.IPIVOT(INDEXB). INDIVIDUAL BLOCKS OF EQUATIONS ALREADY GENERATED IN ARE SOLVED VIA S U UII 'T1‘T.nc0L. INTEGS.NR0w REAL RLOKs(1).LAST+J) IF (JMAX .I) + INDEX INDEXB = INDEXB + NROH INDEXX = INDEXX + LAST BACK SUBSTITUTION PASS NBP1 = NBLOKS + 1 DO 3O J=1. SEE COMMENTS IN S L U B L K FOR DETAILS.I) LAST INTEGS(3. I.NCOLI1 AI1(H.B(INDEXB).HMA1 IP = IPIUOT(LAST+H) no 10 J—1.NBLOKS). 2O RETURN END SUBROUTINE SBBLOK ( BLOKS. NBLOKS. B.B(1).IHTEGS(1.NCOL. WITH THE PLU FACTORIZATION OF A L O K . HCOLI1) C RETURN ZERO OUT THE UPPER RIGHT CORNER OF AI1 JMAXP1 = JHAX + 1 DO 2O J=JHAXP1.NRON. IPIVOT ARE AS ON RETURN FROM FCBLOK. SUPERVISES THE SOLUTION (BY FORNARD AND BACKHARD SUBSTITUTION) OF THE LINEAR SYSTEH A*X I B FOR X.NBLOKS NROW . D) GD TD 99 LASTP1 = LAST+1 * DD 25 K=LASTP1.. I(1). THE RIGHT SIDE DF J—TH EDUATIDN FDR THIS BLOCK. X(J) CONTAINS THE RIGHT SIDE OF THE TRANSFORMED IPIVOT(J)*TH EQUATION IN THIS BLOCK. DN INPUT.. LAST.EQ.. LAST ARE AS ON RETURN FROM FACTRB..E.J)*X(J) + SUN X(K) = B(IP) — SUM TRANSFER HDDIFIED RIGHT SIDES OF EQUATIONS IPIVUT(LAST+1).. J-1.. " E(NRDN+J> CONTAINS.. ON OUTPUT..LAST (AND EVEN FDR J=LAsT+1. IPIVOT.LAsT. IFIvDT(NRDw> TD NENT BLOCK. NRDN. THE APPRDPRIATELY HDDIFIED RIGHT SIDE FDR EDUATIDN J INANEIT BLOCK. ' C NRDNHL = NRDN .NcDL>.NRDN—LAsT..LAST) SUM = D. DD 14 J=1.KP1 REAL w(NRDw. THE ACTION ON THE RIGHT SIDE CORRESPONDING TO THE ELIMINATION CARRIED OUT IN F A C T R B FOR THIS BLOCK. J=1.. SUH K = LAST IP = IPIvDT(K3 SUM = D.GT. NROW..X(NCOL) CONTAINS. IP. THEN. WHILE FOR J . DN OUTPUT.EQ. B(J) IS EXPECTED TD GDNTAIN. DN DUTPUT. ‘U ARAMETERS N.NROH—LAST. MEANS THAT X(J) CONTAINS THE RIGHT SIDE OF EQUATION IPI“ VOT(J) A5 MODIFIED DURING ELIMINATION.EQ...NRON. THE COMPONENTS OF THE SOLUTION CORRESPONDING TO THE PRESENT BLOCK. NCOL. LAST. B.. IPIVOT. .x(NGDL). B(NRON+I) IS GOING TO BE USED AS THE RIGHT SIDE OF EQUATION I IN THE NEXT BLOCK (SHIFTED OVER THERE FROM THIS BLOCK DURING FACTORIZATION). LAST ARE AS DN RETURN FRDN FACTRB. X(1).. X(J) IS ALREADY A COMPONENT OF THE SOLUTT ION VECTOR. J=1. x(J) CONTAINS.E(1)... NCOL) GD TD 4 2 KP1 = K+1 DD 3 J=KP1.---. THE RIGHT SIDE FOR THE EQUATIONS IN THIS BLOCK AFTER BACKSUBSTITUTION HAS BEEN CARRIED UP TO BUT NOT INCLUDING EQUATION IPIVOT(LAST). NRDN. O O O O QO O O INTEGER IPIvDT(NRDw). NROW. x ) CARRIES OUT EAGNGUBGTITUTIDN FDR GURRENT BLOCK. ON INPUT.NCOL 325 . fififififififi INTEGER IPIvDT(NRDN). LAST.NRDN)..NRDH" 25 B(NRDwHL+K> = x(N> 99 RETURN END SUBROUTINE SUBBAK ( N. 1) DD 15 H=2... AT THE END. X ) CARRIES OUT THE FORWARD PASS OF SUBSTITUTION FOR THE CURRENT BLOCK. “U ARAMETERS N.LAsT)..HHLVBLK SUBROUTINE SUBFOR ( N.. J=1.JHAx.H DINENEIDN B(NRDw + NRDN-LAsT) REAL w(NRDw. J=1... IF (K .x(NRDN) IP = IPIvDT(1) x(1) = BCIP) IF (NRDN .. SINCE FOR I=1....X(NCOL) CONTAINS..JHAI SUM = H(IP.K.LAST IF {NRDNHL . I. C.LAST.J.NRDN C GD TD 99 IP = IPIVDT(K) 14 c 15 JHAI = AMINO(K—1. IF.NRDw. IT IS SET EQUAL TO X(LAST+I) HERE. NGDL... THE APPRDPRIATELY HDDIFIED RIGHT SIDE DF EDUATIDN IPIVDT(J) IN THIS BLOCK.. IPIVOT. IPIVOT.... NELDHs _ NRDN ..NBLDHs.IN CASE A Is ALHDsT ELDGH DIAGDNAL NITH ALL BLOCKS HAUING NGDLs GDLUHs UsING ND HDRE sTDRAGE THAN IT TAKES TD sTDRE THE INTERESTING PART DF A .I) LAST = IHTEGS(3. DETsGN DN OUTPUT.IPIVOT(K) SUM = 0.sun)/U(IP.NEQU.IHDEXP + NRDH F RETURN END Here is a subroutine for solving linear systems involving B-splines which uses less storage than does SLVBLK. RETURN GD To 2 END SUBROUTINE DTBLOK ( BLOKS.LAsT REAL ELDHs(1). ‘U ARAHETERS .BLUKSfIP)) INDEX = NROH*IHTEGS(2.DETSGH*SIGH(1.DETLDG DETSGN = IFLAG DETLDG .LAsT IP .D. 0) RETURN INDEX . IFLAG. A THD-DIHENEIDNAL ARRAT DF sIzE (NEQU. but does not save the factorization SUBROUTINE CUIDTH ( w. .~9(1s?5)2?s—sD?). IPIVOT. O CJO O O O N PARAMETERS DN INPUT. D.EQ. I. 2 INDEXP . IT SOLVES THE LINEAR sYsTEH A*X = B DF NEQU EDUATIDNs.NCOLS) GDNTAIN- .J)*1(J) + sun x(K) .H) IF (K . sUGH sYsTEHs DGGUR IN THE DETERMINATION OF THE B-SPLINE COEFFICIENTS Q? A SPLINE APPROXIMATION.IFLAG. 1) KP1 . BLOKS.NGDLs. *** THE LDGARITHH DF THE DETERHINANT Is GDHPUTED INsTEAD DF THE DETERHINANT ITsELF TD AVOID THE DANGER DF DUERFLDN DR UNDERFLDN INHERENT IN THIs GALGULATIDN.INDExP.DETsGN. INTEGS.IFLAG ) THIs PRDGRAN Is A VARIATION DF THE THEHE IN THE ALGDRITHH EANDET1 BY MARTIN AND HILKIHSUN (NUMER.K K . IFLAG = (-1)**(NUMBER DF INTERGHANGEE DURING FAGTDRIZATIDN) IF SUCCESSFUL. INTEGS. QO O CJO O OQ O C INTEGER INTEGS(3.H(IP.INTEGS(1.D INDEIP .EQ.D DD 2 I=1. A DETSGN.I) + INDEE.INDEN + NRDw*(H-1) + IPIvDT(INDExP+H) DETLDG = DETLDG + ALDG(ABs(ELDHs(IP))) 1 DETsGN . GDNTAINs THE sIGN DF THE DETERHINANT.IP. DETLDG ) I COHPUTES THE DETERHINANT DF AN ALMOST BLOCK DIAGDNAL MATRIX NHDsE PLU FAGTDRIZATIDN HAS BEEN OBTAINED PREVIOUSLY IN FGELDH. DTHERNIsE GDNTAINs D. .HATH.B.J 326 Appendix: Fortraiyi Programs 3 4 sun . oTHERNIsE IFLAG = D. NBLOKS. IF (IFLAG .(x(N) . NBLOKS.K-1 IP . GDNTAINs THE NATURAL LDGARITHH DF THE DETERMINANT IF-DETERMIHANT Is NDT ZERO. DETLDG DN OUTPUT.IPIVOT(1).INTEGs.K. IPIVOT.I) DD 1 H-1. IFLAG ARE As DN RETURN FRDH FCBLOK.NBLOKS). IN PARTICULAR. X. HITH THE I—TH BLOCK MADE UP DF NRDHI = INTEGs(1.OF INTERCHANGES DURING ELIMINATIDN) IF A Is INVERTIBLE = D IF A Is sINGULAR ————-.I) ND. INTEGER = (-1)**(HD.NE.. BUT MULTIPLIERS ARE N D T s A v E D IN DRDER TD SAVE sTDRAGE. RATHER. DN DUTPUT. IFLAG DN OUTPUT.CHIDTH 32? ING THE INTERESTING PART OF THE ALMOST BLOCK DIAGONAL COEFFICI- ENT MATRIX A (SEE DESCRIPTION AND EXAMPLE BELOW). THE ARRAY INTEGS DESCRIBES THE sTDRAGE scHEME.METHDD -—-—-——GAUss ELIMINATIDN NITH sGALED PARTIAL PIVOTING Is USED. I. X DN DUTPUT. AND THE INTEGS ARRAY IS INTEGs(H.. DF LENGTH NEQU. * N(NEDU.1)* . IF sTDRAGE Is SCARCE.BLOCK sTRUcTURE DF A —--—~— ‘ THE INTERESTING PART DF A Is TAHEN To cDNsIsT DF NBLOKS GDNSECUTIVE ELDGHs.1) . NE HAVE NBLOKS = 5 . (THE INTEREETING ENTRIEs DF A ARE INDIGATED HY THEIR RDN AND COLUMN INDEX MDDULD 10. IN PARTICULAR. THE ARRAY I GDULD BE UsED IN THE GALLING sEqUENGE FDR D . NEQU NUMBER DF EQUATIONS IN sYsTEH NcDLs BLOCK HIDTH.I) UVERHANG OVER NEAT BLOCK = LAsT NELDHs NUMBER DF BLOCKS D NDRH ARRAY.I) CONSECUTIVE Rows AND NcDLs CONSECUTIVE GDLUMNs DF A . THE DETERMINANT DF A GDULD NDN BE FDUND As IFLAG*H(1.1)*H(2. ND. H GDNTAINs THE UPPER TRIANGULAR FAGTDR U DF THE LU FACTORIZATION DF A PDssIHLY PERMUTED VERSION DF A . THE RIGHT sIDE IS DPERATED DN DURING ELIMINATIDN. NUMER DF COLUMNS IN EAGH BLOCK. DESCRIBING THE BLOCK sTRUGTURE DF A .NExT ELDGH.E. DF LENGTH NEQU . FDR EIANPLE.NEqU). B DN INPUT. TD GDNTAIN RDN sIzEs . HERE Is AN 11TH DRDER MATRIX AND ITs ARRANGEMENT IN THE NDRHARRAY H . DP ELIMINATIDN STEPS IN BLOCK I INTEGs(2. THE TND PARAMETERS . THE RIGHT sIDE DF THE LINEAR sYsTEH.I) = CDOIU CJOI DCJOU€i<DCJO(1ITCEOUJflfifi(D}§CEOfI3}§O<DfI(€i lOHCJ€1DiClO K= I= 1 2 1 2 3 4 5 s 2 2 3 3 1 1 1 2 4 ———————. AND WITH THE FIRsT LAsTI = INTEGs(2.. GDNTAINs GDMPUTED sDLUTIDN (IF IFLAG . THE CONTENTS DF B ARE GHANGED DURING EXECUTION. DF sIzE <2. D).) ___ A ___ ___ NRON1=3 11 12 13 14 ‘ 21 22 23 24 S1 32 33 34 NRON2=2 LAST1=2 43 44 45 46 53 54 55 55 NRON3=3 LAST2=3 65 5? 68 G9 75 T? 78 T9 B6 8? 88 B9 NRON4=1 LAST3=1 9? 98 99 90 NROW5=2 LAST4=1 OB 09 OO O1 18 19 10 11 LAST5=4 11 21 31 43 53 55 T5 B5 -9? O8 18 Q 12 22 32 44 54 6? T? B? 98 O9 19 ___ 13 23 33 45 55 GB TB 88 99 OO 1O 14 24 34 46 56 69 T9 B9 90 01 11 FOR THIS INTERPRETATION OF A AS AN ALMOST BLOCK DIAGONAL MATRIX. INTEGs INTEGER ARRAY.I) cDLUMNs TD THE LEFT DF THE. DF Rows IN ELDGH I ' = NRDN INTEGS(1. THEsE BLOCKS ARE sTDRED CUNSECUTIVELY IN THE NDRHARRAY H . IGDUNT. IPVTEQ Is THE INDEA DF THE VARIABLE'TO BE ELIMINATED NEAT.328 Appendix: Fortran Programs . ETC. OOOQOOOO LAS TGL = NGDLs LAS TI = INTEGs(2.LASTEQ.NCOLS. D.J.1PvTED # .LT..GT.II. OOOOOO NRO HAD = INTEGS(1.LASTCL.INTEGS(2.NBLOKS THE I-LOOP RUNS OVER THE BLOCKS _ THE EQUATIONS FOR THE CURRENT BLOCK ARE ADDED TO THOSE CURRENTLY INVOLVED IN THE ELIMINATIDN PRDGEss.I) DO 3D IGDUNT=1.) Go TO ess 5 D(NEXTEQ) = RDNHAX 1O LAS TEQ = LASTEQ + NRDNAD ' - THERE HILL BE LAsTI = INTEGs(2. IN THIs HAY..NROHAD AHI1DD. UsING EQUATION IPUTEQ (PDssIELY AFTER AN INTERGHANGE) As THE PIVOT EQUATION.NEXTEQ.NBLOKS).1))+D(IPVTEQ) . THIS IS ACCOMPLISHED BY PUTTING THE ENTRIES IN ROHS IPVTEQ+1. LASTEQ) Ill GD To 11 IF ( ABS(N(IPVTEQ.LASTI. OR THE ABOVE EXAMPLE.. OOOOOOOOO INTEGER IFLAG. HY-INGREAEING LASTEQ BY INTEGs(1. THE GDLUHNs OF THE EQUATIONS IN A GIVEN ELDGH (As sTDRED IN N ) HILL BE ALIGNED NITH THDsE DF THE NEAT BLOCK AT THE MOMENT WHEN THEsE NEAT EQUATIONS EECOME INV LVED IN THE ELIMINATION PROCESS.. THUS. IT STARTS EQUAL TO NCOLS WHEN A BLOCK FIRST BECOMES INVOLVED AND THEN DROPS BY ONE AFTER EACH ELIMINA TION STEP. I P v T E D AND L A s T E Q ARE UsED TD KEEP TRACK DF THE AGTIDN..N(NEDU.NRDNAD NEITEQ = LASTEQ + ICOUNT RDNHAX = 0. 12 22 32 44 54 5? #11 #21 #31 43 53 55 13 23 33 45 55 58 14 24 34 45 55 59 11 12 13 #22 23 24 #32 33 34 14 43 44 45 46 53 54 55 56 65 5? 58 59 11 22 #33 #43 #53 56 I 12 23 34 44 54 5? 13 14 24 45 45 55 55 68 59 11 22 33 #44 #54 12 23 34 45 55 55 5? II 13 14 24 45 55 58 59. . 1' IN ALL OTHER RESPECTS.D(NEDU). INCLUDING THE SCALED PA RTIAL PIVOTING.cDLMAA REAL B (NEDU).LASTEQ.. THE ENTRIES IN THE PIVOT GDLUHN ARE A L N A Y s IN GDLUMN 1 OF H . D(IPVTEQ) ) GO To 50 GO TO 999 C .NcDLs). THE PROCEDURE IS STANDARD.NCOLS RDNHAA = AMAA1(RDNMAA..ISTAR.I) ELIMINATIDN sTEPs EEFDRE THE EQUATIONS IN THE NEAT BLOCK BECOME INVOLVED..I) DO 1D IGDUNT=1. I. THE FIRST ELIMINATION STEPS PROCEED AS FOLLOWS.LAsTI IPVTEQ = IPVTEQ + 1 IF (IPUTEQ .LASTEQ REVISED EY THE ELIMINATION OF THE IPVTEQ—TH VARIABLE DNE TO THE LEFT IN N . DD 5 J=1.I) AFTER THE RDHsIzE OF THEsE EQUATIONS HAs BEEN REC DRDED IN THE ARRAY D .NEQU.J))) IF (RDNHAA . FRDM EQUATIDNs IPVTEQ+1.EQ. FURTHER.TEHP 1 IFLAG = 1 IPVTEQ = O LASTEQ = O C DO 5O I=1.RDNHAA. L A S T C L RECORDS THE NUMBER OF COLUMNS INVOLVED IN THE CURREN T ELIMINATION STEP.AEs(N(NEATEQ.A(NEDU). EQ.JMAX 50 51 sUM = sUM + X(IPVTEQ+J)eW(IPVTEQ. IF (JMAA .GT. D(ISTAR) ) G0 TU 999 1- IF (IsTAR .J) = TEMP 14 GO TO 15 SUBTRACT THE APPROPRIATE MULTIPLE OF EQUATION IPVTEQ FROM EQUATIONS IPVTEQ+1. I—1+J ) OF THE GDEFFIGIENT MATRIA..CWIDTH 329 DETERMINE THE sMALLEsT I s T A R IN (IPVTEQ LASTEQ) FDR NHIGH AEs(N(IsTAR.. OOOOCI GDLMAA = ABS(W(IPVTEQ.J+1) A(IPvTED) = (E(IPvTEQ)—sUM)/N(IPvTEQ..1) TO JMAX = JMAX + 1 IPVTEQ = IPVTEQ .1)/W(IPVTEQ. H AND B GDNTAIN AN UPPER TRIANGULAR LINEAR sYsTEM EQUIVALENT TO THE DRIGINAL ONE.J) = W(IPVTEQ. GDENAA) GO GDLMAA = ANI1DD .J) .1))/D(IPVTEQ) 11 ISTAR = IPVTEQ IPVTP1 = IPVTEQ + 1 DO 13 II=IPVTP1.Jl1> = W(II. IsTAR = II GDNTINUE 13 TO 13 IF ( ABS(W(ISTAR.1)>/D(IsTAR) Is As LARGE As POSSIBLE AND INTERGHANGE EDUATIDNs IPVTEQ AND IsTAR IN GAsE IPVTEQ .EQ.1))+D(ISTAR) .J) GDNTAINING ENTRY (I. O) IN REVERSE ORDER GD TD 51 DO 50 J=1.LAsTcL) = O.LASTEQ TO MAKE THE COEFFICIENT OF THE IPVTEQ—TH UNKNOWN (PRESENTLY IN COLUMN 1 OF W ) ZERO UT STORE THE NEW COEFFICIENTS IN W ONE TO THE LEFT FROM THE OLD OOOOOO 15 DO 2O II=IPVTP1.EQ.1 I = I 1 IF (I .LASTI SUM = 0. WITH W(I.I) JMAA = NcDLs — LAsTI DO 70 ICOUNT=1.. SOLVE THIs sYsTEN EY BACKSUBsTITUTIDN. ISTAR . TAKING INTD AGGDUNT ITs BLOCK sTRUGTURE I-LOOP OVER THE BLOCKS OOOOOOO 59 I = NBLOKS LAsTI = INTEGs(2.LE.LT. IPvTED> IFLAG = —IFLAG TEMP = D(IsTAR) D(IsTAR) = D(IPvTED) D(IPvTEQJ = TEMP TEMP = E(IsTAR) E(IsTAR) = B(IPVTEQ) E(IPvTEQ) = TEMP DD 14 J=1.LASTEQ RATIO = W(II. D) 999 IFLAG = O GD TD so RETURN RETURN END .LASTCL TEMP = W(ISTAR.J) H(IsTAR.1})[D(II> IF (ANIIDD .LASTEQ AHIIOD = AEs(N(II.RATIO*W(IPVTEQ 1) 18 N(II. ' E(II) = E(II) — RATIO#B(IPVTEQ) 2O 3O 50 LASTCL = LASTCL “ 1 CONTINUE AT THIs PDINT.J) W(IPVTEQ.1) DO 18 J=2 LASTCL w(II. . 1-70. dissertation. I. Teubner (Stuttgart). SMITH [1978]. * K. The Theory of Splines and Their Applications. “Representation and approximation of surfaces”. “Asymptotic properties of best Lg]0. J. BoNEvA'. 58-119. Elsevier (New York). 282. 589-602. E. ed). p. Rice. D. 1] approximation by splines with variable knots”. Michigan. 35. 138. 44. 137. _ * R. 311. 827—835. Inserting new knots into B-spline curves". AND W. STEFANov [1971]. F. Univ. H. J. NILSON. AI-ILBERG. Spline-Funktionen. W. Math. * K. Compute-r Aided Geometric Design. E. R. I35. Academic Press (New York). G. A D. G. DE BOOR [1966]. Academic Press (New-York). Academic Press (New York). L. p. “The method of projections as applied to the numerical solution of two point boundary value problems using cubic splines". RIESENFELD (eds. L. BIRKHOFF AND C. - G.) [1974]. I57. BARNHILL [1977]. BDHMER. 331 . 281. Quart. H. DE BOOR [196-4]. BOHMER [I974]. 50. Bibliographisches Institut (Mannheim). C. in Mathematical Software HI (J. BIRKHOFF AND C. p. 199-201. Math. Appl. DE BOOR [1955]. p. G. L. of the Royal Statistical Soc. Tagnng iiber Spline-Funictionen. Mech. R. p. Computer-Aided Design 12(4). 13. “Error bounds for spline interpolation". N. p. E.Bibliography * J. Compnt. H. p. Mach. 141. 293-304. SCHEMPP [1974]. KENDALL. i11 Approximation of Functions Garabedian. 17. WALSH [1967]. L. 42. R. AND J. Assoc. ME1NARDUs. J. AND I. “Piecewise polynomial in- terpolation and approximation”. “Spline transformations: Three new diagnostic aids for the statistical data-analyst". 164-190. BARROW AND P. Series B 33. AKIMA [1970]. p. “A new method of interpolation and smooth curve fitting based on local procedures". ' WOLFGANG BOEHM [I980]. ed). p. BARNHILL AND R. 154. DE BOOR [I971]. _ . p. Sahney. DE BOOR [1976]4. 312. Theory 14. 1'15. I85. “Good approximation by splines with variable knots. 57-72.. 132. “On calculating with B-splines”. C. Approx. DE BOOR [I975]. Law and N. “Good approximation by splines with variable knots”. “Package for calculating with B-splines". Approx. II”.332 . 276. B. Approx. Bibliography C. “On uniform approximation by splines”. DE Boon [1990]1. p. 14. Theory 60. DE BOOR [I979]. 1‘l'1lg _ * G. p. p. Rivlin. Sharma. Indiana Ufliv. 219-235. Software 5. 12-20. 315. 120-145. ' C. 30(136). C. p. p. Math. 344-359. DE BOOR ["1990]1. Academic Press (New York).Lab. Moth. Comp. . in Numerical Solution of Difierential Equations (G. p. 173-182. “On ‘best’ interpolation". DE BOOR [I976]1. 13s. “Subroutine package for calculating with B-splines". p. 441-472. p. p. ISNM 21 (A. DE BOOR [I972]. Techn. I21. eds). I93. “Computational aspects of optimal recovery”. DE BOOR [1977]2. Numer. J. 124. 5462. C. DE BOOR [I973].-approximation by splines in terms of a global mesh ratio”. 10. in Optimal Estimation in Approximation Theory (C. G. 765-771. 71. “A taut cubic spline”. South Natick MA 01760). Birkhéuser Verlag (Basel). “The exact condition of the B-spline basis may be hard to determine”. C. I82. Approx. 100. DE BOOR [I968]. 1. 112. Theory 1. C. I21. 69-91. eds).Rep. Approx. I82. “Total positivity of the spline collocation matrix". in Theory of Approximation with Applications (A. Meir and A. “On bounding spline interpolation”. 173. DE BOOR [I980]. 132. I54. 28-42. Inc. eds). 192. p. The MathWorks. “On local linear functionals which vanish at all Bsplines but one" . Plenum (New York). Micchelli and T. 158. J. to appear (ms). p. 101. C. 156. ed). p. DE BOOR [1977]1. DE BOOR [1976]g. Springer (Berlin). J. Theory 6. 201. Los Alamos Nl\I. SIAM J. 135. 273. ' C. ' C. 25. C. ' C. in Spline Functions and Approximation Theory. Viiatson. J. 199. (21 Eliot St. I91-203. p. J._A. Corrigenda: 525. DE BOOR [I974]. LA-4728-MS. 96. ~ C. J. DE BOOR [1976]3. p. Los Alamos Sci. 541-551. C. C. “Efficient computer manipulation of tensor products". Spline Toolbox (for use with MA TLAB). 299. Math. 36. 75. I32. “A bound on the Lm-norm of Lg. ACM'Ti"ans. p. Anal. Theory 16.9. E. SIAM Review I2. 3. Inst. J. ed). 582-606. Academic Press (London). 67. Farin. BURCHARD [I974]. SIAM Publications. Fixed knots/II. Numer. “B(asic)-spline basics". p. 20. G. BRUTMAN [I997]. Processing 6'8. Numer. p. 309-319. “On the degree-of convergence of piecewise polynomial approximation on optimal meshes”. DE BOOR [I993]. 27-49. in Geometric Modeling: Algorithms and New Trends (G. 251. SIAM J. “Lebesgue functions for polynomial interpolation — a survey“.-ebesgue function for polynomial interpolation". p. p. Purdue University (available at fI'JP. DE BooR AND A. “Singular ‘perturbation theory and geophysics". p. p. 155. ed). 245. GUIDO BRUNNETT [I992]. 242.Sci. “The multiplicity of a spline zero”. BURCHARD [I977]. “The computation of all the derivatives of a B-spline basis".WiSC. p. J. L. 280. 507 (Palo Alto CA). 21-27. 3-22. Math. H. DE BOOR AND J. SIAM . ed). in Fundamental Developments of Computer-Aided Geometric Modeling (Les Piegl. “Least squares cubic spline approximation I. 485-490. Anal. “Backward error analysis for totally positive linear systems”. p. SALKAUSKAS [I992]. Variable knots". Soc. Comp. “On the I.Dpt. 88.I. DE BooR AND K. p. Annals of Numerical Mathematics 4. Amer. 258. F. “Properties of minimal-energy splines". Approx. ed). 163. SIAM (Philadelphia PA). p. 155. 21. 15. “B-splines without divided differences". 15-25. p. BOS AND K. 102. in Curve and Surface Design Hagen. BU NEMAN [I973]. DE BOOR I [I997]. R. C. p. “Weighted splines based on piecewise polynomial weight functions”. in Curve and Surface Design Hagen. Anal. SIAM (Philadelphia PA). Anal. 81. 173. Math. G. R. 243. 27. “Spline approximation by quasiinterpolants”. LAURENT [I969]. C. Annals of Numerical Mathematics 4. 87-98. 17. C. SIAM Publications. 252. Math. p. CARASSO AND P.CS. III-I27.Bibliography 333 C. Applics. Stanford University Institute for Plasma Research Rpt. K. C. 234. DE BOOR AND G. SIAM Publications (Philadelphia). PINKUS [1977]. L. SWARTZ [I973]. 239.Bdl1/APPIOIC) . 229-238. TR 20/21. J. 10. p. CARRIER [I970]. p. 175. RICE [I968]. “Splines (with optimal knots) are better". 88. I 1'1 ‘l . DE BOOR AND B. C. HoLLIo [1987]. J. Trans. I75-I93. “On the numerical construction and the practical use of interpolating Spline Functions”. L. BRUTMAN [I978]. C.. 86-89. ed). FIX [I973]. C. p. 531-559. in Info. O. Appl. Theory 8. Numer. BUTTERFIELD [I976]. p. “On-line spline fitting" . I9-45. l (xxx. North Holland (Amsterdam). _H. 694-704. Vol. “Collocation at Gaussian points”. DEMKO [1985]. S. - J.334 Bibliography P. p. SCHOENBERG [1947]. D. p. 264. “Eine Kllasse von Verfahren zur Ermittlung bester nichtlinearer TschebyschefilApproximation". Soc.“"ElementarJ Numerical Analysis. 5. 134-149. J . Analyse Math. B. 181. “Courbes et Surfaces a Poles". “On Polya frequency functions IV: the fundamenta. 373-400. POWELL [1982].. K. 19. 189. Approx. Bull. A. H. B. ACM '17. 87.. “On the existence of interpolating projections onto spline spaces". “Scalar. Amer. 180. 16'. 3rd Edition. p. 299. '‘ * S. CONTE AND C. _ A. 34. “Smoothing noisy data with spline functions estimating the correct degree of smoothing by the method of generalized cross validation". 151-—-156. 1114. ed). 149. xii + 428p. p. 222. 19.and planar-valued curve fitting in one and two dimensions using splines under tension". Math. p. J. J. Purdue Univ. “Attenuation factors in practical Fourier analysis”. Prentice-Hall (Englewood Cliffs NJ).J. I63. S. J. “optilnal interpolation". 282. 31. “Sur l’interpolation". Numer. p. I * GEORGE E.l spline functions and their limits". Maih. DE CASTELJAU [1963]. Philos. COX [1972]. GAUTSCHI [1972]1.. Theory 43. 214. “On spline distributions and their limits: The Polya distribution functions" . 71-107. Paris. . p. 6. 1. Amer. R. Springer Lecture Notes 912 (Berlin). SCHOENBERG [1966]. Soc. 17. 18. FAVARD [19-40]. Math. McGraw-Hill (New York). GAFFNEY AND M. p. 113-132.1972]. Math. 199. M. G. 258. I09. J . p.9. 180. 90-99. EAGLE [1928]. in Numerical Analysis Dundee. p. D. 43. André Citroen Automobiles SA. Comm. dissertation. CROMME [1976]. 288. Pures A ppl. Computer Memads of Linear Algebraic Systems. p. Numer. “The numerical evaluation of B-splines". DE BOOR [1980] . “The degree of approximation by Chebyshevian splines”. Trans. W. 218-223 . W. “Optimal order approximation by polynomial spline functions”. RICHARDS [1973]. DEVORE AND F. Math. 313. 223. p. “On the relations between Fourier constants of a periodic function and the coefficients determined__by harmonic analysis". I2. J.981 (G. p. . Math.98. p. H. Numer. Applies. CLINE [1974]. Mag. Inst. p. DODSON [. 1. 281—306. LUDWIG J. * PETER CRAVEN AND GRACE WAHBA [1979]. 447--459. 53. MOLER [1967]. CURRY AND I. p. 10. Watson. 144. CURRY AND I. 401-418. 25. 377-403. 200. A. Math. FORSYTHE AND CLEVE B. P. LAURENT [1991]. 45. 117-190. Numer. Approx. 4. p. Lectures on Theory of Approximation. Approx. ZIEGLER [1966]. 6. Sixth Floor. M. J. MEYER [1976]. KARLIN AND W. 313. Yosmmoro. 189. * E. “New bounds on the zeros of spline functions" . G. ACM Trans. “Approximation to data by splines with free knots". p. Numerical Approximation to Functions and Data. Algorithms 1. Software 3. R. 242. KARLIN AND Z. 55. J. WEINBERGER [1959]. p. . KELLER [1966]. D. p. Math. 105-122. Press (Stanford). 201. ISAACSON AND H. K. “Ohebyshevian spline functions". * J. HALL [1968]. RONG-QING . Math. 239. _ * S. p. B. KIYOMO [1977]. GOLOMB [1962]. 42. AND T. “The condition of orthogonal polynomials". I C. 209-218. 26. Anal. 199.) [1970]. GOLOMB AND H. “On error bounds for spline interpolation”. 7500 Bellaire Blvd. Theory 76(1). Total Positivity. 1-7. p. F. Wiley (New York). 56'. 56. J. “Spline interpolation at knot averages”. Approx. LANE AND R. KARLIN [1968]. p. Theory and Applications of Spline Functions. Press (Madison). J. “Q-splines". Comp. Theory 16. Theory 37. 239. 55. 923-924. Anal. GAUTSCHI [1972]2. p. one-pass method with a piecewise cubic polynomial". N. 139. 45-73. Numer. J. “Optimal error bounds for cubic spline interpolation”. p. 241.“A geometric proof for the variation diminishing property of B-spline approximation". * S. 14. Inc. 241. p. 175. S. 3. (713)772-1927. GOODMAN [1994]. SIAM J. KULKARNI AND P. Applied Math. STUDDEN [1966]. 139. Stanford Univ. Approx. Division. Icnma. Approx.. p. 173. J. 185. L. J. * T. p. 123-130. A. E. C. GREVILLE (ed. p. HAYES (ed. lnterscience (New York). 1. “Curve fitting by a. F. F. Langer. JUPP [1978]. 514-543. VV. Tschebychefi Systems: With Applications in Analysis and Statistics. Wis. SIAM J.Bibliography 335 W. N. Argonne National Laboratory (Argonne IL). April 1977. HALL AND W. E. A. * M. Constr. 232. in On Numerical Approximation (R. '1". .) [1969]. Theory 1. International Mathematical and Statistical Libraries. 172. U. GNB Building.lIA [1988]. 328-343. 1--4. IMSL. 237. Numer. p. p. 208. ed). “Optimal approximation and error bounds" . 15. Analysis of Numerical Methods. T. RIESENFELD [1983]. Houston TX 77036. M. Computer Subroutines Libraries in Mathematics and Statistics. . Athlone Press (London). 164-174. Academic Press (New York). Anal. F. Solving Least Squares Problems. 213-223. MEHLUM [1974]. RIVLIN. Hermann (Paris). p. Theory 25. SCHUMAKER [1973]. HANSON [1974]. J. 155. MCALLISTER AND JOHN A. E. “The optimal recovery of smooth functions". 276. p. 313. Math. ROULIER [(1978]. Math. Lvcns AND L. 266-279. “Choosing nodes in parametric curve interpolation". p. 314. J. MEHLUM [1964]. MALCOLM [1977]. Barnhill and R. WINTHER [1979]. “Quadratic spline interplation". LYCHE AND R. in . Computer-Aided Design 21. “Unified representations of nonlinear splines". Springer- Verlag (Berlin). 64. “On the computation of nonlinear spline functions”. ' M. “On uniform spline approximation". 280. Bibliography J. Bull. J. eds). LAURENT [1972]. LEE [1989]. MUNTEANU AND L. Riesenfeld. 315-0-350. Soc. 222. Academic Press (New York). LAWSON [1977]. E. T. 80. 193. MARSDEN [1972]. Comp. 209-235. 314. 14. Approximation by Spline Functions. p. 81. DAv1D F. L. T. 363-370. 173-207. “On a method of Carasso and Laurent for constructing interpolating splines”. R. J. G. p. M. 280. “Some piecewise polynomial alternatives to splines under tension”. SIAM J. “Non-linear splines”. p. eds). p. J. L. J. Theory 15. p. E. 317-325. Theory 6. 276. Y. * G. Numer. - T. 280. 147. MICHAEL A. Academic Press (New York). p. 161-194. Rice. “Local spline approximation methods”. 191-200. C. p. Barnhill and R. 314. WINOGRAD [1976]. CHARLES A. MARSDEN [1974]. “Interpolation by convex quadratic splines". “A stable recurrence relation for trigonometric B-splines”. J. E. SCHUMAKER [1975]. ANDERS LINNER [1996]. 249-253. Math. 26. 185. AND S. Academic Press (New York).""1 336 * P. Approx. Approximation et Optimisation. T. “Software for C1 surface interpolation“. ed). 27(122). BIT 4. p. p. 1154-1162 . * C. Approx. Prentice-Hall (Englewood Cliffs NJ). M. 280. J. LAWSON AND R. Math. 278. L. 311. F. J. Comp. Riesenfeld. L. 903-906. Numer. 254--282. E. “A curve-fitting method based on a variational criterion". 294-325. Approx. Theory 84(3). 32(144). jI—-I l—l-I— .Mathematical Software III (J. p. 199. M. p. Approx. NORNBERGER [1989]. Amer. in Computer Aided Geometric Design (R. NIELSON [1974]. p. in Computer Aided Geometric Design (R. MICCHELLI. The Chebyshev Polynomials. Numer. Linear Approximation. 89. ed). RIVLIN [1969]. “Piecewise quadratic surface fitting for contour plotting". Academic Press (London). Schempp. * P. J. Schoenberg. 557-565 . and L. 132. 239. Design 6(4). John Wiley and Sons (New York). ' L. Math. J . p. 313. * THEODORE J. 311.. D. in Approximation with Special Emphasis on Spline Functions (I. H. Splines and Variational Methods. G. 4. WEINTRAUB [1971]. D. “Zur Interpolationstheorie der reellen periodischen Funktionen”. RIVLIN [1974]. _ C. Akad. J . 253-271. R. in Spline-Funlttionen Btihmer. Aided Geom.. R. K. 313. dissertation. Wiss. SCHERER AND A. p. 404--407. Evans. p. Sitzungsber. Approx. Wiley (New York). p. “Blossoms are polar forms”. in Software for Numerical Mathematics (D. I41. Mass). Wiley (New York). Syracuse Univ. 315-415. 208. YU. J. Academic'Press (New York). PRENTER [I975]. SARD AND S. ' M. eds). p. “Applications of B-spline approximation to geometric problems of computer-aided design” . Blaisdell (Walton. POWELL [1974]. p. RIESENFELD [l973]. Math. 132. SARD [1963]. SCHURER [1974]. 349-365. 219. Lorentz. “A Bibliography on Spline Functions". C. 20. 30. Theory 99(2). L. Schumaker. 9. in Approximation Theory. 217-229. 144. AMS (Providence RI). Anal. p. Bibliographisches Institut (Mannheim). 10. “On the degree of convergence of nonlinear spline approximation" . p. p. eds). QUADE AND L. COLLATZ [193 8]. J. “Calculation of best approximations by rational splines". * A. Computer J. R. J. 26. “On tlie maximum errors of polynomial approximations defined by interpolatiori and least squares criteria". A proof of de Boor-‘s 2*“-conjecture“. 27. * T. 333-429. 214. SHASRIN [I999].Bibliography 337 M. 28. p. “New upper bound for the B-spline basis condition number. POWELL [1967]. 14. Academic Press (New York). der Preuss. G. 20. p. REINSCH [1967]. * A. ll. vAN R0011 AND F. Comput. SIAM J. RICE [1969]. P. J . L. W. Math. p. M. Phys. p. JOHN R. 533-539. A Book of Splines. ed).1. 163. . Survey 9. An Introduction to the Approximation of Functions. SCHABACK [l976]. and W. 177-183. J . Numer. “Characterization of Tchebycheff approximations by splines". 313. II (G. RAMSHAW [i989]. Chui. Meinardus. RICE [1967]. “Smoothing by spline functions". K. 323-358. Phys. 141-152. 288. L. p. 15(5). Math. U. L. . Approximation with Special Emphasis on Spline Functions. “Spline functions and the problem of graduation”. “Degree of approximation of spline interpolation”. p. J.S. SCHOENBERG (ed. “On spline functions”. 74. 139. “Contributions to the problem of approximation of equidistant data by analytic functions. 947-950. Academic Press (New York). J. SIAM J. 647-656. translated by W. SCHWEIKERT [1966]. Math. SCHUMAKER [1968]1. Spline Algorithms for Curves and Surfaces. 5. L. SCHUMAKER [1969]g. Utilitas Math. Box 12211 (Research Triangle Per1<. MEIR [1966]. Academic Press (New York). 18. P.1 'l iii I E i 338 Bibliography I. 255-291.0. 19-76 Army Numerical Analysis and Computers Conf. NJ). Proc. p. _ . J . * I. II. 105. 54... SCHOENBERG [1973]. Math. I. SCHUMAKER [I981]. J . Mech. Quart. Math. p. G. p. Part A: On the problem of smoothing or graduation. Ofiice. 35. Math. A. Lorentz. I.) [1969]. SCHUMAKER [1976]. Trans. Shisha. SOANES [1976]. 313. Eindimensionale Spline—Algorithmen. 45-99. Anal. an extension of twice differentiable interpolation”. Cardinal Spline Interpolation. II (G. 283. Soc. J . Appl. 203-268. p. in Proc. H. Amer. * L. SIAM (Philadelphia). Sager. SCHOENBERG [1964]. 313. 4. 172. 369-377 . J. WHITNEY [1953]. 208. The positivity of translation determinants with an application to the interpolation problem by spline curves”. and L. * H. “VP-splines. CBMS. 265. L.fNC). ROYCE W. “An interpolation curve using a spline in tension”. 285. p. “Fitting surfaces to scattered data”. Amer. SCHOENBERG [1967]. 45. G. J . 264. I. Academic Press (New York)._SCHO-ENBERG [I946]. p. “On Polya frequency functions. SCHOENBERG AND A. D. J . Oldenbourg (Miinchen). _ * M. ed). 311. ed). ' L. Spline Analysis. “Uniform approximation by Tchebychefiian spline functions”. p. J . SPATH [1990]. L. (Winnipeg). a first class of analytic approximation formulas”. III. * H. “Uniform approximation by Tchebycheffian spline functions. Hoskins and H. 52. 313. p. Numer. Soc. Spline Functions: Basic Theory. Chui. 246-259. K. _. D. * I. L. Schumaker. Math. Wiley (New York). 65. SHARMA AND A. SPATH [1974]. p. Army Res. Mech. Free knots”. C. in Inequalities I (O. L. in Approximation Theory. W. 759-767. 264. SCHULTZ [1973]. JR. 112-141. ARO Report 76-3 (xxx. 312-31-7. Prentice—Hall (Englewood Cliffs. p. eds). “On piecewise-polynomial (spline) interpolation”. 64. “Error bounds for spline and Lspline interpolation”. Edinburgh Math. p. . 6-49. Nauka (Moscow). 41. p. B. Splines in Numerical Mathematics. Izd. Functional Analysis and Approximation Theory in Numerical Analysis. 3. J. Y. 208. SUBBOTIN [1976].' Bibliography 339 * H. p. H. S.1-risc . * J. K. 63--75. 180. B. 61. Zweidimensionale Spline-Interpolations—Algorithmen. SWARTZ AND R. Linear Algebra. Zametkil. 255-274. REINSCH [1971]. Computational Frameworks for the Fast Fourier Transform. A. VARGA [1972]. Oldenbourg (Miinchen). VARGA [1971]. 244 Note: A reasonably complete (and searchable) list of publications concerning splines is available at http://in-rw . Theory 6. VVHITTAKER [1923]. 63-70. p. N. cs . CBMS Vol. SUBBOTIN [1967]. K. Mat. WITTENBRINK ‘[1973]. SIAM (Philadelphia). SPATH [1991]. T.edu/--deboor/bib. p. 314. Proc. E. 44. . WILKINSON AND C. Springer Verlag (New York). p. “High order projection methods of momentand collocation-type for nonlinear boundary value problems”.. STECHKIN AND YU. _ * S. * R. * CHARLES VAN LOAN [1992]. Computing 11. Approx. SIAM (Philadelphia PA). “On a new method of graduation”. 287. Soc. p. . 48. 203. 64. 143 Bernstein-Bézier form 89 integration of 3' B85581 lllt-EI'pOlELtlOI1 42.Index additive 24 affine 144 agrees at 6 Akima’s interpolation 42. 80. 270 break 61. 48. 246-248 area matching 79. 307 of the PPf°1'm 69 partial 128 B-spline 98. interpolation 31 ' 341 . 49 almost block diagonal 81. 208. 284. 99 f0I' $. 98.221 blossom 144 bl _ 144 ossonung boundary conditions (for interpolation) 43. normalized 87 differently 88 picture of cubic 114 picture of parabolic 92 property 90 property (ii) 91 best approximation property 54. B-form 100. 291 associated polynomial 287 attenuation factor 288 augknt 100 _ aveknt 96 B means basis 99 property property property property property property property (vi) 98 (vii) 102 (viii) 116 131 (x) 132 137 139 recurrence relation for 89 stable evaluation of 109 backward difference xvii bandwidth (of a matrix) 174 basic interval . 69 property (iii) 95 brealipoint 69 property (iv) 96 property (v) 96 broken line 31 E. 99 BBform 89 bell—shaped 139 cardinal 89 definition 87 differentiation of a 116 formula for 89 _ Bernstein Polynomial 89.l¢.t basis spline 87. 222 e1a$‘°1° heal“ 31“ condition of the B-spline basis 132 equlosclllatloll 27 constrained approximation 314 l esselltlally local 282* 290 continuity conditions 82 'Elllel _ continuous from the left 77 Polyllomlllll 65 continuous from the right 70 genemllzed 65 control point 133 splllle lll“l= P5 _ control polygon 133 expanded Chebyshev sites 21 coniyersion exponential decay 63 from B_fOrm to ppform 101’ 284! exponential Euler spline 65 307 to B-form 103 correct interpolation problem 292 Cramerls rule 175 extraneous inflection point 264 extrapolation 70 C‘11TY'S°h°enb'i'3'1‘8 B'$Pl-lne 88 block-diagonal linear systems 81 finite element method 243. pro [necewlif 28 Po ’ . 314 dual functional 1021 115 convergence of 49 _ condition of a basis 13. 180 differentation of a spline 116 distance xiii 24. 103 collocatlon Il_1. 145. exponential 63 deficient spline 105 Cauchy-Schwarz-Inequality 221. H h ii HI: . 3-6 f0I'n1 14:.342 Index cardinal 89 B-spline 106 spline 283 .c4il'171’ 173’ 175 . 16. 20 expanded 21 property (ii) 4 P ro P ert bf.l'tri. 132.(iii) 4 property (iv) 4 roperty V 5 . fl P 190 ‘ d 175 ° “ “T °“-1‘ .(vii) 5 property (viii) 6 table 3. 43. ynmm sites 14.' Cholesky factorization 223 “l‘°“ “Ill 286 ' 3 ( ) w property (V1) 6 P roperty . P erty . draftmanls spline 54. chapeau function 33 ' Chebyshev 181 ' divided difference xviii. 9. 314 Theorem 97. 37. curvature 281 I factorization methods. 35. 51. for almost ffloor xvi fngfm 101 . 148. 35. 163. 51. 52. 240 derivative of a pp 70 ceiling xvi centers for a Newton form 10 centripetal 278 diagonal dominance 34. 60. definition of 3 ' domain (of a function) xvi S1 es comgéefpgspiine interpolation 43.1‘. decay exponent 18 decay. 41. 7. 43. 239 sequence 87 57. 185 insertion 135. 170. 155 . 86 Hermite interpolation 40. 186 optimal 156. 287. 197. 153-155. 220 l complete spline 43. 107. 51. 205 left-continuous 94. 148 l knot average 96. 205 Jackson type theorem (for splines) Galerkinls method 243. 171. abstract linear scheme 291 Akimals 42 Bessel 42 broken line 31 149 J acksonls Theorem 26. 288 free-end condition 44 function notation xvi smoothest 54 tensor product spline 301 isolated zero 172. 207. 41 “natural” spline 44. 156. 138 interior 51 l multiplicity 96 placement 152. 247. 238. 299 Gauss quadrature 244 global mesh ratio xvii. 201. 177. 105 histogram 50. 142. 147. 284 cubic spline 43.Index 343 Fortran 315 interpolation (continued) forward difference xvii Fourier transform 285. 261. 137. 49. 56. 204 osculatory 6. 174 Algebra 98 _ independence 98 interpolation problem 292 LIP 292 Lipschitz continuous 26 local approximation scheme 40. 167. 67. 79 ' Hrjlder continuous 26 Hornerls method 10 Lagrange form for $9 33 of a polynomial 2 inner product 207 of a spline 66. 186 Hermite 40. 182 Gramian matrix 292 graph of a function 133 l hat function 33. 288 integration of a spline 127 interior knot 51 interpolation functional 291 ' problem. 133. 52. 291 parabolic spline 59 periodic spline 287 piecewise cubic 39 Lebesgue function 19. 240 optimal 193. 243 local mesh ratio xvii. 63. linear = LIP 292 Lagrange polynomial 2 spline 288 lath function 288 . 70 Leibniz’ formula 4 ' linear 152. 85 Hermite basis 48. 51. 175. 282. 42. 314 Gauss elimination 34. 200. 223. 152. least-squares approximation 33. 81. 199. 69. 241 nonlinear 280 norm of a function xviii. 240. 171. 222 polynomials 12. 182 local 155 mesh size xvii. 199 order constant xvi order of a polynomial 1 Rayleigh-Ritz method 243 recurrence relations for B-splines 89 regularization 223 Remez Algorithm 191 right-continuous 70. 1 order 1 power form 1 pp = piecewise polynomial xviii. 270. 291 modulus of continuity xviii. 183. 31. 170. 305. 147 midpoint refinement 135 mixing condition 149 orthogonal 28. 239 not-a-knot end condition 44. 32. 161.263 derivative of 71 ppform 71. 193. 289 numerical differentiation 55 parabolic spline interpolation 59 at knots 59 at midpoints 61 parametrization 263. 203. 203 quasi-interpolant 155. 275. o(-) xi. interpolation 24.‘ 109 multiplicity 96 _ of a spline zero 173" nested form 10 Nested multiplication 10. 284. 145 monospline 57 multiaffine 144 ' multiple knots 92. 199.200. 13. 221. 100. weighted 242 . 87 planar curve 263 polar form 144 polynomial xviii. 181 normal equations 33. 185. useful 117 order (continued) of a spline 87 C (-). 131 Peano kernel for the divided difference 88 perfect spline 199 periodic spline interpolation 287 piecewise cubic interpolation 39 p_iecewise polynomial 69 H placeholder notation xi. 26. 200. 100. 35. 167 optimal . 12. 7. 220. 53.344 Index Markovls Inequality 132 Marsdenls identity 95 maxim. 213. 222. 204. 197. 25. 51. 182. 96. 103 Newton form 4 Newton form centered at 10 evaluation of 10 noise in data 132. 235. 307 in the SPLINE TUULBUX 71 preferred directions (in tensor product approximation) 310 Pythagoras 53. 132 linear functional 152 vector 13 n interpolation process 166. 54. 107. 276 partition of unity 89. 313 quadrature 313 recovery scheme 171. 214. 94 roughness measure. 35 mesh ratio global 56. 27 osculatory 173 interpolation 6. 182. 285 smoothest interpolation property 54. 223. 142 sign changes 139 perfect 199 periodic 282. 201. 207 truth 70 nonlinear 280. 314 of minimal support 107 uniform knot sequence 89 schemes 297 spline interpolation 301 thin beam 54 _ i Titanium Heat data 197. 51. 141. 79. 67. 208 superconvergence 245 smoothest 53. 161. 144 target (of a function) xvi Taylor formula 95 identity 88 series. 237. 166. 200. parabolic 59. 185. weighted 242 support of a function xvi minimal 107 symmetric 4. 232 Simpson‘s rule 59. 281 subadditive 25 182. 171. 105 draftman’s 54 generalized 313 in tension 263. 105. 182. 202. 147. 204.. 285 collocatio11 matrix 171 complete 43.71. taut 266 tensor product 297 strain energy 54. 208. 208 sorted 76 spline B. 241 193. truncated 8 tensor product of two functions 294 of two spaces 294 of two linear interpolation 264 cubic B.114 curve 133 deficient 105 definition xviii. 202 smoothing 207 number of. 241. 237 239. 235. 22. 214 smoothness 145. 58. 281 smoothing 207.. 238. 264. 284 cubic 43. 64. S""r xi. 301 section (of a function of two variables) 295 shape preserving 131. 44. 138 weak. 275 interpolation at knot averages 185 mono. 155. 61 singularity 22.57 truncation xvi “na. 207. "201. 105. 214. 66.tural” xviii. 232 truncated function 52 truncated power function 82. 154. 186. 172 truncated Taylor series 8 . S'T_xi. 148. 275 Toeplitz matrix 284 totally positive 174. " . 234 smooth 114. 134. 51.87 best approximation property 51. 240. 149. 41 345 spline (continued) order of a 93 saturation 149 SCh06Hb6Ig-Whitlléj? theorem 1. 91. 141. 241. 200. 27. 142. 201 cardinal 283. 93.Index Runge example 17. 113. 1. 149 weighted splines 242 diminution 138. 141.ii I‘ 1 345 Index i uniformly spaced 57 variational method 314 unimodal 139 variational problem 313 vector-valued 133 variable knots 156.. Ii‘ . 145. 139 Whittaker spline 208 -I1‘ I-li?'I —Z_lI—-|l— |-Zl I 1I *2 1 I . 238 variation Y‘ weighted roughness measure 242 diminishing xviii. Complex-.' Introduction to Spectral ‘Theory: With Applications to Schrodinger Operators. Applications to Mathematical Physics. Stability an Control of Discrete Strnnghnn. Stability. Taylor: Partial Differential Equations ll. (continued on next pnge) . I Bognavski/Povzner. Fnrkns: Periodic Motions. Mnrchforafl-lnIvirenIf. Chossnt/Iooss.' ‘The Geometry of Minkovvslti Spacetirne. Nonlinear Convection.agarstrom.Integral Manifolds and Inertial Manifolds for Dissipative Partial Differential Equations. Ln. H. Mnwhlr.. Kress: Linear Integral Equations. Bluman/Kernel./Ratin. 2nd ed. do Boor/Htilfig/Riemenschneider: Box Splines. Cn. Nonlinear Perturbation Theory.l i Applied Mathematical Sciences { continuedfrom page ii) "|1_-'I‘l-?'I —m_lI—-l |—-Zl|I Gh|'l/Chlldress.vMnckey.Iterative Solution of Large Sparse Systems of Equations. 2nd ed.‘ Global Bifurcations and Chaos.Chaos and Socio-Spatial Dynamics. Meyer/Hall: Introduction to Hamiltonian Dynamical Systems and the N-body Problem. Nussa/l’orke. CerclgnnnE/{liner/Pulviren1i. Dendrt'nos/Sonis.ek Introduction to Functional Differential Equations. N.en. ' Anrmnn: Nonlinear Problems of Elasticity. Taylor: Partial Differential Equations I.. Snnlnger/Weaver: lie Groups and Algebras with Applications to Physics.‘ The Boltzmann Equation and Its Applications.S't'gal. 2nd ed.‘ Symmetries and Differential Equations. I. Hlavdceb’Haslingar/Necasl/Low’sek: Solution of Variational Inequalities in Mechanics.‘ Critical Point Theory and Hamiltonian Systems. 2nd ed.n./Willem. LOChal. Geometry. Wiggins.' Mathematical Theory of Incompressible Nonviscous Fluids.-::. 2nd ed. Cercig-noel. Basic Theory.. Dlekmnnn/‘vnn GHs. ' Vii-in:in. Temnm: Irifinite-Dimensional Dynamical Systems in Mechanics and Physics.Algebraic Methods in Constanrirt*'Foia_eWicolaenko/i"emam.. Bifurcation ‘Theory and Computer Algebra. Yong: Wave Packets and Their Bifiircations in Geophysical Fluid Dynamics. 2nd ed. O’MnHey. and Mechanics..Manifolds.m/Mnrsd. and Noise: Stochastic Aspects of Dynamics.‘ Multiple Scale and Singular Perturbation Methods.Topics in Geophysical Dynamics: Atmospheric Dynamics. Hire: Cell-to-Cell Mapping: A Method of Global Analysis for Nonlinear Systems. Hale/Lun.S'nHe: rnt-... Aldous: Probability Approximations via the Poisson Clumping Heuristic. and Processes. Weder: Spectral and Scattering Theory for Wave Propagation in Perturbed Stratified Media. - Rnnd/Armbruster. 2nd ed.son:. Tensor Analysis. firovich (ed): Trends and Perspectives in Applied Mathematics. L..Singular Perturbation Methods for Ordinary Differential Equations. Kuzne. Grasmnn: Asymptotic Methods of Relaxation Oscillations and Applications.. Qualitative Studies of Linear Equations./Cole. _ Hnckbnsch. Hoppensteddt: Analysis and Simulation of Chaotic Systems.Dynamics: Numerical Explorations. Dynamo ‘Theory and Climate Dynamics. and Applications.'ber.Matched Asymptotic Expansions: Ideas and Techniques. Lnwden: Elliptic Functions and Applications.fVerd_luyn Lune!/Walther: Delay Equations: Functional-. Vol. Golubltsky/Stewnrt/.. and Hislop/. Joseph: Fluid Dynamics of ‘Viscoelastic Fluids.' Mathematical Problems from Combustion Theory..' Chaos.The Couette-Taylor Problem Chorln: ‘Vorticity and Turbulence.' Differential Models of Hysteresis.S'ehne_fi"er. 2nd ed. Fractals.Elements of Applied Bifurcation Theory. ' Dncorognn: Direct Methods in the Calculus of Variations. Wiggins: Normally Hyperbolic Invariant Manifolds in Dynamical Systems. Zefdfer: Applied Functional Analysis: Hernandez-Lemta: Adaptive Markov Processes..'/Mennier: Multiphase Averaging for Classical Systems. Zeidler: Applied Functional Analysis: Main Principles and Their Applications.'it'n: Estimation. ControL and the Discrete Kalman Filter.' The Mathematical Theory of Dilute Gases.'sov. Kevorklnn.Perturbation Methods. Nonlinear Analysis. Coltori/Kress: Inverse Acoustic and Electromagnetic Scattering Theory.‘ The Energy Method. Bebemer/Eberly.' Singularities and Groups in Bifurcation Theory. Abrnha. . Nober: Topology.S'chmirVHenningson. 143.Invariant Manifolds and Fibrations for Perturbed Nonlinear Schrodinger Equations.S'uiem.' Weakly Connected Neural Networks.' An Introduction to the Mathematical Theory of Inverse Problems.. . Atloire: Shape Optimization by the Homogenizati on Method. New. Drew/Possmon: Theory of Multicomponent Fluids. Kirsch. Revised ed. Auoemifomproost: Matlmmatical Problems in lmage'Pr-ocessing: Partial Differential Equations and the Calculus of Variations. Godlewski/Revlon: Nturlerical Approximation of Hyperbolic Systems of Conservation Laws. Holler: Chaos Near Resonance. Cherkaev: Variational Methods for Structural Optimization. Vein/Dole. Gurtin: Configurational Forces as Basic Concepts of Continuum Physics. lhlenburg: Finite Element Analysis of Acoustic Scattering. Solern/. Amoidfifhesin: Topological Methods in Hydrodynamics. Sell/Yon. Feintnch: Robust Control ‘Theory in Hilbert Space. Poiak: Optimization: Algorithms and Consistent Approximations. I45.Homogenization of Reticulated Structures.| -I . Mtitler: Analysis of Spherical Symmetries in Euclidean Spaces._-|I -—_l -—Im|—. and Gauge Fields: Interactions.‘ Dynamics of Evolutionary Equations.STaint Jenn Poulr‘n. i i Hoppenstendt/Izhii:evich. 146.' The Nonlinear Schrodinger Equation: Self-Focusing and Wave Collapse. Cloronescu/. I-— -I|.' Global Analysis in Mathematical Physics: Geometric and Stochastic Methods. 144. Le/Schmitt: Global Bifurcation-in Variational Inequalities: Applications to Obstacle and Unilateral Problems.. Glr'kIi'kh. 147. Geornetry.'on: The N-Vortex Problem: Analytical Techniques. LtfW:‘ggins.Nonlinear ‘Theory of Shallow Shells. Wu: Theory and Applications of Partial Functional Differential Equations. Brokare/Sprekelr: Hysteresis and Phase Transitions. Nonlinear Equations. lsokov: Inverse Problems for Partial Differential Equations. Ericksen: Introduction to the ‘Thermodynamics of Solids. ' Vorow'ch.‘ Determinants and Their Applications in lvlatheaiatical Physics."1 Applied Mathematica] Sciences l (contin nes’from previous page) Taylor: Partial Differential Equations IH. Nedélec: Acoustic and Electromagnetic Equations: Integral Representations for Harmonic Problems.' Stability and Transition in Shear Flows. Documents Similar To A Practical Guide to SplinesSkip carouselcarousel previouscarousel nextnumerical analysisDr. Nirav Vyas numerical method 4.pdfB Spline Theory1-s2.0-S2090447917300370-maininterpolation.pdfFlexible Smoothing With B-Splines and Penaltiesstu2 sayfa3 te sayfa119 3cnin cevabıFuzzy 1Introduction to Human Movement Analysis Part 1Cubic Spline InterpolationSurface Models InterpolationNon Periodic Trigonometric ApproximationInterpolaTingSecret SharingNumerical Methods NotesComparativeReading Mat MD-1IVC_lane Detection and Tracking Using BsnakeENM212.pdfMore From Adam CampbellSkip carouselcarousel previouscarousel nextenglishcantonesechalrich_bwEuropa Guitar scoreeng2hokSor:Fantasie Pour Guitare Seule (Pepe Romero) EDN Best of Design Ideas 2011AP125 Designing Microcontroller Systems for Electrically Noisy EnvironmentsThe Lords PrayerAR246Footer MenuBack To TopAboutAbout ScribdPressOur blogJoin our team!Contact UsJoin todayInvite FriendsGiftsLegalTermsPrivacyCopyrightSupportHelp / FAQAccessibilityPurchase helpAdChoicesPublishersSocial MediaCopyright © 2018 Scribd Inc. .Browse Books.Site Directory.Site Language: English中文EspañolالعربيةPortuguês日本語DeutschFrançaisTurkceРусский языкTiếng việtJęzyk polskiBahasa indonesiaYou're Reading a Free PreviewDownloadClose DialogAre you sure?This action might not be possible to undo. Are you sure you want to continue?CANCELOK
Copyright © 2024 DOKUMEN.SITE Inc.