SUPPORT THE WORK

GetWiki

Spline (mathematics)

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Spline (mathematics)
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Short description|Mathematical function defined piecewise by polynomials}}{{For|the drafting tool|Flat spline}}Image:Parametic Cubic Spline.svg|thumb|Single knots at 1/3 and 2/3 establish a spline of three cubic polynomials meeting with {{math|C2}} parametric continuityparametric continuityIn mathematics, a spline is a function defined piecewise by polynomials.In interpolating problems, spline interpolation is often preferred to polynomial interpolation because it yields similar results, even when using low degree polynomials, while avoiding Runge’s phenomenon for higher degrees. In the computer science subfields of computer-aided design and computer graphics, the term spline more frequently refers to a piecewise polynomial (parametric) curve. Splines are popular curves in these subfields because of the simplicity of their construction, their ease and accuracy of evaluation, and their capacity to approximate complex shapes through curve fitting and interactive curve design.The term spline comes from the flexible spline devices used by shipbuilders and draftsmen to draw smooth shapes.

Introduction

The term “spline” is used to refer to a wide class of functions that are used in applications requiring data interpolation and/or smoothing. The data may be either one-dimensional or multi-dimensional. Spline functions for interpolation are normally determined as the minimizers of suitable measures of roughness (for example integral squared curvature) subject to the interpolation constraints. Smoothing splines may be viewed as generalizations of interpolation splines where the functions are determined to minimize a weighted combination of the average squared approximation error over observed data and the roughness measure. For a number of meaningful definitions of the roughness measure, the spline functions are found to be finite dimensional in nature, which is the primary reason for their utility in computations and representation. For the rest of this section, we focus entirely on one-dimensional, polynomial splines and use the term “spline” in this restricted sense.

Definition

{{Confusing|date=February 2009}}We begin by limiting our discussion to polynomials in one variable. In this case, a spline is a piecewise polynomial function.This function, call it {{mvar|S}}, takes values from an interval {{math|[a,b]}} and maps them to R, the set of real numbers,S: [a,b] to R.We want {{mvar|S}} to be piecewise defined. To accomplish this, let the interval {{math|[a,b]}} be covered by {{mvar|k}} ordered, disjoint subintervals,begin{align}
&[t_i, t_{i+1}], quad i = 0,ldots, k-1 [4pt]
&[a,b] = [t_0,t_1) cup [t_1,t_2) cup cdots cup [t_{k-2},t_{k-1}) cup [t_{k-1},t_k) cup [t_k] [4pt]
&a = t_0 le t_1 le cdots le t_{k-1} le t_k = b
end{align}On each of these {{mvar|k}} “pieces” of {{math|[a,b]}}, we want to define a polynomial, call it {{mvar|P{{sub|i}}}}.P_i: [t_i, t_{i+1}]to R.On the {{mvar|i}}th subinterval of {{math|[a,b]}}, {{mvar|S}} is defined by {{mvar|P{{sub|i}}}},begin{align}
S(t) &= P_0 (t), && t_0 le t < t_1, [2pt]
S(t) &= P_1 (t), && t_1 le t < t_2,
&vdots
S(t) &= P_{k-1} (t), && t_{k-1} le t le t_k.
end{align}The given {{math|k + 1}} points {{mvar|t{{sub|i}}}} are called knots. The vector {{math|1=t = (t{{sub|0}}, …, t{{sub|k}})}} is called a knot vector for the spline.If the knots are equidistantly distributed in the interval {{math|[a,b]}} we say the spline is uniform, otherwise we say it is non-uniform.If the polynomial pieces {{mvar|P{{sub|i}}}} each have degree at most {{mvar|n}}, then the spline is said to be of degree {{math|≤ n}} (or of order {{math|n + 1}}).If Sin C^{r_i} in a neighborhood of {{mvar|t{{sub|i}}}}, then the spline is said to be of smoothness (at least) C^{r_i} at {{mvar|t{{sub|i}}}}. That is, at {{mvar|t{{sub|i}}}} the two polynomial pieces {{math|P’i–1}} and {{mvar|P{{sub|i}}}} share common derivative values from the derivative of order 0 (the function value) up through the derivative of order {{mvar|r{{sub|i}}}} (in other words, the two adjacent polynomial pieces connect with loss of smoothness’ of at most {{math|n – ri’’}})begin{align}
P_{i-1}^{(0)}(t_i) &= P_i^{(0)} (t_i), [2pt]
P_{i-1}^{(1)}(t_i) &= P_i^{(1)} (t_i),
vdots&
P_{i-1}^{(r_i)}(t_i) &= P_i^{(r_i)} (t_i).
end{align}A vector {{math|1=r = (r{{sub|1}}, …, r{{sub|k–1}})}} such that the spline has smoothness C^{r_i} at {{mvar|t{{sub|i}}}} for {{math|1=i = 1, …, k – 1}} is called a smoothness vector for the spline.Given a knot vector {{math|t}}, a degree {{mvar|n}}, and a smoothness vector {{math|r}} for {{math|t}}, one can consider the set of all splines of degree {{math|≤ n}} having knot vector {{math|t}} and smoothness vector {{math|r}}. Equipped with the operation of adding two functions (pointwise addition) and taking real multiples of functions, this set becomes a real vector space. This spline space is commonly denoted by S^{mathbf r}_n(mathbf t).In the mathematical study of polynomial splines the question of what happens when two knots, say {{mvar|t{{sub|i}}}} and {{math|t’i+1}}, are taken to approach one another and become coincident has an easy answer. The polynomial piece {{math|P{{sub|i}}(t)}} disappears, and the pieces {{math|P’i−1(t)}} and {{math|P’i+1(t)}} join with the sum of the smoothness losses for {{mvar|ti}} and {{math|t’i+1}}.That is,
S(t) in C^{n-j_i-j_{i+1}} [t_i = t_{i+1}], where {{math|1=j{{sub|i}} = n – r{{sub|i}}}}.
This leads to a more general understanding of a knot vector. The continuity loss at any point can be considered to be the result of multiple knots located at that point, and a spline type can be completely characterized by its degree {{mvar|n}} and its extended knot vector(t_0 , t_1 , cdots , t_1 , t_2, cdots , t_2 , t_3 , cdots , t_{k-2} , t_{k-1} , cdots , t_{k-1} , t_k)where {{mvar|t{{sub|i}}}} is repeated {{mvar|ji}} timesfor {{math|1=i = 1, …, k – 1}}.A parametric curve on the interval {{math|[a,b]}}G(t) = bigl( X(t), Y(t) bigr), quad t in [ a , b ]is a spline curve if both {{mvar|X}} and {{mvar|Y}} are spline functions of the same degree with the same extended knot vectors on that interval.

