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

Spacecraft allows conversion for singular conic section.

    Details

      Description

      See GMT-1770 attachment for procedures to duplicate this bug. See table 1.14 on pg 8.

      Here is the fix, which I have updated in the math spec.

      In CoordUtil.cpp, change lines 294 through 299 to

      if (Abs(1 - e) < 1E-7)

      { throw UtilityException ("CoordUtil::CartesianToKeplerian() " "Warning: A nearly parabolic orbit was encountered while converting from the Cartesian state to the Keplerian elements. The Keplerian elements are undefined for a parabolic orbit.\n"); }

      at line 303, add the following

      if (Abs(a*(1 - e) < .001)

      { throw UtilityException ("CoordUtil::CartesianToKeplerian() " "Warning: A nearly singular conic section was encountered while converting from the Cartesian state to the Keplerian elements. The radius of periapsis must be greater than 1 meter.\n"); }

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            gmat_wcs Wendy Shoan added a comment -

            In this expression :

            Abs(a*(1 - e) < .001

            do you mean 'sma' for 'a'?

            Also, the specified text for the error message does not match what is expected in STC-19 Step 5. Should it? Or will the text in the document be modified?

            Show
            gmat_wcs Wendy Shoan added a comment - In this expression : Abs(a*(1 - e) < .001 do you mean 'sma' for 'a'? Also, the specified text for the error message does not match what is expected in STC-19 Step 5. Should it? Or will the text in the document be modified?
            Hide
            gmat_wcs Wendy Shoan added a comment -

            Also, I made these changes and I do not get any error messages at all for steps 5, 6, or 7 of STC-19.

            The conversions maybe are done somewhere else?

            Show
            gmat_wcs Wendy Shoan added a comment - Also, I made these changes and I do not get any error messages at all for steps 5, 6, or 7 of STC-19. The conversions maybe are done somewhere else?
            Hide
            gmat_wcs Wendy Shoan added a comment -

            I have updated the code for all 3 of these conversions and I do get an error message now. However, it does not appear to be the correct (or at least expected) one.

            It is failing the first check (for a parabolic orbit) before it gets to the check for a singular conic section.

            Debug from Equinoctial shows:

            StateConverter::FromCartesian() toType=Equinoctial, anomalyType=True Anomaly
            state=6999.998216286 0 -5.00235926377 10.63431352889 0 -0.003772975815698
            Equinoctial ... failing check for parabolic orbit ... e = 0.9999999982

            Show
            gmat_wcs Wendy Shoan added a comment - I have updated the code for all 3 of these conversions and I do get an error message now. However, it does not appear to be the correct (or at least expected) one. It is failing the first check (for a parabolic orbit) before it gets to the check for a singular conic section. Debug from Equinoctial shows: StateConverter::FromCartesian() toType=Equinoctial, anomalyType=True Anomaly state=6999.998216286 0 -5.00235926377 10.63431352889 0 -0.003772975815698 Equinoctial ... failing check for parabolic orbit ... e = 0.9999999982
            Hide
            gmat_wcs Wendy Shoan added a comment -

            I have updated the code for this Bug, so that the exception uses text mostly matching that listed in STC-19.

            However, as we discussed, I never get the singular conic section message, as it fails the first test (nearly parabolic) first.

            Also, you (Steve) were going to look at the other places in the code (CoordUtil, Keplerian, ModKeplerian, StateConverter) where, for different conditions than mentioned in the Bug, it is either:

            • throwing an exception (should it be the same text as listed in STC-19?), or
            • putting up a warning only (should it be an error/exception? with the text from STC-19?)
            Show
            gmat_wcs Wendy Shoan added a comment - I have updated the code for this Bug, so that the exception uses text mostly matching that listed in STC-19. However, as we discussed, I never get the singular conic section message, as it fails the first test (nearly parabolic) first. Also, you (Steve) were going to look at the other places in the code (CoordUtil, Keplerian, ModKeplerian, StateConverter) where, for different conditions than mentioned in the Bug, it is either: throwing an exception (should it be the same text as listed in STC-19?), or putting up a warning only (should it be an error/exception? with the text from STC-19?)
            Hide
            shughes Steven Hughes added a comment -

            This issue only appears when near a singularity that does not happen in flight. So I'm switching it to P2.

            Show
            shughes Steven Hughes added a comment - This issue only appears when near a singularity that does not happen in flight. So I'm switching it to P2.
            Hide
            shughes Steven Hughes added a comment -

            CCB: P1 2012a

            Show
            shughes Steven Hughes added a comment - CCB: P1 2012a
            Hide
            shughes Steven Hughes added a comment -

            CCB: 2013a P2

            Show
            shughes Steven Hughes added a comment - CCB: 2013a P2
            Hide
            shughes Steven Hughes added a comment -

            I verified the invalid input is caught in 4 July 2004 build.

            I see the same error message as wendy. However, the error message is correct. There are several checks that occur for a singular conic section and I assumed erroneously which check happened first.

            Show
            shughes Steven Hughes added a comment - I verified the invalid input is caught in 4 July 2004 build. I see the same error message as wendy. However, the error message is correct. There are several checks that occur for a singular conic section and I assumed erroneously which check happened first.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: