{ } Raw JSON

bundles / scipy 1.17.1 / scipy / interpolate / _interpolate / BPoly / _construct_from_derivatives

staticmethod

scipy.interpolate._interpolate:BPoly._construct_from_derivatives

source: /scipy/interpolate/_interpolate.py :1753

Signature

staticmethod def   _construct_from_derivatives ( xa xb ya yb )

Summary

Compute the coefficients of a polynomial in the Bernstein basis given the values and derivatives at the edges.

Extended Summary

Return the coefficients of a polynomial in the Bernstein basis defined on [xa, xb] and having the values and derivatives at the endpoints xa and xb as specified by ya and yb. The polynomial constructed is of the minimal possible degree, i.e., if the lengths of ya and yb are na and nb, the degree of the polynomial is na + nb - 1.

Parameters

xa : float

Left-hand end point of the interval

xb : float

Right-hand end point of the interval

ya : array_like

Derivatives at xa. ya[0] is the value of the function, and ya[i] for i > 0 is the value of the ith derivative.

yb : array_like

Derivatives at xb.

Returns

: array

coefficient array of a polynomial having specified derivatives

Notes

This uses several facts from life of Bernstein basis functions. First of all,

If B(x) is a linear combination of the form

then :math: B'(x) = n sum_{a=0}^{n-1} (c_{a+1} - c_{a}) b_{a, n-1}. Iterating the latter one, one finds for the q-th derivative

with

This way, only a=0 contributes to :math: B^{q}(x = xa), and c_q are found one by one by iterating q = 0, ..., na.

At x = xb it's the same with a = n - q.

Aliases

  • scipy.interpolate.BPoly._construct_from_derivatives