Gradient - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Student[MultivariateCalculus]

  

Gradient

  

return the gradient at specified points

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Gradient(f(x,y,..), [x,y,..]=[a1,b1,..], x=xmin..xmax, y=ymin..ymax, ..., opts)

Gradient(f(x,y,..), [x,y,..]=[[a1,b1,..],[a2,b2,..],..], x=xmin..xmax, y=ymin..ymax, ..., opts)

Parameters

f(x, y, ..)

-

algebraic expression

x, y, ..

-

name; independent variables

[a1, b1, ..]

-

list or list of lists of real constants or names; point(s) at which the gradient is evaluated

xmin, xmax, ymin, ymax, ...

-

(optional) real constants specifying range over which to plot function

opts

-

(optional) equation(s) of the form option=value where option is one of functionoptions, gradientoptions, curveoptions, output, showfunction, showcurves, showprojectedcurves, gradplotoptions, title, caption or view; specify output and/or plot options

Description

• 

The Gradient(f(x, y,...), [x, y,...] = [a1, b1,...]) calling sequence returns the gradient of the function f at specified points. Multiple points can be given by putting them into a list, for example, Gradient(f(x,y), [x,y] = [[1,2],[2,0]]). In the case of a function of 2 variables, the output option can be used to request that a plot or gradplot be returned.

• 

The Del and Nabla commands are both aliases for the Gradient command.

• 

The GradientTutor routine offers equivalent capabilities to Gradient in a tutor interface.  See the Student[MultivariateCalculus][GradientTutor] help page.

• 

If output=plot is given (so in particular, the function expression has at most two variables), the opts argument can be used to control the appearance of the plot.

  

 

  

 

  

caption = string

  

Specifies the plot or gradplot caption.  The default caption is constructed from the parameters.

  

 

  

functionoptions = list

  

Specifies the plot options for plotting the function fx,y. For more information on plotting options, see plot3d/options.

  

 

  

curveoptions = list

  

Specifies the plot options for plotting the level curve of the function at the point where the gradient is computed, and its projection on the x-y plane. For more information on plotting options, see plot3d/options.

  

 

  

gradientoptions = list

  

Specifies the plot options for plotting the gradient of the function. For more information on plotting options, see plot3d/options.

  

 

  

output = value, plot, or gradplot

  

This option controls the return value of the function.

  

* output = value specifies that the value of the gradient is to be returned. Plot options are ignored if output = value.  The default is output = value.

  

* output = plot specifies that a plot displays, which shows the function, a level curve at the point, the projection of that level curve onto the x-y plane, and a scaled vector in the direction of the gradient.

  

* output = gradplot specifies that a gradplot displays.

  

 

  

gradplotoptions = list

  

Specifies the plot options if the output is a gradplot. For more information on plotting options, see plot/options.

  

 

  

showfunction = true or false

  

Determines whether the function fx,y is plotted. The default is true.

  

 

  

showcurves = true or false

  

Determines whether the level curve is plotted. The default is true.

  

 

  

showprojectedcurves = true or false

  

Determines whether the projection of the level curve is plotted; this option is ignored if showcurves is false. The default is true.

  

For more information on typesetting the title or caption, see plot/typesetting.

  

 

  

title = anything

  

A title for the plot.

  

The default title is constructed from the parameters and the command options. title = "" disables the default title. For more information about specifying a title, see plot/typesetting.

  

 

  

caption = anything

  

A caption for the plot.

  

The default caption is constructed from the parameters and the command options. caption = "" disables the default caption. For more information about specifying a caption, see plot/typesetting.

  

 

  

view = list

  

Specifies the plot or gradplot view.  

  

 

• 

For information on how to change the default colors, see the Student[SetColors] help page.

Examples

withStudentMultivariateCalculus:

Gradientx2+y2,x,y=0,1

02

(1)

The Del and Nabla commands are both aliases for Gradient:

Delx2+y2,x,y=0,1

02

(2)

x2+y2,x,y=0,1

02

(3)

Gradientx2+y2,x,y=0,1,2,1

02,42

(4)

Gradientx2+y2,x,y=0,1,2,1,output=gradplot

The command to create the plot from the Plotting Guide is

Gradientx2+y2,x,y=0,1,2,1,x=1..6,y=1..6,z=0..10,output=plot

Compatibility

• 

The curveoptions, showcurves and showprojectedcurves options were introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

See Also

plot/options

plot3d/options

plots[gradplot3d]

plots[gradplot]

Student

Student[MultivariateCalculus]

Student[MultivariateCalculus][GradientTutor]

Student[VectorCalculus][Gradient]

VectorCalculus[Gradient]