Example “RUBY/EX32/orthogonalTensor.rb” shows how a non-symmetric orthogonal tensor can be used to rotate and diagonalize the components of a stress tensor, and how the reverse operation also can be done.
The orthogonal rotation tensor is produced by calculating the eigenvectors of stress tensor:
s1,v1,s2,v2,s3,v3=stress.eigenQR() q=Result.assembleTensorFrom3Vectors(v1,v2,v3)
This tensor can be used to diagonalize the stress tensor:
diag_stress=Result.directRotation(q,stress)
And this is the reverse operation:
restored_stress=Result.inverseRotation(q,diag_stress)
Example “RUBY/EX32/orthogonalTensor.rb” also prints the Results in text files that allow checking the effectivity of rotation. We see that the rotation that has been generated using the stress tensor eigen vectors are not perfect because rotated tensor is not purely diagonal, but very close to. On the other hand, the restoration of initial tensor by the reverse rotation is nearly perfect.