Domanda

I've written program on Python using pygame library for plotting complex functions phase and modulus graphics.
I'm not programmer and don't have any math background. But now I want to know how I could numerically evaluate Jacobi Elliptic Function value in some point z. I've found definition of the function in Wikipedia Jacobi elliptic function and there was integral but I don't understand how I could use it to evaluate function value in point z of complex plane. I know how to numerically evaluate path integral form some point a to b in complex plane, but there are some theta and phi parameters and I don't understand it.

Could you help me? I don't need Python code (I'll write it myself if I'll understand the principle) but it could be enough if you provide algorithm step by step how to do it.

È stato utile?

Soluzione

You could just use mpmath.

from mpmath import ellipfun

print(ellipfun('cd', 1.0 + 2.0j, 0.5))
(1.90652944795345 + 0.225277477847159j)

Altri suggerimenti

scipyx, my collection of extensions to SciPy, has support for complex-valued arguments in Jacobi elliptic functions.

Install with

pip install scipyx

and use as

import scipyx as spx

u = 1.0 + 2.0j
m = 0.8
# sn, cn, dn, ph = scipy.special.ellipj(x, m)  # not working
sn, cn, dn, ph = spx.ellipj(u, m)

If you're after plotting those, take a look at cplot (also by me):

enter image description here

Having read the article in Wikipedia Jacobi elliptic function and one at http://mysite.du.edu/~jcalvert/math/jacobi.htm I believe this to be an interpretation.

z is a point in the complex plain then z' is its complementary modulus where z'^2 = 1 - z^2

It seems to be the convention that for the Jacobi elliptic function k is used instead of z and that m is used for k^2 and k is such that k^2 is real and 0<k^2<1

the integral is a function u of two parameters k and phi

u(k,phi) = the integral as given

Note then that instead of starting with a z in the complex plane you are starting with a real m 0<k^2<1 and the results relate to the complex solutions of z^2=m

So for a given m you could numerically integrate for a range of values phi (for example 0 to 6π in steps of π/12) giving u

Now for a given m you have a data set plotting for u against phi

The elliptic function sn is the inverse of this ie given u what phi gives this u

So looking in the u data would give the phi results.

Note for a given u there would be more than one phi.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top