tensor(deprecated)/Jacobian - Maple Help

tensor

 Jacobian
 compute the Jacobian and its inverse of a coordinate transformation
 transform
 transform a tensor given the backward transformation, the Jacobian of the backward transformation and its inverse.

 Calling Sequence Jacobian(Y, Finv, yJx, xJy) transform(Tx, Finv, yJx, xJy)

Parameters

 Y - list of n names of coordinate variables Finv - list of n functions in the y's that gives the transformation from the y-coordinate system to another one, say, the x-coordinate system yJx - output parameter of Jacobian(), but an input to transform(); tensor_type of character $\left[1,-1\right]$, and having the Jacobian matrix of the transformation from the x's to y's as components, yJx must have its components expressed in terms of the y's xJy - output parameter of Jacobian(), but an input to transform(); tensor_type of character $\left[-1,1\right]$, and having the transpose of the Jacobian matrix of the transformation from the y's to x's (namely, Finv) as components, xJy must have its components expressed in terms of the y's Tx - any tensor_type of rank-1 or higher

Description

Important: The tensor package has been deprecated. Use the superseding commands DifferentialGeometry[Transformation] and Physics[TransformCoordinates] instead.

 • Given a tensor_type Tx, that represents a tensor T in its x-coordinate representation, transform() constructs Ty, the representation of the same tensor in another coordinate system, say, the y-coordinate system.
 • transform() needs as input parameters, apart from T of course, the inverse transformation Finv, (that is, the x's expressed as functions of the y's), the jacobian (tensor_type) of Finv expressed in terms of the y's and its inverse (tensor_type).
 • yJx must have character $\left[1,-1\right]$, and more visually, components:

 $\mathrm{yJx}\left[\mathrm{compts}\right]\left[a,i\right]={\left(\frac{\partial y}{\partial x}\left(y\right)\right)}_{i}^{a}$ The partial of ${y}^{a}$ with respect to ${x}^{i}$, expressed in terms of the $y$s.

 • xJy MUST have character $\left[-1,1\right]$, and components:

 $\mathrm{xJy}\left[\mathrm{compts}\right]\left[a,i\right]={\left(\frac{\partial x}{\partial y}\left(y\right)\right)}_{a}^{i}$ The partial of ${x}^{i}$ with respect to ${y}^{a}$, expressed in terms of the $y$s.

 Note: Note the transposition here in xJy!  This is due to the fact xJy (and also yJx) is primarily used by tensor[transform], and tensor[transform] uses tensor[change_basis] to perform component manipulations, and tensor[change_basis] requires that the transformation matrix that acts on covariant indices (where xJy indeed does, since in tensor[transform], the transformation is from the x's to the y's) have this transposed arrangement.
 • The function Jacobian() can thus be used to generate the two Jacobians needed by transform().  Note that the xJy produced by Jacobian() is already in that transposed arrangement required by transform().  You need to be concerned about that fact only when they are to construct the jacobian(s) themselves.
 • Simplification :
 – Jacobian: Each of its components is merely a partial derivative of one of the x's w.r.t. one of the y's and Jacobian() uses the simplifier tensor/partial_diff/simp to simplify each of these derivatives.
 – transform: When Tx is of rank zero, only substitutions (of the x's with the y's) are needed.  In this case, transform() uses the simplifier tensor/raise/simp to simplify the (scalar) component of the result after the substitutions.
 When Tx is of rank one or higher, transform() first makes the substitutions and then invokes tensor[change_basis] to carry out the transformation according to the tensorial rule, and hence it, in case of a nonzero rank tensor, transform() uses also tensor/raise/simp as simplifier; tensor/raise/simp is the simplifier used by change_basis().
 • These two functions are part of the tensor package, and can be used in the form Jacobian(..), and transform(..) only after performing the command with(tensor), or with(tensor, Jacobian) or with(tensor, transform).  The functions can always be accessed in the long form tensor[Jacobian] or tensor[transform].

Examples

Important: The tensor package has been deprecated. Use the superseding commands DifferentialGeometry[Transformation] and Physics[TransformCoordinates] instead.

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

