Drawing contour plots

Baron

Junior Member
Joined
Oct 3, 2010
Messages
73
How do I draw contour maps for f(x,y) = cos(x^2+y^2)/(1+x^2+y^2) and f(x,y) = sin(x)*sin(y)*e^(-x^2-y^2).

I know to draw contour maps, you set f(x,y) = k, where k is a constant

so k = cos(x^2+y^2)/(1+x^2+y^2). But I have no idea how that graph looks like because I can't isolate x or y.

So how do I draw contour maps? I have a feeling it has something to do with the fact the contour map would be symmetrical because when x and y are interchanged, the function is the same.
 
How do I draw contour maps for f(x,y) = cos(x^2+y^2)/(1+x^2+y^2) and f(x,y) = sin(x)*sin(y)*e^(-x^2-y^2).

I know to draw contour maps, you set f(x,y) = k, where k is a constant

so k = cos(x^2+y^2)/(1+x^2+y^2). But I have no idea how that graph looks like because I can't isolate x or y.

So how do I draw contour maps? I have a feeling it has something to do with the fact the contour map would be symmetrical because when x and y are interchanged, the function is the same.
The first one has the form

\(\displaystyle \displaystyle f(x,y) = F(r) = \dfrac{\cos{r^2}}{1 + r^2} \)

so all of the contours will be circles. If you draw a circle of radius \(\displaystyle r\), the contour level \(\displaystyle k\) will be \(\displaystyle F(r)\).

For the second one, \(\displaystyle f(x,y) = g(x) \times g(y)\). What is that symmetry like? Because of the sine functions, the function is 0 whenever either \(\displaystyle x= n \pi\) or \(\displaystyle y= m \pi\). The contour for \(\displaystyle k=0\) is a square grid of lines.
 
The first one has the form

\(\displaystyle \displaystyle f(x,y) = F(r) = \dfrac{\cos{r^2}}{1 + r^2} \)

so all of the contours will be circles. If you draw a circle of radius \(\displaystyle r\), the contour level \(\displaystyle k\) will be \(\displaystyle F(r)\).

For the second one, \(\displaystyle f(x,y) = g(x) \times g(y)\). What is that symmetry like? Because of the sine functions, the function is 0 whenever either \(\displaystyle x= n \pi\) or \(\displaystyle y= m \pi\). The contour for \(\displaystyle k=0\) is a square grid of lines.

I understand the reasoning behind the first example but the second example still confuses me. I understand that the contour for k = 0 is a square grid of lines but how would you find contours for other k values and the general shape of the contours? I'm pretty sure the contours only look like square grids when k = 0.

\(\displaystyle f(x,y) = g(x) \times g(y)\) is true only for k = 0 but for other k values, you can't ignore the e^(-x^2-y^2) part of the expression.
 
I understand the reasoning behind the first example but the second example still confuses me. I understand that the contour for k = 0 is a square grid of lines but how would you find contours for other k values and the general shape of the contours? I'm pretty sure the contours only look like square grids when k = 0.

\(\displaystyle f(x,y) = g(x) \times g(y)\) is true only for k = 0 but for other k values, you can't ignore the e^(-x^2-y^2) part of the expression.

\(\displaystyle \displaystyle f(x,y) = \sin{x}\ \sin{y}\ x^{-x^2-y^2}\)

\(\displaystyle f(x,y) = g(x) \times g(y)\) is always true, with \(\displaystyle \displaystyle g(x) = \sin{x}\ e^{-x^2}\).

You should sketch \(\displaystyle g(x)\). Where does it have relative max and min? Consider especially the first square, with \(\displaystyle 0<x<\pi,\; 0<y<\pi\). What happens on the diagonal, \(\displaystyle y=x\)? What happens on the anti-diagonal, \(\displaystyle y=\pi-x\)?

Alternate squares in the xy-grid are positive and negative, Near the center of each square is a max (or min); as you go farther from the origin, the amplitude decreases because of the \(\displaystyle e^{-x^2}\) factor.
 
Top