I programmed the invariant $$ g_2 = 60\sum_{(m,n)\neq{0,0}} \left(m+ni \right)^{-4} $$ (periods $\omega_1=1,\omega_1=i$, https://en.wikipedia.org/wiki/Weierstrass%27s_elliptic_functions)
by (java codes)
public static double[] g2() {
double[] sum = { 0, 0 };
int iteration =100; //the result in not sensitive to the number of iterations
for (int i = 0; i < iteration; i++) {
for (int j = 0; j < iteration; j++) {
if (0 == i && 0 == j)
continue;
double[] grid = {i, j }; // grid m,n
double[] s4 = M.square(M.square(grid));
sum = M.add(sum, M.inverse(s4));
}
}
return M.scale(sum, 60);
}
The program reports $g2=(112.207,0)$ while the correct value is 189.072 (Ferguson p4). Wiki also tells $g_2=2(e_1^2+e_2^2)$, so I am convinced that $g_2=4e_1^2=189.072$ as Hoffman(p113) and other resources say $e_1=6.875$.
I cannot understand this difference since the formula is quite simple and I have no bugs in this very short program.
Reference:
H.Ferguson,A.Gray,S. Markvorsen, Costa's minimal surface via Mathematica, 1995.
D.A. Hoffman,W. Meeks III, A complete embedded minimal surface in $ \bf {R}^3$ with genus one and three ends, 1985
The complete program:
public class TestConstants3 { // D.A. Hoffman, 1985 static final int iteration = 100; public static void main(String[] args) { double[] g2 = g2(); System.out.println("g2: "+g2[0]); }
public static double[] g2() {
double[] sum = { 0, 0 };
for (int i = 0; i < iteration; i++) {
for (int j = 0; j < iteration; j++) {
if (0 == i && 0 == j)
continue;
double[] grid = { i, j }; // grid m,n
double[] s4 = square(square(grid));
sum = add(sum, inverse(s4));
}
}
return scale(sum, 60);
}
public static double[] add(double[] a, double[] b) {
double[] re = new double[a.length];
for (int i = 0; i < a.length; i++)
re[i] = a[i] + b[i];
return re;
}
public static double[] square(double[] c) {
double x = c[0];
double y = c[1];
return new double[] { x * x - y * y, 2 * x * y };
}
public static double[] inverse(double[] c) {
double x = c[0];
double y = c[1];
double d = x * x + y * y;
return new double[] { x / d, -y / d };
}
public static double[] scale(double[] a, double s) {
double[] re = new double[a.length];
for (int i = 0; i < a.length; i++)
re[i] = a[i] * s;
return re;
}
}