BSplineKit Spline Derivative

BSplineKit has in Library => Data Interpolation => Functions, the example

xs = -1:0.1:1;
ys = cospi.(xs);
S = interpolate(xs, ys, BSplineOrder(4))
(Derivative(1) * S)(-1)

For me, this example fails with no method matching * .

The alternative BSplines.jl construction Function(spa, Derivative(1)) construction results in no constructor defined error.

Help is appreciated.

There seems to be a problem with the package as none of my past scripts seem to work anymore (Julia 1.8.2).
Pinging the author @jipolanco

Thx!

@ziolai I just tried the example and it just works for me:

julia> using BSplineKit

julia> xs = -1:0.1:1;

julia> ys = cospi.(xs);

julia> S = interpolate(xs, ys, BSplineOrder(4))
SplineInterpolation containing the 21-element Spline{Float64}:
 basis: 21-element BSplineBasis of order 4, domain [-1.0, 1.0]
 order: 4
 knots: [-1.0, -1.0, -1.0, -1.0, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3  ā€¦  0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0, 1.0, 1.0, 1.0]
 coefficients: [-1.0, -1.00111, -0.8975, -0.597515, -0.314147, 1.3265e-6, 0.314142, 0.597534, 0.822435, 0.96683  ā€¦  0.96683, 0.822435, 0.597534, 0.314142, 1.3265e-6, -0.314147, -0.597515, -0.8975, -1.00111, -1.0]
 interpolation points: -1.0:0.1:1.0

julia> (Derivative(1) * S)(-1)
-0.01663433622896893

This is using the latest version of BSplineKit.jl (v0.14) and Julia 1.8.3. Can you tell me which versions you are using?

@rafael.guerra Iā€™m sorry if your scripts no longer work using the latest BSplineKit. Can you provide a minimal example of a non-working code, to try to identify the issue?

1 Like

@jipolanco, sorry for the noise. I have started a fresh Julia session with the latest version of BSplineKit and could not reproduce the problems. Thank you for your support.

I updated my installation and the code runs fine now.

Sincere thx. Seasons greetings.

1 Like