Finding the orthogonal diagonalizing similarity of a symmetric matrix

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












I'm aware that there are some questions similar to this here, but none that could solve my problem.



So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the orthogonal transformation $P$ such that $P^TmP=D$ where $D$ is diagonal. Here is the last thing I have tried:



m = a*x^2, c*x*y, c*x*y, b*y^2;

vals, vecs = Simplify[Eigensystem[m], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

vecs = Simplify[Normalize /@ vecs, Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

FullSimplify[vecs.vecs[Transpose] == IdentityMatrix[2], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals]


Where the last line does not return True, but rather a matrix, in the LHS, with elements different from unit in the diagonal (but, correctly, with $0$ in the off-diagonal).



Now, if it is not clear enough, I'm really new to Mathematica and would immensely appreciate any tips such as where it would be sufficient for me to include the Assumptions and to Simplify at all in a case like this (I would say that the very last FullSimplify, with the Assumptions, would be enough, but am not sure). Besides that, my problem is that the matrix $P$, or vecs[Transpose], is not orthogonal, which because of stated facts obviously results from the fact that the eigenvectors are not normalized in the proper sense.



I have the feeling that the problem comes from some imaginary numbers not taken care of by the assumptions, but cannot quite pin it down exactly.



Now, the solution suggested in this question works perfectly and I can understand why it works, but cannot understand why the Normalize, as I used, isn't and if there isn't a less artisanal way (than the one of the link above) of solving the problem.










share|improve this question







New contributor




GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    2
    down vote

    favorite
    1












    I'm aware that there are some questions similar to this here, but none that could solve my problem.



    So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the orthogonal transformation $P$ such that $P^TmP=D$ where $D$ is diagonal. Here is the last thing I have tried:



    m = a*x^2, c*x*y, c*x*y, b*y^2;

    vals, vecs = Simplify[Eigensystem[m], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

    vecs = Simplify[Normalize /@ vecs, Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

    FullSimplify[vecs.vecs[Transpose] == IdentityMatrix[2], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals]


    Where the last line does not return True, but rather a matrix, in the LHS, with elements different from unit in the diagonal (but, correctly, with $0$ in the off-diagonal).



    Now, if it is not clear enough, I'm really new to Mathematica and would immensely appreciate any tips such as where it would be sufficient for me to include the Assumptions and to Simplify at all in a case like this (I would say that the very last FullSimplify, with the Assumptions, would be enough, but am not sure). Besides that, my problem is that the matrix $P$, or vecs[Transpose], is not orthogonal, which because of stated facts obviously results from the fact that the eigenvectors are not normalized in the proper sense.



    I have the feeling that the problem comes from some imaginary numbers not taken care of by the assumptions, but cannot quite pin it down exactly.



    Now, the solution suggested in this question works perfectly and I can understand why it works, but cannot understand why the Normalize, as I used, isn't and if there isn't a less artisanal way (than the one of the link above) of solving the problem.










    share|improve this question







    New contributor




    GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      I'm aware that there are some questions similar to this here, but none that could solve my problem.



      So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the orthogonal transformation $P$ such that $P^TmP=D$ where $D$ is diagonal. Here is the last thing I have tried:



      m = a*x^2, c*x*y, c*x*y, b*y^2;

      vals, vecs = Simplify[Eigensystem[m], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

      vecs = Simplify[Normalize /@ vecs, Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

      FullSimplify[vecs.vecs[Transpose] == IdentityMatrix[2], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals]


      Where the last line does not return True, but rather a matrix, in the LHS, with elements different from unit in the diagonal (but, correctly, with $0$ in the off-diagonal).



      Now, if it is not clear enough, I'm really new to Mathematica and would immensely appreciate any tips such as where it would be sufficient for me to include the Assumptions and to Simplify at all in a case like this (I would say that the very last FullSimplify, with the Assumptions, would be enough, but am not sure). Besides that, my problem is that the matrix $P$, or vecs[Transpose], is not orthogonal, which because of stated facts obviously results from the fact that the eigenvectors are not normalized in the proper sense.



      I have the feeling that the problem comes from some imaginary numbers not taken care of by the assumptions, but cannot quite pin it down exactly.



      Now, the solution suggested in this question works perfectly and I can understand why it works, but cannot understand why the Normalize, as I used, isn't and if there isn't a less artisanal way (than the one of the link above) of solving the problem.










      share|improve this question







      New contributor




      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm aware that there are some questions similar to this here, but none that could solve my problem.



      So, I have to diagonalize a symmetric symbolic matrix $m$ (to be seen below) and obtain the orthogonal transformation $P$ such that $P^TmP=D$ where $D$ is diagonal. Here is the last thing I have tried:



      m = a*x^2, c*x*y, c*x*y, b*y^2;

      vals, vecs = Simplify[Eigensystem[m], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

      vecs = Simplify[Normalize /@ vecs, Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals];

      FullSimplify[vecs.vecs[Transpose] == IdentityMatrix[2], Assumptions -> a > 0 && b > 0 && c > 0 && x [Element] Reals && y [Element] Reals]


      Where the last line does not return True, but rather a matrix, in the LHS, with elements different from unit in the diagonal (but, correctly, with $0$ in the off-diagonal).



      Now, if it is not clear enough, I'm really new to Mathematica and would immensely appreciate any tips such as where it would be sufficient for me to include the Assumptions and to Simplify at all in a case like this (I would say that the very last FullSimplify, with the Assumptions, would be enough, but am not sure). Besides that, my problem is that the matrix $P$, or vecs[Transpose], is not orthogonal, which because of stated facts obviously results from the fact that the eigenvectors are not normalized in the proper sense.



      I have the feeling that the problem comes from some imaginary numbers not taken care of by the assumptions, but cannot quite pin it down exactly.



      Now, the solution suggested in this question works perfectly and I can understand why it works, but cannot understand why the Normalize, as I used, isn't and if there isn't a less artisanal way (than the one of the link above) of solving the problem.







      matrix linear-algebra vector eigenvalues






      share|improve this question







      New contributor




      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 hours ago









      GaloisFan

      112




      112




      New contributor




      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      GaloisFan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          This helps:



          assumptions = a > 0 && b > 0 && c > 0 && x ∈ Reals && y ∈ Reals; 
          Simplify[vecs.vecs[Transpose] /. Abs -> RealAbs, assumptions]]



          1, 0, 0, 1




          helps. That's a typical issue when using symbolic compuations involving Norm and Normalize: Mathematica treats all variables as complex numbers. Thus, Abs[z]^2 does not equal z^2 which often prevents the crucial simplification step. Recently, RealAbs was added to the language and it allows this simplification:



          RealAbs[z]^2 // Simplify



          z^2




          Yet, it is somewhat mysterious to me that your approach did not work, because your assumptions imply that all variables are real numbers...






          share|improve this answer




















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "387"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            GaloisFan is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f181978%2ffinding-the-orthogonal-diagonalizing-similarity-of-a-symmetric-matrix%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            This helps:



            assumptions = a > 0 && b > 0 && c > 0 && x ∈ Reals && y ∈ Reals; 
            Simplify[vecs.vecs[Transpose] /. Abs -> RealAbs, assumptions]]



            1, 0, 0, 1




            helps. That's a typical issue when using symbolic compuations involving Norm and Normalize: Mathematica treats all variables as complex numbers. Thus, Abs[z]^2 does not equal z^2 which often prevents the crucial simplification step. Recently, RealAbs was added to the language and it allows this simplification:



            RealAbs[z]^2 // Simplify



            z^2




            Yet, it is somewhat mysterious to me that your approach did not work, because your assumptions imply that all variables are real numbers...






            share|improve this answer
























              up vote
              3
              down vote













              This helps:



              assumptions = a > 0 && b > 0 && c > 0 && x ∈ Reals && y ∈ Reals; 
              Simplify[vecs.vecs[Transpose] /. Abs -> RealAbs, assumptions]]



              1, 0, 0, 1




              helps. That's a typical issue when using symbolic compuations involving Norm and Normalize: Mathematica treats all variables as complex numbers. Thus, Abs[z]^2 does not equal z^2 which often prevents the crucial simplification step. Recently, RealAbs was added to the language and it allows this simplification:



              RealAbs[z]^2 // Simplify



              z^2




              Yet, it is somewhat mysterious to me that your approach did not work, because your assumptions imply that all variables are real numbers...






              share|improve this answer






















                up vote
                3
                down vote










                up vote
                3
                down vote









                This helps:



                assumptions = a > 0 && b > 0 && c > 0 && x ∈ Reals && y ∈ Reals; 
                Simplify[vecs.vecs[Transpose] /. Abs -> RealAbs, assumptions]]



                1, 0, 0, 1




                helps. That's a typical issue when using symbolic compuations involving Norm and Normalize: Mathematica treats all variables as complex numbers. Thus, Abs[z]^2 does not equal z^2 which often prevents the crucial simplification step. Recently, RealAbs was added to the language and it allows this simplification:



                RealAbs[z]^2 // Simplify



                z^2




                Yet, it is somewhat mysterious to me that your approach did not work, because your assumptions imply that all variables are real numbers...






                share|improve this answer












                This helps:



                assumptions = a > 0 && b > 0 && c > 0 && x ∈ Reals && y ∈ Reals; 
                Simplify[vecs.vecs[Transpose] /. Abs -> RealAbs, assumptions]]



                1, 0, 0, 1




                helps. That's a typical issue when using symbolic compuations involving Norm and Normalize: Mathematica treats all variables as complex numbers. Thus, Abs[z]^2 does not equal z^2 which often prevents the crucial simplification step. Recently, RealAbs was added to the language and it allows this simplification:



                RealAbs[z]^2 // Simplify



                z^2




                Yet, it is somewhat mysterious to me that your approach did not work, because your assumptions imply that all variables are real numbers...







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 hours ago









                Henrik Schumacher

                38k249108




                38k249108




















                    GaloisFan is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    GaloisFan is a new contributor. Be nice, and check out our Code of Conduct.












                    GaloisFan is a new contributor. Be nice, and check out our Code of Conduct.











                    GaloisFan is a new contributor. Be nice, and check out our Code of Conduct.













                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f181978%2ffinding-the-orthogonal-diagonalizing-similarity-of-a-symmetric-matrix%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    List of Gilmore Girls characters

                    What does second last employer means? [closed]

                    One-line joke