How Can I Plot This Contoured Function?

In summary, the conversation discusses the function used to plot and how to plot the function, specifically keeping the contour/level lines the same. The suggested approach is to use cylindrical coordinates and the function 1/r, rotated around the z-axis. Other possible functions are mentioned, such as 1/r^2 and 1/r^3. A specific code example is also provided for generating the desired plot in Cartesian coordinates.
  • #1
rsq_a
107
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:
Mathematics news on Phys.org
  • #2
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
 
  • #3
try this:

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

FAQ: How Can I Plot This Contoured Function?

What function plots this?

The function that plots this is known as a mathematical function, which defines a relationship between two variables. It takes an input value and produces an output value based on a specific rule or set of rules.

What are some examples of functions?

Some common examples of functions include linear functions, quadratic functions, exponential functions, trigonometric functions, and logarithmic functions. Each of these functions has a unique rule that determines the relationship between the input and output values.

How do you graph a function?

To graph a function, you will need to plot a series of points on a coordinate plane. The x-coordinate of each point represents the input value, while the y-coordinate represents the output value. Once you have plotted several points, you can then connect them to create a visual representation of the function.

What is the purpose of graphing a function?

The purpose of graphing a function is to visually represent the relationship between the input and output values. It can help to identify patterns, determine the behavior of the function, and make predictions about the function's behavior for different input values.

Can all functions be graphed?

Not all functions can be graphed, as some functions may have infinite inputs or outputs, making it impossible to plot them on a finite coordinate plane. Additionally, some functions may not have a clear relationship between the input and output values, making it difficult to graph them accurately.

Similar threads

Replies
1
Views
1K
Replies
3
Views
890
Replies
7
Views
1K
Replies
1
Views
1K
Replies
1
Views
1K
Replies
5
Views
2K
Replies
1
Views
2K
Back
Top