Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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)))))
share|improve this question
4  
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... –  rm -rf 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
2  
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
1  
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
2  
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. –  kguler Sep 17 '12 at 21:20

2 Answers 2

up vote 4 down vote accepted
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}]]

Mathematica graphics

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

enter image description here

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

enter image description here

@cormullion made a fly-around movie of this (too big for uploading here), but here's a still:

still

share|improve this answer
    
I gave you an upvote, 10U$D for that. :P –  Vladimir Putin 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! –  belisarius Sep 20 '12 at 12:58
    
It looks like a frozen sea, can you see the big piece of ice floating? –  Vladimir Putin Sep 20 '12 at 16:18
    
@GustavoBandeira en.wikipedia.org/wiki/Hallucination –  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]
share|improve this answer
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.