I am trying to make a 3D plot of an expression but the the plot has some holes in it. I have asked a similar question before according to which I should adjust my PlotRange
. I did that too. I have taken PlotRange->All
but it didn't work. I also tried Full and Automatic for PlotRange
but that didn't help also. Then I tried taking some values of plot range manually like {-5,5}, {-0.1,0.1}, {-0.2,0.2}
etc. but either they don't fix the problem or alter the plot's shape. Firstly, I was taking PlotPoints->100
for high-quality plots but then I changed its values to see what happens and when I chose PlotPoints->20
, the appearance of holes was reduced but they were still there. I tried some other values of PlotPoints
as well but they didn't disappear. Please tell me how to solve this issue?
\[Gamma] = x + I*y;
z = 1;
\[Theta] = Pi/4;
m = 3;
a = Sum[((1/(j!*l!))*Binomial[m, j]*Binomial[m, l]*Conjugate[z*Sin[\[Theta]]*Tan[\[Theta]]]^j*(-2*\[Gamma] + z*Cos[\[Theta]])^j*(-2*Conjugate[\[Gamma]] + Conjugate[z]*Cos[\[Theta]])^l*
HypergeometricU[-l, 1 + j - l, (-2*\[Gamma] + z*Cos[\[Theta]])*(-2*Conjugate[\[Gamma]] + Conjugate[z]*Cos[\[Theta]])]*(z*Sin[\[Theta]]*Tan[\[Theta]])^l)/
((-2*\[Gamma] + z*Cos[\[Theta]])*(-2*Conjugate[\[Gamma]] + Conjugate[z]*Cos[\[Theta]]))^l, {j, 0, m}, {l, 0, m}]/E^(2*Abs[\[Gamma] - z*Cos[\[Theta]]]^2)/
(Pi*Sum[((1/(k!*l!))*(-1)^k*Binomial[m, k]*Binomial[m, l]*Conjugate[z*Sin[\[Theta]]*Tan[\[Theta]]]^l*((-z)*Cos[\[Theta]])^l*(Conjugate[z]*Cos[\[Theta]])^k*
HypergeometricU[-k, 1 - k + l, (-z)*Conjugate[z]*Cos[\[Theta]]^2]*(z*Sin[\[Theta]]*Tan[\[Theta]])^k)/((-z)*Conjugate[z]*Cos[\[Theta]]^2)^k, {l, 0, m}, {k, 0, m}]);
Plot3D[a, {x, -5, 5}, {y, -5, 5}, PlotRange -> All, PlotPoints -> 20]
Simplify
in the definition ofa
Look atLeafCount /@ {a, a // Simplify}
$\endgroup$LeafCount
was used to reflect the different computation complexity of the expression before and after simplification, (i.e.,{44338, 6732}
). Whether or not simplified, using arbitrary precision rather than machine precision would also resolve your issue:Plot3D[a, {x, -4, 4}, {y, -4, 4}, PlotRange -> All, PlotPoints -> 20, WorkingPrecision->15]
However, it is much more efficient whenSimplify
is included in the definition ofa
$\endgroup$