Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

B Splines PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

B-Splines

ME/MF F342 Computer Aided Design, II Sem 2019-20


Murali Palla
7th Feb, 2020

1 Definitions
dφn (t)
1-1 We say a curve φ(t) ∈ C n [a, b] (C-n continuous in the interval [a,b]) if is defined for all values
dtn
of t ∈ [a, b].

1-2 Spline is a composite curve made from joining several pieces together in such a way that the continu-
ity is maintained at all the points in the interval. Splines are useful in interpolation and approximation.
When we refer to φ(t) as a spline we mean the following,

§1: φ(t) ∈ C m (R), m ≥ 1.


§2: φ(t) , 0 when t ∈ [a, b] Interval [a, b] is called as the support of the spline.
§3: φ(t) = 0 when t < [a, b]

1-3 The partition of interval [a, b] or knot vector is defined as an n-tuple of numbers (t0 , t1 , t2 , ...tm ) such
that a = t0 ≥ t1 ≥ t2 .... ≥ tm = b

1-4 We can construct a spline with several polynomials π j (t) defined in each sub-interval [t j , t j+1 ]

k
1-5 B-Spline is a blending of polynomial splines r(t) = φi (t)Pi , where Pi are control points.
P
i=0
i+m
φi (t) = π j (t) support of φi (t) = [ti , ti+m ]
S
j=i

Each π j (t) is a polynomial segment of degree n with n + 1 unknown coefficients to be determined.

1-6 Polynomial splines with one knot:


Let Πn := a0 + a1 t + a2 t2 + ...an tn (an , 0).
Take an arbitrary knot point t0 and define a new curve ψ(t) such that

ψ(t) = Πn t ≥ t0
=0 t < t0

• For continuity at t = t0 , ψ(t0 ) = 0 on both sides resulting in Πn (t0 ) = 0. This polynomial can be
expressed by shifting the parameter by t0 ,
Πn = b1 (t − t0 ) + b2 (t − t0 )n + ... + bn (t − t0 )n

-
ME/MF 342 Computer Aided Design

• If ψ(t) ∈ C p (R),
ψ(t0 ) = ψ0 (t0 ) = ....ψ(p) (t0 ) = 0 =⇒ b1 = b2 = ... = b p = 0
• If p = n =⇒ b1 = b2 = ... = bn = 0 but we require bn , 0.
• This implies pmax = n − 1 and b1 = ... = bn−1 = 0 and bn , 0 and
Πn = bn (t − t0 )n
• A plus sign is used as a suffix to represent this spline,

(t − t0 )n (t − t0 ) ≥ 0

ψ(t) = (t − t0 )n+ = 

0
 (t − t0 ) < 0
• ψ(t) ∈ C n−1 (R)

2 Numerical methods for construction of B-Splines


2-1 Determining the m polynomial segments π j (t), each defined over [t j , t j+1 ] such that the composite
curve φi (t) is C m−2 continuous over the complete real number line is the point of interest.
2-2 To automate the process of computing the coefficients of these polynomials, several algorithms have
been proposed.
• Direct method by solving linear equations.
• Recursive/iterative method.
• Divided difference method.
• Blossoming technique.
2-3 The direct method involves matching the derivatives of the left and right segments at each knot value
and solving the resulting equations by any of the linear algebra methods.
2-4 Iterative method was developed by Cox and de Boor (1972) and is available in most of the textbooks.
2-5 The following algorithm generates a B-spline and is shown to be numerically stable,
k
X
r(t) = Ni,m (t)Pi
i=1

The function Ni,m is a basis function for a B-spline curve which is of order m and is computed by a
recursive formula given by deBoor’s algorithm (1972).

1, t ∈ [ti , ti+1 ]

Ni,1 (t) = 

