solve(self, y=0.0, discontinuity=True, extrapolate=None)
This routine works only on real-valued polynomials.
If the piecewise polynomial contains sections that are identically zero, the root list will contain the start point of the corresponding interval, followed by a nan
value.
If the polynomial is discontinuous across a breakpoint, and there is a sign change across the breakpoint, this is reported if the :None:None:`discont`
parameter is True.
Right-hand side. Default is zero.
Whether to report sign changes across discontinuities at breakpoints as roots.
If bool, determines whether to return roots from the polynomial extrapolated based on first and last intervals, 'periodic' works the same as False. If None (default), use :None:None:`self.extrapolate`
.
Roots of the polynomial(s).
If the PPoly object describes multiple polynomials, the return value is an object array whose each element is an ndarray containing the roots.
Find real solutions of the the equation pp(x) == y
.
Finding roots of [x**2 - 1, (x - 1)**2]
defined on intervals [-2, 1], [1, 2]
:
>>> from scipy.interpolate import PPolySee :
... pp = PPoly(np.array([[1, -4, 3], [1, 0, 0]]).T, [-2, 1, 2])
... pp.solve() array([-1., 1.])
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.interpolate._interpolate.PPoly.solve
scipy.interpolate._interpolate.PPoly.roots
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them