I need to solve the following matrix equation to find a set of solutions for matrices A and Q which satisfy the conditions.
Q = Array[x, {3, 3}];
A = {{a, 0, 1}, {0, a, -1}, {1, -1, a - 1}};
sol = FindInstance[
Transpose[Q] . A . Q == {{b, 0, 0}, {0, c, 0}, {0, 0, 0}} &&
Transpose[Q] . Q == IdentityMatrix[3] && b > 0 && c > 0,
{a, b, c, x[1, 1], x[1, 2], x[1, 3], x[2, 1], x[2, 2], x[2, 3],
x[3, 1],
x[3, 2], x[3, 3]}]
However, the above code takes about 300 seconds to output a set of solutions that meet the requirements. How can I improve this code to get a set of solutions that meet the requirements quickly?
A set of solutions satisfying conditions:
A={{2, 0, 1}, {0, 2, -1}, {1, -1, 1}};
Q={{-(1/Sqrt[2]), -(1/Sqrt[3]), 1/Sqrt[6]},
{-(1/Sqrt[2]), 1/Sqrt[3], -(1/Sqrt[6])},
{0, -(1/Sqrt[3]), -Sqrt[2/3]}};
Updated content & Additional questions:
Q = Array[x, {3, 3}];
A = {{1 - a, 1 + a, 0}, {1 + a, 1 - a, 0}, {0, 0, 2}} /. a -> 2;
FindInstance[
Thread[Transpose[Q] . A . Q == {{-4, 0, 0}, {0, 2, 0}, {0, 0, 2}}],
Flatten[Q], Reals]
Since Q is required to be a real matrix, the above code has been running and cannot return results. How can I quickly get a set of solutions that meet the requirements?
Q = EulerMatrix[{a, b, c}]; A = {{f, 0, 1}, {0, f, -1}, {1, -1, f - 1}}; sol = FullSimplify[FindInstance[Transpose[Q] . A . Q == {{d, 0, 0}, {0, e, 0}, {0, 0, 0}} && 0 <= a <= 2*Pi && 0 <= b <= 2*Pi && 0 <= c <= 2*Pi && d > 0 && e > 0, {a, b, c, d, e, f}]]– A little mouse on the pampas Aug 13 '20 at 09:54Select[Solve[eqn,Flatten@{Q,a,b,c}],b>0&&c>0/.#&]– chyanog Aug 13 '20 at 10:17Eigensystemfor your second problem. I updated my answer below. – Hausdorff Aug 18 '20 at 09:04