compute the Jacobian and its inverse of a coordinate transformation
transform a tensor given the backward transformation, the Jacobian of the backward transformation and its inverse.
Jacobian(Y, Finv, yJx, xJy)
transform(Tx, Finv, yJx, xJy)
list of n names of coordinate variables
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
output parameter of Jacobian(), but an input to transform(); tensor_type of character 1,−1, 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
output parameter of Jacobian(), but an input to transform(); tensor_type of character −1,1, 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
any tensor_type of rank-1 or higher
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 1,−1, and more visually, components:
The partial of ya with respect to xi, expressed in terms of the ys.
xJy MUST have character −1,1, and components:
The partial of xi with respect to ya, expressed in terms of the ys.
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.
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].
Declare the coordinate variables in the two systems. Note that declaration of Polar is not necessary in the following computations.
dim ≔ 4:Polar1 ≔ t,R,φ,θ:Polar2 ≔ t,r,φ,θ:
Express the coordinates in the first system in terms of the those in the second.
rtoR ≔ t=t,R=r1+K⁢r24,φ=φ,θ=θ:
Define the Robertson-Walker covariant metric in the first system.
gIJ_compts ≔ array⁡symmetric,1..dim,1..dim:
foritodimdoforjfromi+1todimdogIJ_comptsi,j ≔ 0end doend do:gIJ_compts1,1 ≔ −1:gIJ_compts2,2 ≔ S21−K⁢R2:gIJ_compts3,3 ≔ S2⁢R2⁢sin⁡θ2:gIJ_compts4,4 ≔ S2⁢R2:gIJ ≔ create⁡−1,−1,op⁡gIJ_compts
Form the two jacobians.
Now compute the transformed covariant metric in the second system.
gAB ≔ transform⁡gIJ,rtoR,yJx,xJy
Download Help Document
What kind of issue would you like to report? (Optional)