Declare the coordinate variables in the two systems. Note that declaration of Polar is not necessary in the following computations.

 > $\mathrm{dim}≔4:$$\mathrm{Polar1}≔\left[t,R,\mathrm{\phi },\mathrm{\theta }\right]:$$\mathrm{Polar2}≔\left[t,r,\mathrm{\phi },\mathrm{\theta }\right]:$

Express the coordinates in the first system in terms of the those in the second.

 > $\mathrm{rtoR}≔\left[t=t,R=\frac{r}{1+\frac{K{r}^{2}}{4}},\mathrm{\phi }=\mathrm{\phi },\mathrm{\theta }=\mathrm{\theta }\right]:$

Define the Robertson-Walker covariant metric in the first system.

 > $\mathrm{gIJ_compts}≔\mathrm{array}\left(\mathrm{symmetric},1..\mathrm{dim},1..\mathrm{dim}\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}i\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dim}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}j\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{from}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}i+1\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dim}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{gIJ_compts}\left[i,j\right]≔0\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$$\mathrm{gIJ_compts}\left[1,1\right]≔-1:$$\mathrm{gIJ_compts}\left[2,2\right]≔\frac{{S}^{2}}{1-K{R}^{2}}:$$\mathrm{gIJ_compts}\left[3,3\right]≔{S}^{2}{R}^{2}{\mathrm{sin}\left(\mathrm{\theta }\right)}^{2}:$$\mathrm{gIJ_compts}\left[4,4\right]≔{S}^{2}{R}^{2}:$$\mathrm{gIJ}≔\mathrm{create}\left(\left[-1,-1\right],\mathrm{op}\left(\mathrm{gIJ_compts}\right)\right)$
 ${\mathrm{gIJ}}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{-1}& {0}& {0}& {0}\\ {0}& \frac{{{S}}^{{2}}}{{-}{K}{}{{R}}^{{2}}{+}{1}}& {0}& {0}\\ {0}& {0}& {{S}}^{{2}}{}{{R}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}& {0}\\ {0}& {0}& {0}& {{S}}^{{2}}{}{{R}}^{{2}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (1)

Form the two jacobians.

 > $\mathrm{Jacobian}\left(\mathrm{Polar2},\mathrm{rtoR},\mathrm{yJx},\mathrm{xJy}\right):$
 > $\mathrm{op}\left(\mathrm{yJx}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {-}\frac{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}{{4}{}\left({K}{}{{r}}^{{2}}{-}{4}\right)}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{1}{,}{-1}\right]\right]\right)$ (2)
 > $\mathrm{op}\left(\mathrm{xJy}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {-}\frac{{4}{}\left({K}{}{{r}}^{{2}}{-}{4}\right)}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{1}\right]\right]\right)$ (3)

Now compute the transformed covariant metric in the second system.

 > $\mathrm{gAB}≔\mathrm{transform}\left(\mathrm{gIJ},\mathrm{rtoR},\mathrm{yJx},\mathrm{xJy}\right)$
 ${\mathrm{gAB}}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{-1}& {0}& {0}& {0}\\ {0}& \frac{{16}{}{{S}}^{{2}}}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}& {0}& {0}\\ {0}& {0}& \frac{{16}{}{{S}}^{{2}}{}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}& {0}\\ {0}& {0}& {0}& \frac{{16}{}{{S}}^{{2}}{}{{r}}^{{2}}}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (4)
 > $\mathrm{gAB}≔\mathrm{transform}\left(\mathrm{gIJ},\mathrm{rtoR},\mathrm{yJx},\mathrm{xJy}\right)$
 ${\mathrm{gAB}}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{-1}& {0}& {0}& {0}\\ {0}& \frac{{16}{}{{S}}^{{2}}}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}& {0}& {0}\\ {0}& {0}& \frac{{16}{}{{S}}^{{2}}{}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}& {0}\\ {0}& {0}& {0}& \frac{{16}{}{{S}}^{{2}}{}{{r}}^{{2}}}{{\left({K}{}{{r}}^{{2}}{+}{4}\right)}^{{2}}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (5)