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?

    This one I have no idea. Any idea how its plot can be generated?
     
  2. jcsd
  3. Nov 2, 2008 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    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]);
    Zm=1./sqrt(X.^2+Y.^2);
    surf(X,Y,-Zm);
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: What function plots this?
  1. What's this function? (Replies: 8)

Loading...