Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
1989
Parametric splines in tension
Surendra K. Gupta
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion
in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact
.
Recommended Citation
Parametric Splines in Tension
by
Surendra K. Gupta
Submitted in Partial Fulfillment
of the
Requirement for the Degree
of
MASTER OF SCIENCE
Approved
by:
1.
Professor Guy Johnson
2.
Professor Peter G. Anderson
3.
~---_
Professor Peter H. Lutz
Department of Computer Science
Rochester Institute of Technology
Rochester, New York
Parametric Splines in Tension
Reprod uction Agreement
I,
Surendra Kumar Gupta prefer to be contacted each time a request for
reproduction is made. I can be reached at the following address:
Dr. Surendra K. Gupta
61 Parkridge Drive
Pittsford, NY 14534
Abstract
A
brief
review ofcurvefitting
terminology
is
presented,
andthe
cubic splineinterpolation
schemeis
outlined.Parametric
and non-parametric curvefit
ting
techniques
are compared.The
technique to
fit
parametric cubic splinesis derived
using the
Euler-
Lagrange formulation.
Previous
work on splinesin
tension
is identified.
Employing
the
notion of splinesin
tension,
a methodis
proposedto
fit
aparametric curve
to
a set of(n
+
1)
pointsin
^-dimension
spacesatisfying
a specified set of
boundary
conditions.The
curvefitted
will nothave
any
inflection
points withinany
span and willbe invariant
with respectto
coordinate
translation
and rotation.Using
Euler-Lagrange
formulation,
a systemof
linear
equationsin
terms
ofthe
unknown secondderivatives
atknots
is
developed.
Three
kinds
ofboundary
conditions areinvestigated.
Software
is developed in VAX Fortran
to
fit both
parametric splinesin
tension
andparametric cubic splines.
Applications
where splinesin
tension may
find
use areidentified.
Some
examples of such applications are presented and comparison
to
cubic splinemade.
Splines in
tension
offer abetter
alternativethan
Fourier
transform
in
describing boundary
of shapein
digital image processing
application.Possi
ble
extensionsto the
numerical schemedeveloped
and relatedinvestigations
Acknowledgements
A
number ofindividuals have
facilitated
the
preparation ofthis
monograph.My
sincerestthanks
are extendedto:
Guy Johnson,
who provided superb guidanceduring
research,
painstakingly
readthe
entiremanuscript,
and suggested severalimprovements;
Peter
Anderson,
who always madehimself
available,
help
me setmy
methodology
and goaded meto
reachfor
the
highest level
ofexcellence;
David J.
Medvedeff,
whohelped
me withthe
WT^yX-
systemto typeset
and print
this monograph;
Sandhya
Varshney
Gupta,
who sustained meduring
allthe
stressfulContents
1
Introduction
1
1.1
Single-
valuedCurve
Fitting
3
1.2
Multi-valued Curve
Fitting
5
1.3
Parametric & Non-parametric Splines
9
1.4
Euler-
Lagrange Formulation for
Splines
9
1.5
Disadvantages
ofCubic
Splines
15
1.6
Splines in Tension
18
2
Mathematical
Development
23
2.1
Constraints
23
2.2
Boundary
Conditions
25
2.3
Integration
ofDifferential Equation
25
2.4
Normalization
ofTension Parameter
a28
2.5
Substitution
ofBoundary
Conditions
30
2.5.1
Type I
Boundary
Conditions
30
2.5.2
Type II
Boundary
Conditions
33
2.5.3
Type III
Boundary
Conditions
34
2.6
Solution
ofSystem
ofLinear Equations
36
2.7
Implementation
37
3
Some
Applications
& Future Extensions
40
3.1
Tension
versusCubic
Splines
41
3.3
Dislocation Dynamics
47
3.4
Shape Descriptions
for
Machine Vision
49
3.5
Other
Extensions
51
3.5.1
Adaptive Parametrization
52
3.5.2
Variable Tension
52
3.5.3
Other Approaches
53
3.6
Concluding
Remarks
54
A
Splines
in
Tension
55
B
Cubic Splines
64
C
Bibliography
72
List
of
Figures
1.1
Parametric
cubicspline[7] using
t,
=i
7
1.2
Parametric
cubicspline[7] using
accumulated chordlength
asthe
parametert
8
1.3
Parametric
cubicspline[7]
using
GHOST
software10
1.4
Parametric
cubicspline[7] using
GINO-F
software11
1.5
Cubic
spline[7]
16
1.6
Cubic
spline[7]
17
1.7
Spline in
tension[7]
using the
data
offigure 1.5
20
3.1
Cubic
spline with cyclicboundary
conditionsfitted
to
a shapecomposed of a semicircle and a rectangle
43
3.2
Tension
spline with cyclicboundary
conditions and normalizedtension
parameter7
=0.001 fitted
to
a shapeconsisting
ofasemicircle and a rectangle
44
3.3
Cubic
spline with cyclicboundary
conditionsfitted
to
data
pointsrepresenting
a shape composed of a semicircle and arectangle with
fillets
of radii =0.125
46
3.4
Spline in
tension
with cyclicboundary
conditions and normalized
tension
parameter7
=0.01
fitted
to
data
points representing
a shape composed of a semicircle and a rectangle withfillets
of radii =0.125
48
3.5
Parametric
splinesin
tension
with constant curvatureend conditions
and normalizedtension
parameter7
=0.5 fitted
to
points
describing
aFrank-Read
source attime t
=0,
2000,
Chapter
1
Introduction
In modeling
of physicalsystems, there
is
often a needfor
drawing
a smooth curvepassing through
a number ofdata
points whichtypically
are result ofsome scientific experimentor simulation.
Such
applicationsemploy
curvefit
ting
techniques to
interpolate
between
the
data
points andto
computeboth
magnitude and
direction
ofthe tangent
and curvature vector at eachdata
point.
For
example,
in
the study
of plasticdeformation
ofcrystalline materials,
dislocation
type
line defects
needto
be
modeled[19].Since
adislocation
assumes complex configurations as
it
glidesthrough the
crystal underap
plied
stresses,
smooth curvesdescribing
these
configurations are requiredto
study
its
glide.The
curves can notbe
expressedanalytically,
and numericalcurve
fitting
techniques
become
essentialto
simulatedislocation
motion.To
the
data
pointsdescribing
the
dislocation
shapeis
needed[18].Influenced
by
author's experience
in
physicalsciences, this investigation
concentrates oncurve
fitting
techniques
in
a non-interactive environment ratherthan
inter
active
design
ofcurves.In interactive design
ofcurves,
the
control points canbe
movedto
obtain a curve ofdesired
shape.For
example,
B-splines[6,
10]
are
very
useful and powerfulin
computer aideddesign.
However,
in
many
technical applications,
for
a given set ofinterpolation
points,
the
shape ofthe
fitted
curve mustbe
controlledby
modifying
shape parametersinstead
of
altering
some or allinterpolation
points.Consequently,
in
the
pastfive
years,
interest in
the applying
splinesto
curve synthesishas
resurged.Consider
fitting
a smooth curvethrough
(n
+
1)
data
points{
cc, ,y,
}
"_0
in
the
x-y
plane.Two distinct
cases exist:Drawing
a curvey
=f(x)
whenit is
known
that
f(x)
underlying the
data is
single-valued,
i.e.,
for
every
xin
the
range[xij,a;n],
y(x)
has
a unique value.
For
example,
whendata
represents measurement oftemperature yt
at eachtime x,, the
drawn
curvey
=f(x)
shouldbe
single-valued.
Drawing
a curvethrough the
data
points whichrepresent contour mapsor shapes or
trajectories.
Now
the
data
(x,,
y,) is
simply
a collection ofdata
pointsin
the x-y plane,
andthere
is
no notionthat y
is
afunction
of x.
Thus,
a given xin
the
range[xn,xn]
may
correspondto
severaly
values
requiring
amulti-valued curve.Such
curvesmay
be
open,
i.e.,
point
(xu,y0)
does
not coincide with point(xn,yn),
ormay
be
closed,
i.e.,
the two
end-points(xu,y0)
and{xn,yn)
do
coincide,
for
example,
may
impose further
restrictions,
e.g.,
contour maps requirethat
severalclosed curves must not
intersect
one another.In
single-valued casesinvolving
curves wherey
is
implicitly
dependent
onx and
the
data
points areclosely
relatedto the
particular axis systemin
which
they
aredefined,
e.g.,
in
simple graphplotting
applications,
the
needto
rotatethe
coordinate systemdoes
not exist.In
many
otherapplications,
however,
there
is
no notionthat y
is
afunction
of x and moreimportantly,
axis rotation
may
be
desired.
In
suchcases, the
single-valued curves aretoo restrictive,
and notonly the possibility
of a curvebeing
multi-valuedmust
be
allowedbut
alsothe
curve mustbe invariant
whenthe
axes arerotated.
For
instance,
the
trajectory
ofa rocketdescribed
by
a curvepassing
through
a sequence of pointsin
two-dimensional
spacemay
appearsingle-valued when
the
points aredefined in
a particular coordinate systemx-y
but
willbecome
multi-valued whenthe
samepoints are redefined
in
anothercoordinate system x'-y'.
Thus,
the
shape ofthe
curve shoulddepend
only
on
the
relative positions ofthe
points and not ontheir
positions relativeto
a particular axis system.
1.1
Single-
valued
Curve
Fitting
Most
common and populartechnique
for
fitting
a single-valued compositecurve
y
=/(x)
through
the
data
points{x,-,y-}"=u
is
splineinterpolation.
The
term
splineis borrowed
from
the
draftsman's
aid athin metal,
plasticthe
data
points calledknots.
The
physical splinerepresenting the
curveminimizes
its
elastic strain energy.Mathematically,
it implies
that the
meansquared curvature
is
minimum,
andin
that
sense,
it is
the
smoothest curvepassing through
the
knots.
Each
subintervalj:
[xj_!,xj]
is
called a spanwhere
x7_!
<
Xj
andj
=0,
. . .,ra.
On
each spanj,
a piecewise polynomialSj(x)
ofdegree
m,
called aspline, is
chosen suchthat
it
has its first
(m
1)
derivatives
continuous atthe
knots
Xj_x
and Xj.In
practice,
cubic splines(m
=3)
areused,
andtheir
secondderivative
continuity
produces avisually
smooth curve.
The
construction of cubic splinesdoes
not,
however,
assumethat the
derivatives
ofthe
interpolant
agree withthose
ofthe
function
/(x),
even at
the
knots
[2].
The
particular problem of cubic splineinterpolation is
to
find
cubic polynomials
Sj(x)
on span[xj_i,Xj]
wherej
1,
. . .,ra such
that
1.
5i(x())
=y0
andSj(xj)
=yj for
j
l,...,n; i.e.,
composite curvepasses
through
eachdata
point;
2.
Sj+i(xj)
=Sj(xj)
for
j
=1,
. . .,ra
1; i.e.,
successive splines meet attheir
commonknot;
3.
Sj+1(xj)
=S'j(xj)
for
j
=1,
...,n1; i.e.,
successive splineshave
first
derivative
continuity
attheir
commonknot;
4.
5"4|(x;)
=S'j'(xj)
for
j
=1,
... ,7i1; i.e.,
successive splineshave
second
derivative
continuity
attheir
commonknot;
Type I:
5,'(x)
=y'{)
andS'n(xn)
=y'n
wherey',
andy'n
arespecified;
i.e.,
built-in
boundary
giving
clampedspline,
orType II:
5,'(x0)
=^'(x)
=0; i.e.,
free
boundary
giving
naturalspline.
Cubic
splines canbe defined
with other sets ofboundary
conditions.The
equations abovedescribe
asystemof4ra
linear
algebraic equationsinvolv
ing
the
4ra
unknown polynomial coefficients which canbe
solvedfor
the
valueofeach unknown.
Readers
requiring
moredetails
than the
brief
outline abovecan
find
good referenceson cubic splineinterpolation
in
papersby Cox[ll, 12]
and on
boundary
(or
end)
conditionsin
the
paperby
Adams[l].
An
alternateand more general
formulation,
employing
the
Euler-Lagrange
equation andits
integration,
is
presentedin
section1.4.
This formulation forms
the
basis
for
avariety
of extensionsto
controlthe
shape offitted
splines.Instead
ofdescribing
each cubic splineby
four
polynomial coefficients(resulting
in 4ra
unknowns), the
curveis
expressedin
terms
ofthe
secondderivative
at eachinterpolation
point.Thus,
at most(ra
+
1)
unknown secondderivatives
needto
be
found.
1.2
Mult
i-
valued
Curve
Fitting
The
cubic splinetechnique
to
fit
single-valued curves extends quitenaturally
to
multi-valued curves.Each
data
point(x,,
y,) is
characterizedby
a uniqueparameter
,-.
Employing
the
method of cubicsplines,
inter-polants x =
f(t)
andy
-=g(t)
canbe
generatedseparately,
and combinedto
give a parametric curve(x(t),y(t)).
Even
though
eachdata
pointis
assigned a unique parameter value
t,
a multi-valued curve canbe
fitted,
in
the
sense
that
a value of xmay
correspondto
several values ofy
and viceversa,
e.g.,
a curve whichdescribes
the
shape of atwo-dimensional
physical object.But
parametrizationintroduces
a major new problemhow best
to
chosethe
value oft,.
Additionally,
onemay
want parametric curvesto
be invariant
under rotation and
translation
of coordinatesystem,
i.e.,
whenthe
pointsare redefined with respect
to
another coordinate system onthe
samex-y
plane.
Otherwise,
a solid object whose shapeis
being
described
by fitting
the
parametric curve will change shape asit is
rotated.The
choice of parametrizationis
alsocrucialto the
smoothness ofthe
curve[7].A
simpleparametrization, e.g.,
{,
=x}"_0
canbe
used.Figure 1.1
shows aparametric cubic spline
drawn
through
a set ofdata
pointsin
the
form
of aletter S
witht,
=i.
Ahlberg,
Nilson
andWalsh[2]
suggestdefining
tu
=0
t,
=tt_i
+
yj(x,- x,_i)2
+
(y,
-yt-i)2for
i =l,...,ra
(1.1)
Thus,
t
becomes
the
accumulated chordlength between
successivedata
points.
This
parametrization when used onthe
data
offigure 1.1
produces acurve shown
in figure
1.2
whichis
visually
smootherthan the
curveoffigure
1.1.
Choosing
accumulated chordlength
as parametert
is
useful even whenthe
data
points are not spaced equally.Theoretical
argumentsin its favor
arepresented
by
Epstein[13]. The
resulting
parametric curveis invariant
undert
8
7
6
5
>>
3
CUBIC SPLINE-EQUAL INTERVAL
2
3
4
5
6
8
t
6
7
6
5
3
2
1
CUBIC SPLINE-CHORD LENGTH
2
3
4
5
6
7
x(t)
>
8
Figure
1.2:
Parametric
cubicspline[7]
using
accumulated chordlength
asthe
1.3
Parametric
&
Non-parametric
Splines
Just
assingle-valued curves cannot offer
the
flexibility
requiredin
some situations,
parametric curves which areinvariant
under axis redefinition can notguarantee
to
produce single-valued curvefrom
single-valueddata.
For in
stance, the two
graphics packages popularin Great Britain:
GH0ST[15]
andGIN0-F[16],
only
offerthe
axis-invariant parametric curvedrawing
routines.These
aredisastrous
for
users who wishto
ensurethat
single-valued curvesare generated
for
single-valued
data.
Figure 1.3
showsthe
curvedrawn
by
GHOST
through
a set ofdata
pointsrepresenting
measurements of particlespeed
y
atuniformly
spacedinstants
oftime
x.Figure
1.4
showsthe
curvedrawn
by
GINO-F
through the
same set ofdata
points.Both
curves showseveral speed values
y
at a giventime x, e.g.,
at x ~5,
whichdoes
not makeany
physical sensebecause
atany
giventime the
particle musthave
aparticular speed.
In
parametriccase,
if
parametrizationt
= xis
chosen,
it
degenerates
to the
single-valued case.1.4
Euler-Lagrange Formulation for
Splines
The
problem ofinterpolating
agiven set of pointsusing
cubic splines canbe
formulated in
form
of a second-orderordinary
differential
equation.Given
aset of
(ra
+
1)
points{,, Pi]"-U
wheret,
representsthe
parameter value andP,
the
position vector ofthe
pointin
a global coordinatesystem, the
objectis
GHOST
6IM0-F
time
x
of
the
curve at each point.The
curveis described
by
a set of cubic splines{5_,}"=1.
Each
splineSj
is
fitted
overthe
span[_,_!,,].
Assuming
that
S"(t)
is
linear
on each span yields a methodto
constructthe
desired
cubicsplines,
i.e..
sm
for
j
---1,
[
h:
+
S"{tj)
t
-tj.
~^7
(1.2)
,rawhere
hj
=tj
i7_i
representsthe
parametriclength
of spanj.
Integrating
the
differential
equationtwice
with respectto
parametert
yields:3(0
=?"(*;-1)
h3
for-?' =lv
ttj
~ 32
J
+
S"(tj)
1
,1
,L2
J6
. ,n
+
1
2L2* '-1
1
-1
, -f--tH
6
r
+
Sj
(1.3)
,_,! -rSjt
+ ej
(1.4)
where
8j
ande*_,
arethe two
constants ofintegration. The
constants canbe
determined
by
invoking
the two
constraints: att
=-_i,
Sj(t)
=Pj-i
and att
=tj,
Sj(t)
=Pj.
Thus,
P
-P
rj
rj-hi
l^[2t)^iUt]
+
tU\
+
^[^'u-lj+tj-,^-)]
(1.6)
For
the
curveto
have
continuity
in
first-order
derivative,
two neighboring
spans must
have
the
samederivative
vector attheir
commonknot, i.e.,
sm
=s'J+l(tj)
for
j
=l,...,ra
-1
(1.7)
Thus,
the continuity
conditionimplies
that
^ti_l)
+
t>-%-it>(tj)
+
Z
2/-,
2Mj+l
~*j
Sll/4.
\t
2h,
S"(tJ)--^S"(tJ+1)
+
6J+1
The
above equationis
combined withthe
expressionfor
constant8
and rearranged
to
providehjSj_i
+2(hj
+
hj+i)Sj'+
hj+1Sj+l
=6
Pj+i
~
Pj
Pj
~Pj-"\7
+l"-j
for
j
=l,...,ra
-1
(1.8)
For
notationalconvenience,
S'{
representsS"(t
=tj).
Thus,
ra1
equationsare available
in
terms
ra+ 1
unknown secondderivative
vectors, i.e.,
{5,"}"_.
These
equations canbe
combinedwiththe two
boundary
conditions specifiedto
yieldthe
valuesfor
the
unknown vectors.For
example,
if Type II
boundary
p" _ c" _
n
andPn=S't
=0
then the
system of equationsdeveloped
canbe
representedin
a matrixform:
A(_i)x(r,_1)S(n_1)xl
=B(_1)xl
where
the
square matrixA
containsknown
coefficientsinvolving
the
parametric span
lengths:
at<l
=2(h,
+
hl+l
)
for i
1,
. . . ,n1
a^i-i
=hi
for i
=2,
. . . ,ra1
a',,+1
=/i,+i
for i
=1,
...,n2
Matrix B
containsknown
residualsinvolving
the
parametric spanlengths
and
the
coordinate vectors ofthe
knots:
b{
=6
Pi+l
-P,
Pj
-Pj-i
hi+1
ht
for
i
=1
,. . .,ra
1
Matrix
S"contains
the
unknown secondderivative
vectors:a"
Sl
=>,
for i
1
,. . .which need
to
be
determined.
The
coefficient matrixA is
symmetric, tridiagonal
anddiagonally
dominant
which guarantees
that the
solution vector S" willbe
unique andthe
solutiontechnique
willbe
stable with respectto
round-off errors.Similar
systems ofequations can
be developed for
othertypes
ofboundary
conditions.1.5
Disadvantages
of
Cubic Splines
Cubic
splineinterpolation
has
two
majordisadvantages:
It
produces unwanted points ofinflection
onthe
curve.Figure 1.5
showsthe
cubic splineinterpolant
for
a set of pointsdescribing
costy
versuseffectiveness x
data. For
theoretical reasons, the
curveis
known
to
be
concave everywhere and
free from inflection
points.So,
the
spuriousinflection
point at x S310 introduced
by
the
interpolant
is
misleading.It
produces undesirable oscillationsin
the
curve.Figure 1.6
shows anexample of cubic spline
interpolant
for
a set of pointsdescribing
x-ray
intensity
y
versus crystal orientation xdata. The
overshoots at eitherside of
the
main peak are undesirable.The
unwantedinflection
points andthe
undesirable oscillations canbe
removed
by
pulling
onthe
ends ofthe
spline curve.If
the tension
characCUBIC
SPLINE
5
10
15
20
25
30
35
40
effectiveness
x
?CUBIC
SPLINE
4
6
8
orientation
x
-10
simply be
connectedby
straightfine
segments,
andthe
curvewouldbe
piece-wise
linear.
Thus,
spline
in
tension
is
the
mathematical analogue ofthe
mechanical spline subject
to
a uniformtension
between
its
ends.1.6
Splines in Tension
Schweikert[22]
wasthe
first
personto
investigate
analytically the
notion ofsplines
in
tension.
Instead
ofthe
standard cubicinterpolant:
/(x)
= a+
b
x
+
c-x2-x-d-x*,
he
usedthe
form:
f(x)
= a+
6-x
+ c-sinh(a-x) + <i-cosh(a-x)
on each span where a
is
the tension parameter,
andimposed
first
and secondderivative
continuity
conditions ateachknot. The
limiting
interpolant
a *0
becomes
the
standard cubicspline,
whereasthe
otherlimiting
interpolant
a > oo
degenerates
the
curveto
become
piecewiselinear, i.e.,
polygonalsegments.
Cline
[9]
alsoinvestigated the
splinesin
tension
but
with adifferent
assump
tion,
andhis
treatment
yields results similarto those
ofSchweikert.
He
assumed
that
{/"(x)
a2
f(x)}
is linear
on eachspan,
again ais
the ten
sion parameter.
This leads
to
a set ofordinary
differential
equations whichcan
be
integrated
analytically.Nielson[20]
generalizedthe
notion ofsplinesin
tension
by
characterizing
them
with a certain minimum
property,
and created a class ofinterpolants
whichThe
curves producedby
splinesin
tension
for
the
data
offigures 1.5
and1.6
are shownin
figures
1.7
and1.8.
These
curves are muchtighter than
those
offigures
1.5
and1.6.
The
unwantedinflection
point andthe
undesirable oscillations no
longer
exist.In
using
splinesin
tension,
however,
the
computational
simplicity
of piecewise cubic polynomialsis
lost
sincethey
now
involve
hyperbolic
functions.
Also,
the tension
parameter a needsto
be
varied until an acceptable curve
is
generated.1.7
Problem Description
The
treatments
ofboth Schweikert
andNielson
assume ay
=f(x)
form
thus restricting the
curvefit
to
a set ofknots in
two-dimensional
space(x-y
plane)
wherethe
x-coordinates mustmonotonically
increase in
value.Cline
also makes
the
samerestriction,
but
suggeststhat
his
scheme canbe
generalized
to
fit
a continuous curvethrough
a sequence of points characterizedby
x-y
coordinate pairsin
the plane,
which will allowapproximating open,
closed and multi-valued curves.
This investigation
extendsCline's
schemeto
parametric curves
in
ci-dimension space.Specifically,
given(ra
+
1)
point coordinate vectorsin
^-dimension
(d
>
1)
space
{Pi}"=u
andtwo
boundary
conditionsinvolving
the
first
two
derivatives
P'(t)
and(
or)
P"(t)
atthe
two
end-pointsPn
andP
where parametert
is
uniquely
defined for
each pointvector, the
objectis
to
construct a set ofSPLINE/TENSION
10
15
20
25
30
effectiveness
x
-35
40
SPLINE/TENSION
2468
orientation
x
10
i-'
>'ji=i -Lhus,
splineSj(t)
musthave
two
continuousderivatives
onits
span[tj-i,tj].
Additionally,
each splineSj(t)
must nothave
any
inflection
points1within
the
span[*,_!,
*].
The
parametert
mustbe defined in
a suitablemanner
to
ensurethat
the
drawn
curveis invariant
whenthe
coordinatesystem
is translated
and rotatedin
the
d-dimension
space.'inflection
points arephysically
meaningfulin
two-dimensional
space;
in
Chapter
2
Mathematical
Development
Cline's
assumptionthat
{S"(t)
a2-S(t)} is linear
on eachspan where ais
the
tension
parameter,
canbe
incorporated
in
the
Euler-Lagrange formulation
ofsection
1.4.
Such
aformulation
will yield a methodto
constructthe
splinesin
tension.
In
the
following
sections, the
mathematics ofthe
methodto
fit
aparametric spline
in
tension
is developed.
2.1
Constraints
The
notion ofaccumulated chordlength is
extendedto
^-dimension
spaceby
can
be
defined
as*u
=0
and
*,
=*,_,
+
\\Pi-Pi_AL
for
1,
,ra(2.1)
where
\\Pt
Pi_[ ||2
representsthe
notion ofthe
distance
between
point(i
1)
and point
i.
The
splinesS}(t)
are chosento satisfy the
following
constraints:Si(tu)
P0
andSj(tj)
=Pj
iot
j
=l,...,n
Sj+i
(tj)
=Sj{tj)
for
j
=1,
. . .,n
-
1
S'j+Ah)
=S'jitj)
for;
=l,...,ra-l
S'-+l
(tj)
=Sj(tj)
for
j
=1,
. . .,ra
-1
S>;{t)
-a2S3(t)
=["(*,-_!
)-
a2-Sit^)}
+
[&)
-a2&)]
for
j
=l,...,ra
_,
-*j
*>-i
*~*7-l
*i
~~*>-i
(2.2)
(2.3)
(2.4)
(2.5)
(2.6)
2.2
Boundary
Conditions
Many
choices existfor specifying
the
endboundary
conditionsfor
a piecewisecurve,
but
only the
following
three
sets willbe
treated
in
this thesis:
Type
I:
Specify
the two
endtangent vectors,
i.e.,
the
values ofS[(tu)
andS'n(tn). This
type
ofboundary
condition resultsin
clampedsplines,
also called encastered splines[21].
Type II: Set
the
secondderivative
atthe two
endsto zero,
i.e.,
S['(t{))
=S'n(tn)
0.
This
type
ofboundary
condition resultsin
naturalsplines,
also called relaxed splines[23].Type III:
Cyclic
endconditions,
i.e.,
S[(t0)
=S'n(t)
andS"(t0)
=S'n(tn),
canbe
usedto
produce a curve which repeatsitself
atintervals
or a closed curve
if
P0
=P
.This
type
ofboundary
condition resultsin
cyclicsplines,
sometimes also called periodic splines.2.3
Integration
of
Differential
Equation
To derive
agoverning
equation similarto
equation1.8 in
section1.4,
the
linear differential
equation2.6
needsto
be integrated
twice,
followed
by
subconvenience,
amodified
equation2.6 is
reproducedbelow:
S'j(t)
-a*Sj{t)
=[S>-_X
-a2P^]
+
[S'l-J-P]
t:
-tt
-*,-_,
for
j
=l,...,n
where
hj
=tj
tj.x
representsthe
notional parametric spanlength. Other
modifications
include
substitution ofS"(tt)
by
S" and ofS(t{)
by P{
for
notational convenience and compactness.
The homogeneous
solution ofthe
differential
equationis
(X-t
Shh(t)
=ajeat
+
b,e-a-(2.7)
where
a:
andbj
are constant coefficientsto
be determined
later,
eis
the
exponential
function
andthe
subscripth denotes
that it is
the
homogeneous
solution.
The
particular solutionis
ofthe
form
SjAt)
= Cj-t+
dj
(2.8)
where
c,
anddj
are again constantsto
be determined
later,
andthe
subscriptp
denotes
that
it is
the
particular solution.Thus,
the
complete solution willbe
the
sum ofhomogeneous
and particularsolution,
i.e.,
Sj(t)
=a}ead
This
canbe differentiated
twice
with respectto
parametert,
and substitutedin
the
differential
equation aboveto
obtainthe
constantsCj
anddj.
The
particular solution
becomes
Sj,P(t)
=[-<*-*
U
+
pi-*
tj-t
hj
+
h*-2
s]
+
Pj]
t
-tj-ihj
(2.10)
The
constantsa*j
andbj
aredetermined
by
setting
Sj(t)
=P3-{
att
i7_i
and
Sj(t)
=Pj
att
=tj.
Then,
the
complete solutionbecomes
Sj(t)
=Vl
+
a'
S"
or
sinh{a(ij
-t)}
(t3
-t)
sinh
(ahj)
hj
sinh{a(*
-*,_.)}
{t-tj-x)
sin
hiahj)
hj
,
P
(Vz0,p
(*-*,-!)
*i
*i
(2.11)
Thus,
interpolation
within a spanj
requiresknowledge
ofthe
parametricspan
length
hj,
the two
end-pointsPj-i
andPj,
secondderivatives
atthe
two
end-pointsS'j_l
andS'J,
andthe tension
parameter a.The
continuity
conditions requirethat two neighboring
spans musthave
the
same
first
derivative
attheir
commonknot,
i.e.,
&&)
=S'j+l(tj)
for
j
=1,.
. . ,nHence,
whenthe
first
derivative
ofthe
interpolant
with properindices is
substituted
in
the
continuity
conditionabove,
it
yields+
+
a"
sj
a2
9"
jj+i
OL2
3-H
a
hj
sinh(a/ij)
acoth(ahj)
+
acoth(a/iJ+i)
--fy
fy+U
a
hi
j+iP,
Pv
-P
rij+\
for
j
=1,
sinh(a/iJ+1)
j-i
,ra
1
(2.12)
Obviously,
this
equationis
very
similarto that
derived
in
section1.4.
But it
nowinvolves
hyperbolic functions
which arecomputationally time-intensive.
Now,
a system of(ra
1)
equations canbe developed
involving
(re-)-
1)
unknown secondderivative
vectors,
{Sl'}"-0.
These
equations when combined withthe
two
boundary
conditions will yieldthe
solution matrixcontaining the
unknown vectors.
2.4
Normalization
of
Tension
Parameter
a
Unfortunately,
if
the
parametert
is
scaled withtension
parameter a remaining the same,
adifferent
curve willbe
generated.It is
easily
seenthat
equation2.12
is
alteredin
a non-linear mannerif
the
parametert
(and
hence
behav-ior,
the tension
parameter a canbe
normalizedby
the
average spanlength.
Thus,
the
normalizedtension
parameter7
canbe defined
astn
to
-7
= a = ann
(2.13)
When
appropriate substitutionsof aby
7
are madein
equation2.12,
the
samespline will result even
if
parametert
is
linearly
scaled,
aslong
asthe
samenormalized
tension
parameter7
is
employed.For
convenience,
equations2.11
and
2.12
are restatedbelow
using 7
instead
ofaSj{t)
=+
72
72
sinh{7(t,-
-t)/h]
(^
-t)
smh.(*fhj/h)
hj
sinh{7(t
-tj.^/h}
(t-tj.,)
smb.(jhj/h)
fy
+
P
n(*J-*)
, n(*-*J-l)J-1
+
Pj'fy
(2.14)
+
+
vs>;_x
T
h2^
72 727
hj
hs'mh.(ihj/h)
7
7
=coth(7fy/fc)
-t-+
t
coth(7/iJ+1//i)
fy
lj+i
hsmh.("/hj+i/h)
Pj+1
-Pj
Pj
~Pj-hj
1j+l
for
j
=1,,
,rafy+i
2.5
Substitution
of
Boundary
Conditions
Substituting
any
onethe three types
ofboundary
conditionsbeing
considered
into
the
expressionderived in
the
sectionabove,
will provide anon-homogeneous
system oflinear
algebraic equationsinvolving
the
unknownsS"(t,). In
each, the
system ofequations canbe
representedin
a matrixform
AS"
=
B,
wherethe
square matrixA
containsknown
coefficients,
matrixB
containsknown
residuals,
and matrix S" containsthe
unknown secondderivatives
which needto
be determined. Both
matricesB
andS"
will
have
d
columns,
eachrepresenting
a coordinatedirection
ofthe
(/-dimension space.2.5.1
Type
I
Boundary
Conditions
To
fit
clampedsplines, the
values ofS'(t0)
andS'(tn)
are specifiedby
the
user:
S'(to)
=4>o
and
s'(tn)
=</>
which allows S"
to
be
expressedin
terms
ofS"
and
<j)0,
andS"
in
terms
ofEquation
2.11
canbe
differentiated
once with respectto t
yielding:Sj(t)
a-+
+
S" aacosh{a(i7
t)}
1
smh(ahj)
hj
acosh{a(t
tj.i)}
1
sinh.(ahj)
hj
(Pj-Pj-i)
(2.16)
Substituting S[(to)
=<f>o
in
the
equation above providescn
o
a"S'{
crah\
sinh(a/i1)
+
sinh(a/ii)
a/ii
cosh(ah\)
sinh(o;/i1)
(A
-P0)
-h,$o
ahx
cosh(a/i1)
s\rvh.(ahi)
and
substituting
S'n(tn)
<f>n
providesS" cr on '-'n-l a^
ahn
sinh.(ahn)
+
sinh(a/xn)
ahn
cosh(a/in)
sinh(ahn)
hJn-(Pn-Pn^)
ahn
cosh.(ahn)
sinh(a/i)
(2.17)
(2.18)
The
two
equations abovein
conjunction with equation2.12
yield a systemof
(ra
1)
equationsin
terms
of(ra
1)
unknown secondderivatives,
i.e.,
{S"}"=i
.Such
a system canbe
representedin
a matrixform:
AS"=
B
where
an
=acoth(ah,)
-+
acoth.(ah,+l)
--for
i
=2,
. . . ,re-
2
a.,.-)
=~,
a
h(
sinh(a/i,)
for i
=
2,
. . . ,ra1
a
l,i+l
fy+1
sinh(a/i!+i)
for i
=
1
,. . .
,ra
2
57
a-for
i
=1
,. . .
,n
1
6,- =
P
+l ~~~P
Pi
~P'-l
fy+1
fy
for i
=2,
...,ra2
and
au
=acoth.(ah{)
-f-acoth(a/i2)
t~h,
/i2
+
sinh(a/i1)
ah.
sinh(a/i1
)
a/ij
cosh(a/z1)
h,
sinh(a/i1)
aP2-p,
fy
p,
-io
Al
a/ij
ahi
cosh(a/i1)
-^0
sinh(a/i!)
ah,
cosh(a/i1)
sinh(a/ii)
ah\
sinh(a/i1)
a/ii
cosh(a/ii)
1
1
an_!,_i
=acoth(a^_i)
-h
acoth(a/in)
--+
fy-1
sinh(a/i)
ahn
sinh(a/in)
a/in
cosh(a/iri)/ \/in
sinh(a/in)
fy-1
=Pn
~Pn
- 1hn
Pn-l
~Pn-2
fy-l
a/in
a/in
cosh(ahn)
sinh(a/in)
a/Yn
cosh(a/in)
sinh(a/in)
a/in
+
<Pn
sinh(a/in)
a/i
cosh(a/iri)
Matrix
A is
symmetric, tridiagonal
anddiagonally
dominant.
Thus,
a uniqueand non-trivial solution
to the
system of equations mentioned above exists.Furthermore,
numericaltechniques
employedto
solve such a system willbe
stable with respect
to
round-offerrors,
and will not requireany
special pivoting
orscaling
strategies.2.5.2
Type
II
Boundary
Conditions
Natural
splines requirethe
secondderivative S"(t
)
to
be
zero att
=t0
andat
t
tn.
Thus,
S'{;
=0
and<%
=0
The
equations abovein
conjunction with equation2.12
again yield a systemof
(ra
-1)
equationsin
terms
of(ra
-1)
unknown secondderivatives, i.e.,
{5''}"r,1. Such
a system canbe
representedin
matrixform:
AS" =B
wherethe only
non-zero entries arean
=acoth(ahj)
-+
acoth(ah,+l)
--hi
tii+i
for i
=1
, . . .
a l!,l-l
h{
sinh(ahi)
for
z =2,
... ,ra1
aM
+l1
a/i,+i
sinh(a/i1+1)
for i
=
1
,. . .,ra
2
5"
a^
for
i =1
,. . .,re
1
P,+1
-P
P,
-P
i-1fy
+1for i
=1
,. . .,ra
1
Again,
matrixA is
symmetric, tridiagonal
anddiagonally
dominant.
Thus,
aunique and non-trivial solution
to the
system of equations mentioned aboveexists.
Furthermore,
numericaltechniques
employedto
solve such a systemwill
be
stable with respectto
round-offerrors,
and will not requireany
specialpivoting
orscaling
strategies.2.5.3
Type
III
Boundary
Conditions
Cyclic
splines requirethat
the
first derivative
S'
be
same att
=to
andt
=tn,
andthe
secondderivative
S"
at
t
=tu
be
equalto that
att
=t.
Thus,
c" _ c"
Equation 2.16
canbe algebraically
manipulatedto
yieldthe
needed equation67
a--a1
+
Oil a'sinh(a/ii)
h,
asinh(a/i)
hn
S"\
1
1
+
77
acoth(ahi)
+
acoth(a/in)
+
~2
/ii
fcJ
a'
Pn
~Pn-L
Pi
""-Pj
hn
fy
(2.19)
Now,
the
equations abovein
conjunction with equation2.12
yield a systemof ra equations
in
terms
of ra unknown secondderivatives, i.e.,
{5t"}"=1. The
system of equations can still
be
representedin
a matrixform:
AS"
=
B
where
the
non-zero entries area,,,
= acoth(ahi)
+
acoth(a/i1+1)
for i
=1,
. . . ,ra1
hi
h{+\
a
d'i.i- 1
h{
sinh(ahi)
for i
=2,
. . . ,ra1
aa"',i
+l/ii+i
sinh(a/ii+i)
for i
=1
,. . .,ra
1
5"
3,' =
for i
=1
,. . .
,ra
ar
6,=
P+1
-P,
P
-P-i
h,+i
^
for
z =1
,. . .and
1
affll,n
="---h-[
sinh(a/ii)
1
a<Vi
=hi
sinh(a/i,)
an.n
= ctcoth(a/it
)
7
ha
coth(a/in)
A
1~
n
~
P---1
The
matrixA is
stillsymmetric,
banded
anddiagonally
dominant
althoughnot
tridiagonal.
Thus,
numericaltechniques
employedto
solvethe
systemwill
be
stable with respectto
round-off errors and will yieldthe
unique andnon-trivial solution.
However,
due
to the
corner elementsa,
n andanX, the
numerical
techniques
will nolonger be
ascomputationally
efficient asthose
for
tridiagonal
matrices.2.6
Solution
of
System
of
Linear
Equations
Many
methods existto
solve such systems oflinear
equations,
for
example,
elimination
methods,
LU
decomposition
methods anditerative
methods[8].For
a system ofequations
ofdegree
ra,
whenthe
coefficient matrixis
diago
nally
dominant
andtridiagonal,
a modifiedGaussian
eliminationtechnique
can
be
used.Pivoting
orscaling
strategies are notrequired,
andthe tech
nique
is
O(nd).
If
the
coefficient matrixis
diagonally
dominant but
nottridiagonal,
the
sametechnique
canbe
employedbut is
nolonger 0(nd). In
this study, the
technique
is
implemented
as a separate routine withoutany
special provisions
for storing
efficiently the
elements ofthe
coefficient matrix.2.7
Implementation
The
schemeto
fit
parametric splinesin
tension
as outlinedin
this
chaptercan
be implemented
simply using
few
routines.Detailed
algorithms are notpresented
in
this
section since each routineis
simplebeing
merely
ahigher-language
translation
ofthe
equationsderived in
this
chapter.Compiler-produced
listings
ofthe
routines canbe found in
appendixA. The
mainprogram
TENSION
requires standardinput
andproduces standardoutput.The input data is
n:
the
number ofdata
points;
d:
the
number of componentsin
eachdata
point coordinatevector;
P:
coordinate vectorfor
eachdata
point;
7:
the
normalizedtension
parameter;
type
A
implies
that the
parametert
equalsthe
first
component ofcoordinate
vectorP
ofeachdata
point, i.e., t
- xfor
single-valuedcurve
fitting;
type
B
implies
that the
parametert
equalsthe
index
ofeachdata
point,
i.e.,
t
=i.
This
parametrization
is
notsatisfactory
andis
implemented
to
allow comparison with publisheddata;
andtype
C implies
that the
parametert
equalsthe
accumulated chordlength between
successivedata
points(see
equation2.1).
This
parametrization
is
most appropriatefor
many-valued curvefitting.
btype:
the type
ofboundary
conditionsdesired,
type 1
implies
clampedsplines,
in
which casetwo vectors, the
first
derivative
at eachend,
mustbe
suppliedby
the user;
type 2
implies
naturalsplines,
no additionalinformation is
needed;
and
type
3 implies
cyclicsplines,
again,
no additionalinformation
is
needed.
The
standard outputis
the
list
of secondderivative
vectorsSPP
=S".
The
main programfirst invokes
a subprogram calledPARAMETRIZE
to
assign a parameter value
to
eachdata
pointdepending
on ptype specifiedby
the
user.It
then
invokes
another subprogram calledTSPLINES
to
fit
parametric splines
in
tension
withthe
specifiedtype
ofboundary
conditions.The
subprogramTSPLINES,
in
turn,
invokes
another subprogram calledGAUSS
to
solve a system of equationsby
modifiedGaussian
eliminationA
similarprogram
package
to
fit
parametric
cubic splines canbe
found
in
Chapter
3
Some Applications
& Future
Extensions
The
tension
parameter a canbe
considered as a shapefactor
underuser-control which
the
user canvary to
alterthe
shape of a curvefitted
to
agiven set of
data
points.This is in
contrastto
computer-aideddesign
ofcurves where
for
example, using
B-splines,
a user canmodify the
curveby
increasing
ordecreasing
the
number ofcontrolpoints,
even perhapsaltering
a
few
control points.In
most scientificapplications,
however,
a userdoes
not
have
the
flexibility
to
modify
the
given set ofdata
points, and canonly
alter
the
fitted
curveby
manipulating
shapefactors. In
this
chapter,
afew
applications are presented which
demonstrate
the
use of splinesin
tension.
the
first
two
examples,
both
types
ofcurves are presentedfor
comparison.3.1
Tension
versus
Cubic Splines
To illustrate
the
dramatic
effect oftension
appliedto
a closedcurve,
asimpleshape composed of a semicircle over a rectangle
is
constructed.To
representthe shape,
knots
are chosen atevery
15interval
onthe
semicircle of unitradius,
atthe
corners andthe
midpoint of each side ofthe
rectangle.Thus,
a
total
of18
points are chosen withthe
0thpoint
coinciding
withthe
18thpoint.
Coordinates
of each point arelisted below.
i
0
1
2
3
4
Xi
y.
0.0
0.0
0.03407417
0.258819
0.133975
0.5
0.2928932
0.7071068
0.5
0.866025
i
5
6
7
8
9
X,
y>
0.741181
0.9659258
1.0
1.0
1.258819
0.9659258
1.5
0.866025
1.707107
0.7071068
i
10
11
12
13
14
x{
yi
1.866025
0.5
1.965926
0.258819
2.0
0.0
2.0
-0.52.0
-1.0i
15
16
17
18
Accumulated
chordlength
is
chosenfor
curve parameter and cyclicboundary
conditions
(i.e.,
first
and secondderivatives
are matched atthe
first
andthe
last
point)
areimposed.
The
curvethat
results when a cubic splineis
fitted
to the
data
pointsis
shownin
figure
3.1.
The
semicircular part ofthe
shape
is
reproducedaccurately
by
the
cubic spline.This is
to
be
expectedbecause
the
semicirclehas
aconstant curvature overits
span and cubicsplineinterpolates
linearly
on eachspanthe
curvature atthe
knots.
Thus,
the
cubicspline
fit
resultsin
a circular arc.However,
cubic splinepoorly
representsthe
rectangular part ofthe
shape.It has
extraneous curls atthe
corners ofthe
rectangle.A
tension
spline with normalizedtension
parameter7
=0.001
with cyclicboundary
conditionsis
fitted
to the
same set ofdata
points andis
shownin
figure
3.2.
When
comparedto
cubicspline, the
semicircular portion ofthe
shape
is
notfitted
wellby
tension
spline.However,
the
fit
to
rectangular portionis
excellent.It
shouldbe
notedthat the
curvetightens
considerably
with such a smalltension
(i.e.,
7
=0.001).
3.2
Shape
with
Fillets
To
eliminate stress concentrationsthat
arise atsharp
corners,
engineering
components are often rounded at corners
(this
rounding
is
referred asfillets).
The
shapein
the
last
sectionis
rounded atthe
bottom
two
rectangular corners with a circular arc ofradius =0.125,
resulting
in
a shape composedofSemicircle
overRectangle (Cubic
Spline)
Figure 3.1:
Cubic
spline with cyclicboundary
conditionsfitted
to
a shapeSemicircle
overRectangle
(Tension
Spline)
Cv}
O
^H
o
-
f
o
1
o
cu , , , , 1 , , , , 1 , , , , 1 , , , ,
-1.0
0.0
1.0
X
2.0
3.0
Figure
3.2:
Tension
spline with cyclicboundary
conditions and normalizedtension
parameter7
=0.001
fitted
to
a shapeconsisting
of a semicircle andby
points at 30intervals
resulting in
atotal
of24
pointslisted below:
i
0
1
2
3
4
xt
y,
0.0
0.0
0.03407417
0.258819
0.133975
0.5
0.2928932
0.7071068
0.5
0.866025
i
5
6
7
8
9
x,
0.741181
0.9659258
1.0
1.0
1.258819
0.9659258
1.5
0.866025
1.707107
0.7071068
i
10
11
12
13
14
xt
y.
1.866025
0.5
1.965926
0.258819
2.0
0.0
2.0
-0.52.0
-0.875i
15
16
17
18-19
X,
1.983253
-0.93751.9375
-0.98325321.875
-1.01.0
-1.00.125
-1.0i
20
21
22
23
24
X,
y.
0.0625
-0.98325320.01674682
-0.93750.0
-0.8750.0
-0.50.0
0.0
As in
the
previoussection,
accumulated chordlength is
chosenfor
parameterization,
and cyclicboundary
conditions are employed.Curve
resulting
from
fitting
a cubicsplineis
shownin figure
3.3.
Straight
segments ofthe
rectangleare not represented
accurately
by
such a curve.The
curve,
in
comparisonto
that
offigure
3.1,
is
tighter.
Semicircle+Rectangle
w/fillets(Cubic
Spline)
Oi
l-l
~^\
]
o
L
J
1
o
oi
-1.0
0.0
1.0
X
2.0
3.0
Figure
3.3:
Cubic
spline with cyclicboundary
conditionsfitted
to
data
pointsrepresenting
a shape composed of a semicircle and a rectangle withfillets
ofradii =
0.125
considering
that
only
afew data
pointshave been
chosento
representthe
semicircular
portion andthe
fillets
at rectangular corners.With
shapes such asthose
discussed
in
sections3.1
and3.2,
it is
difficult
to
chose
if
splinesin tension
resultin
better
representation ofthe
shapethan
cubic splines.
These
static shapes arein
any
casebetter described
by
acollection of circular arcs and straight
fine
segments.Splines in
tension
are much more usefulin
describing
dynamic
shapesin
numerical simulation ofscientific
phenomenon.
Such
an exampleis
presentedin
the
next section.3.3
Dislocation Dynamics
In
the study
of plasticdeformation
of crystallinematerials,
dislocation
type
line defects
needto
be
modeled.Since
adislocation
(defined
asthe
boundary
between
slipped and unslippedregions)
assumes complex configurations asit
glides
through the
crystal under appliedstresses,
smooth curvesdescribing
these
configurations are requiredto study
its
glide.The
curves can notbe
expressed
analytically,
and numerical curvefitting
techniques
become
essentialto
simulatethe
motion ofdislocations.
To
simulate suchmotion,
knowl
edge of
both
tangent
and curvature vectors atthe
data
pointsdescribing
the
dislocation
shapeis
needed.In
past,
investigators fitted
a circular arcto
three
points(the
point ofinterest
andits
two
neighbors on eitherside)
whichyields
the
information
aboutthe tangent
and curvature vectors.A
moresatisfactory
methodis
to
fit
parametric splinesin
tension.
In
fact,
since amin-Semicircle+Rectangle
w/fillets(Tension
Spline)