scijit.interpolate.splder_ev¶
- scijit.interpolate.splder_ev(x, tck, nu=1)¶
Evaluate the nu-th derivative of a spline.
Named
splder_ev, notsplder, on purpose:scipy.interpolate. splderreturns the derivative spline’s tck, and that role is filled in this package bysplder(also exported assplder). This function EVALUATES.- Parameters:
- x1-D float64 ndarray
Points to evaluate at.
- tcktuple of (t, c, k)
Spline representation.
- nuint, optional
Derivative order,
0 <= nu <= k. Default 1.
- Returns:
- y1-D float64 ndarray, same length as x
Derivative values, extrapolated outside the knot range.
- Raises:
- ValueError
If nu is outside
0..k, or if c holds fewer thanlen(t) - k - 1coefficients.
Notes
scipy publishes no
splder_ev. It reaches the same computation assplev(x, tck, nu), which this package also provides under the name splev.prange-safe: yes.
Examples
>>> import numpy as np >>> from numba import njit >>> from scijit.interpolate import splrep, splder_ev >>> x = np.linspace(0, 4, 40) >>> tck = splrep(x, np.sin(x)) >>> @njit ... def slope(tck, q): ... return splder_ev(q, tck, 1) >>> float(np.round(slope(tck, np.array([0.0]))[0], 6)) 1.000019