How do you sketch the contour graph of a function with several independent variables?

Suppose you have a function f(x,y) = 2x^4 + 4y^3 + 2.

you set z equal to this function, so z = 2x^4 + 4y^3 + 2.

How do you sketch the contour graph of z?

Asker: Kevin, 19 years old

Answer

Good question, but the answer is not easy.
If you choose a constant level z in such a function, you get what x and y are concerned with a so-called implicit function of one variable, namely something of the form:

f(x,y) = K

a joint requirement on x and y, without being able to separate one unambiguously from the other. You’re basically saying “Mr. X and Mr. Y, do whatever you want, but see that you match”. So, for example, if you give x a value, the number of possible values ​​of y will be limited. Hence the name “… of 1 variable” because you can only choose one variable freely.

How are you going to draw that now? In any case, with a PC.

Most mathematical software does this by brute force: a fine mesh of small rectangles is chosen in the desired xy region, and it is calculated which sides of which rectangle are intersected by the curve. Those intersections are then connected to each other. This works reasonably well unless f(x,y) is a curve that intersects itself. Then the software sometimes has trouble knowing every dot to connect. Making the network even finer therefore only helps temporarily. Maple, for example, does this. On the accompanying figure you see the lemniscate,

(X2 +y2)2 = 2 (x2 – y2)

but you see that in (0,0) misery occurs. From four directions, a piece of solution comes to that, and Maple does not know how to connect correctly.

Another method is the following:

If you differentiate the implicit function into:

f’X (x,y) dx + f ‘y (x,y) dy = 0

Can you make two differential equations:

(1) dy/fx = – f ‘X /f’y

(2) dx/fy = – f ‘y /f’X

(1) can be used in parts where the graph runs more or less horizontally, (2) where it runs more or less vertically. Now pick a starting point on the solution, and use the differential equations to run along the solution. From time to time you have to switch from one to the other, but that’s not a problem: if abs(dy) > abs(dx) you use (2), otherwise (1). You will more than likely have to solve these differential equations numerically. When switching from a step dx to dy or vice versa, you also have to see that you give that step the correct sign, otherwise you simply return to the already calculated solution instead of continuing.
If you also apply a Newton-Raphson method after each step, you can even completely neutralize the slowly occurring deviations as a result of the numerical calculation.

I once again used this method to plot the equipotential surfaces of the constrained three-body problem. It worked, but you have to write a program for it, unless you find software that can do that already. Here too you can have problems in points where the solution intersects itself. And if the contour consists of disjoint pieces, you have to walk along them separately.

I would say unless plotting is really the subject of your work use a math package like Maple or Matlab and plot it there.

How do you sketch the contour graph of a function with several independent variables?

Answered by

prof.dr. Paul Hellings

Department of Mathematics, Fac. IIW, KU Leuven

Catholic University of Leuven
Old Market 13 3000 Leuven
https://www.kuleuven.be/

.

Recent Articles

Related Stories