Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

complex-zeros-delves-lyness

Compute the zeros of a complex analytic function using the method of Delves and Lyness

Introduction

Given a complex analytic function and its derivative, this module uses the method of Delves and Lyness [1] to compute the zeros. That is, it computes

s_N = \frac{1}{2 \pi i} \oint z^N \frac{f'(z)}{f(z)} dz

numerically using adaptive Simpson's method integration. In the absence of poles, Cauchy's argument principle states s0 is the number of zeros M. Using Newton's Identities, the moments s1 through sM are transformed into a polynomial, the roots of which correspond to the encircled zeros of the function f and which may be computed with a complex polynomial root-finder like the Weierstrass method.

To Do

Currently locates multiple zeros with recursive subdivision, but needs checks for near-zero along the contour and check for poor S0 integration. Optional derivative-based post-processing refinement (i.e. Newton-Raphson) would also be a nice plus.

Installation

Can be installed from github, but not currently published.

Example

The single zero of the function cos(z) + sin(z) inside the unit circle is z0 = -π / 4:

var zeros = require('complex-zeros-delves-lyness');

function f (out, a, b) {
  out[0] = Math.cosh(b) * (Math.cos(a) + Math.sin(a));
  out[1] = Math.sinh(b) * (Math.cos(a) - Math.sin(a));
};

function fp (out, a, b) {
  out[0] = Math.cosh(b) * (Math.cos(a) - Math.sin(a));
  out[1] = -Math.sinh(b) * (Math.cos(a) + Math.sin(a));
};

zeros(f, fp, [0, 0], 1);
// => [ [ -0.785398350762156 ], [ 3.289335470668675e-11 ] ]

Since f and f' are used 1-1 and often repeat many identical operations, they may be computed together and returned as the third and fourth entries of the output array:

function f (out, a, b) {
  var chb = Math.cosh(b);
  var shb = Math.sinh(b);
  var ca = Math.cos(a);
  var sa = Math.sin(a);
  out[0] = chb * (ca + sa);
  out[1] = shb * (ca - sa);
  out[2] = chb * (ca - sa);
  out[3] = -shb * (ca + sa);
};

zeros(f, null, [0, 0], 1);
// => [ [ -0.785398350762156 ], [ 3.289335470668675e-11 ] ]

Usage

require('complex-zeros-delves-lyness')(f, fp, z0, r, tol, maxDepth)

Compute the zeros of a complex analytic function.

Arguments:

  • f: function(out: Array, a: Number, b: Number): a function that places the real and imaginary components of f(a + ib) into the first and second elements of the output array.
  • fp: function(out: Array, a: Number, b: Number): a function that places the real and imaginary components of f'(a + ib) into the first and second elements of the output array. If fp is null, argument f may instead place the real and imaginary components of f' into the third and fourth elements of the output of f.
  • z0: Array: an Array specifying the real and imaginary components of the center of the contour around which to integrate. Default is [0, 0].
  • r: Number: the radius of the contour. Default is 1.
  • tol: tolerance used in the integration and polynomial root-finding steps. Default is 1e-8.
  • maxDepth: maximum recursion depth of the adaptive Simpson integration. Default is 20.

Returns: Returns false on failure, otherwise an array containing an Array containing Arrays of the real and imaginary components of the zeros, respectively. That is, 1 + 2i and 3 + 4i would be returned as [[1, 3], [2, 4]].

References

[1] Delves, L. M., & Lyness, J. N. (1967). A numerical method for locating the zeros of an analytic function. Mathematics of Computation.

License

© 2016 Ricky Reusser. MIT License.

About

[WIP] Compute the zeros of a complex analytic function using the method of Delves and Lyness

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.