2
$\begingroup$

I have this three variable equation $$4 \sinh (2 y) \cosh (z-x)+5 \sin (2 x-y)-6 x+y+3 \cosh (2 z)=0$$ where $$0<x<4\;,\qquad-3<y<0\;,\qquad0<z<2$$

I want to have a continuous plot (by joining the adjacent points) of the solutions of the equation for the two variables $x,y$ in 2D, and the third variable $z$ changes with color ( ColorFunction for example from Blue to Red) with the step $0.01$, something like this

enter image description here

Is it possible to do this?

The equation

 5 Sin[2 x - y] + 3 Cosh[2 z] - 6 x + 4 Sinh[2 y] Cosh[z - x] + y==0

enter image description here

$\endgroup$
4
  • 1
    $\begingroup$ I think you might have some problems with this strategy: for each x, y there are multiple z that solve the equation (even when restricting to the reals), so the question of what color the point at x, y should be arises. To see this consider N@Solve[5 Sin[2 x - y] + 3 Cosh[2 z] - 6 x + 4 Sinh[2 y] Cosh[z - x] + y == 0, z] /. {x -> 2, y -> -2}. However, if you have a way of picking just one z at each point that you want to show, it should be possible (but that method would be noncanonical, and up to you) $\endgroup$
    – thorimur
    May 25 at 22:34
  • $\begingroup$ @thorimur Thanks. I thought we can calculate the points $(x,y,z)$ which solves this equation, then, ask Mathematica to join the adjacent points and give a continuous line. $\endgroup$
    – user80187
    May 25 at 22:42
  • 1
    $\begingroup$ ah, somehow i totally missed the restrictions on $z$! I was wrong that this is an issue; those restrictions turn out to be enough to make your idea work and to make the $z$-value at a given $x,y$ unique. cvgmt's solution works. :) $\endgroup$
    – thorimur
    May 26 at 0:49
  • $\begingroup$ You can edit you original question to clarify your needs. $\endgroup$
    – Michael E2
    May 26 at 13:03
2
$\begingroup$

Maybe use ContourPlot3D and ColorFunction for z.

ContourPlot3D[
 5 Sin[2 x - y] + 3 Cosh[2 z] - 6 x + 4 Sinh[2 y] Cosh[z - x] + y == 
  0, {x, 0, 4}, {y, -3, 0}, {z, 0, 2}, MeshFunctions -> {#3 &}, 
 ColorFunction -> Function[{x, y, z}, Hue[z]], 
 ViewProjection -> "Orthographic", ViewPoint -> Top, 
 Axes -> {True, True, False}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thank you, but I meant to see the change of $z$ (with step $0.01$) in your black curves with different colors., something like manipulating the variable $z$ but with colors. Is it possible? $\endgroup$
    – user80187
    May 26 at 9:12
  • $\begingroup$ @MsMath ColorFunction -> (Blend[{{0, Red}, {1, Blue}}, #3] &) ? $\endgroup$
    – cvgmt
    May 26 at 10:22
  • $\begingroup$ No, something like the second picture I have added to the text. Is it possible to show the change of $z$ like that? $\endgroup$
    – user80187
    May 26 at 11:04
  • $\begingroup$ I mean using ContourPlot3D for the three variables $x,y,z$ where the behaviour of $z$ is shown by changing its colour. $\endgroup$
    – user80187
    May 26 at 11:09