I have a quadratic equation with complex coefficients. The coefficients depend on two real variables r and w. This quadratic equation has two complex roots, which also depend on two variables r and w. I try to plot the dependence of the absolute value of the root on the variables r and w.
Suddenly I noticed that the surface quality depends on whether I am using expression simplification. Moreover, the more simplifications, the worse the quality.
Below, the quadratic roots are simplified in three different ways and three pairs of surfaces correspond to these three ways. Surface quality decreases, build time increases.
My problem is that my project deals with thousands of similar equations and the project code is over 4000 lines. I have used Simplify in many places without fear, and the result is thought-provoking.
Can anyone comment please?
eq=6*q^2*Exp[-3/2*I*w] + q(2r-3)(3(r-3)r(Exp[1/2*I*w]-Exp[-1/2*I*w])+(r-2)(r-1)(Exp[-3/2*I*w]-Exp[3/2*I*w]))-6Exp[3/2*I*w];
sq1=q/.Solve[eq==0,q];
sq2=q/.Solve[Simplify[eq]==0,q];
sq3=Simplify[sq1];
SetOptions[Plot3D,PlotPoints->60,PlotRange->{0,2}];
Timing[g1=GraphicsRow[{Plot3D[Abs[sq1[[1]]],{r,0,1},{w,-Pi,Pi}],Plot3D[Abs[sq1[[2]]],{r,0,1},{w,-Pi,Pi}]},ImageSize->Large]] [[1]]
Timing[g2=GraphicsRow[{Plot3D[Abs[sq2[[1]]],{r,0,1},{w,-Pi,Pi}],Plot3D[Abs[sq2[[2]]],{r,0,1},{w,-Pi,Pi}]},ImageSize->Large]] [[1]]
Timing[g3=GraphicsRow[{Plot3D[Abs[sq3[[1]]],{r,0,1},{w,-Pi,Pi}],Plot3D[Abs[sq3[[2]]],{r,0,1},{w,-Pi,Pi}]},ImageSize->Large]] [[1]]
g1
g2
g3
Below are the results: