2
$\begingroup$

I am using the StreamPlot3D function from Wolfram Mathematica for the following system

  1. $x'=\left(-x^2-1\right) (3 x+y)+3 x z$
  2. $y'= 3 y z-x y (3 x+y)$
  3. $z'= z (6 (z-1)-2 x (3 x+y)),$

with the following restriction $-x^2+2y^2+z=1.$

I am using the RegionFunction option of StreamPlot3D to plot on the inside of the restriction, that is $-x^2+2y^2+z\leq 1$ or RegionFunction -> Function[{x, y, z}, -x^2 + 2 y^2 + z <= 1]

![Example Plot

Is there a way to plot the lines on the surface of the restriction i.e. the hyperbolic paraboloid?

I don't see any way to do it in the documentation or in the help for the StreamPlot3D function. I tried defining the region function to ==1 but it does not work. The closest thing i have seen is this link: Mapping StreamPlot onto spherical surfaces

But they go from a 2D system to a 3D projection on a sphere, I do have a 2D version of this system solving the restriction for z and I have 2D plots for this but I cannot define the quadric surface properly to make it work like in that example. As requested here is the code I am using

Show[StreamPlot3D[{(-1 - x^2) (3 x + y) + 3 x z, -x y (3 x + y) +3 y z, (-2 x (3 x + y) + 6 (-1 + z)) z}, {x, -1, 1}, {y, -1, 1}, {z, 0, 2}, Axes -> True, AxesLabel -> {x, y, z}, LabelStyle -> Directive[Bold, 15], AxesStyle -> Directive[ 16], StreamPoints -> 20, StreamMarkers -> "Arrow", StreamScale -> {Full, 20, 0.1}, StreamColorFunction -> None, StreamStyle -> Orange, RegionFunction -> Function[{x, y, z}, - x^2 + 2 y^2 + z <= 1], ImageSize -> 300, PlotLabel -> "example"], ParametricPlot3D[{x, 0, 1 + x^2}, {x, -1, 1}, RegionFunction -> Function[{x, y, z}, (- x^2 + 1 - x^2 <= 1)], PlotStyle -> {Black, Thick, Dashed}], ParametricPlot3D[{x, -3 x, 0}, {x, -1, 1}, RegionFunction -> Function[{x, y, z}, (- x^2 + 2 (y)^2 + z <= 1)], PlotStyle -> {Black, Thick, Dashed}], ViewPoint -> {-2, 2, 1}]

Thanks in advance for the help.

$\endgroup$
2
  • 1
    $\begingroup$ Please post the Mathematica code. $\endgroup$
    – cvgmt
    Commented Nov 4, 2022 at 5:15
  • $\begingroup$ I added the code in the question $\endgroup$
    – Alfdav
    Commented Nov 4, 2022 at 5:33

1 Answer 1

-1
$\begingroup$

For anyone with the same issue, I used SliceVectorPlot3D to obtain this.

Show[SliceVectorPlot3D[{(-1 - x^2) (3 x + y) + 3 x z, -x y (3 x + y)+3 y z, (-2 x (3 x + y) + 6 (-1 + z)) z}, {-x^2 + 2 y^2 + z == 1}, {x, -1, 1}, {y, -1, 1}, {z, 0, 2}, LabelStyle -> Directive[Bold, 15], AxesStyle -> Directive[ 16], VectorAspectRatio -> 0.25, VectorColorFunction -> None, VectorStyle -> Orange, AxesLabel -> Automatic, VectorMarkers -> "Arrow3D", VectorPoints -> 6, VectorSizes -> {2, 0.8}, ImageSize -> 300, PerformanceGoal -> "Quality", PlotStyle -> Opacity[0.5], PlotLabel -> "example"], ParametricPlot3D[{Sqrt[-1 + 2 y^2], y, 0}, {y, -1, 1}, RegionFunction -> Function[{x, y, z}, (- x^2 + 2 (y)^2 + z <= 1)], PlotStyle -> {Black, Thick, Dashed}], ParametricPlot3D[{-Sqrt[-1 + 2 y^2], y, 0}, {y, -1, 1}, RegionFunction -> Function[{x, y, z}, (- x^2 + 2 (y)^2 + z <= 1)], PlotStyle -> {Black, Thick, Dashed}], ParametricPlot3D[{x, 0, 1 + x^2}, {x, -1, 1}, RegionFunction -> Function[{x, y, z}, (- x^2 + 1 - x^2 <= 1)], PlotStyle -> {Black, Thick, Dashed}], ViewPoint -> {-2, 2, 1}]

example

$\endgroup$
3
  • 3
    $\begingroup$ Please post the Mathematica code instead of only a picture. $\endgroup$
    – cvgmt
    Commented Nov 9, 2022 at 0:24
  • 1
    $\begingroup$ I am not the down vote. BTW, this does not solve the original problem sice this is only some vector arrow, not the stream lines. $\endgroup$
    – cvgmt
    Commented Nov 9, 2022 at 3:34
  • $\begingroup$ I'm ok with the vector arrows, the streamlines are not necessary. Even in StreamPlot3D you can choose between vectors or streamlines to represent the flow. $\endgroup$
    – Alfdav
    Commented Nov 10, 2022 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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