0% found this document useful (0 votes)
75 views7 pages

Intro To Splines

A spline is a mechanical device used by architects to draw smooth curves. A spline function is a piecewise defined polynomial function that is continuous in its derivatives up to a specified order at points called knots. Cubic splines are commonly used for curve design as the second derivative continuity prevents inflection points and provides curvature continuity. The example document defines a cubic spline consisting of two cubic polynomial pieces over the intervals [0,4] and [4,6] with continuity conditions at the knot x=4.

Uploaded by

Professor Saad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views7 pages

Intro To Splines

A spline is a mechanical device used by architects to draw smooth curves. A spline function is a piecewise defined polynomial function that is continuous in its derivatives up to a specified order at points called knots. Cubic splines are commonly used for curve design as the second derivative continuity prevents inflection points and provides curvature continuity. The example document defines a cubic spline consisting of two cubic polynomial pieces over the intervals [0,4] and [4,6] with continuity conditions at the knot x=4.

Uploaded by

Professor Saad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Introduction to Splines

A spline is a thin rod of some elastic material equipped with a groove and a set of weights (called
ducks or rats) with attached arms designed to fit into the groove. This mechanical device spline
has been used by architects to draw smooth curves passing through prescribed points.

Spline (or Spline Function)


A piecewise defined polynomial function, say, S is said to be spline or spline function of degree
k, if for
𝑎=𝑥 <𝑥 <𝑥 …<𝑥 <𝑥 …<𝑥 <𝑥 =𝑏

1. S is a polynomial function of degree less than or equal to k, for each of the subintervals

