next up previous
Next: Exercises to Hand In Up: Computer Lab #5: Gradient Previous: Review of the Gradient

Vector Fields and Gradient Fields

1.
A vector field $\mathbf{V}$ is simply a way of assigning, to points (x,y) in the plane, vectors $\mathbf{V}(x,y)$. For example, the vector field $\mathbf{V}(x,y)=(4xy-1)\mathbf{i+}(2x^{2}+2y)\mathbf{j}$ assigns the vector $\mathbf{V}(2,3)=23\mathbf{i}+14\mathbf{j}$ to the point (2,3).
2.
Given a function f(x,y), its gradient $\nabla f=\left( \frac{\partial
f}{\partial x}\right) \mathbf{i}+\left( \frac{\partial f}{\partial
y}\right) \mathbf{j}$ is a vector field. For example, suppose f(x,y)=2x2y+y2-x+2. Then $\nabla f=(4xy-1)\mathbf{i+}(2x^{2}+2y)\mathbf{j}$ (see immediately above), so $\nabla f$ assigns the vector $23\mathbf{i}+14\mathbf{j}$ to the point (2,3).

3.
We can picture vector fields by selecting a grid of points in the plane and drawing the vector $\mathbf{V}(P)$ at the point P. Matlab does this with the command quiver (a ``quiver'', you may recall, is a carrying case for arrows). Here is an m-file which draws the gradient field for the function above, as well as a contour plot for the same function

\begin{displaymath}
\begin{tabular}[c]
{c}\texttt{grad1.m}\\ \hline
\multicolumn...
 ...x,y,px,py), contour(xx,yy,zz),
hold off}}\\ \hline\end{tabular}\end{displaymath}

Here are some comments about this m-file.

4.
Combined gradient and contour plots can be helpful in classifying critical point (places where the gradient is zero). These are of three types:



next up previous
Next: Exercises to Hand In Up: Computer Lab #5: Gradient Previous: Review of the Gradient
Mark Bridger
1/4/2002