How Can I Plot This Contoured Function?

  • Thread starter Thread starter rsq_a
  • Start date Start date
  • Tags Tags
    Function Plots
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
rsq_a
Messages
103
Reaction score
1
This is both a question about the function used to plot AND how to plot the function (I'm interested in keeping the contour/level lines the same):

This looks like a simple f(x,y) = 1/(xy) function. But how would I get Maple/Matlab to plot the contours as shown?

http://science.nasa.gov/headlines/y2005/images/gpb/vortex1_crop.jpg one I have no idea. Any idea how its plot can be generated?
 
Last edited by a moderator:
Physics news on Phys.org
I don't see any great difference between the two.

First, they are 3 dimensional and, second, they have circular symmetry so it is best to use cylindrical coordinates. The first is not "1/xy" but you are right to think it looks like 1/x, rotated around the z-axis. Use "r", not x. z= -1/r will give a graph like that. Without more specific information about the graph, z= -1/r2, z= -1/r3, etc. all look the same. If you want them in Cartesian coordinates, use [itex]r= \sqrt{x^2+ y^2}[/itex]. Then they are [itex]z= -1/\sqrt{x^2+ y^2}[/itex], [itex]z= -1/(x^2+ y^2)[/itex], [itex]z= -1/(x^2+ y^2)^{3/2}[/itex], etc.l
 
try this:

[X,Y] = meshgrid([-5:0.2:5]);
Zm=1./sqrt(X.^2+Y.^2);
surf(X,Y,-Zm);