Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What function plots this?

  1. Nov 2, 2008 #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 [Broken] one I have no idea. Any idea how its plot can be generated?
    Last edited by a moderator: May 3, 2017
  2. jcsd
  3. Nov 2, 2008 #2


    User Avatar
    Science Advisor

    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
  4. Nov 2, 2008 #3
    try this:

    [X,Y] = meshgrid([-5:0.2:5]);
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook