I have this function and I want to see where it is zero. $$\frac{1}{16} \left(\sinh (\pi x) \left(64 \left(x^2-4\right) \cosh \left(\frac{2 \pi x}{3}\right) \cos (y)+\left(x^2+4\right)^2+256 x \sinh \left(\frac{2 \pi x}{3}\right) \sin (y)\right)+\left(x^2-12\right)^2 \sinh \left(\frac{7 \pi x}{3}\right)-2 \left(x^2+4\right)^2 \sinh \left(\frac{5 \pi x}{3}\right)\right)+2 \left(x^2-4\right) \sinh \left(\frac{\pi x}{3}\right)$$ I use ContourPlot

f[x_, y_] := 
  2 (-4 + x^2) Sinh[(π x)/3] + 
   1/16 (((4 + x^2)^2 + 64 (-4 + x^2) Cos[y] Cosh[(2 π x)/3] + 
         256 x Sin[y] Sinh[(2 π x)/3]) Sinh[π x] - 
      2 (4 + x^2)^2 Sinh[(5 π x)/3] + (-12 + x^2)^2 Sinh[(
        7 π x)/3]);

 f[x, y] == 0, {x, 3.465728, 3.465729}, {y, 1.046786, 1.046795}, 
 PlotPoints -> 500]

and I obtain this plot

Now, my question is that can I trust this plot and conclude that the curves do not cross?

Or, I should increase the precision of the plot? And if so, how can I ask Mathematica to give higher precision for the axis in ContourPlot?


Not a complete answer but one direction to go in:

cp = ContourPlot[f[x, y] == 0, {x, 3.465728, 3.465729}, {y, 1.046786, 1.046795}, PlotPoints -> 500]

{l1, l2} = Cases[Normal[cp], _Line, Infinity];
{{x1, y1}} = MinimalBy[First@l1, RegionDistance[l2]];
{{x2, y2}} = MinimalBy[First@l2, RegionDistance[l1]];
 ListPlot[{{x1, y1}, {x2, y2},}, 
  PlotStyle -> {PointSize[Large], Red}]


sol1 = r /. FindRoot[f[r, y], {r, x1}];
sol2 = r /. FindRoot[f[r, y], {r, x2}];
sol1 - sol2


At least FindRoot also finds that there are two distinct solutions at that y. However, FindRoot also warns about its ability to find roots with the desired accuracy, so it is still not conclusive. Also, perhaps it should be looking for the root by also adjusting y.

The idea here is that we can extract values from the plot and then try to verify our conclusions about the plot using other functions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy