Understading the idea behind Gradient vector fields..

3.8k Views Asked by At

Example 3: Sketch the gradient vector field for $f(x,y) = x^2 + y^2$ as well as several contours for this function.

The gradient of the vector field is $$ \nabla f(x,y)=2x\vec{i}+2y\vec{j}. $$

But when i plot those 2 functions, I get a vector field that doesn't make sense.

enter image description here

What does the Gradient vectors (the purple ones) tell me abouth the function?

2

There are 2 best solutions below

1
On

They give you info about the level sets which are everywhere orthogonal to the gradient. Level sets are the results of sectioning the surface with horizontal planes and the outcome is exactly what you see in a topographic map. The longest the gradient vector, the faster the height is growing in that direction (i.e. the biggest the slope is).

In your example the gradient field is radial so you know that the level sets are circumferences, and since it is linearly growing, so is the slope (which results in a quadratic growth of the heigth).

Think of a river that flows on a hill and eventually reaches the sea. Clearly it always follows the path with highest slope which is the one the gradient is pointing to (but in the opposite direction, since water flows downward). If you see a topographic map of the hill, i.e. if you know the level sets of the its surface, the river flows orthogonally to those curves, think about it: when it reaches the sea it flows into it orthogonally with respect to the shoreline, which indeed is the level $0$ set.

EDIT:

Fix $\ell\in\mathbb R$, then the $\ell$-level set of the function $f(x,y)$ is the subset of the domain of $f$ where $f$ has value $\ell$. Briefly speaking it is the preimage $f^{-1}\big(\{\ell\}\big)$, i.e. $$ \big\{(x,y):~f(x,y)=\ell\big\} $$ If $f$ is smooth, then its level sets are either empty or disjoint unions of smooth curves and/or single points. If $f(x,y)=x^2+y^2$ as in your case, then the $\ell$-level set is \begin{align} U_\ell = ~& \big\{(x,y):~x^2+y^2=\ell\big\} \\ = ~& \begin{cases} \text{circumference with radius $\sqrt l$ centered in } (0,0) & \text{if } \ell>0 \\ \text{single point } \{(0,0)\} & \text{if } \ell =0 \\ \emptyset & \text{if } \ell<0 \end{cases} \end{align}

Example 1

The following pictures might help you understand the concept:

A local minimum Pic. source

Here is a function pretty much as yours. On the domain the level sets are closed and shrink to a single point in the origin. As you would expect in a topographic map, that indicates that that point is either a local maximum (the top of a mountain) or a local minimum (i.e. the bottom of a lake, assuming it is an isolated point).

It is not necessary to know the exact geometry of the level sets, but studying separately the (sign of the) partial derivatives $f_x$ and $f_y$ you can figure out where the gradient is pointing at, and deduce how the level sets behave using the fact that they are orthogonal to the gradient (see the $F$ in the picture, which clearly represents the gradient vector).

Example 2

Now take a look at this:

A saddle point Pic. source

The level sets show that there is a saddle point, in fact they do not encircle it but rather they kinda "diverge".

Hope this helps you out understanding the meaning of the level sets and how it is related the gradient field.

2
On

I'd say the easiest way of thinking about gradient vectors is to realize that they point out the direction that gives the largest momentaneous increase of the target function.

For a function $g(x)$, then the derivate $g'(x)$ will tell you in wich way to move along the $x$-axis in order for $g(x)$ to increase. Think about it: If the derivate is positive, you increase the value of the function by moving in the positive direction along the $x$-axis, and if the derivate is negative you increase the value of the function by moving in the negative direction.

Since in that case there's only one variable (i.e. one dimension), there's only two directions of movement.

But with two variables, like in $f(x,y)=x^2+y^2$, there's two dimensions, and suddenly there's an awful lot of possible directions of movement. But the gradient (derivate if you will) still tells you in which way to move to get the largest increase.

In your plot, since $f(x,y)=x^2+y^2$ is larger further away from the origin, the gradient vectors all point away from the origin. And their length is proportional to the momentaneous rate of increase when you move in that direction.

If you think about the value of the target function as height in a three dimensional landscape, the gradient vector for a point tells you in what direction the slope is steepest in that point. This leads on to the concept of level sets that AndreasT described, because orthogonally to the steepest direction the surface is locally level.

Not a very strict description, but I hope it helps. :) Also as mentioned in the comments, the blue vectors don't seem related to you actual question.