Algebraic Operations with Tensors Versus Matrices:
Emphasis on Operations in Appendix A.3
 

Appendix A.3 and A.4 define some important operations on tensors or, as we will interpret them, matrices.   Note in Maple 9.5 it may be necessary to employ the functions act and map, for tensors and matrices respectively in order to achieve a given operation.  In Maple 10, this does not seem necessary so I will not treat this subject.  In general, it seems that Maple has overloaded all of its scalar functions to work with matrices and,in some cases, tensors as well. 

 

First addition and subtraction for matrices proceed as expected and follow the same rules as Appendix A.3-12. 

 

> `+`(`τMatrix`(x, y, z), `τMatrix`(x, y, z)); 1
 

Matrix(%id = 148187652) 

 

However, for tensors, even after simplifying, the expected result is not evident. 

 

> simplify(`+`(`τTensor`(x, y, z), `τTensor`(x, y, z)), size); 1
 

`+`(table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]), table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]))
`+`(table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]), table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]))
`+`(table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]), table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]))
`+`(table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]), table([index_char = [-1, -1], compts = Matrix(%id = 148815172)]))
 

 

The same seems to be true for multiplication by a scalar.  Matrices, on the other hand, do behave as expected.  For instance, multiplication by a scalar gives a result that is equivalent to A.3-13. 

 

> 3*`τMatrix`(x, y, z); 1
 

Matrix(%id = 150477880) 

 

Meanwhile, tensors do not behave as expected.  In fact, neither the comand eval nor the simplify command seems to get the desired result for scalar multiplication. 

 

> simplify(eval(3.*`τTensor`(x, y, z)), size); 1
 

3.*table([index_char = [-1, -1], compts = Matrix(%id = 151117292)])
3.*table([index_char = [-1, -1], compts = Matrix(%id = 151117292)])
 

 

Given the akward tendencies of tensors, their use will be ignored from this point.  Instead, matrices will be discussed. 

 

Nonetheless, even using matrices, it seems that the double dot product of a matrix with a matrix, is not a predefined function in Maple.  Fortunately, the dot product (or matrix-matrix multiplication) is defined, as seen below. 

 

> Typesetting:-delayDotProduct(`τMatrix`(x, y, z), `τMatrix`(xx, yy, zz)); 1
 

Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
Matrix(%id = 150343064)
 

 

We can calculate other quantities as well such as the vector product (or dot product) of a matrix with a vector. 

 

> Typesetting:-delayDotProduct(`τMatrix`(x, y, z), v(x, y, z)); 1
 

Vector[column](%id = 150762720) 

 

Nonetheless the cross product of a matrix with a vector does not seem to work. 

 

> CrossProduct(`τMatrix`, v(x, y, z)); 1
 

Error, (in ProcToVectorField) the procedure must evaluate to a Vector