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

Additive and multiplicative scale factor fields active for differential corrector

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: P1
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: R2013a
    • Component/s: Vary Command (FRC-2)
    • Labels:
      None
    • Environment:

      I am using the June 29 version of GMAT on Windows 7

      Description

      To replicate this bug, open the default mission then add a Target command to the mission tree. Append a Vary command to the Target command. When you open the Vary command you will see that all fields are active but the additive and multiplicative scale factor fields should only be active for fmincon optimizers

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            shughes Steven Hughes added a comment -

            I'm not sure this is the expected behavior. I believe it is NOT correct and those fields should be active for DC. WE need to define behavior for all solvers and verify for ALL solvers before closing.

            Show
            shughes Steven Hughes added a comment - I'm not sure this is the expected behavior. I believe it is NOT correct and those fields should be active for DC. WE need to define behavior for all solvers and verify for ALL solvers before closing.
            Hide
            dcooley Steve Cooley added a comment -

            Added 3 new tests to test how additive and multiplicative scale factors are used. According to the output message window, all three solvers (DC, fmincon, VF13ad1) use both the additive and multiplicative fields.

            'Vary_DC_PiC_Additive_and_Multiplicative_ScaleFactor_RealNumber'
            'Vary_optimizer_fmincon_Additive_and_Multiplicative_ScaleFactor_RealNumber'
            'Vary_optimizer_VF13ad1_Additive_and_Multiplicative_ScaleFactor_RealNumber'

            Show
            dcooley Steve Cooley added a comment - Added 3 new tests to test how additive and multiplicative scale factors are used. According to the output message window, all three solvers (DC, fmincon, VF13ad1) use both the additive and multiplicative fields. 'Vary_DC_PiC_Additive_and_Multiplicative_ScaleFactor_RealNumber' 'Vary_optimizer_fmincon_Additive_and_Multiplicative_ScaleFactor_RealNumber' 'Vary_optimizer_VF13ad1_Additive_and_Multiplicative_ScaleFactor_RealNumber'
            Hide
            dcooley Steve Cooley added a comment -

            Darrel,

            Can you verify that all three solvers use both the additive and multiplicative scale factors?

            The message window output would suggest that they do. (But, I suppose the message output could be outputing values that the solvers do not actually use)

            Show
            dcooley Steve Cooley added a comment - Darrel, Can you verify that all three solvers use both the additive and multiplicative scale factors? The message window output would suggest that they do. (But, I suppose the message output could be outputing values that the solvers do not actually use)
            Hide
            djcinsb Darrel Conway added a comment -

            The Vary command contains the following code in its Execute() method:

            The first time the command fires, the initial value for the variable is set using this code:

               if (!solverDataFinalized) 
               {
                  // First time through, tell the solver about the variables
                  Real varData[6], asf, msf;
                  asf = additiveScaleFactor->EvaluateReal();
                  msf = 1.0 / multiplicativeScaleFactor->EvaluateReal();
            
                  varData[5] = initialValue->EvaluateReal();                // Initial value
            
                  // scale by using Eq. 13.5 of Architecture document
                  varData[0] = (varData[5] + asf) / msf;
            ...
                  variableID = solver->SetSolverVariables(varData, variableName);
            ...
            

            All calls then use this code:

               Real var = solver->GetSolverVariable(variableID);
               // scale using Eq. 13.6 of Architecture document
               var = var / multiplicativeScaleFactor->EvaluateReal() -
                  additiveScaleFactor->EvaluateReal();
            

            This is applied regardless of the Solver. It is a feature of the Vary command.

            Why was this issue reopened?

            Show
            djcinsb Darrel Conway added a comment - The Vary command contains the following code in its Execute() method: The first time the command fires, the initial value for the variable is set using this code: if (!solverDataFinalized) { // First time through, tell the solver about the variables Real varData[6], asf, msf; asf = additiveScaleFactor->EvaluateReal(); msf = 1.0 / multiplicativeScaleFactor->EvaluateReal(); varData[5] = initialValue->EvaluateReal(); // Initial value // scale by using Eq. 13.5 of Architecture document varData[0] = (varData[5] + asf) / msf; ... variableID = solver->SetSolverVariables(varData, variableName); ... All calls then use this code: Real var = solver->GetSolverVariable(variableID); // scale using Eq. 13.6 of Architecture document var = var / multiplicativeScaleFactor->EvaluateReal() - additiveScaleFactor->EvaluateReal(); This is applied regardless of the Solver. It is a feature of the Vary command. Why was this issue reopened?
            Hide
            dcooley Steve Cooley added a comment -

            Solver question answered.

            Show
            dcooley Steve Cooley added a comment - Solver question answered.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h