# How to have a 3d plot of a complex polynomial?

I'm trying to have a 3d plot for a complex polynomial using the ContourPlot3D It shows me a plot which does not vary when the input values of different variables are varied. So, I guess it is just a dummy plot I'm getting. Kindly guide me as how to get a correct 3d plot. I'm using Mathematica version 9.

omegaJ = (0.41*10^-5)^-1;
lambdaJ = 1.724*10^15;
n0 = 10^12;
zion = 1.602*10^-19;
e = 1.602*10^-19;

t0 = 10^6;
melec = 9.1094*10^-31;
Subscript[ν, i] = 1.00*10^1;
Subscript[ν, id] = 5.00*10^-3;
Subscript[ν, ed] = 1.00*10^2;
rdust = 37.5*10^-6;

telec = 2.6*10^4;
tion = .26*10^4;
temp = telec;

mion = 2*10^-14;
mnd = 4.0*10^-16;

grav = 6.67*10^-11;
veff = 10;
nion = 2*10^5;
η = 0.01;
cs = Sqrt[telec/mion]*(4*π*n0*mion*grav)^-0.5;

Subscript[n, e0] = 5*10^3;
Subscript[n, i0] = 10^3;
Subscript[ϕ, g] = -2.51*temp/e;
Subscript[q, d0] = rdust*Subscript[ϕ, g];

Subscript[I, e0] =
Abs[-π*rdust^2*e*Sqrt[((8*telec)/(π*melec))]*Subscript[n, e0] * Exp[(e*Subscript[q, d0])/(rdust*telec)]];
Subscript[I, i0] = Abs[π*rdust^2*e*Sqrt[((8*tion)/(π*mion))]*Subscript[n, i0]*
Exp[1 - (e*Subscript[q, d0])/(rdust*tion)]];
Subscript[ν, ndch] = 10^4*e;

SuperStar[c] = (-Subscript[ν, ed] + Subscript[ν, i] - 2*n0*veff)/omegaJ;

SuperStar[d] = ((3*η*omegaJ)/(
melec*n0*lambdaJ*ξ^2)) + ((η*omegaJ*k^2)/(
melec*n0*lambdaJ));

SuperStar[q] = (4*π*e^2*n0*lambdaJ^2)/telec ;
a4 = telec/(mion*cs^2);
r1 = zion*(2*veff*n0 - Subscript[ν, i]);
r2 = - telec*(1/(melec*lambdaJ) + (Subscript[q, d0]*omegaJ)/(e*mnd));

r4 = a4*zion*omegaJ;
r5 = a4*Subscript[I, i0]*omegaJ;

p1 = SuperStar[c]*SuperStar[d]*SuperStar[
q]*(e*r4*Subscript[ν, ndch] + r5) ;

p3 = (e*r1*Subscript[ν, ndch] +
Subscript[I, e0]*Subscript[ν, id] + r1*Subscript[I, i0]) * SuperStar[q]*r2 ;
p4 = SuperStar[c]*SuperStar[d]*Subscript[ν, ndch]*Subscript[ν, id]*e;

q1 = (SuperStar[d]*Subscript[ν, ndch]*e*r4 -
SuperStar[c]*cs*omegaJ*Subscript[ν, ndch]*e*r4 -
omegaJ*SuperStar[c]*SuperStar[d]*e*r4 + SuperStar[d]*r5 -
SuperStar[c]*cs*omegaJ*r5)*SuperStar[q] ;

q3 = (e*r1 + Subscript[I, e0])*omegaJ*r2*SuperStar[q];
q4 = (SuperStar[d]*Subscript[ν, ndch]*Subscript[ν, id] -
SuperStar[c]*cs*omegaJ*Subscript[ν, ndch]*Subscript[ν,
id] - SuperStar[c]*SuperStar[d]*omegaJ*Subscript[ν, id] -
SuperStar[c]*SuperStar[d]*omegaJ*Subscript[ν, ndch])*e;

(* Roots *)

