Grad

Grad[f,{x1,,xn}]
gives the gradient .

Grad[f,{x1,,xn},chart]
gives the gradient in the coordinates chart.

DetailsDetails

  • Grad[f,x] can be input as xf. The character can be typed as EscdelEsc or \[Del]. The list of variables x is entered as a subscript.
  • An empty template can be entered as EscgradEsc, and Tab moves the cursor from the subscript to the main body.
  • All quantities that do not explicitly depend on the variables given are taken to have zero partial derivative.
  • If f is an array of dimensions {n1,,nk}, then Grad[f,{x1,,xm}] yields an array of dimensions {n1,,nk,m}.
  • If f is a scalar, Grad[f,{x1,x2,,xn},chart] returns a vector in the orthonormal basis associated with chart.
  • In Grad[f,{x1,,xn},chart], if f is an array, it must have dimensions {n,,n}. The components of f are interpreted as being in the orthonormal basis associated with chart.
  • Coordinate charts in the third argument of Grad can be specified as triples {coordsys,metric,dim} in the same way as in the first argument of CoordinateChartData. The short form in which dim is omitted may be used.
  • Grad works with SparseArray and StructuredArray objects.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

The gradient in three-dimensional Cartesian coordinates:

In[1]:=
Click for copyable input
Out[1]=

The gradient using an orthonormal basis for three-dimensional cylindrical coordinates:

In[1]:=
Click for copyable input
Out[1]=

The gradient in two dimensions:

In[1]:=
Click for copyable input
Out[1]=

Use EscdelEsc to enter and Ctrl+- to enter the list of subscripted variables:

In[1]:=
Click for copyable input
Out[1]=

Use EscgradEsc to enter the template ; press Tab to move between inputs:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2012
(9.0)
| Updated in 2014
(10.0)
Translate this page: