1
$\begingroup$

I have the following code:

f[x_, y_, p_] = (
  p (E^( π/y) x + 2 x Cosh[(2 π x)/y] - 
     2 Sinh[(2 π x)/y]))/(y (E^(π/y) + 2 Cosh[(2 π x)/y]));

y1 = 1/11;

t1 = I*y1;

p1 = 1;

xf = NArgMax[{Abs[f[x, y1, p1]], 0 <= x <= 1/2}, x];

inv = WeierstrassInvariants[{1, t1}];

f1[x_, t_] := WeierstrassP[2 x + t, inv]

pt[val_] := (72*
    Abs[f1[(x /. FindRoot[f[x, y1, p1] == val, {x, 0}]), t1] - 
      f1[(x /. FindRoot[f[x, y1, p1] == val, {x, 0.5}]), 
       t1]])/(p1*(Pi^3))

Plot[pt[x], {x, 0, Abs[f[xf, y1, p1]]}]

when run, I get the error message about "1/0 encountered." It also says that "Half-periods {ComplexInfinity,0.+0.09090909090909093 I} are not independent." It also mentions the error "EllipticReducedHalfPeriods::nind" which I believe means the two complex numbers aren't independent, but they clearly are. I mean, indeed, t1 is approaching zero, but I need to look at t1 with very small imaginary part. When you change y1 to 1/10, everything is okay so perhaps 1/11 and below is just too small? How can I alter the code to look at such small y1 values?

In addition, the half-periods should be 1 and t1, I don't know why mathematica is claiming they are ComplexInfinity and t1.

$\endgroup$
3
  • $\begingroup$ Use the documentation. Learn about WorkingPrecision, PrecisionGoal, AccuracyGoal, etc. READ the Possible Issues sections for ALL of the functionality you're using. Plots fine, no half-period errors, etc., when these are taken into account. $\endgroup$ – ciao Aug 11 '15 at 1:25
  • 1
    $\begingroup$ I'm voting to close this question as off-topic because it is too localized; i.e, it applies only to the local situation and needs of its poster and answers will not benefit others. $\endgroup$ – m_goldberg Aug 11 '15 at 23:14
  • $\begingroup$ I strongly disagree. Why was this question closed?! I encountered the same problem, if this one would be given chance to get an answer I would not have to open another question about it. There is no documentation on EllipticReducedHalfPeriods, maybe somebody could provide some information. If this is a duplicate in any sense, links should be provided. If not, more detail about precision issues when plotting should be provided in an answer. Cannot vote to reopen yet. $\endgroup$ – მამუკა ჯიბლაძე Nov 16 '15 at 8:05