I try to plot the following, but something seems to be wrong in my code and I can't figure out how to fix it:
RegionPlot3D[{CountRoots[\[Sigma]q33[\[Omega], V1, V2,
V3], {\[Omega], 0, Infinity} == 0],
CountRoots[\[Sigma]q33[\[Omega], V1, V2,
V3], {\[Omega], 0, Infinity} == 1],
CountRoots[\[Sigma]q33[\[Omega], V1, V2,
V3], {\[Omega], 0, Infinity} == 2],
CountRoots[\[Sigma]q33[\[Omega], V1, V2,
V3], {\[Omega], 0, Infinity} == 3 ],
CountRoots[\[Sigma]q33[\[Omega], V1, V2,
V3], {\[Omega], 0, Infinity} == 4]}, {V1, 0, 50}, {V2, 0,
50}, {V3, 0, 100}, {GrayLevel[i, 0.5], {i, 0, 0.8, 0.2}},
Mesh -> None, LabelStyle -> (FontSize -> 14)]
The number of roots in omega of the function \[Sigma]q33 depends on the other Variables V1, V2 and V3. I would like to visualize that. The regions where CountRoots gives different values should be in different gray levels, all with an opacity of 0.5. I think the problem I have is that I do not know how to use GrayLevel to define different shades of gray for the different areas.
And do you have an idea how to define the CountRoots-functions all in one, maybe with Map or something like that? Here is the \[Sigma]q33, in case it is necessary to answer the question:
\[Sigma]q33[\[Omega]_, V1_, V2_,V3_] = (1/48 ( Exp[-V1] + Exp[-V2]) (1 + Exp[-V3]) + 1/48 (Exp[-(V2 - V1)/2] - Exp[(V2 - V1)/2])/(Exp[(V2 - V1)/2] +
Exp[-(V2 - V1)/2]) (( Exp[-V1] - Exp[-V2] Exp[-V3]) - (
Exp[-V2] - Exp[-V1] Exp[-V3])) +
1/8 (( Exp[-V1] - Exp[-V2] Exp[-V3]) + (
Exp[-V2] - Exp[-V1] Exp[-V3])) (-2 (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3]) (-Exp[-(V1 + V2)/2 - V3] +
Exp[-(V2 + V1)/2])/(Exp[(V2 - V1)/2] +
Exp[-(V2 - V1)/2])/(\[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3]) ^2)) +
1/2 (( Exp[-V1] - Exp[-V2] Exp[-V3]) - (
Exp[-V2] - Exp[-V1] Exp[-V3])) (-(
Exp[-V1] + Exp[-V2] Exp[-V3] - Exp[-V2] -
Exp[-V1] Exp[-V3]) (-Exp[-(V1 + V2)/2 - V3] +
Exp[-(V2 + V1)/2])/(Exp[(V2 - V1)/2] +
Exp[-(V2 - V1)/2]) (2 \[Omega]^2 - (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2)/((\[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2) (4 \[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2))) + ((
Exp[-V1] - Exp[-V2] Exp[-V3]) + (
Exp[-V2] - Exp[-V1] Exp[-V3])) ((
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3]) (-Exp[-(V1 + V2)/2 - V3] +
Exp[-(V2 + V1)/2])/(Exp[(V2 - V1)/2] +
Exp[-(V2 - V1)/2]) ((
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2 -
5 \[Omega]^2)/(6 (9 \[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3]) ^2) (\[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2)) + (
Exp[-V1] + Exp[-V2] Exp[-V3] - Exp[-V2] -
Exp[-V1] Exp[-V3]) ^2 ((
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3]) (-Exp[-(V1 + V2)/2 - V3] +
Exp[-(V2 + V1)/2])/(Exp[(V2 - V1)/2] +
Exp[-(V2 - V1)/2]) (11 \[Omega]^2 - (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2)/(2 (\[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2) (4 \[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2) (9 \[Omega]^2 + (
Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2)))))





RegionPlot3Ddocumentation examples, and try to build up from there. (You really don't need a complicated example, and once you switch to a simpler example, it'll probably be clearer what's going wrong.) – Brett Champion Sep 17 '12 at 20:56Show. (Or do something withColorFunctionandColorFunctionScaling, but I'd probably go withShow.) – Brett Champion Sep 17 '12 at 21:06RegionPlot3Daccept multiple boolean functions as the first argument? (2) how do you useGrayLevelfor coloring a region plot? I think the answer to the first question is no:RegionPlot3Dexpects a single function as the first argument (you get error when you use a list of boolean functions). (Btw,RegionPlotdoes accept a list of boolean function). As an alternative, you can use separate region plots and combine them usingShoworOverlay. For the second question, check usage examples ofColorFunction. – kguler Sep 17 '12 at 21:20