Examples of level curves: Difference between revisions
From Applied Science
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| style="padding: 1em;" | <math>f(x,y) = x^2 + y^2</math> [[ | | style="padding: 1em; text-align: center;" | <math>f(x,y) = x^2 + y^2</math> <br /><br />[[file:levelcurve_circle.png|200px]] || Make the function equal to a constant <math>f(x,y) = 1</math>. Then <math>1 = x^2 + y^2</math>. If you know the equation of a circle it should be obvious that this is the equation of a circle with radius = 1. Choose <math>x = 0</math> and you get <math>y = \pm \sqrt{1}</math>. Repeat for <math>y = 0</math> and you get <math>x = \pm \sqrt{1}</math>. This should give four points on the XY plane. How do we know that the points are connected with a circle and not a square diamond? Because the equation is not linear, it has squares on it. The circles being symmetric in both axes explain why the function is symmetric in both axes. Multiply one variable by a constant and we effectively deform the circles, making them ellipsis. | ||
The other way to picture the level curve is by isolating either <math>x</math> or <math>y</math> to get a function of one variable, such as <math>y = \pm \sqrt{1 - x^2}</math> which translates to <math>f(x) = \sqrt{1 - x^2}</math> or <math>f(x) = -\sqrt{1 - x^2}</math>. | The other way to picture the level curve is by isolating either <math>x</math> or <math>y</math> to get a function of one variable, such as <math>y = \pm \sqrt{1 - x^2}</math> which translates to <math>f(x) = \sqrt{1 - x^2}</math> or <math>f(x) = -\sqrt{1 - x^2}</math>. | ||
Line 7: | Line 7: | ||
There is a little mistake that can happen regarding the circle's radius. Pay attention to the square. I plotted the levels 4 and 9 because the radius is squared. So for the level 4, <math>x = 2^2</math>. The level 2 would had been <math>x = \sqrt{2}^2</math> which is hard to get the right distance without having a scale to measure. | There is a little mistake that can happen regarding the circle's radius. Pay attention to the square. I plotted the levels 4 and 9 because the radius is squared. So for the level 4, <math>x = 2^2</math>. The level 2 would had been <math>x = \sqrt{2}^2</math> which is hard to get the right distance without having a scale to measure. | ||
For <math>e^{-x^2 - y^2}</math> and <math>\sin( | For <math>e^{-x^2 - y^2}</math> and <math>\sin(x^2 + y^2)</math> the level curves are circles too. Except that the levels have different meanings. For the exp, we have the levels <math>e^0, \ e^1, \ e^2, \ ...</math>. For the sine, it's the angle <math>\theta_1, \ \theta_2, \ \theta_3, \ ...</math> | ||
|- | |- | ||
| style="padding: 1em;" | <math>f(x,y) = \sin(x + y)</math> [[file:levelcurve_lines.png]] || The first confusion to avoid is that <math>\sin(x)</math> is not a linear function, but <math>x + y</math> is linear. The level curves are going to be straight lines, not waves. For each <math>\theta</math> there are infinitely many pairs <math>(x,y)</math> that add up to that angle. For example: <math>\pi/4 = 0 + \pi/4</math> or <math>\pi/4 = \pi/4 + 0</math>. Repeat for other angles to plot more level curves. | | style="padding: 1em; text-align: center;" | <math>f(x,y) = \sin(x + y)</math> <br /><br />[[file:levelcurve_lines.png|200px]] || The first confusion to avoid is that <math>\sin(x)</math> is not a linear function, but <math>x + y</math> is linear. The level curves are going to be straight lines, not waves. For each <math>\theta</math> there are infinitely many pairs <math>(x,y)</math> that add up to that angle. For example: <math>\pi/4 = 0 + \pi/4</math> or <math>\pi/4 = \pi/4 + 0</math>. Repeat for other angles to plot more level curves. | ||
The second mistake is that the function is non-linear, which means that the distance between level curves cannot be a constant. If we take increments at a constant rate, such as <math>\pi/2</math> we do see evenly spaced level curves. However, in between <math>0</math> and <math>\pi/2</math> we have the angles <math>\pi/4</math> and <math>\pi/6</math> and the distance between them is no longer constant. | The second mistake is that the function is non-linear, which means that the distance between level curves cannot be a constant. If we take increments at a constant rate, such as <math>\pi/2</math> we do see evenly spaced level curves. However, in between <math>0</math> and <math>\pi/2</math> we have the angles <math>\pi/4</math> and <math>\pi/6</math> and the distance between them is no longer constant. | ||
|- | |- | ||
| style="padding: 1em;" | <math>f(x,y) = x/y</math> [[file:levelcurve_lines2.png]] || Again, the function is non-linear, yet the level curves are straight lines. <math>c = x/y \iff y = x/c</math>, that's the equation of a line where <math>c</math> changes the slope of it. The function is undefined for <math>(x, 0)</math> (all points over the <math>x</math> axis) or <math>(0,0)</math>. It's a bit hard to picture it, but try to imagine twisting a sheet of paper. One side is twisted clockwise. The opposite side is twisted anti-clockwise. For each level the curves are "rotating" with a maximum angle of < 360°. Going above that would make the function intersect itself. | | style="padding: 1em; text-align: center;" | <math>f(x,y) = x/y</math> <br /><br />[[file:levelcurve_lines2.png|200px]] || Again, the function is non-linear, yet the level curves are straight lines. <math>c = x/y \iff y = x/c</math>, that's the equation of a line where <math>c</math> changes the slope of it. The function is undefined for <math>(x, 0)</math> (all points over the <math>x</math> axis) or <math>(0,0)</math>. It's a bit hard to picture it, but try to imagine twisting a sheet of paper. One side is twisted clockwise. The opposite side is twisted anti-clockwise. For each level the curves are "rotating" with a maximum angle of < 360°. Going above that would make the function intersect itself. | ||
For <math>c = 1</math>, we have <math>x = y</math> | For <math>c = 1</math>, we have <math>x = y</math> | ||
Line 22: | Line 22: | ||
'''Note:''' if you plot this graph on google or wolfram, you'll notice that there is a gap in the function when viewed from above and some parabolas at certain angles. It's an illusion. If <math>c \ \to \ \pm \infty</math> the slope of a level curve goes to zero. The curvature that you see is caused by the fact that the relationship <math>x/y</math> is not constant. | '''Note:''' if you plot this graph on google or wolfram, you'll notice that there is a gap in the function when viewed from above and some parabolas at certain angles. It's an illusion. If <math>c \ \to \ \pm \infty</math> the slope of a level curve goes to zero. The curvature that you see is caused by the fact that the relationship <math>x/y</math> is not constant. | ||
|- | |- | ||
| style="padding: 1em;" | <math>f(x,y) = x^2 - y^2</math> [[file:levelcurve_hyperbola.png]] || By inverting the sign of one of the parabolas, what was a paraboloid is now a hyperbolic paraboloid. If you know the equation of hyperbolas it's going to be quick to notice that the level curves are hyperbolas. When <math>f(x,y) = 0 \ ?</math> When <math>x^2 = y^2</math>, which is the same as <math>x = y</math>. We have two level curves with this reasoning, both the diagonals of the XY plane. Along the diagonals the function is null. | | style="padding: 1em; text-align: center;" | <math>f(x,y) = x^2 - y^2</math> <br /><br />[[file:levelcurve_hyperbola.png|200px]] || By inverting the sign of one of the parabolas, what was a paraboloid is now a hyperbolic paraboloid. If you know the equation of hyperbolas it's going to be quick to notice that the level curves are hyperbolas. When <math>f(x,y) = 0 \ ?</math> When <math>x^2 = y^2</math>, which is the same as <math>x = y</math>. We have two level curves with this reasoning, both the diagonals of the XY plane. Along the diagonals the function is null. | ||
<math>1 = 0^2 + y^2</math>. With this we have that when <math>x = 0</math>, <math>y = \pm 1</math>. This shows us that the hyperbola is not going to cross the origin. | <math>1 = 0^2 + y^2</math>. With this we have that when <math>x = 0</math>, <math>y = \pm 1</math>. This shows us that the hyperbola is not going to cross the origin. | ||
Line 30: | Line 30: | ||
<math>c + x^2 = y^2 \iff y = \pm \sqrt{c + x^2}</math>. This resembles the equation of a a function that plots half a circle, except that the minus sign is now a plus sign. It's easy to notice that the change on the sign makes each point go farther and farther away from the origin rather than keeping a constant distant from it. | <math>c + x^2 = y^2 \iff y = \pm \sqrt{c + x^2}</math>. This resembles the equation of a a function that plots half a circle, except that the minus sign is now a plus sign. It's easy to notice that the change on the sign makes each point go farther and farther away from the origin rather than keeping a constant distant from it. | ||
|- | |- | ||
| style="padding: 1em;" | <math>f(x,y) = \sin(|x| + |y|)</math> [[file:levelcurve_diamond.png]] || Just by glancing at it and we can already assume that the level curves are straight lines. However, there is the absolute value now. For positive coordinates the level curve is exactly the same as <math>\sin(x + y)</math>. What happens when one or both are negative? <math>\theta = |x| + |y|</math>. Remember, we are not plotting functions. We are asking "What pairs <math>(x,y)</math> satisfy that angle?". | | style="padding: 1em; text-align: center;" | <math>f(x,y) = \sin(|x| + |y|)</math> <br /><br />[[file:levelcurve_diamond.png|200px]] || Just by glancing at it and we can already assume that the level curves are straight lines. However, there is the absolute value now. For positive coordinates the level curve is exactly the same as <math>\sin(x + y)</math>. What happens when one or both are negative? <math>\theta = |x| + |y|</math>. Remember, we are not plotting functions. We are asking "What pairs <math>(x,y)</math> satisfy that angle?". | ||
Suppose the constant is <math>\pi</math>. Which pairs do we have that add up to that angle? <math>(\pi, 0)</math> and <math>(0, \pi)</math> we already know from the previous example. With the modulus we have two more: <math>(-\pi, 0)</math> and <math>(0, -\pi)</math>. From <math>\sin(x + y)</math> we already know that the level curves are straight lines. With this we can trace level curves that resemble square diamonds. | Suppose the constant is <math>\pi</math>. Which pairs do we have that add up to that angle? <math>(\pi, 0)</math> and <math>(0, \pi)</math> we already know from the previous example. With the modulus we have two more: <math>(-\pi, 0)</math> and <math>(0, -\pi)</math>. From <math>\sin(x + y)</math> we already know that the level curves are straight lines. With this we can trace level curves that resemble square diamonds. | ||
Line 36: | Line 36: | ||
The graph of this function propagates, symmetrically, in all directions. The shape of the graph is different from <math>\sin(x^2 + y^2)</math> but notice how the modulus and calculating the square have the same effect of negating negative values for the function. Both functions always stay above zero. | The graph of this function propagates, symmetrically, in all directions. The shape of the graph is different from <math>\sin(x^2 + y^2)</math> but notice how the modulus and calculating the square have the same effect of negating negative values for the function. Both functions always stay above zero. | ||
|- | |- | ||
| <math>f(x,y) = xy</math> [[file:levelcurve_xy.png]] || Doing <math>c = xy</math> leads us to a quick conclusion. To keep the level curve at a constant level, <math>x</math> and <math>y</math> must be one the inverse of the other. This reminds us of the single variable function <math>f(x) = 1/x</math>. Careful with the proportion of the curves! Don't trace perfectly round curves nor curves that are perfectly parallel to each other. | | style="padding: 1em; text-align: center;" | <math>f(x,y) = xy</math> <br /><br />[[file:levelcurve_xy.png|200px]] || Doing <math>c = xy</math> leads us to a quick conclusion. To keep the level curve at a constant level, <math>x</math> and <math>y</math> must be one the inverse of the other. This reminds us of the single variable function <math>f(x) = 1/x</math>. Careful with the proportion of the curves! Don't trace perfectly round curves nor curves that are perfectly parallel to each other. | ||
For <math>c = 2</math> we have the pairs <math>(1,2)</math> and <math>(2,1)</math> (as well as infinitely many others). But there are two more <math>(-1,-2)</math> and <math>(-2,-1)</math>. For <math>c = -2</math> there are also four possible pairs that satisfy it. Which means that this function has symmetric level curves in all directions. The function also intersects both axis, because when <math>x = 0</math> and/or <math>y = 0</math>, the function is null. | For <math>c = 2</math> we have the pairs <math>(1,2)</math> and <math>(2,1)</math> (as well as infinitely many others). But there are two more <math>(-1,-2)</math> and <math>(-2,-1)</math>. For <math>c = -2</math> there are also four possible pairs that satisfy it. Which means that this function has symmetric level curves in all directions. The function also intersects both axis, because when <math>x = 0</math> and/or <math>y = 0</math>, the function is null. | ||
Line 42: | Line 42: | ||
Pay attention to the signs! The function is going up at the 1st and 3rd quadrants and going down at the 2nd and 4th quadrants. | Pay attention to the signs! The function is going up at the 1st and 3rd quadrants and going down at the 2nd and 4th quadrants. | ||
|- | |- | ||
| style="padding: 1em;" | <math>f(x,y) = \frac{x}{x^2 \ + \ y^2}</math> [[file:levelcurve_butterfly.png]] || The denominator being <math>x^2 + y^2</math> does make us think on circles. However, the numerator is not a constant, which makes the analysis more complicated. The easiest level curve is when <math>x = 0</math> because then the function is zero too. | | style="padding: 1em; text-align: center;" | <math>f(x,y) = \frac{x}{x^2 \ + \ y^2}</math> <br /><br />[[file:levelcurve_butterfly.png|200px]] || The denominator being <math>x^2 + y^2</math> does make us think on circles. However, the numerator is not a constant, which makes the analysis more complicated. The easiest level curve is when <math>x = 0</math> because then the function is zero too. | ||
For <math>f(x,y) = c</math>, we have <math>\frac{x}{x^2 + y^2} = c</math>. | For <math>f(x,y) = c</math>, we have <math>\frac{x}{x^2 + y^2} = c</math>. |