tensor(deprecated)/partial_diff - Help

tensor

 partial_diff
 compute the partial derivatives of a tensor_type with respect to given coordinates

 Calling Sequence partial_diff( U, coord)

Parameters

 U - tensor_type whose partial derivatives are to be found 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 any tensor_type U, partial_diff(U, coord) constructs the partial derivatives of U, which will be a new tensor_type (not necessarily a tensor, of course) of rank one higher than that of U.
 • The extra index due to differentiation is of covariant character, by convention. Thus the index_char field of the result is $\left[{U}_{\mathrm{index_char}},-1\right]$.
 • Simplification:  This routine uses the tensor/partial_diff/simp routine for simplification purposes.  The simplification routine is applied to each component of result after it is computed.  By default, tensor/partial_diff/simp is initialized to the tensor/simp routine.  It is recommended that the tensor/partial_diff/simp routine be customized to suit the needs of the particular problem.
 • When computing the first and second partial derivatives of the covariant metric tensor components, it is suggested that the tensor[d1metric] and tensor[d2metric] routines be used instead of the partial_diff routine so that the symmetries of the first and second partials be implemented using the tensor package indexing functions. The partial_diff routine does not preserve any symmetric properties that the indices of its input may have.
 • This function is part of the tensor package, and so can be used in the form partial_diff(..) only after performing the command with(tensor) or with(tensor, partial_diff).  The function can always be accessed in the long form tensor[partial_diff](..).

Examples

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

 > $\mathrm{with}\left(\mathrm{tensor}\right):$
 > $\mathrm{coord}≔\left[r,\mathrm{\theta },\mathrm{\psi }\right]:$
 > $A≔\mathrm{array}\left(1..3,\left[f\left(r\right),g\left(\mathrm{\theta }\right),h\left(\mathrm{\psi }\right)\right]\right):$
 > $U≔\mathrm{create}\left(\left[1\right],\mathrm{op}\left(A\right)\right)$
 ${U}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}{f}{}\left({r}\right)& {g}{}\left({\mathrm{\theta }}\right)& {h}{}\left({\mathrm{\psi }}\right)\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}\right]\right]\right)$ (1)
 > $\mathrm{part_U}≔\mathrm{partial_diff}\left(U,\mathrm{coord}\right)$
 ${\mathrm{part_U}}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{f}{}\left({r}\right)& {0}& {0}\\ {0}& \frac{{ⅆ}}{{ⅆ}{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{g}{}\left({\mathrm{\theta }}\right)& {0}\\ {0}& {0}& \frac{{ⅆ}}{{ⅆ}{\mathrm{\psi }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{h}{}\left({\mathrm{\psi }}\right)\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]\right]\right)$ (2)
 > $V≔\mathrm{create}\left(\left[\right],H\left(r,\mathrm{\theta },\mathrm{\psi }\right)\right)$
 ${V}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}{H}{}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\psi }}\right){,}{\mathrm{index_char}}{=}\left[\right]\right]\right)$ (3)
 > $\mathrm{part_V}≔\mathrm{partial_diff}\left(V,\mathrm{coord}\right)$
 ${\mathrm{part_V}}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{ccc}\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{H}{}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\psi }}\right)& \frac{{\partial }}{{\partial }{\mathrm{\theta }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{H}{}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\psi }}\right)& \frac{{\partial }}{{\partial }{\mathrm{\psi }}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{H}{}\left({r}{,}{\mathrm{\theta }}{,}{\mathrm{\psi }}\right)\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}\right]\right]\right)$ (4)