Drawing Level Curves: Solving K=0 Problem

In summary, the function f(x,y) = (y-2x)^2 degenerates into one branch (line) when k=0 in Maple, but WolframAlpha does not have this issue.
  • #1
Yankel
395
0
Hello all,

I have a question relating the drawing of levels curves.

The function is:

\[f(x,y)=(y-2x)^{2}\]

Fairly simple if I may add.

In order to draw the levels curves, I did:

\[(y-2x)^{2}=k\]

which resulted in:

\[y=2x\pm \sqrt{k}\]

So far so good. So for k=1, I get two straight lines, one intersecting the y-axis at -1 and one at 1. Same for every other value of k. However, when I put k=0, I get y=2x.

Drawing the levels curves in both MAPLE and Wolfram Alpha, resulted in plots in which there is no line going through the origin. My question is why ? What am I missing about k=0 ?

Thank you !

View attachment 7945
 

Attachments

  • lc.PNG
    lc.PNG
    14 KB · Views: 100
Physics news on Phys.org
  • #2
I think the issue is that for $k = 0$ the two solution branches of $f(x,y) := (y - 2x)^2 = k$ degenerate into one branch (line). In Maple, you can try something like
Code:
f := (x,y) -> (y - 2*x)^2:
eps := 0.05:
plots:-contourplot(f, -3..3, -3..3, contours = [eps, 1, 3]);
As you decrease the value of "eps", you will see the corresponding branches not only approach each other, but also their plots become worse and worse. (This can be partially compensated for by increasing the number of grid points using the "grid" option of the plotting command.) In the left figure we have eps = 0.05 and in the right figure we have eps = 0.025.

Note that if $(x_0,y_0)$ is a point on the contour corresponding to $k = 0$, then indeed $y_0 = 2x_0$ and both partial derivatives $D_xf(x_0,y_0)$ and $D_yf(x_0,y_0)$ vanish, so the implicit function theorem fails badly.
 

Attachments

  • contours.png
    contours.png
    9.5 KB · Views: 95
  • contours.png
    contours.png
    9.6 KB · Views: 101
Last edited:
  • #3
Here's some comments on drawing graphs of "implicit" functions. I don't know how WolframAlpha draws such, but probably it's similar to what I have done. To draw such a graph f(x,y) = 0, partition the rectangle of interest in the x-y plane into a bunch of "small" rectangles. In each small rectangle, look for a point $(x_0,y_0)$ satisfying the equation. Here, the equation of the tangent plane to z = f(x,y) at $(x_0,y_0)$ is very useful. Of course this tangent plane "normally" is found with the aid of the 2 first partial derivatives of f. However, if these two partials are 0, something else must be done to look for a solution in the rectangle. Such a "bad" point on the graph is called a singular point. This makes the drawing algorithm work much "harder" (slower). In any event, after a bunch of points are found in the small rectangles, conceptually one has a bunch of dots. Just connect the dots.

Here's a sequence of drawings that might be instructive. Each drawing is the graph of
$$\sin(\pi\sqrt{x^2+y^2})=c$$
First c=1/2, then c=0.99. These graphs are pairs of concentric circles with the distance between a pair of circles smaller as c gets larger. The last graph is when c=1. Here, every point on the graph is a singular point! Aside, I couldn't get WolframAlpha to draw this graph.

View attachment 7986

Here the "connect the dots" results in a poor drawing.View attachment 7987

Here's the same graph with only the dots plotted.

View attachment 7988

Make the mesh of the partition finer (more rectangles):

View attachment 7989

Finally, the graph of all singular points:

View attachment 7990
 

Attachments

  • MHBcalc7.png
    MHBcalc7.png
    14.9 KB · Views: 80
  • MHBcalc7a.png
    MHBcalc7a.png
    13.4 KB · Views: 81
  • MHBcalc7b.png
    MHBcalc7b.png
    13.4 KB · Views: 87
  • MHBcalc7c.png
    MHBcalc7c.png
    12.6 KB · Views: 83
  • MHBcalc7d.png
    MHBcalc7d.png
    8.1 KB · Views: 76

FAQ: Drawing Level Curves: Solving K=0 Problem

What is the "K=0 problem" in drawing level curves?

The "K=0 problem" refers to the situation where the level curve for a given function, f(x,y), intersects with the line K=0. This means that the function's output, f(x,y), is equal to zero at that point.

Can you explain the concept of level curves in drawing?

Level curves are a way to visually represent the output of a function in terms of its input variables. They are formed by drawing curves that connect points where the function's output is constant, creating a contour map of sorts.

What is the purpose of drawing level curves?

Drawing level curves can help us better understand the behavior of a function in terms of its input variables. By looking at the shape and direction of the level curves, we can gain insights into the rate of change and critical points of the function.

How can we solve the "K=0 problem" in drawing level curves?

To solve the "K=0 problem", we can use algebraic techniques to find the points where the function's output is equal to zero. These points can then be plotted on the level curve, allowing us to see where the level curve intersects with the line K=0.

Are there any other methods for representing functions besides level curves?

Yes, there are other methods for representing functions, such as 3D graphs, contour plots, and vector fields. Each of these methods has its own advantages and can provide different insights into the behavior of a function. It is important to choose the appropriate representation based on the specific function and the information being sought.

Similar threads

Back
Top