In[1]:= Coordinates[XX]
Out[1]= {X1, X2, X3}
In[2]:= InputCoordinates[XX, 4]
Out[2]= {XX, {X1, X2, X3, X4}}
In[3]:= Coordinates[XX]
Out[3]= {X1, X2, X3, X4}
Besides the default coordinate system we can define as much coordinate
systems as we want using InputCoordinates. For instance, we can
define the cartesian coordinates in a 2-dimensional space with name cart2
and symbols {x, y} and the spherical coordinates sph
in a 3-dimensional space with coordinate symbols {r,theta,phi}.
A coordinate symbol cannot be used twice in the same system but there is
no problem in using an identical symbol in another coordinate system. For
example, the system cart2 and the system cart3 with symbols
{x,
y, z} can be used without problems during the same session.
In[4]:= InputCoordinates[cart2, {x, y}]
Out[4]= {XX, {X1, X2, X3, X4}}
{cart2, {x, y}}
In[5]:= InputCoordinates[cart3, {x, y, z}]
Out[5]= {XX, {X1, X2, X3, X4}}
{cart2, {x, y}}
{cart3, {x, y, z}}
In[6]:= InputCoordinates[sph, {r, theta, phi}]
Out[6]= {XX, {X1, X2, X3, X4}}
{cart2, {x, y}}
{cart3, {x, y, z}}
{sph, {r, theta, phi}}
The output of InputCoordinates shows in column form the coordinate
systems defined until now. If we decide to change the symbols of the previous
coordinates, two things have to be done:
Clear the old
ones using ClearCoordinates
enter them again.
In[7]:= ClearCoordinates[sph]
Out[7]= {XX, {X1, X2, X3, X4}}
{cart2, {x, y}}
{cart3, {x, y, z}}
In[8]:= InputCoordinates[sph, {r, th, ph}]
Out[8]= {XX, {X1, X2, X3, X4}}
{cart2, {x, y}}
{cart3, {x, y, z}}
{sph, {r, th, ph}}
Besides clearing the coordinate system, ClearCoordinates has other
effects as will be see in How to clear. If
we want to know which coordinate systems have been declared so far, we
can use CoordinateNames. On the other hand, Dimension
yields the dimension of the coordinate system.
In[9]:= CoordinateNames
Out[9]= {XX, {X1, X2, X3, X4}}
{cart2, {x, y}}
{cart3, {x, y, z}}
{sph, {r, th, ph}}
In[10]:= Dimension[sph]
Out[10]= 3
:
the symbol used to name the natural basis is the same as that of the corresponding
coordinate system.
In consequence, the notation for the basis elements is:
coords[-i]
coords[i]
dxi
Instead of i , it is also possible to use xi:
coords[-xi]
coords[xi]
dxi
The minus sign is associated with the lower position of the index in
.
This is a general rule of TTC: a minus sign appears every
time you want to indicate that an index is a subscript of a tensor or of
a tensor component.
: a lower index in both, a basis element or a component
of a tensor, is indicated in TTC by a minus sign.
In[1]:= InputCoordinates[cart, {x, y, z}]
Out[1]= {XX, {X1, X2, X3}}
{cart, {x, y, z}}
In[2]:= XX[-1]
Out[2]= DX1
In[3]:= XX[3]
Out[3]= dX3
In[4]:= cart[-z]
Out[4]= Dz
In[5]:= cart[3]
Out[5]= dz
As you can see, the TTC output imitates the mathematical
notation making the substitutions ![]()
and the form
![]()
In[6]:= cart[x] Out[6]= dx In[7]:= v = a x cart[-1] + 3 cart[-y] - y cart[-3] Out[7]= -y Dz + 3 Dy + a x Dx In[8]:= w = 5 f[x] cart[2] - cart[z] Out[8]= 5 f[x] dy - dz
This page is maintained by XavierJaén.