If {ei } , {ei } and {e'i },{e'i } are two pairs of dual basis, then the second one can be expressed in terms of the former as
![]()
being n the dimension of the manifold and
an
matrix
. A tensor T can be expressed in each one of the basis. It's
components will be related through the matrix
.
This correspond to the passive point of view . Alternatively we
can thing that the basis change is a relation between two manifolds (active
point of view). With respect to this point of view there are two tenors
T.
One for each manifold. This point of view is more adapted at the way you
must proceed with TTC and in general with Mathematica.
You must discting with to diferents names the tensor T at a diferents
basis. Let's name T and T' . The corresponding components
are related with
![]()
Although the comments with respect the name of tensors above we usually will say that a change of basis has been performed, that is we will adopt the passive point of view
When the change takes place between two coordinate basis
and
the
matrix
and
its inverse is given by
![]()
and often it is said that a coordinate change or coordinate
transformation
}
has been performed.
Note that in a coordinate change, the new components are expressed using the new coordinates.
In[2]:= InputCoordinates[cart, {x, y, z}];
In[3]:= InputCoordinates[cyl, {r, phi, z}];
In[4]:= InputCoordinateChange[cart, cyl,
{ x -> r Cos[phi], y -> r Sin[phi], z -> z } ];
Out[4]= {x -> r Cos[phi], y -> r Sin[phi], z -> z}
In[5]:= JacobianMatrix[cart, cyl] // MatrixForm
Out[5]//MatrixForm= Cos[phi] -(r Sin[phi]) 0
Sin[phi] r Cos[phi] 0
0 0 1
Next, we realize the change from cartesian to cylindrical coordinates over
a scalar function F=f(x2+y2+z2), over
a vector In[6]:= F = f[x^2 + y^2 + z^2] 2 2 2 Out[6]= f[x + y + z ] In[7]:= Change[cart, cyl][F] 2 2 Out[7]= f[r + z ] In[8]:= e = ZZ[cart]; In[9]:= R = x e[-1] + y e[-2] + z e[-3] Out[9]= z Dz + y Dy + x Dx In[10]:= Change[cart, cyl][R] Out[10]= z Dz + r Dr In[11]:= w = y e[1] + (x + z Cos[y z]) e[2] + y Cos[y z] e[3] Out[11]= y dx + (x + z Cos[y z]) dy + y Cos[y z] dz In[12]:= Change[cart, cyl][w] Out[12]= (z Cos[r z Sin[phi]] Sin[phi] + r Sin[2 phi]) dr + > r (r Cos[2 phi] + z Cos[phi] Cos[r z Sin[phi]]) dphi + > r Cos[r z Sin[phi]] Sin[phi] dzThe expression of the euclidean metric in cylindrical coordinates can be obtained easily performing a coordinate change on the metric tensor in cartesian coordinates.
In[13]:= InputMetric[euclidean, cart, e[1, 1] + e[2, 2] + e[3, 3]] Out[13]= dx*.dx + dy*.dy + dz*.dz In[14]:= g = %; In[15]:= Change[cart, cyl][g] 2 Out[15]= dr*.dr + r dphi*.dphi + dz*.dz In[16]:= InputMetric[euclidean, cyl, %] 2 Out[16]= dr*.dr + r dphi*.dphi + dz*.dz In[17]:= Metric[euclidean, cyl] 2 Out[17]= dr*.dr + r dphi*.dphi + dz*.dzThe coordinate changes only work in one direction. If you have input the coordinate transformation
InputCoordinateChange[x, x', rules]
you cannot change an object expressed in terms of xi to coordinates x'i\. If you want to do it, the declaration
InputCoordinateChange[x', x, rules]
has to be done. On the contrary, as it will be seen in the next section, the changes of basis allow the transformations to work in both senses.
relation between both basis. If you are going to perform only algebraic manipulations and the coordinate system involved is of minor importance, the default coordinates XX can be used.
In[2]:= InputCoordinates[XX, 2];
In[3]:= InputBasis[{XX, B1}]
Out[3]= {{XX, B1}, {1, 2}}
In[4]:= InputBasis[{XX, B2}]
Out[4]= {{XX, B1}, {1, 2}}
{{XX, B2}, {1, 2}}
In[5]:= e = ZZ[{XX, B1}]; u = ZZ[{XX, B2}];
In[6]:= InputBasisChange[{XX, B1}, {XX, B2},
{ e[1] -> u[2], e[2] -> 4 u[1] + 8 u[2] } ]
In[7]:= BasisVectorChange[{XX, B1}, {XX, B2}] // ColumnForm
Out[7]= B1[-1] -> B2[-2] - 2 B2[-1]
1
B1[-2] -> - B2[-1]
4
In[8]:= BasisFormChange[{XX, B1}, {XX, B2}] // ColumnForm
Out[8]= B1[1] -> B2[2]
B1[2] -> 4 B2[1] + 8 B2[2]
In[12]:= BasisVectorChange[{XX, B2}, {XX, B1}] // ColumnForm
Out[9]= B2[-1] -> 4 B1[-2]
B2[-2] -> 8 B1[-2] + B1[-1]
In[10]:= BasisFormChange[{XX, B2}, {XX, B1}] // ColumnForm
1
Out[10]= B2[1] -> -2 B1[1] + - B1[2]
4
B2[2] -> B1[1]
In[11]:= t1 = (X1 + X2) e[1, -1] - 3 X1 e[2, -1]
Out[11]= (X1 + X2) B1[1]*.B1[-1] - 3 X1 B1[2]*.B1[-1]
In[12]:= t2 = Change[{XX, B1}, {XX, B2}][t1]
Out[12]= -12 X1 B2[1]*.B2[-2] + 24 X1 B2[1]*.B2[-1] +
> (-23 X1 + X2) B2[2]*.B2[-2] + (46 X1 - 2 X2) B2[2]*.B2[-1]
In[13]:= Change[{XX, B2}, {XX, B1}][t2]
Out[13]= (-184 X1 + 4 (46 X1 - 2 X2) + 8 X2) B1[1]*.B1[-2] +
> (X1 + X2) B1[1]*.B1[-1] - 3 X1 B1[2]*.B1[-1]
In[14]:= TensorSimplify[{Expand}][%]
Out[14]= (X1 + X2) B1[1]*.B1[-1] - 3 X1 B1[2]*.B1[-1]
This page is maintained by XavierJaén.