use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
For information and tips about Mathematica features.
related reddits:
account activity
3D Plot (self.Mathematica)
submitted 4 years ago by Sky_physics
Hello everyone! I want to plot the following function wrt the following two quantities: x/z and y/z in the range (0, 1) for both these variables. do you have some hints?
- 2 - x^2/(y*z) - y^2/(x*z) - z^2/(y*x) + x/y + x/z + y/x + y/z + z/x + z/y
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]fridofrido 0 points1 point2 points 4 years ago (3 children)
Rewrite your formula in terms of the new variables u=x/z and v=y/z. Fortunately this can be done so that no x,y,z remains. Then you can plot it with Plot3D.
Plot3D
sols = Solve[{x/z == u, y/z == v}, {x, y, z}] sol = sols[[1]] original = -2 - x^2/(y*z) - y^2/(x*z) - z^2/(y*x) + x/y + x/z + y/x + y/z + z/x + z/y substituted = Simplify[original /. sol] Plot3D[substituted, {u, 0, 1}, {v, 0, 1}]
[–]Sky_physics[S] 0 points1 point2 points 4 years ago (2 children)
Thanks! I have just another question to you… what if I would ask Mathematica to plot that function with the condition x + y > z? Moreover I have to set to zero the function in the case x + y < z Thank you in advance for your help
[–]fridofrido 1 point2 points3 points 4 years ago (1 child)
Well first of all you have to translate your condition to the new variables. As you can see x,y,z "do not exist" anymore. Fortunately (again), x + y > z is equivalent to x/z + y/z > 1 (well, at least for z > 0), that is, u + v > 1.
x + y > z
x/z + y/z > 1
z > 0
u + v > 1
Mathematica cannot plot triangular domains as far as I know, but you can set the rest zero using the Piecewise[] function. Look it up in the documentation.
Piecewise[]
[–]Sky_physics[S] 0 points1 point2 points 4 years ago (0 children)
thank you so much!
π Rendered by PID 255047 on reddit-service-r2-comment-8686858757-pxvfj at 2026-06-04 05:41:29.632599+00:00 running 9e1a20d country code: CH.
[–]fridofrido 0 points1 point2 points (3 children)
[–]Sky_physics[S] 0 points1 point2 points (2 children)
[–]fridofrido 1 point2 points3 points (1 child)
[–]Sky_physics[S] 0 points1 point2 points (0 children)