Some terms left unsimplified

January 6, 2017

I had been slowly going through some OEIS entries in an attempt to add or optimize the Mathematica code found there. One thing that struck me with respect to the sequences that are related to the elliptic integrals/elliptic functions was that they were often left in the form that was spit out by a CAS. I had railed about the deficiencies of current software for generating simple expressions for elliptic integrals many times before, so this was but a confluence with the fact that not many people these days have experience in the analytical manipulation of these functions, as classical and important as they are.

I certainly have my work cut out for me…

A short note on Costa’s minimal surface

May 14, 2012

The other day, I finally managed to simplify Alfred Gray’s parametric equations for Costa’s minimal surface. I might edit this post later, with details on how to manipulate the Weierstrass elliptic functions that show up in the equations, but enjoy these for now:

\displaystyle x=\frac{\pi u}{2}-\Re\left(\frac{\zeta(u+iv;g_2,0)}{2}-\frac{\pi\,\wp(u+iv;g_2,0)}{\wp^\prime(u+iv;g_2,0)}\right) \\ y=\frac{\pi v}{2}+\Im\left(\frac{\zeta(u+iv;g_2,0)}{2}+\frac{\pi\,\wp(u+iv;g_2,0)}{\wp^\prime(u+iv;g_2,0)}\right) \\ z=\sqrt{\frac{\pi}{8}}\log\left|\frac1{\frac12+\frac{\wp(u+iv;g_2,0)}{\sqrt{g_2}}}-1\right|

Here, \wp, \wp^\prime and \zeta are respectively the Weierstrass elliptic function, its derivative, and the Weierstrass zeta function, with invariants g_2=\left(\frac12\mathrm{B}\left(\frac14,\frac14\right)\right)^4=\frac{\Gamma(1/4)^8}{16\pi^2} and 0, and \mathrm{B}(x,y) and \Gamma(x) are the usual beta and gamma functions. The invariants are the ones corresponding to the semi-periods \omega_1=\frac12 and \omega_3=\frac{i}{2}. The parameter ranges are 0 < u < 1 and 0 < v < 1.

I was very delighted at my result, that I decided to make a stylized plot of the surface in Mathematica, using Perlin’s simplex noise for the coloring:

Costa's minimal surface

An experiment in the visualization of elliptic functions

January 27, 2012

An elliptic function is defined as a meromorphic function with two complex periods, such that the ratio of the two periods has nonzero imaginary part. The double periodicity in the complex plane of an elliptic function is usually visualized through surface or contour plots, as in the following example:

equianharmonic Weierstrass elliptic functions, contour plots

The functions being visualized above essentially comprise what is termed as the “equianharmonic case” of the Weierstrass elliptic function, \wp(z;g_2,g_3). The plots are of the real and imaginary parts of the Weierstrass elliptic function and its derivative. It is easily seen from these plots that the functions possess a motif, whose shape can be taken to be a rhombus:

equianharmonic Weierstrass elliptic functions, single tile

One often sees in references like this book by N.I. Akhiezer the description of the topological equivalence of the lattice forming the domain of an elliptic function with the donut-shaped surface called the torus, where the edges of each repeating unit of the elliptic function are suitably identified and sewn together appropriately to form the torus. On a lark, I decided that I wanted to visualize in Mathematica the contour plots of the Weierstrass elliptic function being wrapped on a torus. Since the repeating unit of the equianharmonic case of the Weierstrass elliptic function is a rhombus as opposed to a rectangle like in the case of the Jacobian elliptic functions or the lemniscatic case of the Weierstrass elliptic function, a bit of trickery in Mathematica was necessary. After a fair bit of coding and some amount of time waiting for the pictures to render, I got what I wanted to see (note the correspondence between this and the previous images):

equianharmonic Weierstrass elliptic functions, torus embedding

Here for instance is a bigger version of the toroidal embedding of \Im(\wp^\prime(z)):

torus embedding of the imaginary part of the derivative of the Weierstrass function

For the time being, I have opted not to share the Mathematica code I have used here, since the code is horribly unoptimized. Suffice it to say for now that I was able to make good use of version eight’s new Texture[] feature; I used it to copy a single period rhombus of the Weierstrass function (obtained through ContourPlot[]) to cover the torus appropriately. I suppose the torus visualization technique would be simpler to apply in the case of the Jacobian elliptic functions, as their repeating units are essentially rectangular. A probably stiffer challenge for visualization would be the Dixon elliptic functions, whose repeating units are hexagonal in shape. My initial success in generating these pictures has been quite encouraging; I will definitely be doing a few more experiments on torus embeddings of elliptic functions.

On the elliptic logarithm and the Carlson symmetric elliptic integral

August 16, 2010

Nothing too deep for this blog entry, but since neither DLMF nor Wolfram Functions has this listed, I’ll go ahead and save it here for posterity.

Wolfram MathWorld defines the “elliptic logarithm” as follows (rearranged a bit for clarity):

\mathrm{eln}_{a,b}\left(z\right)=-\frac1{2}\int_{z}^{\infty}\frac{\mathrm{d}y}{\sqrt{y^3+a y^2+b y}}

which resembles the defining expression for the Carlson symmetric elliptic integral of the first kind R_F:


To segue a bit, as noted in the MathWorld entry, it is rather annoying that the corresponding function EllipticLog[] in Mathematica has a superfluous second parameter that merely serves to change the sign of the output in the real case.

However, I note here that the phrase “complicated form involving incomplete elliptic integrals of the first kind with complex parameters” in the MathWorld entry is true only if one sticks to using the Legendre incomplete elliptic integral of the first kind F(\phi|m), as shown in this Wolfram Functions entry. If one uses the Carlson form instead, the expression is only a bit more complicated.

After making the substitution y=t+z in the defining integral for the elliptic logarithm, one simply factors the denominator expression into


where v_1 and v_2 are the roots of the polynomial v^2+av+b.

At this point, you the reader might ask why I chose not to use the quadratic formula directly here. The problem is that naïvely applying the formula


can result in one of the roots being computed inaccurately whenever b is tiny relative to a (computing one of the roots then requires the subtraction of two nearly equal numbers, which is always a bad thing to do in numerical work). The right way to go about it is to choose the sign of the square root such that \Re\left(\bar{a}\sqrt{a^2-4b}\right)\geq 0, after which the two roots are

v_1=-\frac{a+\sqrt{a^2-4b}}{2} and v_2=-\frac{2b}{a+\sqrt{a^2-4b}}

Thus, the elliptic logarithm and the Carlson symmetric elliptic integral have the following relation:


where of course the three arguments of R_F can be permuted as appropriate due to symmetry.

Since there are published algorithms for computing the Carlson integrals, this is how one might compute the elliptic logarithm when one has the Carlson functions available.

The only limitation for this relation is that R_F is only defined when all of its arguments lie in the complex plane cut along the negative real axis; thus, for instance, one cannot use this relation when z is a negative real. One might be able to use the homogeneity relation for R_F, but I still have to investigate the proper way of going about it.