1

When plotting the Eisenstein Series (great information here Eisenstein Series in Mathematica?) you observe highly non-trivial branch cut behavior close to the real axis. This makes the numerics break down, and you either get "blank spots" or incorrect plots.

Something very similar was dealt with here Derivative of the Dedekind eta function fails to compute with errors I don't understand.

About half-way down that thread, there is a fabulous answer suggesting the use of Rationalize to produce a much cleaner, more accurate plot. I'm trying to apply that same procedure to plot a slightly different (quasi-) modular function.

Simply put, I'm trying to plot Arg[K2] where K2 is defined in my code:

E22[z_] = 
  1 - 24*Sum[(n*Exp[2*Pi*I*(z)*n])/(1 - Exp[2*Pi*I*(z)*n]), {n, 1, 
      300}];
EisensteinE2[4, 
   z_] := (EllipticTheta[2, 0, Exp[I*Pi*(z)]]^8 + 
     EllipticTheta[3, 0, Exp[I*Pi*(z)]]^8 + 
     EllipticTheta[4, 0, Exp[I*Pi*(z)]]^8)/2;
K2[z_] = (((E22[z])^2) - EisensteinE2[4, z])/144;
Block[{f}, 
  f[z_?NumericQ] := 
   Block[{res}, res = Arg[N@Quiet@N[K2[z][Rationalize[z, 0]], 6]]];
  res /; NumericQ[res]];
ContourPlot[f[x + I y], {x, -.5, .5}, {y, 0.1, .5}, Contours -> 50, 
 ImageSize -> Full, AspectRatio -> Automatic]

Unfortunately, this simply produces a blank plot. I think I'm either applying the syntax of the suggested procedure in the answer above incorrectly, or there's something I don't understand about the use of Rationalize in my context. Can anyone see where I'm screwing up here?

Benighted
  • 1,327
  • 1
  • 10
  • 14
  • 1
    Your Block gets thrown away. Do you want ContourPlot[Re@K2[x + I y], {x, -.5, .5}, {y, 0.1, .5}, ImageSize -> Full, AspectRatio -> Automatic], or ContourPlot[Im@K2[x + I y], {x, -.5, .5}, {y, 0.1, .5}, ImageSize -> Full, AspectRatio -> Automatic]? – Karsten7 May 15 '16 at 23:41
  • 1
    Formatting tip: Select your code block and click the {} button in the toolbar (fifth from left, between the quote marks and the image button). –  May 16 '16 at 00:08
  • 1
    That was exactly what I was after, except with Arg replacing Re or Im, thanks!! So I was somehow by-passing the Block? – Benighted May 16 '16 at 00:14

0 Answers0