Examples

Suppose the interval {{math|[a, b]}} is {{math|[0, 3]}} and the subintervals are {{math|[0, 1], [1, 2], [2, 3]}}. Suppose the polynomial pieces are to be of degree 2, and the pieces on {{math|[0, 1]}} and {{math|[1, 2]}} must join in value and first derivative (at {{math|1=t = 1}}) while the pieces on {{math|[1, 2]}} and {{math|[2, 3]}} join simply in value (at {{math|1=t = 2}}). This would define a type of spline {{math|S(t)}} for whichbegin{align}
S(t) &= P_0 (t) = -1+4t-t^2, && 0 le t < 1 [2pt]
S(t) &= P_1 (t) = 2t, && 1 le t < 2 [2pt]
S(t) &= P_2 (t) = 2-t+t^2, && 2 le t le 3
end{align}would be a member of that type, and alsobegin{align}
S(t) &= P_0 (t) = -2-2t^2, && 0 le t < 1 [2pt]
S(t) &= P_1 (t) = 1-6t+t^2, && 1 le t < 2 [2pt]
S(t) &= P_2 (t) = -1+t-2t^2, && 2 le t le 3
end{align}would be a member of that type.(Note: while the polynomial piece {{math|2t}} is not quadratic, the result is still called a quadratic spline. This demonstrates that the degree of a spline is the maximum degree of its polynomial parts.)The extended knot vector for this type of spline would be {{math|(0, 1, 2, 2, 3)}}.The simplest spline has degree 0. It is also called a step function.The next most simple spline has degree 1. It is also called a linear spline. A closed linear spline (i.e, the first knot and the last are the same) in the plane is just a polygon.A common spline is the natural cubic spline. A cubic spline has degree 3 with continuity {{math|C2}}, i.e. the values and first and second derivatives are continuous. Natural means that the second derivatives of the spline polynomials are zero at the endpoints of the interval of interpolation.S(a) , = S(b) = 0.Thus, the graph of the spline is a straight line outside of the interval, but still smooth.

Algorithm for computing natural cubic splines

Cubic splines are of the formS_j(x) = a_j + b_j(x - x_j) + c_j(x-x_j)^2 + d_j(x-x_j)^3.Given set of coordinates C = bigl[ (x_0, y_0), (x_1, y_1), ..., (x_n, y_n) bigr], we wish to find set of {{mvar|n}} splines {{math|S{{sub|i}}(x)}} for {{math|1=i = 0, …, n – 1}}.These must satisfy:begin{align}
S_i (x_i) &= y_i = S_{i-1} (x_i), && i = 1, ldots, n-1, [4pt]
S_{0} (x_0) &= y_0 , [4pt]
S_{n-1} (x_n) &= y_n ,[4pt]
S’_i (x_i) &= S’_{i-1} (x_i), && i = 1, ldots, n-1, [4pt]
S_i (x_i) &= S_{i-1} (x_i), && i = 1, ldots, n-1, [4pt]
S_0 (x_0) &= S_{n-1} (x_n) = 0.
end{align}Let us define one cubic spline {{mvar|S}} as a 5-tuple {{math|(a, b , c, d, x{{sub|t}})}} where {{mvar|a, b, c, d}} correspond to coefficients in the form shown earlier and {{mvar|x{{sub|t}}}} is equal to {{mvar|x{{sub|j}}}}.Algorithm for computing Natural Cubic Splines:Input: set of coordinates {{mvar|C}}, with {{math|1={{abs|C}} = n + 1}}Output: set splines which is composed of {{mvar|n}} 5-tuples.
  1. Create new array {{mvar|a}} of size {{math|n + 1}} and for {{math|1=i = 0, …, n}} set a_i = y_i ,
  2. Create new arrays {{mvar|b}} and {{mvar|d}}, each of size {{mvar|n}}.
  3. Create new array {{mvar|h}} of size {{mvar|n}} and for {{math|1=i = 0, …, n – 1}} set h_i = x_{i+1} - x_i ,
  4. Create new array {{mvar|α}} of size {{mvar|n}} and for {{math|1=i = 1, …, n – 1}} set


alpha_i = frac{3}{h_i} (a_{i+1} - a_i) - frac{3}{h_{i-1}} (a_i - a_{i-1}).
  1. Create new arrays {{mvar|c, l, μ, z}}, each of size {{math|n + 1}}.
  2. Set l_0 = 1, {mu}_0 = z_0 = 0 ,
  3. For {{math|1=i = 1, …, n – 1}} set the following:begin{align}


l_i &= 2 (x_{i+1} - x_{i-1}) - h_{i-1}mu_{i-1},
mu_i &= frac{h_i}{l_i},
z_i &= frac{alpha_i - h_{i-1}z_{i-1}}{l_i}.
end{align}
  1. Set l_n = 1; z_n = c_n = 0. ,
  2. For {{math|1=j = n – 1, n – 2, …, 0}}, set the following:begin{align}


c_j &= z_j - mu_j c_{j+1}, [4pt]
b_j &= frac{a_{j+1} - a_j}{h_j} - frac{h_j (c_{j+1} + 2c_j)}{3}, [4pt]
d_j &= frac{c_{j+1} - c_j}{3h_j}.
end{align}
  1. Create new set {{code|Splines}} and call it {{code|output_set}}. Populate it with {{mvar|n}} splines {{mvar|S}}.
  2. For {{math|1=i = 0, …, n – 1}} set the following: begin{align}


S_{i,a} = a_i,
S_{i,b} = b_i,
S_{i,c} = c_i,
S_{i,d} = d_i,
S_{i,x} = x_i.
end{align}
  1. Output {{code|output_set}}
C++ implementation:
  1. include
templatestd::array natural_cubic_splines_impl( const std::array& x, const std::array& y){ std::array a; for (int i = 0; i )
  • The choices made in forming the extended knot vector, for example:
    • using single knots for {{math|C{{sup|n–1}}}} continuity and spacing these knots evenly on {{math|[a,b]}} (giving us uniform splines)
    • using knots with no restriction on spacing (giving us nonuniform splines)
  • Any special conditions imposed on the spline, for example:
    • enforcing zero second derivatives at {{mvar|a}} and {{mvar|b}} (giving us natural splines)
    • requiring that given data values be on the spline (giving us interpolating splines)
Often a special name was chosen for a type of spline satisfying two or more of the main items above. For example, the Hermite spline is a spline that is expressed using Hermite polynomials to represent each of the individual polynomial pieces. These are most often used with {{math|1=n = 3}}; that is, as Cubic Hermite splines. In this degree they may additionally be chosen to be only tangent-continuous ({{math|C

- content above as imported from Wikipedia
- "Spline (mathematics)" does not exist on GetWiki (yet)
- time: 2:33am EDT - Wed, May 22 2024
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 21 MAY 2024
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
CONNECT