y = (p1 + (p4 - p3)*(1/ξ - I k))/(q1 + (q3 + q4)*(1/ξ - I k));
x == 0;

(* Plot *)
ContourPlot3D[y, {y, 0, 10}, {ξ, 0.01, 10}, {k, 1, 100},
PlotLegends -> {"y", "ξ", "k"}, AxesLabel -> {"y", "ξ", "k"},
PlotLegends -> Automatic, Mesh -> None,
ContourStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]]]

η = 0.03;

y - (p1 + (p4 - p3)*(1/ξ - I k))/(q1 + (q3 + q4)*(1/ξ - I k)) == 0;
ContourPlot3D[y, {y, 0, 10}, {ξ, 0.01, 10}, {k, 1, 100},
PlotLegends -> {"y", "ξ", "k"}, AxesLabel -> {"y", "ξ", "k"},
PlotLegends -> Automatic, Mesh -> None,
ContourStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]]]

η = 0.05;

y = (p1 + (p4 - p3)*(1/ξ - I k))/(q1 + (q3 + q4)*(1/ξ - I k));
ContourPlot3D[y, {y, 0, 10}, {ξ, 0.01, 10}, {k, 1, 100},
PlotLegends -> {"y", "ξ", "k"}, AxesLabel -> {"y", "ξ", "k"},
PlotLegends -> Automatic, Mesh -> None,
ContourStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]]]

mnd = 5.0*10^-16;

y = (p1 + (p4 - p3)*(1/ξ - I k))/(q1 + (q3 + q4)*(1/ξ - I k));
ContourPlot3D[y, {y, 0, 10}, {ξ, 0.01, 10}, {k, 1, 100},
PlotLegends -> {"y", "ξ", "k"}, AxesLabel -> {"y", "ξ", "k"},
PlotLegends -> Automatic, Mesh -> None,
ContourStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]]]


I want to have a 3d plot for the equation as below with the value of y,xi and k along the three axes.

I've done the changes as advised by the experts in the forum.

Kindly let me know if Contourplot3d can be used for plotting complex plots or not.

enter code here


y = (p1 + (p4 - p3)(1/ξ - I k))/(q1 + (q3 + q4)(1/ξ - I k));

enter code here

• You write ContourPlot3D[y, {y, 0, 10}, {ξ, 0.01, 10}, {k, 1, 100}, ...], but $y$ has no value assigned to it, so you are pretty much plotting the equivalent of Plot[y, {y, 0, 10}]. What are you trying to do here? Your code looks weird in places. For instance, you have some equations set up right before the ContourPlot, but those are not assigned to anything so they do not do anything for your calculations. You need to explain what you are trying to do. Otherwise this is a very long code dump, and it would take a lot of time and patience for somebody to understand it enough to fix it. Commented Jun 3, 2020 at 5:54
• Crossposted here. Commented Jun 3, 2020 at 14:58
• Actually, y does have a value assigned to it, namely, the expression involving the ps and qs, so it does not make sense to me then to use y as one of the variables in any kind of plot. Moreover, y is complex-valued. Commented Jun 3, 2020 at 15:50
• Sample some values of Re[y] and Im[y] to try to see what is happening. For example, the output from Table[Re[y], {\[Xi], 0.1, 10, 0.5}, {k, 10, 100, 5}] // TableForm seems to show that Re[y] is essentially constant! So does Plot3D[Re[y], {\[Xi], 0.1, 10}, {k, 10, 100}]. Look at Plot3D[Im[y], {\[Xi], 0.1, 10}, {k, 10, 100}, PlotRange -> All]. Commented Jun 3, 2020 at 16:10
• @RahulChakraborty: As I said, Re[y] seems to be essentially constant over the domain of values you specify for k and \[xi]. But im[y] does not: I see quite a "bumpy" output from Plot3D[Im[y], {\[Xi], 0.1, 10}, {k, 10, 100}, PlotRange -> All]. That is using what is posted in your original question here. Commented Jun 3, 2020 at 19:18