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

Implement a ScriptDebug command

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: P1
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: Someday
    • Component/s: Base
    • Labels:
      None

      Description

      Sometimes it would be useful to know where an issue occurs in the mission sequence. One way to do that is to add a command to GMAT that allows the user to generate output to the message window showing the current script command that is about to execute. Here is some pseudoscripting for how to make this work:

      BeginMissionSequence
      Propagate
      Propagate
      Target
      ...
      EndTarget

      ScriptDebug On

      Propagate
      Optimize
      ...
      EndOptimize
      Target
      ...
      EndTarget

      ScriptDebug Off

      Propagate
      Report
      ...

      The ScriptDebug command should be idempotent (turning it on and then turning it on again shoule be just like doing it one time) and should generate output something like this (taken from a functional piece of debug):

      Interpreting scripts from the file.
      ***** file: /home/djc/gsfcgmat/GmatDevelopment/application/samples/Ex_HohmannTransfer.script
      Successfully interpreted the script
      Running mission...
      CurrentCommand: BeginMissionSequence;
      CurrentCommand: Propagate 'Prop to Perigee' DefaultProp(DefaultSC) {DefaultSC.Periapsis};
      CurrentCommand: Propagate 'Prop to Perigee' DefaultProp(DefaultSC) {DefaultSC.Periapsis};
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      ********************************************************
      *** Performing Differential Correction (using "DC")
      *** 2 variables; 2 goals
         Variables:  TOI.Element1, GOI.Element1
         Goals:  DefaultSC.Earth.RMAG, DefaultSC.ECC
         SolverMode:  Solve
      ********************************************************
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
        -->    Maneuver 'Apply TOI' TOI(DefaultSC);
        -->    Propagate 'Prop to Apogee' DefaultProp(DefaultSC) {DefaultSC.Apoapsis};
        -->    Propagate 'Prop to Apogee' DefaultProp(DefaultSC) {DefaultSC.Apoapsis};
        -->    Achieve 'Achieve RMAG' DC(DefaultSC.Earth.RMAG = 42165, {Tolerance = 0.1});
        -->    Vary 'Vary GOI.V' DC(GOI.Element1 = 0.5, {Perturbation = 0.0001, Lower = 0, Upper = 3.14159, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});
        -->    Maneuver 'Apply GOI' GOI(DefaultSC);
        -->    Achieve 'Achieve ECC' DC(DefaultSC.ECC = 0, {Tolerance = 0.1});
        -->    EndTarget;
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      DC Iteration 1; Nominal Pass
         Variables:  TOI.Element1 = 0.5, GOI.Element1 = 0.5
         Goals and achieved values:
            DefaultSC.Earth.RMAG  Desired: 42165  Achieved: 9746.50992622  Variance: 32418.4900738
            DefaultSC.ECC  Desired: 0  Achieved: 0.0136536689069  Variance: -0.0136536689069
      
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
        -->    Maneuver 'Apply TOI' TOI(DefaultSC);
        -->    Propagate 'Prop to Apogee' DefaultProp(DefaultSC) {DefaultSC.Apoapsis};
        -->    Propagate 'Prop to Apogee' DefaultProp(DefaultSC) {DefaultSC.Apoapsis};
        -->    Achieve 'Achieve RMAG' DC(DefaultSC.Earth.RMAG = 42165, {Tolerance = 0.1});
        -->    Vary 'Vary GOI.V' DC(GOI.Element1 = 0.5, {Perturbation = 0.0001, Lower = 0, Upper = 3.14159, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});
        -->    Maneuver 'Apply GOI' GOI(DefaultSC);
        -->    Achieve 'Achieve ECC' DC(DefaultSC.ECC = 0, {Tolerance = 0.1});
        -->    EndTarget;
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
         Completed iteration 1, pert 1 (TOI.Element1 = 0.5001)
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
        -->    Maneuver 'Apply TOI' TOI(DefaultSC);
        -->    Propagate 'Prop to Apogee' DefaultProp(DefaultSC) {DefaultSC.Apoapsis};
        -->    Propagate 'Prop to Apogee' DefaultProp(DefaultSC) {DefaultSC.Apoapsis};
        -->    Achieve 'Achieve RMAG' DC(DefaultSC.Earth.RMAG = 42165, {Tolerance = 0.1});
        -->    Vary 'Vary GOI.V' DC(GOI.Element1 = 0.5, {Perturbation = 0.0001, Lower = 0, Upper = 3.14159, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});
        -->    Maneuver 'Apply GOI' GOI(DefaultSC);
        -->    Achieve 'Achieve ECC' DC(DefaultSC.ECC = 0, {Tolerance = 0.1});
        -->    EndTarget;
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
         Completed iteration 1, pert 2 (GOI.Element1 = 0.5001)
      CurrentCommand: Target 'Raise and Circularize' DC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = true};
      ...
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              djcinsb Darrel Conway added a comment -

              The functionality in GMT-6063 covers this work

              Show
              djcinsb Darrel Conway added a comment - The functionality in GMT-6063 covers this work

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 6 hours
                    6h
                    Remaining:
                    Remaining Estimate - 6 hours
                    6h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified