scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
unique_roots(p, tol=0.001, rtype='min')

Notes

If we have 3 roots a , b and c , such that a is close to b and b is close to c (distance is less than :None:None:`tol`), then it doesn't necessarily mean that a is close to c . It means that roots grouping is not unique. In this function we use "greedy" grouping going through the roots in the order they are given in the input p.

This utility function is not specific to roots but can be used for any sequence of values for which uniqueness and multiplicity has to be determined. For a more general routine, see numpy.unique .

Parameters

p : array_like

The list of roots.

tol : float, optional

The tolerance for two roots to be considered equal in terms of the distance between them. Default is 1e-3. Refer to Notes about the details on roots grouping.

rtype : {'max', 'maximum', 'min', 'minimum', 'avg', 'mean'}, optional

How to determine the returned root if multiple roots are within :None:None:`tol` of each other.

  • 'max', 'maximum': pick the maximum of those roots

  • 'min', 'minimum': pick the minimum of those roots

  • 'avg', 'mean': take the average of those roots

When finding minimum or maximum among complex roots they are compared first by the real part and then by the imaginary part.

Returns

unique : ndarray

The list of unique roots.

multiplicity : ndarray

The multiplicity of each root.

Determine unique roots and their multiplicities from a list of roots.

Examples

>>> from scipy import signal
... vals = [0, 1.3, 1.31, 2.8, 1.25, 2.2, 10.3]
... uniq, mult = signal.unique_roots(vals, tol=2e-2, rtype='avg')

Check which roots have multiplicity larger than 1:

>>> uniq[mult > 1]
array([ 1.305])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.signal._signaltools.unique_roots scipy.signal._signaltools.residue scipy.signal._signaltools.invres scipy.signal._signaltools.residuez scipy.signal._signaltools.invresz

Local connectivity graph

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


GitHub : /scipy/signal/_signaltools.py#2394
type: <class 'function'>
Commit: