0
$\begingroup$

I have three functions, but I can't get roots for these equations. In RegionPlot, what should I do to plot a vertical line through one of the points? I can't get roots because there are implicit functions for more time, so I want to plot a vertical line through one of the roots, but I don't know how to write code to represent it.

f[x_, y_, z_] = x + y + z
g[x_, y_, z_] = x y z
h[x_, y_, z_] = x^7 + y^6 + z^5
Solve[{f[x, y, z] == g[x, y, z] == h[x, y, z]}, {x, y, z}]
    Manipulate[
 RegionPlot[
  f[x, y, z] > g[x, y, z] && f[x, y, z] > h[x, y, z], {x, 0, 5}, {y, 
   0, 5}], {z, -5, 5}]

enter image description here

$\endgroup$
3
  • $\begingroup$ Why can't you get the roots for the intersections here? Mathematica returns an answer just fine. $\endgroup$
    – march
    Nov 18, 2022 at 17:44
  • $\begingroup$ this is an example, I can't get roots because there are implicit functions for more time, so I want to plot a vertical line through one of the roots, but I don't know how to write code to represent it. $\endgroup$ Nov 19, 2022 at 0:00
  • $\begingroup$ You only have two independent equations. Did you mean to have three, e.g. {f,g,h}==0? $\endgroup$ Nov 19, 2022 at 17:35

1 Answer 1

0
$\begingroup$

We can solve f[x,y,z]-g[x,y,z]==0 && f[x,y,z]-h[x,y,z]==0 instead of f[x,y,z]==g[x,y,z]==h[x,y,z]

Clear[f, g, h];
f[x_, y_, z_] = x + y + z;
g[x_, y_, z_] = x y z;
h[x_, y_, z_] = x^7 + y^6 + z^5;
(*SolveValues[{f[x,y,z]-g[x,y,z]==0,f[x,y,z]-h[x,y,z]==0},{x,y},Reals]*)
Manipulate[
 Module[{pt}, 
  pt = NSolveValues[{f[x, y, z] - g[x, y, z] == 0, 
     f[x, y, z] - h[x, y, z] == 0}, {x, y}, Reals];
  RegionPlot[
   f[x, y, z] > g[x, y, z] && f[x, y, z] > h[x, y, z], {x, 0, 5}, {y, 
    0, 5}, Epilog -> {Green, Point[pt], Red, 
     InfiniteLine[pt[[-1]], {0, 1}]}, 
   PerformanceGoal -> "Quality"]], {z, -5, 5}]

enter image description here

$\endgroup$
1
  • $\begingroup$ I tested it out and it's pretty good. Thank you very much! $\endgroup$ Nov 19, 2022 at 3:15

Your Answer

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

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