# Several functions in one RegionPlot with different grayscale

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[σq33[ω, V1, V2, V3], {ω, 0, Infinity} == 0],
CountRoots[σq33[ω, V1, V2, V3], {ω, 0, Infinity} == 1],
CountRoots[σq33[ω, V1, V2, V3], {ω, 0, Infinity} == 2],
CountRoots[σq33[ω, V1, V2, V3], {ω, 0, Infinity} == 3],
CountRoots[σq33[ω, V1, V2, V3], {ω, 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 σ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 σq33, in case it is necessary to answer the question:

σq33[ω_, 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])/(ω^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 ω^2 - (Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2)/((ω^2 + (Exp[-V1] + Exp[-V2] Exp[-V3] +
Exp[-V2] + Exp[-V1] Exp[-V3])^2) (4 ω^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 ω^2)/(6 (9 ω^2 + (Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2) (ω^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 ω^2 - (Exp[-V1] + Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2)/(2 (ω^2 + (Exp[-V1] + Exp[-V2] Exp[-V3] +
Exp[-V2] + Exp[-V1] Exp[-V3])^2) (4 ω^2 + (Exp[-V1] +
Exp[-V2] Exp[-V3] + Exp[-V2] +
Exp[-V1] Exp[-V3])^2) (9 ω^2 + (Exp[-V1] + Exp[-V2] Exp[-V3] +
Exp[-V2] + Exp[-V1] Exp[-V3])^2)))))

-
Please rewrite your question to use a minimal example and explain what you're trying to do clearly. Do not just dump your current homework problem... – R. M. Sep 17 '12 at 20:19
@R.M Please excuse my bad english, I have tried to make it clearer now. As for the minimal, I think I really need a rather complicated function to show the problem with the number of roots. I am sorry I do not know where exactly my mistake is. – Apatura Sep 17 '12 at 20:40
Take one of the RegionPlot3D documentation 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:56
Bingo. If you want one graphic with multiple regions, you're going to have to generate them separately and combine them with Show. (Or do something with ColorFunction and ColorFunctionScaling, but I'd probably go with Show.) – Brett Champion Sep 17 '12 at 21:06
There are two questions here:(1) Does RegionPlot3D accept multiple boolean functions as the first argument? (2) how do you use GrayLevel for coloring a region plot? I think the answer to the first question is no: RegionPlot3D expects a single function as the first argument (you get error when you use a list of boolean functions). (Btw, RegionPlot does accept a list of boolean function). As an alternative, you can use separate region plots and combine them using Show or Overlay. For the second question, check usage examples of ColorFunction. – kglr Sep 17 '12 at 21:20

ee[v1_?NumericQ,v2_?NumericQ,v3_?NumericQ]:= CountRoots[σq33[ω,v1,v2,v3],{ω,0,Infinity}];

Show[Table[RegionPlot3D[
ee[v1, v2, v3] == i, {v1, 0, 50}, {v2, 0, 50}, {v3, 0, 100},
Mesh -> None, LabelStyle -> (FontSize -> 14),
PlotStyle -> Directive[GrayLevel[ i/10 + 1/10, 3/10]],
PlotPoints -> 7, BoundaryStyle -> None], {i, 0, 4}]]


If you want a better plot, increment PlotPoints, but it is too CPU intensive for my poor machine.

Edit

here you have a much better image done by @R.M without specifying PlotPoints

Another one, made by @GustavoBandeira with PlotPoints->12

-
I gave you an upvote, 10U\$D for that. :P – Voyska Sep 20 '12 at 8:38
I added the movie still (PlotPoints -> 25) only to give me an excuse to ask "what is this plot showing?". I can't decode the equations - so what is this showing? – cormullion Sep 20 '12 at 12:48
@cormullion Me neither ... just trying to help. Thanks for your edit! – Dr. belisarius Sep 20 '12 at 12:58
It looks like a frozen sea, can you see the big piece of ice floating? – Voyska Sep 20 '12 at 16:18
@GustavoBandeira en.wikipedia.org/wiki/Hallucination – Dr. belisarius Sep 20 '12 at 16:21

I can't get this code to run here. Try this hyperbolic tetrahedron in cage form :

RegionPlot3D[ (x - 1)^2 + (y - 1)^2 + (z - 1)^2 >= 1 && x^2 - y^2 + z^2 >= 0 &&
x^2 + y^2 - z^2 >= 0 && -x^2 + y^2 + z^2 >= 0,
{x, 0, 1}, {y, 0, 1}, {z, 0, 1},
Axes -> False, Boxed -> False, PlotRange -> All, PlotPoints -> 90,
ColorFunction -> "Pastel", MeshStyle -> {Tube[0.25/16]},
PlotStyle -> {Opacity[0.0]}, ViewPoint -> {0, 0, 5},
ImageSize -> {674, 501}, Mesh -> 10]

-
This looks more like a new question rather than an answer to the question posed by Apatura. Please make your answer clearer -- in particular, explain how it applies to question under consideration. – m_goldberg Nov 26 '12 at 18:37