Rootfinding Result

class cxroots.root_result.RootResult(roots: List[complex], multiplicities: List[int], contour: ContourABC)[source]

A class which stores the roots and their multiplicites as attributes and provides convienent methods for displaying them.

roots

List of roots

Type:

list

multiplicities

List of multiplicities where the ith element of the list is the multiplicity of the ith element of roots.

Type:

list

contour

The contour bounding the region in which the roots were found.

Type:

Contour

show(save_file: str | None = None) None[source]

Plot the roots and the initial integration contour in the complex plane.

Parameters:

save_file (str, optional) – If provided the plot of the roots will be saved with file name save_file instead of being shown.

Example

from cxroots import Circle
C = Circle(0, 2)
f = lambda z: z**6 + z**3
df = lambda z: 6*z**5 + 3*z**2
r = C.roots(f, df)
r.show()

(Source code, png, hires.png, pdf)

_images/result-1.png