Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Transform components of tensors with arbitrary rank with regard to their transformation behavior under any given mapping
ResourceFunction["TensorCoordinateTransform"][tensor,mat] transform tensor components according to their transformation behavior matrix mat. All tensor slots are considered to be contravariant and not normalized. |
"TransformationBehavior" | "AllContravariant" | transformation behavior of individual components |
"Normalize" | False | whether the components are represented with respect to a normalized basis |
Apply a rotation transformation to a tensor:
In[1]:= | ![]() |
Out[1]= | ![]() |
Rotate vector components about the three axes counterclockwise:
In[2]:= | ![]() |
Out[2]= | ![]() |
Change the axis:
In[3]:= | ![]() |
Out[3]= | ![]() |
Rotate the rank-2 tensor about the three axes counterclockwise:
In[4]:= | ![]() |
Out[4]= | ![]() |
Rotate a rank-4 tensor with three symmetries about the three axes counterclockwise:
In[5]:= | ![]() |
Out[6]= | ![]() |
The contravariant vector components with respect to covariant bases are a=vjbj=vi'bi'. The old system is Cartesian (aj=vj):
In[7]:= | ![]() |
Consider a transformation between new ei' and old ej covariant base vectors e1'=2e1+3e2+1e3, e2'=1e1+2e2+2e3 and e3'=1e1+2e3. Here are the contravariant components vi' of the new system:
In[8]:= | ![]() |
Out[8]= | ![]() |
They should be the same vector:
In[9]:= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
The covariant vector components with respect to contravariant bases are a=vjbj=vi'bj'
In[12]:= | ![]() |
Out[12]= | ![]() |
Find related contravariant base vectors bi' by transforming the covariant base in contravariant sense (index juggling bi'→bi'):
In[13]:= | ![]() |
Out[13]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
Note that covariant and contravariant base vectors are inverse to each other bi'bj'=δi'j':
In[16]:= | ![]() |
Out[16]= | ![]() |
Consider the aibi≡cijklskltjbi=ci'j'k'l'sk'l'tj'bi'≡ai'bi'-invariant tensors in Cartesian frame:
In[17]:= | ![]() |
The transformation from Cartesian to local torus coordinates (i→i'):
In[18]:= | ![]() |
The torus surface at α=β=0…2π, with R and r constant:
In[19]:= | ![]() |
Out[19]= | ![]() |
Transform tensors' different ranks regarding the local torus base with respect to transformation behavior. This is faster than transformation of an entire assembled rank-7 tensor):
In[20]:= | ![]() |
Local covariant base vector bi':
In[21]:= | ![]() |
Assemble the tensor term by contracting the right indices ci'j'k'l'sk'l'tj'bi≡ai'bi':
In[22]:= | ![]() |
Out[22]= | ![]() |
In[23]:= | ![]() |
Out[23]= | ![]() |
The result should be the same in the Cartesian system:
In[24]:= | ![]() |
Out[24]= | ![]() |
If the base vectors are not normalized ("Normalize"→False), i.e. if they have local-dependent lengths (and are not orthogonal in general reference systems either), the corresponding tensor components are transformed according to their co- and contravariant transformation behaviors. This leads to different representations of the same tensor object.
Here is an example of all four transforming possibilities of a rank-2 tensor to a local, non-normalized cylindrical system:
In[25]:= | ![]() |
All coordinates transform the contravariant tij (default):
In[26]:= | ![]() |
Out[26]= | ![]() |
All coordinates transform the covariant tij:
In[27]:= | ![]() |
Out[27]= | ![]() |
A tensor object with coordinates of mixed-transformation behavior tij:
In[28]:= | ![]() |
Out[28]= | ![]() |
A tensor object with coordinates of opposite mixed-transformation behavior tji:
In[29]:= | ![]() |
Out[29]= | ![]() |
Nomenclature referencing all indices together or each index separately is interchangeable:
In[30]:= | ![]() |
Out[30]= | ![]() |
This is analogous for the covariant transformation:
In[31]:= | ![]() |
Out[31]= | ![]() |
Transformed contravariant vector components with respect to normalized base vectors:
In[32]:= | ![]() |
Out[32]= | ![]() |
The same transformed contravariant vector components with respect to non-normalized base vectors (default):
In[33]:= | ![]() |
Out[33]= | ![]() |
Transformed covariant normalized base vectors:
In[34]:= | ![]() |
Out[34]= | ![]() |
The contraction of the assigned tensors should be produce invariance:
In[35]:= | ![]() |
Out[35]= | ![]() |
Tensor components with respect to an orthonormal cylindrical system:
In[36]:= | ![]() |
Out[35]= | ![]() |
TransformedField also assumes a normalized base:
In[37]:= | ![]() |
Out[37]= | ![]() |
In[38]:= | ![]() |
Out[38]= | ![]() |
With orthonormal reference systems (e.g. normalized cylindrical systems), no distinction between co- and contravariant transformation behavior is required:
In[39]:= | ![]() |
Out[39]= | ![]() |
In[40]:= | ![]() |
Hook's general law describes a linear relationship between the components of the rank-2 stress tensor σ and the two-stage strain tensor ε using the rank-4 tensor C: σij=Cijklεkl with the symmetries σij=σji, εkl=εlk and Eijkl=Ejikl=Eijlk=Eklij.
Components of the general, fully anisotropic stiffness tensor with initial symmetries:
In[41]:= | ![]() |
Out[37]= | ![]() |
The number of independent components:
In[42]:= | ![]() |
Out[42]= | ![]() |
One plane of symmetry, rotated by 180 degrees, results in the same stiffness:
In[43]:= | ![]() |
Out[44]= | ![]() |
This results in a stiffness tensor with fewer independent components:
In[45]:= | ![]() |
Out[20]= | ![]() |
Determination and comparison of different material symmetries:
In[46]:= | ![]() |
In[47]:= | ![]() |
In[48]:= | ![]() |
Summary:
In[49]:= | ![]() |
Out[49]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License