Calculus III Lab 7
Curves of Steepest Ascent and
Gradient Flow
Mathematical Outline
One of the important ideas in section 12.6 is
that for a function
of
two variables, the gradient at any point
is
perpendicular to the level curve through that point, and that the direction
of the gradient is the direction in which the function
rises
most rapidly. If you ``zoom in" on the point
,
then the level curves will appear to be parallel, straight lines. In fact
they will appear as the level curves of the tangent plane to the graph
of
.
If you imagine the level curves as wide stairs, then it is clear that the
fastest way to ascend is to go perpendicular to the stairs, rather than
to angle off. So the direction of your velocity is in the direction of
the vector
.
The first two components of the vector correspond to the gradient vector,
which is a 2-d vector in the domain, and the third component corresponds
to the ``vertical" rate of change of the function in the direction of the
gradient vector. Now if R(
)=
is
the space curve corresponding the curve of most rapid ascent (see FIGURE
10 page 790), then we may not have equations for the components of Rbut
we certainly have equations for the velocity vector of R'. They
are
,
,
.
This is what is called a system of three first
order differential equations.The ``unknowns" are the three function
,
which are the components of the space curve Rcorresponding to steepest
ascent. The equations relate the derivatives of the three unknown functions
to the given function
.
The general theory for this situation is best left for a future course
in differential equations, but at this point we can simply use Maple as
a ``black box" to graphically solve the system. The key command isDEplot3d,
which is loaded with the package DEtools. The syntax and usage
for our purpose is illustrated below. We find the curve of steepest ascent
staring at the domain point
on
a certain elliptic parabolid with vertex at (2,3,9).
> f:=(x,y)->9-(x-3)^2-9*(y-2)^2;
![]()
> A:=contourplot3d(f(x,y), x=0..6, y=-1..5,axes=framed, filled=true):
> diffeqs:=[ D(x)(t)=D[1](f)(x(t),y(t)), D(y)(t)=D[2](f)(x(t),y(t)), D(z)(t) = D[1](f)(x(t),y(t))*D(x)(t)+ D[2](f)(x(t),y(t))*D(y)(t) ];
> with(DEtools):
> B:=DEplot3d(diffeqs, [x(t),y(t),z(t)],
t=0..2,
[[x(0)=1, y(0)=-1, z(0)=f(1,-1)]], x=0..6,
y=-1..5, scene=[x(t),y(t),z(t)], stepsize=.01, thickness=3, linecolor=black
):
> with(plots):
display(B, A, view=-80..10, orientation=[-62,41]
);
![[Maple Plot]](lab0718.gif)
It is useful to visualize the situation in the domain. We will plot the gradient vectors, the projection of the solution curve above, and the contour plot of the function.
> {diffeqs[1],diffeqs[2]};
![]()
> path:=DEplot({diffeqs[1],diffeqs[2]}, [x(t),y(t)], t=0..2, [[x(0)=1, y(0)=-1]], x=0..6, y=-1..5, stepsize=.01, thickness=3, linecolor=red, arrows=NONE ):
> vectors:=gradplot( f(x,y), x=0..6, y=-1..5, arrows=THICK, scaling=constrained, color=f(x,y)):
> contours:=contourplot(f(x,y), x=0..6, y=-1..5, thickness=3):
> display(contours, path, vectors, axes=boxed, title=`Picture in Domain Space` );
![[Maple Plot]](lab0720.gif)
The Three-Dimensional Setting
Frequently we start with a function
of
three variables, instead of with a function
of
two variables. In this case, the domain is three-dimensional instead of
two-dimensional. The analogue of level curves is level surfaces.
See the top of page 747. The analogous key idea is that the paths of most
rapid ascent are perpendicular to the level surfaces. Instead of attempting
to visualize the graph of the function, which is a three dimensional object
in four dimensions (just as the graph of a function of two variables is
a two-dimensional object in three dimensions), we settle on analyzing the
path in domain space which corresponds to the path of most rapid ascent.
Typically the level surfaces hide and obscure one another, so it is not
worth the effort to plot them. For example, if the function is given by
,
then the level surfaces are concentric spheres, so if we were to plot them,
then the outermost sphere would hide all of the inner spheres. Too bad
we cannot put our eye in a fourth dimension and peer in! So we typically
settle for a display of the gradient vectors and a solution curve. We illustrate
by way of EXAMPLE 4 page 786.
> f:=(x,y,z)->80/(1+x^2+2*y^2+3*z^2):
Do you see that for this function, the level surfaces are ellipsoids centered at the origin?
> vectors:=gradplot3d(f(x,y,z),x=0..2,y=0..2,z=-3..0,arrows=THICK,axes=boxed,grid=[15,15,15]):
> Curve:=DEplot3d({D(x)(t)=D[1](f)(x(t),y(t),z(t)), D(y)(t)=D[2](f)(x(t),y(t),z(t)), D(z)(t)=D[3](f)(x(t),y(t),z(t))},[x(t),y(t),z(t)],t=0..0.18,[[x(0)=1,y(0)=1,z(0)=-2]]):
> display(Curve,vectors,title=`Picture in Domain Space`);
![[Maple Plot]](lab0724.gif)
What You Need to do in the Lab
For the functions and indicated points of exercises 9, 10, 19, 24 and 28 in section 12.6, produce plots showing the surface with contours, curve of steepest ascent. Also produce corresponding domain pictures, showing the level curves, gradient vectors, and path. For #24, note that you should instead focus on the path of steepest descent.
For problem #27, produce a picture in domain space
showing the gradient vectors, and the path of steepest descent/ascent through
the point P.
Prelab: What You Need to Do Before
Lab
For the function
of
the example above, differential equations for
and
are
indicated. The differential equation for
calls
for a function whose derivative is
.
Verify that the function
satisfies
the differential equation. So you need to work out both
and
X'(
),
and confirm that they are equal.
Next verify that
solves
the corresponding differential equation for
.
Find the values of
and
,
assuming that the curve passes through the point indicated in the example
at
.
By eliminating the parameter
,
find a Cartesian equation for the parametric curve
.
Below is a contour plot of a function. The high and low regions are indicated by H and L. Three points are indicated (small circles). Sketch the curves of steepest ascent through these three points.