3
$\begingroup$

I have function like this

Plot3D[1.11956 Sqrt[(Sqrt[\[Psi]] (1 + 2 \[Psi])^(3/2))/(dy^4 (1 + \[Psi]))], 
{\[Psi],0,10},{dy,0,10}, AxesLabel -> {"\[Psi]", "dy", "dx"}]

I have a region plot given by

k2 = RegionPlot[1 < dx/dy < 8, {dx, 0, 10}, {dy, 0, 10}]

Now I want the region defined by this equality inside the Plot3D

Thank in Advance

$\endgroup$
2
$\begingroup$

Try this:

Show[{
  Plot3D[1.11956 Sqrt[(Sqrt[\[Psi]] (1 + 2 \[Psi])^(3/
           2))/(dy^4 (1 + \[Psi]))], {\[Psi], 0, 10}, {dy, 0, 10}, 
   AxesLabel -> {"\[Psi]", "dy", "dx"}, PlotRange -> {0, 10}],
  RegionPlot3D[
   1 < dx/dy < 8, {\[Psi], 0.1, 10}, {dy, 0.1, 10}, {dx, 0.1, 10}, 
   PlotStyle -> Opacity[0.7]]
  }]

with the following effect

enter image description here

Have fun!

$\endgroup$
3
$\begingroup$
plt1 = Plot3D[1.11956 Sqrt[(Sqrt[ψ] (1 + 2 ψ)^(3/2))/(dy^4 (1 + ψ))], 
   {ψ, 0, 10}, {dy, 0, 10}, 
  AxesLabel -> {"ψ", "dy", "dx"}, 
  RegionFunction -> (Not[1 < #3/#2 <= 8] &), PlotRange -> {0, 10}, Mesh -> None]; 
plt2 =  Plot3D[1.11956 Sqrt[(Sqrt[ψ] (1 + 2 ψ)^(3/2))/(dy^4 (1 + ψ))], 
   {ψ, 0, 10}, {dy, 0, 10}, 
  RegionFunction -> (1 < #3/#2 <= 8 &), PlotStyle -> Red, Mesh -> None];
Show[plt1, plt2]

enter image description here

$\endgroup$
1
$\begingroup$
ContourPlot3D[
 dx == 1.11956 Sqrt[(Sqrt[ψ] (1 + 2 ψ)^(3/2))/(dy^4 (1 + ψ))],
 {ψ, 0, 10}, {dy, 0, 10}, {dx, 0, 10},
 MeshFunctions -> Function[{ψ, dy, dx}, dx/dy], Mesh -> {{1, 8}},
  MeshShading -> {Yellow, Red}, AxesLabel -> Automatic]

enter image description here

The setting Mesh -> {{1, 8}} divides the range into three pieces, below 1, between 1 and 8, and above 8. The setting MeshShading -> {Yellow, Red} is a list of colors, applied cyclically, to the three regions (hence Yellow, Red, Yellow):

Mathematica graphics

The same idea can be applied to Plot3D, but ContourPlot3D does a better job of meshing the steep part of the graph:

Plot3D[1.11956 Sqrt[(Sqrt[ψ] (1 + 2 ψ)^(3/2))/(dy^4 (1 + ψ))],
 {ψ, 0, 10}, {dy, 0, 10},
 MeshFunctions -> Function[{ψ, dy, dx}, dx/dy], Mesh -> {{1, 8}},
 MeshShading -> {Yellow, Red}, AxesLabel -> {"ψ", "dy", "dx"}, 
 PlotRange -> {0, 10}]
$\endgroup$

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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