Test data for B-spline operators based on Galerkin
L
2
projection.
Wrap
Mathematica
's B-spline routines so they match the GNU Scientific Library's semantics. Note that
Mathematica
workswith piecewise polynomial degree while the GSL uses piecewise order plus one.
In[1]:=
Knots
k_, b_
:
Join
ConstantArray
First
b
, k
1
, b, ConstantArray
Last
b
, k
1
Lastdof
k_, b_
:
Length
Knots
k, b
k
1
2;Basis
k_, b_
:
BSplineBasis
k
1, Knots
k, b
,
1,
2
&
Provide some sample breakpoints for testing purposes and visualize some different basis orders:
In[4]:=
b
Sort
0, 1, 3
2, 2, 9
8, 3
;
In[5]:=
Plotem
k_
:
Plot
Table
Basis
k, b
i, x
,
i, 0, Lastdof
k, b
,
x, First
b
, Last
b
, PlotRange
Full, PlotLabel
k
Table
Plotem
k
,
k, 1, 4
Out[6]=
0.5 1.0 1.5 2.0 2.5 3.00.20.40.60.81.0
1
,
0.20.40.60.81.0
2
,
Leave a Comment