and
0, t < ]ti , ti+1 [

(t − ti )Ni,p−1 (t) (ti+p − t)Ni+1,p−1 (t)
Ni,p (t) = + To repeat from p = 2 to m
ti+p−1 − ti ti+p − ti+1
2-6 The above recursion formula roots from the divided difference method and to understand the mathe-
matical properties of Ni,m , we need to put some effort in understanding divided difference method.

Page 2
ME/MF 342 Computer Aided Design

2.1 Divided Difference Method

2-7 B-spline basis function φ(t) can be shown to be an mth divided difference of a function defined as
f m−1 (tν , t) := (tν − t)+m−1
where (tν − t)+m−1 = (tν − t)m−1 for (tν − t) > 0
(tν − t)m−1
+ = 0 for (tν − t) ≤ 0
But what is a divided difference?

2-8 Divided differences are analogous to derivatives of a function.

2-9 Let tν denote the knot vector (ti , ti+1 , ti+2 ,...,ti+k ), and f (tν ) the values of the functions at these knot
values given by ( f (ti ), f (ti+1 ), f (ti+2 ),..., f (ti+k )), the successive divided differences are defined in the
following way,
Zeroth divided difference of f (tν ) := f [ti ] = f (ti )
f [ti+1 ] − f [ti ]
First divided difference of f (tν ) := f [ti , ti+1 ] =
ti+1 − ti
f [ti+1 , ti+2 ] − f [ti , ti+1 ]
Second divided difference of f (tν ) := f [ti , ti+1 , ti+2 ] =
ti+2 − ti
f [ti+1 , ..., ti+p ] − f [ti , ..., ti+p−1 ]
pth divided difference of f (tν ) := f [ti , ..., ti+p ] =
ti+p − ti
2-10 For brevity we will use an alternative notation to represent the divided differences as follows:

∆ip f (tν ) := f [ti , ..., ti+p ]. As per this notation we can express the above recursion relation as
∆i+1
p−1
f (tν ) − ∆ip−1 f (tν )
∆ip f (tν ) :=
ti+p − ti

Let us practice
If tν =[ 0,1,2,3,4,5,6,7,8,9] and f (tν ) = t3 , determine all the possible divided differences.

Answer:
∆0 f = [ 0,1,8,27,64,125,216,343,512,729]
∆1 f = [1,7,19,37,61,91,127,169,217]
∆2 f = [3,6,9,12,15,18,21,24]
∆3 f = [1,1,1,1,1,1,1]
∆4 f = [0,0,0,0,0,0]

Page 3
ME/MF 342 Computer Aided Design

2-11 The following general results are useful:


∆n tn = 1
∆n+1 tn = 0
∆r ( f + g) = ∆r f + ∆r g f and g are functions of t
∆r (c f ) = c ∆r f c is a constant
∆n πn−1 =0 πn−1 is a polynomial of degree n − 1

2-12 Divided difference of a function can also be expressed using the following formula,
i+p
P f (tr )
∆ip f (tν ) = 0
r=i w (tr )
i+p
w(t) = (t − ti )(t − ti+1 )(t − ti+2 )...(t − ti+p ) =
Q
(t − tr )
r=i

Example 1
If tν = [t0 , t1 ] is the knot vector and [y0 , y1 ] are values of the function at tν , show the
equivalence of the above two definitions of divided differences

y1 − y0
∆10 y = as per definition [2-10]
t1 − t0
y0 y1
∆10 y = + as per definition [2-12].
t0 − t1 t1 − t0
Example 2
If θν = [θ0 , θ1 , θ2 , θ3 ], find 3rd divided difference of sin θν using above formula.

Answer
sin θ0 sin θ1
∆30 = +
(θ0 − θ1 )(θ0 − θ2 )(θ0 − θ3 ) (θ1 − θ0 )(θ1 − θ2 )(θ1 − θ3 )
sin θ2 sin θ3
+ +
(θ2 − θ1 )(θ2 − θ0 )(θ2 − θ3 ) (θ3 − θ1 )(θ3 − θ2 )(θ3 − θ0 )

Page 4
ME/MF 342 Computer Aided Design

We will now return to the point 2-7,


Interesting Result

φ(t) = ∆m m−1
i (tν − t)+ is a B-spline.

2-13 To see that φ(t) is a B-spline, we need to demonstrate that φ(t) has the three important properties
mentioned in 1-2.
From the expanded form of divided difference we have:
(ti − t)+m−1 (ti+1 − t)m−1
+ (ti+2 − t)m−1
+ (ti+m − t)m−1
+
φ(t) = ∆mi (tν − t)+m−1 = + + + .... +
w0 (ti ) w0 (ti+1 ) w0 (ti+2 ) w0 (ti+m )

§1 : φ(t) ∈ C m−2

All the terms are of the form shown in 1-6 and are C m−2 continuous .
Since each term is a C m−2 continuous function of t, the sum of all the terms must me C m−2 continuous.

§2 : φ(t) = 0, for t ≥ ti+m .

t ≥ ti+m =⇒ t ≥ ti+m ≥ ti+m−1 ≥ ti+m−2 ... ≥ ti . Hence all terms of φ are zero

§3 : φ(t) = 0, for t ≤ ti .

t ≤ ti =⇒ t ≤ ti ≤ ti+1 ... ≤ ti+m .

(ti − t)+m−1 (ti+1 − t)m−1


+ (ti+2 − t)m−1
+ (ti+m − t)m−1
+
φ(t) = ∆mi (tν − t)+m−1 = + + + .... +
w0 (ti ) w0 (ti+1 ) w0 (ti+2 ) w0 (ti+m )

(ti − t)m−1 (ti+1 − t)m−1 (ti+2 − t)m−1 (ti+m − t)m−1


= + + + .... +
w0 (ti ) w0 (ti+1 ) w0 (ti+2 ) w0 (ti+m )

= ∆mi (tν − t)m−1 = 0

tRi+m
1
§4 : φ(t) dt =
ti m

This statement can be shown by using the remainder term of a Taylor series of a power function.
Consider the Taylor series expansion of a general function f (t),

Page 5
ME/MF 342 Computer Aided Design

1 00 1
f (t) = f (ti ) + f 0 (ti )(t − ti ) + f (ti )(t − ti )2 + ... + f (m−1) (ti )(t − ti )m−1
2! (m − 1)!
Zt
1
+ f (m) (s)(t − s)(m−1) ds
(m − 1)!
ti
Zti+m
1
= Πm−1 (t − ti ) + f (m) (s)(t − s)(m−1)
+ ds
(m − 1)!
ti

Substituting f (t) = tm and taking mth divided difference on both sides gives,

tRi+m
1
1=0+ m!∆mi (tν − s)m−1
+ ds
(m − 1)! ti

2.2 Iterative Method for construction of B-splines

2-14 Recursive formula for B-Splines

An iterative formula for B-splines can be obtained in the following way.

Let f (tν , t) := (tν − t)+m−2 and g(tν , t) := (tν − t)+ such that
(tν − t)m−1
+ = f (tν , t)g(tν , t)
Leibnitz rule for divided differences of a product of two functions:
∆mi (tν − t)m−1
+ = ∆0i f (tν , t)∆mi g(tν , t) + ∆1i f (tν , t)∆m−1
i+1 g(tν , t) + ∆i f (tν , t)∆i+2 g(tν , t) . . .
2 m−2

+∆im−1 f (tν , t)∆1i+m−1 g(tν , t) + ∆mi f (tν , t)∆0i+m g(tν , t) (#1)

m
= ∆ri f (tν , t)∆i+r
m−r
g(tν , t)
P
r=0

For each term, ∆ri f (tν , t) = 0 for t ≥ ti+r .


For t < ti+r , we have ∆i+r
m−r
g(tν , t) = ∆m−r
i+r (tν − t)+ = ∆i+r (tν − t) = 0 if (m − r) > 1
m−r

Hence in (#1) only the last two terms survive. Let Mm,i := ∆mi (tν − t)m−1
+ . Simplification of (#1) leads
to,
Mm,i = ∆m−1
i (tν − t)+m−2 + (ti+m − t)∆mi (tν − t)m−2
+

Page 6
ME/MF 342 Computer Aided Design

Mm,i = Mm−1,i + (ti+m − t)∆mi (tν − t)+m−2

∆i+1
m−1
(tν − t)m−2 − ∆mi (tν − t)m−2
" #
+ +
Mm,i = Mm−1,i + (ti+m − t)
ti+m − ti
" #
ti+m − t
Mm,i = Mm−1,i + (Mm−1,i+1 − Mm−1,i )
ti+m − ti
" # " #
t − ti ti+m − t
Mm,i = Mm−1,i + Mm−1,i+1
ti+m − ti ti+m − ti

Define Nm,i := Mm,i (ti+m − ti )

Nm−1,i = Mm−1,i (ti+m−1 − ti ), Nm−1,i+1 = Mm−1,i+1 (ti+m − ti+1 )


" # " #
t − ti ti+m − t
Nm,i = Nm−1,i + Nm−1,i+1
ti+m−1 − ti ti+m − ti+1

Page 7

You might also like