Matlab代码考克斯Bspline.py
通过Cox-de
Boor算法实现Bspline基本函数的Python
/
Numpy实现。
还提供了高阶微分,并置矩阵生成以及最小化的过程API(主要用于处理结向量),这可能有助于转换MATLAB代码。
用法
import
numpy
import
bspline
import
bspline
.
splinelab
as
splinelab
##
Spline
setup
and
evaluation
p
=
3
#
order
of
spline
(as-is;
3
=
cubic)
nknots
=
11
#
number
of
knots
to
generate
(here
endpoints
count
only
once)
tau
=
[
0.1
,
0.33
]
#
collocation
sites
(i.e.
where
to
evaluate)
knots
=
numpy
.
linspace
(
0
,
1
,
nknots
)
#
create
a
knot
vector
without
endpoint
repea
评论0
最新资源