Skip to main content

Find all the roots (zeros) of a complex analytic function within a given contour in the complex plane.

Project description

https://travis-ci.org/rparini/cxroots.svg?branch=master

cxroots

cxroots is a Python package for finding all the roots of a function, f(z), of a single complex variable within a given contour, C, in the complex plane. It requires only that:

  • f(z) has no roots or poles on C

  • f(z) is analytic in the interior of C

from numpy import exp, cos, sin
f = lambda z: (z*(z+2))**2 * (exp(2*z)*cos(z)-1-sin(z)+z**5)

from cxroots import Circle
C = Circle(0,3)
roots = C.roots(f)
roots.show()
https://github.com/rparini/cxroots/blob/master/README_files/README_1_0.png?raw=true
print(roots)
 Multiplicity |               Root
------------------------------------------------
      2       | -2.000000000000 -0.000000000000i
      1       | -0.651114070264 -0.390425719088i
      1       | -0.651114070264 +0.390425719088i
      3       |  0.000000000000 +0.000000000000i
      1       |  0.648578080954 -1.356622683988i
      1       |  0.648578080954 +1.356622683988i
      1       |  2.237557782467 +0.000000000000i

See the documentation or GitHub page for more details and examples.

Installation

Install on the command line with

pip install cxroots

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cxroots-1.0.6.tar.gz (23.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page