{ } Raw JSON

bundles / scipy 1.17.1 / scipy / interpolate / _bsplines / BSpline / from_power_basis

classmethod

scipy.interpolate._bsplines:BSpline.from_power_basis

source: /scipy/interpolate/_bsplines.py :792

Summary

Construct a polynomial in the B-spline basis from a piecewise polynomial in the power basis.

Extended Summary

For now, accepts CubicSpline instances only.

Parameters

pp : CubicSpline

A piecewise polynomial in the power basis, as created by CubicSpline

bc_type : string, optional

Boundary condition type as in CubicSpline: one of the not-a-knot, natural, clamped, or periodic. Necessary for construction an instance of BSpline class. Default is not-a-knot.

Returns

b : `BSpline` object

A new instance representing the initial polynomial in the B-spline basis.

Notes

Accepts only CubicSpline instances for now.

The algorithm follows from differentiation the Marsden's identity [1]: each of coefficients of spline interpolation function in the B-spline basis is computed as follows:

- a coefficient of CubicSpline, - an m-th defivative of a dual polynomial in .

k always equals 3 for now.

First n - 2 coefficients are computed in , e.g.

Last nod + 2 coefficients are computed in x[-2], nod - number of derivatives at the ends.

For example, consider , and bc_type = natural

The coefficients of CubicSpline in the power basis:

The knot vector:

In this case

Aliases

  • scipy.interpolate.BSpline.from_power_basis