TransformCoordinates - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : TransformCoordinates

Physics[TransformCoordinates] - transform the coordinates in a tensorial expression

Calling Sequence

TransformCoordinates(tr, expression, X_new, X_old, ...)

Parameters

tr

-

the transformation equations with the old variables on the left-hand sides and algebraic expressions involving the new variables X_new on the right-hand sides, or the other way around

expression

-

any algebraic expression that can also be tensorial, having free indices

X_new

-

optional, an ordered list with the new coordinates, it is however required when they are not related to a system of coordinates set with Coordinates or there is ambiguity regarding the transformation being from old to new or the other way around

X_old

-

optional, same as X_new; if given, then X_new must also be given before

output = line_element

-

optional, to request the output to be the spacetime line element when expression is the spacetime metric

performsumoverrepeatedindices

-

optional, can be true (default) or false, to perform the sum over repeated tensor indices in the returned result

setcoordinates = ...

-

optional - can be true or false (default), to automatically set the X_new as a coordinate system and also as the differentiation variables for d_, D_ and others

setmetric = ...

-

optional - can be true or false (default), when expression is the metric, to automatically set the transformed metric as the new metric

simplifier = ...

-

optional - indicates the simplifier to be used instead of the default simplify

Description

• 

The TransformCoordinates, performs a transformation of coordinates in an algebraic expression that is also tensorial, i.e. one that has free and/or repeated spacetime indices that are either covariant or contravariant (see Check to determine the indices).

• 

The transformation performed with TransformCoordinates is the standard one for tensors. Consider for instance a transformation from one coordinate system, x0,x1,x2,x3 to another y0,y1,y2,y3

xμ=fμy0,y1,y2,y3

  

where the fμ are certain functions. When you transform the coordinates, every contravariant tensor of one index, say Aμx, a vector, transforms into a contravariant Aμy in the new system of coordinates according to

Aμy=yμxνAνx

  

and every covariant vector transforms according to

Aμy=xνyμAνx

  

and in the case of more than one index, for each contravariant or covariant index there is a factor as in the corresponding right-hand sides of these formulas.

• 

CAVEAT: in curvilinear coordinates, none of the Christoffel symbols, the noncovariant d_ operator and the SpaceTimeVector Xμ are tensors, even when the algebraic manipulation of their indices is done as if they were. This version of TransformCoordinates does not transform coordinates on these objects.

• 

When the given tr is from the old variables - say xμ - on the left-hand sides of the transformation equations to the new variables - say yμ - on the right-hand sides, as in the previous item, the output is entirely expressed in terms of the new coordinates yμ. This is accomplished in two steps:

1. 

In the given expression, change variables from the old ones x to the new ones y to get everything expressed in terms of y. (If options known = ... and unknown = ... are received by TransformCoordinates, they are forwarded to dchange.  See dchange for info on the use of those options.)

2. 

Transform the resulting tensorial expression expressed in terms of y regarding each of its free indices (i.e.: multiply by the appropriate factors mentioned, yμxν or xνyμ and sum over the corresponding repeated indices).

  

The result represents the tensorial expression in the new coordinate system, expressed in terms of the new coordinates.

• 

It frequently happens, however, that the transformation can only be expressed in simple form if it is from the new variables on the left-hand sides to the old variables on the right-hand sides. You can pass the transformation tr in this way too, in which case you need to also pass the two lists X_new and X_old respectively as third and fourth arguments. The result will then be the tensor in the new coordinate system, entirely expressed in terms of the coordinates xμ of the old system, .

• 

The output of TransformCoordinates is an Array with dimension equal to the number of free indices of expression. In the special cases where the number of indices is 2 or 1, instead of an Array, the result is respectively expressed as a Matrix or a column Vector. In all cases, giving values to these indices you retrieve each of the components of the tensorial expression in the new coordinate system, entirely expressed in terms of the new coordinates X_new whenever the given transformation is from the old to the new variables (see the two previous paragraphs).

• 

The transformation can be given as an equation or a set or list of them, and does not need to include equations for all the coordinates - for instance: some may not be changing. Also, because the transformation of coordinates is equivalent to a change of the system of reference, it is possible to continue using the same geometrical coordinates (same names representing the coordinates in both systems) so that the right-hand sides of the transformation equations can involve the list of X_new variables, even if they are the same as the old ones, for instance as in transforming [t = -t], performed by TransformCoordinates in two steps: transform t=τ then evaluate at τ=t.

• 

You can retrieve all the nonzero components of the transformed expression at once by passing the output of TransformCoordinates to the ArrayElems command.

• 

When expression is the spacetime metric g_[mu,nu], you can optionally request the output to be the corresponding line element by passing output = line_element instead of a Matrix.

• 

By default, when changing variables in the metric (i.e. expression is the metric itself), the transformed metric is not automatically set as the new metric. To change this behavior, pass the optional argument setmetric, in which case a call to Setup with metric = ... transformed metric ..., coordinates = ... new coordinates ... will be automatically performed before returning the result.

• 

By default, the new variables are not set as a coordinate system (when they are not already) nor they are set as the differentiation variables. To change this behavior, pass the optional argument setcoordinates. If not given, the default value of this option is false, unless you pass the option setmetric in which case the new variables are set as a coordinate system and as new differentiation variables together with the metric g_. When the new variables are not already set as a coordinate system, the label used for the new variables will always be the label originally used for the old variables.

• 

By default, in the returned result, summation is explicitly performed over all the repeated indices found in expression, taking into account the covariant/contravariant character of each index. To avoid performing this summation and keep repeated indices not summed pass the optional argument performsumoverrepeatedindices = false.

• 

By default, all the components of the returned result are simplified using simplify. This frequently results in a desired form. You can change the simplifier to be any other one by indicating it on the right-hand side of the optional argument simplifier = ....

Examples

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

Consider the general form of a transformation of coordinates tr, from X to Y, and its inverse itr from Y to X, expressed in terms of 8 arbitrary functions X1y1,y2,y3,y4,...,Y4x1,x2,x3,x4

CoordinatesX,Y

Default differentiation variables for d_, D_ and dAlembertian are:X=x1,x2,x3,x4

Systems of spacetime coordinates are:X=x1,x2,x3,x4,Y=y1,y2,y3,y4

X,Y

(2)

trx1=X1Y,x2=X2Y,x3=X3Y,x4=X4Y

trx1=X1Y,x2=X2Y,x3=X3Y,x4=X4Y

(3)

itry1=Y1X,y2=Y2X,y3=Y3X,y4=Y4X

itry1=Y1X,y2=Y2X,y3=Y3X,y4=Y4X

(4)

For readability, suppress the display of functionality in these 8 functions

Typesetting:-Suppressmaprhs,tr

Typesetting:-Suppressmaprhs,itr

The covariant components of a vector A transform  according to

DefineA

Defined objects with tensor properties

A,γμ,σμ,μ,gμ,ν,εα,β,μ,ν,Xμ,Yμ

(5)

Aμ

Aμ

(6)

TransformCoordinatestr,

X1y1A1+X2y1A2+X3y1A3+X4y1A4X1y2A1+X2y2A2+X3y2A3+X4y2A4X1y3A1+X2y3A2+X3y3A3+X4y3A4X1y4A1+X2y4A2+X3y4A3+X4y4A4

(7)

For the contravariant components of A one can replace A[mu] by A[~mu] in the above. In that way, however, the new components will involve the inverse of the Jacobian of the transformation, resulting in a correct but rather large algebraic expression, due to the generality of the transformation tr. In such a case it is more convenient to use a transformation from the new to the old variables, as itr:

A~mu

Aμμ

(8)

TransformCoordinatesitr,

Y1x1A11+Y1x2A22+Y1x3A33+Y1x4A44Y2x1A11+Y2x2A22+Y2x3A33+Y2x4A44Y3x1A11+Y3x2A22+Y3x3A33+Y3x4A44Y4x1A11+Y4x2A22+Y4x3A33+Y4x4A44

(9)

Verify that the transformation

TRr=1+m2ρ2ρ

TRr=1+m2ρ2ρ

(10)

transforms the line element of the Schwarzschild metric into one where the line element of spatial distance has conformal euclidean form, i.e.: it is proportional to the euclidean spatial line element in spherical coordinates, ρ2+ρ2θ2+sinθ2φ2.

Set first the metric to be the Schwarzschild metric and the coordinates to be spherical. For that purpose you can use Setup, Coordinates or because Schwarzschild's metric is known to the system you can directly pass the keyword or an abbreviation of it to the metric g_ itself to do all in one step

g_sc

_______________________________________________________

Systems of spacetime coordinates are:X=r,θ,φ,t,Y=y1,y2,y3,y4

Default differentiation variables for d_, D_ and dAlembertian are:X=r,θ,φ,t

Setting lowercaselatin_is letters to represent space indices

The Schwarzschild metric in coordinates r,θ,φ,t

Parameters: m

Signature: - - - +

_______________________________________________________

gμ,ν=r2mr0000r20000r2sinθ20000r2mr

(11)

Transform the coordinates in this metric using the transformation TR. Because the new variables were not set using Coordinates, indicate them as ρ,θ,φ,t; request the output to be the corresponding line element:

TransformCoordinatesTR,g_μ,ν,ρ,θ,φ,t,output=lineelement

2ρ+m4ⅆρ2+sinθ2ⅆφ2+ⅆθ2ρ216ρ4+m2ρ2ⅆt22ρ+m2

(12)

By inspection, the spatial part of this result is proportional to the euclidean spatial line element mentioned. Compare with the line element of the Schwarzschild metric,

g_line_element

rⅆr22mrr2ⅆθ2r2sinθ2ⅆφ2+r2mⅆt2r

(13)

Remark: this transformed metric (12) is not automatically set as the metric. It is for that reason that the line above shows the line element of the original metric, not the changed metric. To set the new metric use Setupg=12, or use the optional argument setmetric, in which case both the metric and the new coordinates will be set. For example, adding the keyword setmetric to the input that resulted in (12),

TransformCoordinatesTR,g_μ,ν,ρ,θ,φ,t,output=lineelement,setmetric

_______________________________________________________

Coordinates: ρ,θ,φ,t. Signature: - - - +

_______________________________________________________

gμ,ν=2ρ+m416ρ400002ρ+m416ρ200002ρ+m4sinθ216ρ20000m2ρ22ρ+m2

_______________________________________________________

2ρ+m4ⅆρ2+sinθ2ⅆφ2+ⅆθ2ρ216ρ4+m2ρ2ⅆt22ρ+m2

(14)

so that now you see X as a label to the new coordinates ρ,θ,φ,t and the line element as the new line element

Coordinates

Systems of spacetime coordinates are:X=ρ,θ,φ,t,Y=y1,y2,y3,y4

X,Y

(15)

g_line_element

2ρ+m4ⅆρ2+sinθ2ⅆφ2+ⅆθ2ρ216ρ4+m2ρ2ⅆt22ρ+m2

(16)

Set the metric and coordinates again to be Schwarzschild and spherical

g_sc

_______________________________________________________

Systems of spacetime coordinates are:X=r,θ,φ,t,Y=y1,y2,y3,y4

Default differentiation variables for d_, D_ and dAlembertian are:X=r,θ,φ,t

The Schwarzschild metric in coordinates r,θ,φ,t

Parameters: m

Signature: - - - +

_______________________________________________________

gμ,ν=r2mr0000r20000r2sinθ20000r2mr

(17)

Transform the Schwarzschild metric to Kruskal coordinates. The new coordinates are

CoordinatesK=U,θ,φ,V

Systems of spacetime coordinates are:K=U,θ,φ,V,X=r,θ,φ,t,Y=y1,y2,y3,y4

K,X,Y

(18)

The transformation is

trV=expv4m,U=expu4m

trV=ⅇv4m,U=ⅇu4m

(19)

vt+r+2mlnr2m

vt+r+2mlnr2m

(20)

utr2mlnr2m

utr2mlnr2m

(21)

Note this is a transformation from new to old variables. The line element of the transformed metric is

TransformCoordinatestr,g_i,j,output=lineelement

r2ⅆθ2r2sinθ2ⅆφ2+16ⅆUm2ⅇr2mⅆVr

(22)

By default, repeated indices in expression are returned explicitly summed. For example, consider this expression with free indices μ and ν

g_μ,ρA~rhoAν

gμ,ρAρρAν

(23)

To perceive the difference with and without the option performsumoverrepeatedindices, perform an identity transformation on (24)

MTransformCoordinatesr=r,

MA1A11r2mrA2A11r2mrA3A11r2mrA4A11r2mrA1r2A22A2r2A22A3r2A22A4r2A22A1A33r2sinθ2A2A33r2sinθ2A3A33r2sinθ2A4A33r2sinθ2A1A44r2mrA2A44r2mrA3A44r2mrA4A44r2mr

(24)

In the above, the sum over ρ is performed. With performsumoverrepeatedindices = false the sum is not performed:

TransformCoordinatesr=r,,performsumoverrepeatedindices=false

g1,ρAρρA1g1,ρAρρA2g1,ρAρρA3g1,ρAρρA4g2,ρAρρA1g2,ρAρρA2g2,ρAρρA3g2,ρAρρA4g3,ρAρρA1g3,ρAρρA2g3,ρAρρA3g3,ρAρρA4g4,ρAρρA1g4,ρAρρA2g4,ρAρρA3g4,ρAρρA4

(25)

Note that the Matrix M assigned in (25) can effectively be used to retrieve the value of (24) for given values of its free indices μ and ν. Similar functionality is available using TensorArray.

M1,1

A1A11r2mr

(26)

M4,1

A1A44r2mr

(27)

You can as well transform tensorial expressions that have no free indices; in that case only a change of variables in the scalar expression using PDEtools:-dchange is performed, although in the returned result the repeated indices will appear explicitly summed. To perform only the summation use SumOverRepeatedIndices.

See Also

Array, ArrayElems, Check, Coordinates, d_, dchange, Define, DifferentialGeometry[Tensor][PushPullTensor], g_, Matrix, PDEtools:-dchange, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup, SumOverRepeatedIndices, TensorArray

References

  

Landau, L.D., and Lifshitz, E.M. The Classical Theory of Fields, Course of Theoretical Physics Volume 2, fourth revised English edition. Elsevier, 1975.