invert complete elliptic integral of first kind K(k)

Hi,

I am not a mathematician although I use it in hydrodynamics research. I have a question regarding elliptic integrals for my research in wave theory

Given the value of the complete elliptic integral of the first kind K(k) is there a closed form way to find the elliptic modulus k. If not is there a fast numerical algorithm to evaluate it?

$K(k) = \int_0^{\pi/2} \frac{d\theta}{\sqrt{1-k^2 \sin^2\theta}}$

Thanks

-
The notation may not be familiar to most people. I know what you are talking about, but I'd have to look up the precise definition. It would be helpful if you defined the integrals in the question. Have you tried looking up the j-function? – Felipe Voloch Dec 6 '10 at 19:21
From your comments Kurup, I am not entirely sure whether you want the inverse nome or the inverse of the complete elliptic integral of the first kind. For the second one, I haven't seen any closed form for the inverse of the complete elliptic integral of the first kind, but you can use Newton-Raphson for this, and for a starting point for the Newton-Raphson iteration you can perform Lagrange inversion of the hypergeometric series corresponding to $K$. – J. M. Dec 7 '10 at 2:33
For the inverse nome, as has been said by previous commenters/answerers, there is a convenient theta function representation: functions.wolfram.com/09.52.27.0002.01 . Note that theta function series start converging slowly if $|q|>\frac12$ or so, and you need to use either modular transformations or a sequence transformation algorithm (one doesn't require much thought, while the other might lead to a simplification) to maintain the quick convergence of the theta series. – J. M. Dec 7 '10 at 2:37
Thanks to all folks who commented esp David and JM. It looks like JM's first comment regarding NR iteration for the inverse of the integral is what I am looking for. As I see it going from the nome $q$ to $k$ is easy (from all the comments by David,JM) but how do I get $q$ from just $K$ and not $K′$. Is there a way to get $K′$ from $K$ without knowing $k$? I have to admit that the confusion might be due to my deficiency in math!! Thanks again to all you guys for commenting. It was a very useful discussion for me. – N Kurup Dec 7 '10 at 17:41
Somebody smarter than me might be able to figure something cleverer, but I am unable to see anything simpler than the two-stage method of computing $k$ from $K(k)$ via e.g. Newton-Raphson, and then using a suitably modified AGM iteration to compute $q$ from $k$. – J. M. Dec 7 '10 at 17:57

Edit: Gerald Edgar remarks that I probably read your question the other way around. If this is case, then deducing the $j$ invariant (and hence $k$) from $K$ is even easier: as already alluded to in Felipe Voloch's comment, the $j$ invariant has a simple closed form in terms of theta constants, and theta constants have very fast converging expressions in terms of $q:=e^{2\pi i \tau}$.
Thats Right Gerald, My question is Given $K(k)$ find $k=f(K)$ (the modulus). AGM seems to let me calculate K(k) fast but is there a known reverse algorithm/closed form expression? Thanks NK – N Kurup Dec 6 '10 at 22:05
David, Thanks for all the help...Unfortunately I have another question regarding getting the nome $q$ from $K$. $q$ is defined in terms of $K$ and $K'$ (the imaginary quarter period) and I don't know my value for $K'$ unless I know $k$!! I think i might be missing something here unfortunately my knowledge of elliptic functions is not very good!! Thanks NK – N Kurup Dec 7 '10 at 2:17