How to solve symbolic problem for two equal matrices?

There's a rank-4 tensor C written in Mandel-Kelvin notation as 6by6 matrix. Assume it's orthotropic. After I rotate it, C2 = R*C*R', where R is provided in this form: https://scicomp.stackexchange.com/questions/35600/4th-order-tensor-rotation-sources-to-refer#:~:text=In%20this%20case%2C%20you%20can%20rotate%20stiffness%20and%20compliance%20tensors%20with . I want to equate C2 and C using symbolic variables as C11, C22,... But when I use: S = solve(C2 == C), matlab return all Cij = 0. That's not right. Any one can help me with that? I'm quite confused. Thanks in advance.

5 comentarios

Sam Chak
Sam Chak el 28 de Abr. de 2022
Can you share your fully MATLAB code here that results in MATLAB returns all ?
Torsten
Torsten el 28 de Abr. de 2022
But when I use: S = solve(C2 == C), matlab return all Cij = 0. That's not right.
Why do you think it's not right ?
C being the 0 matrix, if C2 is also the 0 matrix, is one solution to the problem. It may not be the one you expected, but it is valid.
As a simpler example, if I told you "I'm thinking of two numbers. Their average is 3. What are the numbers?" one solution is 3 and 3. Another solution is 6 and 0. Those may not be the solutions you had in mind, but they are both valid.
@Steven Lord I think you're right. The 0 solution is valid. Thank you.
@Sam Chak @Steven Lord
This is my code. I assumed that after calculation, I can solve 9 equations w.r.t Cij.
Vec_x = 0.5774; Vec_y = Vec_x; Vec_z = Vec_x; theta = 30;
Rot = [cosd(theta)+(Vec_x)^2 * (1-cosd(theta)), ...
Vec_x*Vec_y*(1-cosd(theta))-Vec_z*sind(theta), ...
Vec_x*Vec_z*(1-cosd(theta))+Vec_y*sind(theta); ...
Vec_y*Vec_x*(1-cosd(theta))+Vec_z*sind(theta), ...
cosd(theta)+(Vec_y)^2 * (1-cosd(theta)), ...
Vec_y*Vec_z*(1-cosd(theta))-Vec_x*sind(theta); ...
Vec_z*Vec_x*(1-cosd(theta))-Vec_y*sind(theta), ...
Vec_z*Vec_y*(1-cosd(theta))+Vec_x*sind(theta), ...
cosd(theta)+(Vec_z)^2 * (1-cosd(theta))];
syms C11 C12 C13 C22 C23 C33 C44 C55 C66
MK = [Rot(1,1)^2, Rot(1,2)^2, Rot(1,3)^2, ...
sqrt(2)*Rot(1,2)*Rot(1,3), sqrt(2)*Rot(1,1)*Rot(1,3), sqrt(2)*Rot(1,1)*Rot(1,2);...
Rot(2,1)^2, Rot(2,2)^2, Rot(2,3)^2, ...
sqrt(2)*Rot(2,2)*Rot(2,3), sqrt(2)*Rot(2,1)*Rot(2,3), sqrt(2)*Rot(2,1)*Rot(2,2);...
Rot(3,1)^2, Rot(3,2)^2, Rot(3,3)^2, ...
sqrt(2)*Rot(3,2)*Rot(3,3), sqrt(2)*Rot(3,1)*Rot(3,3), sqrt(2)*Rot(3,1)*Rot(3,2);...
sqrt(2)*Rot(2,1)*Rot(3,1), sqrt(2)*Rot(2,2)*Rot(3,2), sqrt(2)*Rot(2,3)*Rot(3,3),...
Rot(2,2)*Rot(3,3)+Rot(2,3)*Rot(3,2), Rot(2,1)*Rot(3,3)+Rot(2,3)*Rot(3,1), Rot(2,1)*Rot(3,2)+Rot(2,2)*Rot(3,1); ...
sqrt(2)*Rot(1,1)*Rot(3,1), sqrt(2)*Rot(1,2)*Rot(3,2), sqrt(2)*Rot(1,3)*Rot(3,3),...
Rot(1,2)*Rot(3,3)+Rot(1,3)*Rot(3,2), Rot(1,1)*Rot(3,3)+Rot(1,3)*Rot(3,1), Rot(1,1)*Rot(3,2)+Rot(1,2)*Rot(3,1); ...
sqrt(2)*Rot(1,1)*Rot(2,1), sqrt(2)*Rot(1,2)*Rot(2,2), sqrt(2)*Rot(1,3)*Rot(2,3),...
Rot(1,2)*Rot(2,3)+Rot(1,3)*Rot(2,2), Rot(1,1)*Rot(2,3)+Rot(1,3)*Rot(2,1), Rot(1,1)*Rot(2,2)+Rot(1,2)*Rot(2,1); ...
];
C = [C11 C12 C13 0 0 0; C12 C22 C23 0 0 0; C13 C23 C33 0 0 0;...
0 0 0 2*C44 0 0; 0 0 0 0 2*C55 0; 0 0 0 0 0 2*C66];
C_rot = MK * C * transpose(MK);
S = solve(C_rot == C)

Iniciar sesión para comentar.

 Respuesta aceptada

Torsten
Torsten el 29 de Abr. de 2022
Editada: Torsten el 29 de Abr. de 2022
If you add the two lines
[A,b] = equationsToMatrix(C_rot - C==0);
rank(A)
you'll see that
rank(A) = 9.
Thus your system only permits the trivial solution that all C's are zero.
Since MK is regular, everything else would have been surprising.

3 comentarios

Thank you
rank() of a symbolic matrix that involves variables often does not recognize identities though.
Torsten
Torsten el 29 de Abr. de 2022
Editada: Torsten el 29 de Abr. de 2022
The matrix does not involve variables - it's pure "numeric-symbolic".

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear Algebra en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Abr. de 2022

Editada:

el 30 de Abr. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by