tensor(deprecated)/d2metric - Maple Help

tensor

 d2metric
 compute the second partial derivatives of the covariant metric tensor components

 Calling Sequence d2metric( d1g, coord)

Parameters

 d1g - first partials of the covariant metric tensor coord - list of names representing the coordinate variables

Description

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 • Given the coordinate variables, coord, and the first partials of the covariant metric tensor, d1g, d2metric( d1g, coord ) computes the second partial derivatives of g, which will be a new tensor_type of rank four and which uses the d2met indexing function provided by the tensor package to implement the symmetry in the indices of the second partials.
 • d1g must be a rank 3 tensor_type with character [-1,-1,-1] and must use the cf1 indexing function for its component array.  It is recommended that d1g be computed using tensor[d1metric].
 • The extra index due to differentiation is of covariant character, by convention. Thus, the index_char field of the result is [-1, -1, -1, -1].
 • Indexing Function: The d2met indexing function is meant to index the second partials of the covariant metric tensor components. Specifically, it implements the symmetry in the first and second indices (due to the symmetry in the metric components themselves) and the symmetry in the third and fourth indices (due to the symmetry of the mixed partial derivatives) of a four index quantity.
 • Simplification:  This routine uses the tensor/d2metric/simp routine for simplification purposes.  The simplification routine is applied to each component of result after it is computed.  By default, tensor/d2metric/simp is initialized to the tensor/simp routine.  It is recommended that the tensor/d2metric/simp routine be customized to suit the needs of the particular problem.  For example, if the metric component functions are not fully known but are known to satisfy certain differential equations, the tensor/d2metric/simp routine could be used to make substitutions for the partial derivatives of these functions.
 • For computing the partial derivatives of the components of an arbitrary tensor, use tensor[partial_diff].
 • This function is part of the tensor package, and so can be used in the form d2metric(..) only after performing the command with(tensor) or with(tensor, d2metric).  The function can always be accessed in the long form tensor[d2metric](..).

Examples

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 > $\mathrm{with}\left(\mathrm{tensor}\right):$

Define the coordinate variables and the covariant components of the Schwarzchild metric.

 > $\mathrm{coord}≔\left[t,r,\mathrm{\theta },\mathrm{\phi }\right]:$
 > $\mathrm{g_compts}≔\mathrm{array}\left(\mathrm{symmetric},\mathrm{sparse},1..4,1..4\right):$
 > $\mathrm{g_compts}\left[1,1\right]≔1-\frac{2m}{r}:$$\mathrm{g_compts}\left[2,2\right]≔-\frac{1}{\mathrm{g_compts}\left[1,1\right]}:$
 > $\mathrm{g_compts}\left[3,3\right]≔-{r}^{2}:$$\mathrm{g_compts}\left[4,4\right]≔-{r}^{2}{\mathrm{sin}\left(\mathrm{th}\right)}^{2}:$
 > $g≔\mathrm{create}\left(\left[-1,-1\right],\mathrm{eval}\left(\mathrm{g_compts}\right)\right)$
 ${g}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}{-}\frac{{2}{}{m}}{{r}}& {0}& {0}& {0}\\ {0}& {-}\frac{{1}}{{1}{-}\frac{{2}{}{m}}{{r}}}& {0}& {0}\\ {0}& {0}& {-}{{r}}^{{2}}& {0}\\ {0}& {0}& {0}& {-}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{th}}\right)}^{{2}}\end{array}\right]\right]\right)$ (1)

Compute the first partials of g:

 > $\mathrm{d1g}≔\mathrm{d1metric}\left(g,\mathrm{coord}\right):$

Compute the second partials of g:

 > $\mathrm{d2g}≔\mathrm{d2metric}\left(\mathrm{d1g},\mathrm{coord}\right):$

All indices are covariant

 > $\mathrm{get_char}\left(\mathrm{d2g}\right)$
 $\left[{-1}{,}{-1}{,}{-1}{,}{-1}\right]$ (2)
 > $\mathrm{compts}≔\mathrm{get_compts}\left(\mathrm{d2g}\right):$

The symmetries in the indices are implemented with indexing:

 > $\mathrm{op}\left(1,\mathrm{op}\left(\mathrm{compts}\right)\right)$
 ${\mathrm{d2met}}$ (3)

Extract only the nonzero entries

 > map( proc(x) if compts[op(x)]<>0 then op(x)=compts[op(x)] else NULL end if end proc,    [ indices(compts) ] );
 $\left[\left({2}{,}{2}{,}{2}{,}{2}\right){=}\frac{{4}{}{m}}{{\left({-}{r}{+}{2}{}{m}\right)}^{{3}}}{,}\left({1}{,}{1}{,}{2}{,}{2}\right){=}{-}\frac{{4}{}{m}}{{{r}}^{{3}}}{,}\left({4}{,}{4}{,}{2}{,}{2}\right){=}{-}{2}{}{{\mathrm{sin}}{}\left({\mathrm{th}}\right)}^{{2}}{,}\left({3}{,}{3}{,}{2}{,}{2}\right){=}{-2}\right]$ (4)