[𝑥 , 𝑥 [, [𝑥 , 𝑥 [, … , [𝑥 , 𝑥 [, … , [𝑥 ,𝑥 ]

2. S and its higher order derivatives, up to the order k-1, are continuous at knots

𝑥 ,𝑥 ,…,𝑥 ,𝑥 ,…,𝑥

Note: The spline of degree k can also be defined over the whole real line Ɍ with knots
𝒙𝟎 , 𝒙𝟏 , … , 𝒙𝒊 , 𝒙𝒊 𝟏 , … , 𝒙𝒏 , similarly.

Why order of derivative continuity at knots, up to k-1?

Consider the following piecewise defined cubic polynomials function over the interval [a, b]
with a single knot at c

𝑎 +𝑎 𝑥+𝑎 𝑥 +𝑎 𝑥 , 𝑥 𝜖 [𝑎, 𝑐[
𝑆(𝑥) =
𝑏 +𝑏 𝑥+𝑏 𝑥 +𝑏 𝑥 , 𝑥 𝜖 [𝑐, 𝑏]
s.t. S and its higher derivatives are continuous at knot c up to the order three.
i.e. 𝑆(𝑐 ) = 𝑆(𝑐), 𝑆 (𝑐 ) = 𝑆 (𝑐), 𝑆 (𝑐 ) = 𝑆 (𝑐) and 𝑆 (𝑐 ) = 𝑆 (𝑐),
then it can be determined that 𝑎 = 𝑏 , 𝑎 = 𝑏 , 𝑎 = 𝑏 and 𝑎 = 𝑏 , which shows that both the
cubic polynomials remain no more different.
Thus, to define piecewise cubic polynomials functions the order of derivative continuity at knot
cannot be imposed to be three.

Note: If a spline is defined using polynomials of different degrees, then the order
of derivative continuity must be one less than the degree of polynomial with larger
degree from the polynomials adjacent to the knot. In such case the degree of spline
will be the degree of polynomial with maximum degree among the polynomials
used in defining the spline. More precisely, if a spline of degree k is defined using
polynomials of degrees less than or equal to k, then at certain knots the order of
derivative continuity may not exceed even k-1.

Example: Consider the following piecewise defined function S

⎧3𝑥 + 2, 𝑥 𝜖 [−2, −1[


⎪ −6𝑥 − 1, 𝑥 𝜖 [−1, 1[
𝑆(𝑥) =
⎨ 6𝑥 − 18𝑥 + 5, 𝑥 𝜖 [1, 2[
⎪ 3𝑥 − 6𝑥 − 7, 𝑥 𝜖 [2, 3]

It can be verified that
𝑆(−1 ) = 𝑆(−1), 𝑆(1 ) = 𝑆(1), 𝑆(1 ) = 𝑆(1), as
𝑆(−1 ) = 3(−1) + 2 = 5, 𝑆(−1) = −6(−1) − 1 = 5
𝑆(1 ) = −6(1) − 1 = −7, 𝑆(1) = 6(1) − 18(1) + 5 = −7
𝑆(2 ) = 6(2) − 18(2) + 5 = −7, 𝑆(2) = 3(2) − 6(2) − 7 = −7
Similarly, it can be proved that

𝑆 (−1 ) = 𝑆 (−1), 𝑆 (1 ) = 𝑆 (1), 𝑆 (2 ) = 𝑆 (2), where 𝑆 (𝑥 ) =

Hence, S is a spline of degree 2 defined over the interval [-2, 3].

Note: In general, a spline may be of piecewise defined polynomials of different


degrees in different subintervals, but while using a spline for a solution of
boundary-value-problems, the spline is taken to be polynomial functions of
same degrees in all subintervals.
Moreover, for curve designing, spline is taken to be piecewise polynomials of
degree three, as the second order derivative continuity at knots provides
curvature continuity which is more than sufficient for smoothness at knots.
Also, the second order derivative continuity prevents the creation of inflection
points at knots.
Why Spline Function?
1
Consider the data points (0,0), (1,1), (8,2), (27,3) taken from the function 𝑓(𝑥) = 𝑥 3 . Then using
cubic Lagrange polynomial function, the data points are interpolated as shown in the following
figure

It may be noted while using Lagrange interpolant, the more number of data points, the higher
degree of Lagrange interpolant will be, which increases the possibility of more number of
unwanted inflection points. It may also be noted that to reduce the error, the shape of the
Lagrange interpolant cannot be modified, like in case of other interpolating functions there is no
choice of shape control.
Thus, in such situation only the piecewise defined polynomial functions (splines) are useful.

Exercise: Determine whether the following piecewise defined polynomial function is


spline?

⎧ −5𝑥 + 12𝑥 , 𝑥 𝜖 [0, 2[


⎪ −7𝑥 + 35, 𝑥 𝜖 [2, 4[
𝑆(𝑥) =
⎨ 3𝑥 − 16, 𝑥 𝜖 [4, 7[
⎪4𝑥 − 24, 𝑥 𝜖 [7, 10]

How to define a cubic spline consisting of two pieces of curves


Let S be the piecewise defined polynomial function over the interval [0, 6], with one knot at 𝑥 =
4, dividing the interval [0, 6] into two subintervals [0, 4[ and [4, 6] s.t. S is cubic polynomials
over both the subintervals.
By definition, cubic spline S, 𝑆 and 𝑆 must be continuous at the knot 𝑥 = 4,
𝑖. 𝑒. 𝑆(4 ) = 𝑆(4), 𝑆 (4 ) = 𝑆 (4) and 𝑆 (4 ) = 𝑆 (4).
Let,
𝑎 +𝑎 𝑥+𝑎 𝑥 +𝑎 𝑥 , 𝑥 𝜖 [0, 4[
𝑆(𝑥) =
𝑏 +𝑏 𝑥+𝑏 𝑥 +𝑏 𝑥 , 𝑥 𝜖 [4, 6]

s.t., 𝑺(𝟎) = 𝟐, 𝑺(𝟒 ) = 𝟐 = 𝑺(𝟒), 𝑺(𝟔) = 𝟐, 𝑺 (𝟒 ) = 𝟏 = 𝑺 (𝟒) 𝐚𝐧𝐝 𝑺 (𝟒 ) = 𝟏 = 𝑺 (𝟒),


then
𝑆(𝑥), 𝑥 𝜖 [0, 4[ can be determined as
𝑆(0) = 2 ⇒ 𝑎 = 2
𝑆(4 ) = 2 ⇒ 𝑎 + 4𝑎 + 16𝑎 + 64𝑎 = 2
𝑆 (4 ) = 1 ⇒ 𝑎 + 8𝑎 + 48𝑎 = 1
𝑆 (4 ) = 1 ⇒ 2𝑎 + 24𝑎 = 1
After solving the above system of equations, 𝑎 , 𝑎 , 𝑎 and 𝑎 are calculated to be

𝑎 = 2, 𝑎 = 0, 𝑎 = − , 𝑎 = .

Thus
𝟏 𝟏
𝑺(𝒙) = 𝟐 − 𝒙𝟐 + 𝒙𝟑 , 𝒙 𝝐 [𝟎, 𝟒[
𝟒 𝟏𝟔

𝑆(𝑥), 𝑥 𝜖 [4, 6] can be determined as


𝑆(4) = 2 ⇒ 𝑏 + 4𝑏 + 16𝑏 + 64𝑏 = 2
𝑆 (4) = 1 ⇒ 𝑏 + 8𝑏 + 48𝑏 = 1
𝑆 (4) = 1 ⇒ 2𝑏 + 24𝑏 = 1
𝑆(6) = 2 ⇒ 𝑏 + 6𝑏 + 36𝑏 + 216𝑏 = 2
After solving the above system of equations, 𝑏 , 𝑏 , 𝑏 and 𝑏 are calculated to be

𝑏 = 38, 𝑏 = −27, 𝑏 = ,𝑎 = −

Thus,
𝟏𝟑 𝟏
𝑺(𝒙) = 𝟑𝟖 − 𝟐𝟕𝒙 + 𝒙𝟐 − 𝒙𝟑 , 𝒙 𝝐 [𝟒, 𝟔].
𝟐 𝟐

The cubic spline S can be written as


1 1
2− 𝑥 + 𝑥 , 𝑥 𝜖 [0, 4[
𝑆(𝑥) = 4 16
13 1
38 − 27𝑥 + 𝑥 − 𝑥 , 𝑥 𝜖 [4, 6]
2 2
as shown below

It may be noted that the second order derivative continuity at the knot 𝒙 = 𝟒 ceases
the inflection point at the knot.
Note: It can be calculated that 𝑆 (0) = 0, 𝑆 (6) = −3. Thus, keeping in view 𝑆(𝑥), the
following piecewise function 𝐻(𝑥) can be defined over the interval [0, 6], s.t. 𝐻(𝑥) defines two
different cubic polynomials over the subintervals [0, 4[ and [4, 6], along with
𝐻(0) = 2, 𝐻(4) = 2, 𝐻(6) = 2, 𝐻 (0) = 0, 𝐻 (4) = 1, 𝐻 (6) = −3
1 1
2− 𝑥 + 𝑥 , 𝑥 𝜖 [0, 4[
𝐻(𝑥) = 4 16
13 1
38 − 27𝑥 + 𝑥 − 𝑥 , 𝑥 𝜖 [4, 6]
2 2
i.e. 𝐻(𝑥) = 𝑆(𝑥), 𝑥 𝜖 [0, 6]

Example: Let,
𝑎 +𝑎 𝑥+𝑎 𝑥 +𝑎 𝑥 , 𝑥 𝜖 [0, 4[
𝑆(𝑥) =
𝑏 +𝑏 𝑥+𝑏 𝑥 +𝑏 𝑥 , 𝑥 𝜖 [4, 6]

s.t., 𝑆(0) = 2, 𝑆(4 ) = 2 = 𝑆(4), 𝑆(6) = 2, 𝑆 (0) = 1 , 𝑆 (4 ) = 1 = 𝑆 (4) and 𝑆 (6) = −2


then
𝑆(𝑥), 𝑥 𝜖 [0, 4[ can be determined as
𝑆(0) = 2 ⇒ 𝑎 = 2
𝑆(4 ) = 2 ⇒ 𝑎 + 4𝑎 + 16𝑎 + 64𝑎 = 2
𝑆 (0) = 1 ⇒ 𝑎 = 1
𝑆 (4 ) = 1 ⇒ 𝑎 + 8𝑎 + 48𝑎 = 1
After solving the above system of equations, 𝑎 , 𝑎 , 𝑎 and 𝑎 are calculated to be

𝑎 = 2, 𝑎 = 1, 𝑎 = − , 𝑎 = .

Thus
𝟑 𝟏
𝑺(𝒙) = 𝟐 + 𝒙 − 𝒙𝟐 + 𝒙𝟑 , 𝒙 𝝐 [𝟎, 𝟒[
𝟒 𝟖

𝑆(𝑥), 𝑥 𝜖 [4, 6] can be determined as


𝑆(4) = 2 ⇒ 𝑏 + 4𝑏 + 16𝑏 + 64𝑏 = 2
𝑆(6) = 2 ⇒ 𝑏 + 6𝑏 + 36𝑏 + 216𝑏 = 2
𝑆 (4) = 1 ⇒ 𝑏 + 8𝑏 + 48𝑏 = 1
𝑆 (6) = 1 ⇒ 𝑏 + 12𝑏 + 108𝑏 = −2
After solving the above system of equations, 𝑏 , 𝑏 , 𝑏 and 𝑏 are calculated to be

𝑏 = 14, 𝑏 = −11, 𝑏 = 3, 𝑎 = −

Thus,
𝟏
𝑺(𝒙) = 𝟏𝟒 − 𝟏𝟏𝒙 + 𝟑𝒙𝟐 − 𝒙𝟑 , 𝒙 𝝐 [𝟒, 𝟔].
𝟒

The cubic spline S can be written as


3 1
2+𝑥− 𝑥 + 𝑥 , 𝑥 𝜖 [0, 4[
𝑆(𝑥) = 4 8
1
14 − 11𝑥 + 3𝑥 − 𝑥 , 𝑥 𝜖 [4, 6]
4

𝟑
It can be calculated that 𝑺 (𝟒 ) = , while 𝑺 (𝟒) = 𝟎. Thus, 𝑺(𝒙) is not a cubic spline, as
𝟐
shown below.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy