# BSplineKit Spline Derivative

**URL:** <https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961>\
**Category:** Specific Domains\
**Tags:** question, package, bsplinekit\
**Created:** [December 21, 2022, 3:28pm UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961 "2022-12-21T15:28:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Post date:** [December 21, 2022, 3:28pm UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961/1 "2022-12-21T15:28:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 22, 2022, 8:47am UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961/2 "2022-12-22T08:47:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Post date:** [December 22, 2022, 11:03am UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961/3 "2022-12-22T11:03:48Z")

</div>

Thx!

---

<div class="post-metadata">

**Author:** ![jipolanco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jipolanco/32/12129_2.png) [@jipolanco](https://discourse.julialang.org/u/jipolanco)\
**Post date:** [December 22, 2022, 11:59am UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961/4 "2022-12-22T11:59:39Z")

</div>

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

```julia
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?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [December 22, 2022, 12:14pm UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961/5 "2022-12-22T12:14:59Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ziolai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ziolai/32/23422_2.png) [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Post date:** [December 22, 2022, 1:08pm UTC](https://discourse.julialang.org/t/bsplinekit-spline-derivative/91961/6 "2022-12-22T13:08:34Z")

</div>

I updated my installation and the code runs fine now.

Sincere thx. Seasons greetings.
