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

Splines 2014

This document discusses splines and finite element spaces. It begins by defining splines as piecewise polynomial functions with certain regularity properties. B-splines are introduced as a useful basis for spline spaces. Finite element spaces are defined using equally spaced knot sequences, and the dimension of these spaces is derived based on the degree of the polynomials and smoothness requirements. The construction of cubic splines is then presented, with the derivation of basis functions for the space of cubic splines that interpolate both function values and derivatives at the knots.

Uploaded by

Muhammad Shehbaz
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)
69 views7 pages

Splines 2014

This document discusses splines and finite element spaces. It begins by defining splines as piecewise polynomial functions with certain regularity properties. B-splines are introduced as a useful basis for spline spaces. Finite element spaces are defined using equally spaced knot sequences, and the dimension of these spaces is derived based on the degree of the polynomials and smoothness requirements. The construction of cubic splines is then presented, with the derivation of basis functions for the space of cubic splines that interpolate both function values and derivatives at the knots.

Uploaded by

Muhammad Shehbaz
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

Splines and Finite Element Spaces

Francis J. Narcowich

October 2014∗

1 Splines
Splines are piecewise polynomial functions that have certain “regularity”
properties. These can be defined on all finite intervals, and intervals of the
form (−∞, a], [b, ∞) or (−∞, ∞).
We have already encountered linear splines, which are simply continuous,
piecewise-linear functions. More general splines are defined similarly to the
linear ones. They are labeled by three things: (1) a knot sequence, ∆; (2) the
degree k of the polynomial; and, (3) the space C r , the level of differentiability
of the whole spline. The knot sequence is where the polynomial may change.
For a linear spline defined on [0, 1], the knot sequence ∆ = {x0 = 0 < x1 <
x2 < · · · < xn = 1} is where one linear polynomial meets another. Since the
polynomials are linear, k = 1. Finally, since the linear splines are continuous,
they are in C 0 [0, 1], so r = 0.
Definition 1.1. We denote the set of splines having knot sequence ∆, degree
of polynomial k, and smoothness C r by S ∆ (k, r).
There is a special case in which k = 0 and r = −1. These are just step
functions. Since the polynomials are taken to be constants, k = 0. Letting
r = −1 simply means that the step function is discontinuous at the knots.
With ∆, k, and r fixed, S ∆ (k, r) is a vector space, which may be finite
dimensional or infinitely dimensional. This raises the issue of bases for the
spaces.

1.1 Basis Splines – B-Splines


We begin with the following useful notation. The function below is called
the plus function, for obvious reasons.

Revised October 2019

1
(
x x≥0
(x)+ =
0 x < 0.

The plus function is a linear spline, with ∆ = Z, k = 1, and r = 0. (We


remark that the only place the linear function changes is at x = 0.) It s
defined over R. With it in hand, we can define the order1 m = 2 cardinal
B-spline:

N2 (x) = (x)+ − 2(x − 1)+ + (x − 2)+ . (1.1)

The knot sequence for N2 is the the set of all integers, Z, although changes
in the function only occur at {0, 1, 2}, and N2 is a linear spline. As the
graph below shows, N2 is a “tent” function.

Order 2 Linear B−spline

N2(x)
0.5

−0.5 0 0.5 1 1.5 2 2.5

Proposition 1.2. Let ∆ be an equally spaced knot sequence, with xj = nj ,


j = 0, . . . , n. Then B = {N2 (nx − j + 1) : j = 0, . . . , n} is a basis for
S ∆ (1, 0) (the space of linear splines), provided x ∈ [0, 1].

Proof. Exercise.
1
The order of a B-spline is m = k + 1.

2
Example 1.3. Consider n = 4. Recall that the values at the corners and
endpoints determine the linear spline. So, let yj be given at j = 0, 1, 2, 3, 4.
Then, the interpolating spline is
4
X
s(x) = yj N2 (4x − j + 1), 0 ≤ x ≤ 1.
j=0
(
1 x ∈ [0, 1)
The order 1 B-spline is just a “box” of the form N1 (x) = .
0 x 6∈ [0, 1)
It can be used to start an iteration to obtain cardinal B-splines of order
m ≥ 2 and higher. The recurrence formula to be iterated is
x m−x
Nm (x) = Nm−1 (x) + Nm−1 (x − 1).
m−1 m−1
From the formula above, one can show that the order m B-splines, Nm , are
in S Z (m − 1, m − 2), and that the support of Nm is precisely [0, m]. This
feature is important enough that is used to label them.

2 Finite Element Spaces


Let ∆ := {x0 = 0 < x1 < x2 < · · · < xn = 1} be a knot sequence for [0, 1]. It
is convenient to define the subintervals Ij = [xj−1 , xj ), with In = [xn−1 , 1].
Let Pk denote the set of polynomials of degree less than or equal to k. By
Definition 1.1, the space of splines may be written as follows:

S ∆ (k, r) = {φ : [0, 1] → R : φ|Ij ∈ Pk (Ij ) and φ ∈ C (r) ([0, 1])} (2.1)

When r = −1, φ is discontinuous.


Consider an equally spaced knot sequence for [0, 1], ∆ = {j/n : j =
1
0, . . . , n}. The finite element spaces2 S n (k, r) are degree k polynomials on
each interval and have r ≤ k −1 derivatives that match at the interior knots.
We consider the following question: How many parameters are required to
1
describe a function in S n (k, r)? That is, what is the dimension of this linear
space?
There are n intervals and on each interval there are k+1 free parameters,
since the function is a degree k polynomial there. Therefore, we have n(k+1)
free parameters. At each of the n − 1 knots, the polynomials must smoothly
2 1
In the case where ∆ is a set of equally spaced knots on [0, 1], we will let S n (k, r) :=

S (k, r).

3
join, so there are r + 1 equations that must match (the polynomials across
a knot must match and their r derivatives must match). This yields (n −
1)(r + 1) constraints. Therefore, we have at least n(k + 1) − (n − 1)(r + 1) =
1
n(k − r) + r + 1 parameters. It follows that the dimension of S n (k, r) =
n(k − r) + r + 1 provided that the equations at the knots are independent
(which can be shown). We summarize this below3
1
Proposition 2.1. dim S n (k, r) = n(k − r) + r + 1.
1
For an example, consider k = 1, r = 0. This is the space S n (1, 0) which
has dimension n(1 − 0) + 0 + 1 = n + 1. If we consider k = m − 1, r = m − 2,
1
then the dimension S n (m−1, m−2) is n(m−1−m+2)+m−2+1 = n+m−1.

3 Construction of Cubic Splines


1
The cubic splines in S n (3, 1) are differentiable, piecewise cubic polynomials
defined on [0, 1]. Cubic splines can be used to simultaneously interpolate
both a function and its derivatives on any set of knots {xj }nj=0 . That is, if the
values f (xj ) and f 0 (xj ) are known, then there exists a (unique) cubic spline
1
s ∈ S n (3, 1) satisfies both s(xj ) = f (xj ) and s0 (xj ) = f 0 (xj ). Returning to
1
∆ = {j/n}nj=0 , we see that, by Proposition 2.1, the dimension of S n (3, 1),
is 2n + 2, which exactly matches the 2n + 2 pieces of data to be fit.
1
We construct a basis of functions for S n (3, 1) by first constructing two in-
terpolating functions. Consider the interval [0, 1] and the problem of finding
a cubic polynomial φ(x) such that φ(0) = 1, and φ(1) = φ0 (1) = φ0 (0) = 0.
Then, a polynomial of the form

φ(x) = A(x − 1)3 + B(x − 1)2

satisfies φ(1) = φ0 (1) = 0. Substituting the values for φ(0) = 1 and φ0 (0) = 0
yields −A + B = 1 and 3A − 2B = 0, which has the solution A = 2 and
B = 3. Then, after re-arranging, we see that

φ(x) = 2(x − 1)3 + 3(x − 1)2 = (x − 1)2 (2x + 1).

We then extend the function to all of R as follows:


(
(|x| − 1)2 (2|x| + 1) |x| ≤ 1
φ(x) = (3.1)
0 |x| > 1,
3
The same argument applies to a knot sequence of the form ∆ = {x0 = 0 < x1 < x2 <
· · · < xn = 1}. Hence, dim S ∆ (k, r) = n(k − r) + r + 1.

4
By construction, φ(0) = 1 and φ0 (±1) = φ0 (0) = 0. Of course, outside of
[−1, 1], it is identically 0. It is easy to show that φ ∈ C (1) , so φ ∈ S Z (3, 1).
The function φ will be used to interpolate the values of a function, while
yielding zero derivative data on each of the knots.
We next construct a function ψ that takes zero value at the endpoints,
but assumes a derivative value of one at 0. We let ψ be the cubic function
ψ(x) = A(x − 1)3 + B(x − 1)2 ,
which already satisfies ψ(1) = ψ 0 (1) = 0. The condition ψ(0) = 0 implies
A = B and the condition ψ 0 (0) = 1 implies 3A − 2B = 1. Combining these
conditions yields the function
ψ(x) = x(x − 1)2 .
We then extend it to all of R:
(
x(|x| − 1)2 |x| ≤ 1
ψ(x) = (3.2)
0 |x| > 1
As in the case of φ, we have ψ ∈ S Z (3, 1), but this time ψ(0) = 0 and
ψ 0 (0) = 1.
1
We now construct a set of functions that will form a basis for S n (3, 1).
We begin by changing scale in φ and ψ, which are defined in (3.1) and (3.2),
and then translating the resulting functions. For φ, we define
φj (x) := φ(nx − j). (3.3)
Notice that φ0 (x) = φ(nx) and φj (x) = φ(n(x − nj )) = φ0 (x − nj ). That
is, φj (x) is φ0 (x) translated by nj , that φj (x) is supported on the interval
[ j−1 j+1 0
n , n ], and that the conditions used to define φ – i.e., φ(0) = 1, φ (0) = 0
0
and so on – imply that φj (k/n) = δj,k and that φj (k/n) = 0.
To construct ψj basis functions from ψ, we first consider the derivative
of ψ(nx − j). We note that
d 0 0

dx (ψ(nx − j)) x= j = nψ (nx − j) x= j = nψ (0) = n.

n n

From this computation, in order to have ψj0 (k/n)


= 1, must scale ψ(nx − j)
by n. Consequently, we define
1
ψj (x) = ψ(nx − j) (3.4)
n
and we see the the support of ψj is also contained in the interval [ j−1 j+1
n , n ].
Applying the conditions imposed on ψ, we see that ψj (k/n) = 0 and that
ψj0 (k/n) = δj,k .

5
4 Interpolation with Cubic Splines
We consider the problem of interpolating a function f and its derivative at
a set of n + 1 equally spaced knots, using the cubic splines constructed in
the previous section. We begin by showing that {φj , ψj }nj=0 is a basis for
1
S n (3, 1).
We note that there are n + 1 of each type, which gives a total of 2n + 2
1
functions in the set. Since this is the dimension of S n (3, 1), it suffices to
show that the set {φj , ψj }nj=0 is linearly independent.
Consider a linear combination of the cubic splines, s(x) = nj=0 αj φj (x)+
P
βj ψj (x). Using φj (k/n) = δj,k , φj (k/n) = 0 and ψj (k/n) = 0, ψj0 (k/n) = δk,j ,
we see that
Xn
s(k/n) = αj φj (k/n) +βj ψj (k/n) = αk (4.1)
| {z } | {z }
j=0
δj,k 0
n
X
s0 (k/n) = αj φ0j (k/n) +βj ψj0 (k/n) = βk , (4.2)
j=0
| {z } | {z }
0 δj,k

As usual, showing linear independence amounts to showing that s(x) ≡


0 implies that the αj ’s and βj ’s are all 0. Note that if s ≡ 0, then so
is s0 . Hence, the previous equation implies that αk = s(k/n) = 0 and
βk = s0 (k/n) = 0. Since the αj ’s and βj ’s are all 0, the set {φj , ψj }nj=0 is
1
linearly independent, and hence is a basis for S n (3, 1).
Solving the interpolation problem stated at the start of this section is
now actually very easy to do; just set
X n
s(x) = f (j/n)φj (x) + f 0 (j/n)ψj (x). (4.3)
j=0

By (4.1), we have s(k/n) = f (k/n) and s0 (k/n) = f 0 (k/n). Hence, s in (4.3)


(uniquely) solves the interpolation problem.

5 Finite Element Methods and Galerkin Methods


1
Consider the problem of finding the “smoothest” function in S n (3, 1) such
that at the knots xj , s(xj ) = fj for j = 0, . . . , n. To define “smoothest”, we
seek a function s that minimizes
Z 1
ksk2 := (s00 (x))2 dx (5.1)
0

6
1
over all s ∈ S n (3, 1) for which s(xj ) = fj for j = 0, . . . , n.
Since s is a piecewise cubic function, s00 exists and is piecewise continu-
1
ous. Therefore, the equation (5.1) is well defined for all of s ∈ S n (3, 1). In
fact, it can be shown that (5.1) is an inner product on the set of functions
1
in S n (3, 1) that are zero at the endpoints.
1
Any function s ∈ S n (3, 1) such that s(xj ) = fj can be written in the
form
Xn Xn
s(x) = fj φj (x) − αj ψj (x).
j=0 j=0
Pn
Let f = j=0 fj φj (x). We seek to find coefficients α that minimize the
norm of s. That is, we want to solve the problem

min kf − gk. (5.2)


g∈span(ψj )

This is a least-squares problem that can beP


dealt with by solving the asso-
ciated normal equations. We expand g = nj=0 αj ψj and we seek to find
coefficients αj such that

hf − g, ψk i = 0 (5.3)

for k = 0, . . . , n. Expanding g in terms of the ψk functions, we see this yields


a system of equations
n
X
αj hψj , ψk i = hf, ψk i. (5.4)
| {z }
j=0
Gj,k

The matrix G is a Gram matrix for the linearly independent ψj ’s. Conse-
quently, it’s invertible. Due to the compact support of ψk , we see that
Z 1 Z
00 00
hψj , ψk i = ψj (x)ψk (x) dx = ψj00 (x)ψk00 (x) dx. (5.5)
0 [ j−1
n
, j+1
n
]∩[ k−1
n
, k+1
n
]

This integral is nonzero only for k = j − 1, k = j or k = j + 1. Therefore,


G is a tridiagonal matrix, and the system (5.4) is also “tridiagonal.” Such
systems are easy to solve numerically.

Previous: the discrete Fourier transform


Next: x-ray tomography and integral equations

You might also like