Plotting Contours for a Non-Linear Function with the Lambert-W Function

  • Thread starter mmh37
  • Start date
In summary, the conversation discusses how to plot the contour diagram for the function z = (x^2 - y^2) * e^ {-x^2 - y^2} and how to find the intersection between the two functions y = ln(x^2 - y^2) and y = x² + y². The conversation suggests looking at x² as X and y² as Y to simplify the problem, and using the Lambert-W function to solve for y.
  • #1
mmh37
59
0
I shall plot the contour diagram of

[tex] z = (x^2 - y^2) * e^ {-x^2 - y^2} [/tex]

for z = O this is easy, however, if z = 1 one gets

[tex] ln (x^2-y^2) = x^2 + y^2 [/tex]

Does anyone know how to draw this?

I tried to find the intersection between two functions y1 and y2 being the lhs and rhs of the above equation respectively; but since I don't know how to draw y = ln (x^2 - y^2) either I have no clue how this is supposed to work.
 
Physics news on Phys.org
  • #2
Maybe start by looking at x² as X, and y² as Y, so you're just looking at ln(X-Y) = X+Y. Also, you do not want to see where y = ln(x² - y²) and y = x² + y² intersect. For example, if you wanted to plot the diagram for

cos(y) = sin(y)

you wouldn't want to see where:

y = sin(y), and y = cos(y)

intersected. y = cos(y) will just be the horizontal line y = 0.74 (approximately), and y = sin(y) will just be the horizontal line y = 0, so their intersection will be empty. On the other hand, sin(y) = cos(y) will have a solution consisting of infinitely many horizontal lines, a distance of [itex]\pi[/itex] apart from one another.

So you really just have to solve ln(X-Y) = X+Y.
 
  • #3
thanks for this. I do understand your argument. however, I do not understand how I could draw ln(X-Y) = X+Y either, since solving for x and y looks impossible.


AKG said:
Maybe start by looking at x² as X, and y² as Y, so you're just looking at ln(X-Y) = X+Y. Also, you do not want to see where y = ln(x² - y²) and y = x² + y² intersect. For example, if you wanted to plot the diagram for

cos(y) = sin(y)

you wouldn't want to see where:

y = sin(y), and y = cos(y)

intersected. y = cos(y) will just be the horizontal line y = 0.74 (approximately), and y = sin(y) will just be the horizontal line y = 0, so their intersection will be empty. On the other hand, sin(y) = cos(y) will have a solution consisting of infinitely many horizontal lines, a distance of [itex]\pi[/itex] apart from one another.

So you really just have to solve .
 
  • #4
I believe you're approaching it wrong. Do not take the log but rather solve for y in the equation:

[tex]a=(x^2-y^2)e^{-(x^2+y^2)}[/tex]

Yea, it could happen via the Lambert W function. How about I start it for you:

Switch it around to:

[tex](x^2-y^2)=ae^{(x^2-y^2)}[/tex]

Now here comes the tricky part: What do I have to multiply both sides by so that the LHS is:

[tex]fe^{f}[/tex]

(where f is some algebraic expression)

That's the form to extract the Lambert-W function. Then solve for y . . . equal rights and all that stuf.:smile:
 
Last edited:

FAQ: Plotting Contours for a Non-Linear Function with the Lambert-W Function

How are contours created?

Contours are created by connecting points of equal elevation on a map. This creates lines that represent the shape and slope of the land.

What is the purpose of using contours?

Contours are used to visualize the terrain and topography of a geographical area. They can also be used to determine the elevation and steepness of a slope, which is important for activities such as hiking and construction.

How accurate are contour lines?

The accuracy of contour lines depends on the scale of the map they are drawn on. Generally, the smaller the scale of the map, the less accurate the contour lines will be. However, with modern technology and advanced mapping techniques, contour lines can now be created with high levels of accuracy.

Can contours change over time?

Yes, contours can change over time due to natural processes such as erosion and deposition, as well as human activities such as construction and land development. It is important to regularly update maps and contour lines to reflect these changes.

How can I use contours to navigate?

Contours can be used for navigation by identifying the direction and steepness of slopes, as well as locating features such as ridges and valleys. By understanding the contour lines, you can determine the best route to take and avoid any potentially hazardous areas.

Similar threads

Replies
10
Views
1K
Replies
3
Views
1K
Replies
8
Views
1K
Replies
17
Views
2K
Replies
2
Views
1K
Replies
3
Views
1K
Back
Top