Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-7021

Incorrect matrix inverse calculated by Rmatrix::Inverse()

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: P1
    • Resolution: Fixed
    • Affects Version/s: R2018A
    • Fix Version/s: None
    • Component/s: Utilties
    • Labels:

      Description

      The matrix inverse calculated by Rmatrix::Inverse() can be incorrect. The inverse that GMAT calculates for the following matrix does not provide the identity when it is multiplied by the original matrix, the result is not the identity matrix

            Rmatrix test(3, 3, 0.59492810196097023, 0.0, 0.0,
                               0.0061069648389752013, 0.57948825437340046, 0.0,
                               -0.040047793631885792, -0.0069358918035562576, 0.60471814035482963);
      
            Rmatrix testInv = test.Inverse();
            Rmatrix identityTest1 = test * testInv;
            Rmatrix identityTest2 = testInv * test;
      
      

      Neither of the matrices which should be identity are identity, and the largest off diagonal element is -0.09. The matrix being inverted has a condition number of 1.073, and MATLAB is able to correctly invert it.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: