1
$\begingroup$

There are some indications that the following matrix congruence might have a one-dimensional family of solutions. Also this discussion is relevant

a = DiagonalMatrix[{5, 4, 3}]
b = DiagonalMatrix[{3, 4, 5}]
X = Array[x, {3, 3}]
r = NSolve[
  Transpose[X].a.X == b && (Transpose[X].X)[[1, 1]] == 
    1 && (Transpose[X].X)[[2, 2]] == 1 && (Transpose[X].X)[[3, 3]] == 
    1, Flatten[X], Reals, WorkingPrecision -> 32]

This is clearly a solution

X={{0,0,1},{0,1,0},{1,0,0}}

I am curious if there are other real solutions. However, MA cannot find even the obvious one. Suggestion of experts how to obtain these (preferably the whole family) solutions are appreciated.

$\endgroup$

1 Answer 1

1
$\begingroup$

Rewrite your expression to remove the equalities (which are hard for real-valued equations) and represent it as a minimization problem. This gives an answer without trouble:

NMinimize[
 Norm[Flatten[{Thread[Transpose[X].a.X - b], (Transpose[X].X)[[1, 1]] - 
     1, (Transpose[X].X)[[2, 2]] - 1, (Transpose[X].X)[[3, 3]] - 1}]], Flatten[X]]
$\endgroup$
1
  • $\begingroup$ In contrast to Solve, the Minimization method is quite stable. It was unexpected to me. $\endgroup$
    – yarchik
    May 3, 2019 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.