1
$\begingroup$

I'm trying to approximate the contour lines of the velocity function $f(x,y)=\cos x\cos y$ by using the second order Maclaurin polynomial of $f$, which I've calculated to be $g(x,y)=1-\frac{x^{2}}{2}-\frac{y^{2}}{2}$. If $f(x,y)=C$ where $C$ is a constant, then

$$C\approx 1-\frac{x^{2}}{2}-\frac{y^{2}}{2}\\ \frac{x^{2}}{2}-\frac{y^{2}}{2}\approx 1-C\\ x^{2}+y^{2}\approx 2(1-C)$$

Obviously $-1\le \cos x\le 1$ and $-1\le \cos y\le 1$. Since we've defined $C=\cos x\cos y$, then $-1\le C \le 1$ and thus $0\le 1-C\le 2$ and $0\le 2(C-1)\le 4$. So $f(x,y)$ can be approximated by circles centered at the origin and with radii lying between $0$ and $2$. However, when I plot the contour lines for $f(x,y)$, the radii seem to lie between $0$ and $\sqrt{2}$. Can someone please help me understand why this is? I assume I have made a mistake, but I can't see where.

  • 0
    If you use the MacLaurin polynomial, you are assuming that $(x,y)$ is near $(0,0).$ (and C is near 1). The farther away you move from the origin the less accurate your estimate.2017-02-24
  • 0
    one more thought, the square $x = \pm \frac {\pi}{2}, y = \pm \frac {\pi}{2}$ is a contour of $f(x,y) = 0$2017-02-24
  • 0
    @DougM Ahh, I hadn't thought of that. That makes sense. Thanks so much!2017-02-24

1 Answers 1

0

I started working out a few level curves from well-known angles and proceeding from there.

$f(x,y) =$ cos$(x)$cos($y)$

$f(x,y) = 0$ iff cos$(x) = 0$ or cos$(y) = 0$.

Using the notation $k_i$ for any integer constants below

$\rightarrow x = (2k_1 + 1) \pi/2 \ \ $ OR $ \ \ y = (2k_2 + 1) \pi/2$

(1) The level curves for $f(x,y) = 0$ therefore form a grid of lines at each odd multiple of $\pi/2$, horizontally and vertically. The other level curves above and below zero values must fit inside this square grid (contour lines can never cross).

(2) The level "curves" for $f(x,y) = 1$ are maximal points where either $\\$ (a) cos$(x) = 1$ and cos$(y) = 1$ OR (b) cos$(x) = -1$ and cos$(y) = -1$

So $(x,y) = (2k_3 \pi, 2k_4 \pi) $ OR $(x.y)= (2k_5 + 1) \pi. (2k_6+1) \pi$

These points form a "checkerboard" pattern across the whole xy plane, one in the center of every second grid square.

(3) The level "curves" for $f(x,y) = -1$ are minimal points where either $\\$ (a) cos$(x) = 1$ and cos$(y) = -1$ OR (b) cos$(x) = -1$ and cos$(y) = 1$

So $(x.y) = (2k_7 \pi, (2k_8 + 1) \pi) $ OR $(x,y) = ((2k_9 + 1) \pi, 2k_{10} \pi ) $ These points also form a "checkerboard" pattern across the whole xy plane, one in the center of every second grid square, alternating with the maximal points noted above.


I still haven't mastered graphics on here. If someone could illustrate these curves (please!) the picture is amusing.


All the other level curves fit between these max/min points and the grid lines. The cosine function is well known to be smooth and to have derivatives of every degree.

Therefore as $f(x,y)$ approaches a max or a min the contour lines must surround that point and form a symmetric smooth curve, so around those points the level curves must be very close to circles, $(x-k_{11} \pi)^2 + (y - k_{12} \pi)^2 = \epsilon^2$

On the other hand, as the contour lines approach the grid of zero level lines, they must smoothly approach this grid; but they must also be symmetric smooth closed curves by the geometry of the function.

A good approximation to such a level curve on a one-unit grid would be $x^{10} + y^{10} = .99^{10}$. The higher the exponent, the more "square" the curve. We can adapt this to the trig grid.


(4) For the level curves $f(x,y) = 1/2$, we can have cos$x$ = cos$y$ = $1/ \sqrt 2$ or cos $x = 1/2$ and cos $y = 1$ or vice versa. (And similarly for $f(x,y) = -1/2)$. In our central grid square around the origin, this gives points $( \pm \pi/3, 0), (0, \pm \pi/3), (\pm \pi/4, \pm \pi/4)$

Note these points appear to outline a symmetric closed curve as expected, and it could be described as a slightly squared-off circle (on the axes the "radius" is $pi/3 \approx 1.0472$ while on the $y=x$ line the "radius" is $\sqrt{2} * \pi/4 \approx 1.1107$, a $5.7 \% $ increase.)

We can see that from the center of the square to halfway at $ x \approx\pm \pi/4$ the change in the contour line or level curve is quite small, still very close to a circle, but from $\pi/4$ to $\pi/2$ the distortion is more rapid, changing to a square. A function that can give us this pattern of behaviour is tan$x$.

Let a = 2 + j*tan$(x)$ where j is a constant to be determined experimentally. (If we make it match at $x = pi/4$ we should get pretty close. If not, we could try tan$^2 x$ or higher powers.)

Then equations for the contour lines / level curves of $f(x,y) = \cos x \cos y$ will be $(x - c_1)^a + (x-c_2)^a = r^a$ where (c_1, c_2) is the max/min point at the center of the grid square, $c_1 = k_{13} \pi,c_2 = k_{14} \pi$, and $r $ takes on values from $0$ to $\pi/2$ for level curves of value $f(x,y) = \cos r$

  • 0
    Wow, that is a detailed explanation. Thanks so much!2017-02-25