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

Numerical integration errors for long simulations

    Details

    • Sprint:
      R2019a

      Description

      I was performing long duration lifetime simulations for an operational mission. I used RSSStep error control using PD78 and RK89 propagators. The MaxStep was set at 60, 600, or 3600 seconds. Some of the errors generated seemed to indicate that the MaxStep setting was being ignored:

      ODEModel Exception Thrown: The ForceModel FM generated a derivative that is not a number

      ODEModel Exception Thrown: The ForceModel Earth2Body generated a derivative that is infinite
      Mission run failed.

      Integrator attempted too many steps! (51 attempts taken)
      Command Exception: In Propagate::TakeAStep, Propagator PD78_Clone failed to take a good final step (size = 11432.001869552834)
      Mission run failed.

      Integrator attempted too many steps! (51 attempts taken)
      Command Exception: In Propagate::TakeAStep, Propagator PD78_Clone failed to take a good final step (size = -8742.481554000000)
      Mission run failed.

      When running a number of different scripts, these errors occur frequently but are hard to reproduce reliably for any given script. I will try to create a script where the error occurs somewhat frequently.

      For runs that do finish without error, I am concerned about the accuracy of the results. I did two comparisons with other s/w:
      (1) for a 13 year run, the difference s/w was 3 months.
      (2) for a longer run, the difference was about a decade. Needs more digging.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              shughes Steven Hughes added a comment -

              This is not easy to duplicate and takes a long time during a run before encountering.

              Show
              shughes Steven Hughes added a comment - This is not easy to duplicate and takes a long time during a run before encountering.
              Hide
              shughes Steven Hughes added a comment -

              Several projects have encountered this. I tracked back to at least R2015a.

              Show
              shughes Steven Hughes added a comment - Several projects have encountered this. I tracked back to at least R2015a.
              Hide
              shughes Steven Hughes added a comment -

              Code review of final step may help as the step was attempted outside of the max step bound which should not be allowed.

              Show
              shughes Steven Hughes added a comment - Code review of final step may help as the step was attempted outside of the max step bound which should not be allowed.
              Hide
              shughes Steven Hughes added a comment -

              The AutomatedTranfser script hits the issue after about 30 minutes on Windows.

              Show
              shughes Steven Hughes added a comment - The AutomatedTranfser script hits the issue after about 30 minutes on Windows.
              Hide
              djcinsb Darrel Conway added a comment - - edited

              The issue is occurring in the secant method code. For this script, the problem computation is this line (around line 5900; I've added debug so don't have an exact reference):

                          secsToStep = x[1] + (target - y[1]) / slope;
              

              The variables have the values like

                 x[1] = -19891.033011
                 target = 0
                 y[1] = -0.88410807986504347
                 slope = 1.4978978596506199e-07
              

              making secsToStep = 4150150.8742128466 (for this case), larger than the max step of 86400.0 set in the script. A bit later we get secsToStep = 1025962.876169892. And so forth. Eventually we hit a case where secsToStep = -13940370.879468121, caused because slope = 5.4958855838848272e-08, and the integrator chokes.

              Note: The code where I'm trapping the issue uses a non-time based stopping condition. The time based stop has a similar setup, so once a fix is made here, we'll need to make it there as well.

              Expect a fix after I spend a bit of time pondering how to do it.

              Show
              djcinsb Darrel Conway added a comment - - edited The issue is occurring in the secant method code. For this script, the problem computation is this line (around line 5900; I've added debug so don't have an exact reference): secsToStep = x[1] + (target - y[1]) / slope; The variables have the values like x[1] = -19891.033011 target = 0 y[1] = -0.88410807986504347 slope = 1.4978978596506199e-07 making secsToStep = 4150150.8742128466 (for this case), larger than the max step of 86400.0 set in the script. A bit later we get secsToStep = 1025962.876169892. And so forth. Eventually we hit a case where secsToStep = -13940370.879468121, caused because slope = 5.4958855838848272e-08, and the integrator chokes. Note: The code where I'm trapping the issue uses a non-time based stopping condition. The time based stop has a similar setup, so once a fix is made here, we'll need to make it there as well. Expect a fix after I spend a bit of time pondering how to do it.
              Hide
              dcooley Steve Cooley added a comment - - edited

              I attach a script, Not_a_number, that generates the following error:

              ODEModel Exception Thrown: The ForceModel FM generated a derivative that is not a number

                  • Mission run failed.

              This occurs since I changed the May/June 2018 flux values from about 75 to 100.
              Perhaps, the bigger jump in flux May 1 and July 1 causes problems. Not sure why this would happen since this is only a 100 second propagation starting June 13 2018. (MinStep=0, MaxStep=600).

              Show
              dcooley Steve Cooley added a comment - - edited I attach a script, Not_a_number, that generates the following error: ODEModel Exception Thrown: The ForceModel FM generated a derivative that is not a number Mission run failed. This occurs since I changed the May/June 2018 flux values from about 75 to 100. Perhaps, the bigger jump in flux May 1 and July 1 causes problems. Not sure why this would happen since this is only a 100 second propagation starting June 13 2018. (MinStep=0, MaxStep=600).
              Hide
              djcinsb Darrel Conway added a comment -

              (Note for when this is worked) To see the issue in the secant method, add this debug:

              Real Propagate::RefineFinalStep(Real secsToStep, StopCondition *stopper)
              {
                 #ifdef DEBUG_SECANT_DETAILS
                    MessageInterface::ShowMessage("\nRefineFinalStep(%16.13lf) entered.\n",
                          secsToStep);
                 #endif
              
                 if (secsToStep > 864000.0)
                    MessageInterface::ShowMessage("SecsToStep too big: %16.13lf\n", secsToStep);
              
                 bool closeEnough = false;
              
              Show
              djcinsb Darrel Conway added a comment - (Note for when this is worked) To see the issue in the secant method, add this debug: Real Propagate::RefineFinalStep(Real secsToStep, StopCondition *stopper) { #ifdef DEBUG_SECANT_DETAILS MessageInterface::ShowMessage("\nRefineFinalStep(%16.13lf) entered.\n", secsToStep); #endif if (secsToStep > 864000.0) MessageInterface::ShowMessage("SecsToStep too big: %16.13lf\n", secsToStep); bool closeEnough = false;

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated: