Nonlinear Constraint Feature Spec and Test Procedures Lead: Steve C Developer: Darrel STE/GUI Tester: Tom Explore Failing Tests Other Findings Requirements Interface/Functional Spec Overview Script Syntax Description Fields GUI Remarks Examples Test Procedures Assumptions Existing Tests Recommended Additional Tests Appendix A - Miscellaneous Data NOTES Explore Known bugs/issues committed in JIRA against this feature: JIRA ID Summary Comment GMT-3125 Solvers don't handle cyclic parameters near modulo boundaries P2 bug with no fix version specified. No action required. Note that GMT-2644 is the NonlinearConstraint QA task (not a bug). Failing Tests Run Identification: [Gmat-buildtest] Test results: 2012-11-13 (Win7-64/GMAT-32/M2010a/VS) No failed tests. Other Findings 1 Requirements These are working requirements. They are included here for review and convenience purposes. After review, requirements are maintained in the formal SRS located at SourceForge in /trunk/doc/SystemDocs/Requirements. ID Requirement FRC-7.1 The system shall have a command named NonlinearConstraint that allows the user to define a constraint function in an optimization sequence. FRC-7.2.0 The system shall support the following variables in the NonlinearConstraint command: FRC-7.2.1 1) Any scalar parameter defined in FRR-38 FRC-7.2.2 2) Any userdefined variable FRC-7.2.3 3) Any userdefined array element Interface/Functional Spec Overview Specifies a constraint used during optimization. Script Syntax NonLinearConstraint OptimizerName ({logical expression}) Description The NonlinearConstraint command is used within an Optimize/EndOptimize optimization sequence to apply a linear or nonlinear constraint. See Also: Vary, Optimize, and Minimize. Fields See the User Interface Spec spreadsheet for reference information for fields. Team Internal Notes 1 Per discussion with Steve H, the logical expression defining the constraint will be broken up into 3 inputs, LHS, Operator, and RHS. GUI You use a NonlinearConstraint command, within an Optimize/EndOptimize sequence as shown below, to define an equality or inequality constraint that you want to be satisfied at the end of the optimization process. Figure 1 Mission Sequence - Optimize/EndOptimize Double click on NonlinearConstraint1 to bring up the NonlinearConstraint command dialog box, shown below. Figure 2 NonlinearConstraint dialog box You must provide four inputs for the NonlinearConstraint command dialog box above: 1 2 3 4 Choice of optimizer. Constraint Object. Click the Edit button to the right of this field to select the type of constraint object from three possible choices, Spacecraft, Variable, or Array. Logical operator. Select one from three choices, =, <=, or >=. Constraint value. Note that Inputs 2-4 define a logical expression. In the example above, we have DefaultSC.SMA = 7000 Remarks Number of Vary, NonlinearConstraint, and Minimize commands within an Optimization Sequence An Optimization sequence must contain one or more Vary commands. Vary commands must occur before any Minimize or NonlinearConstraint commands. Multiple NonlinearConstraint commands are allowed. There is exactly one NonlinearConstraint command for every constraint. It is possible for an Optimize/EndOptimize optimization sequence to contain no NonlinearConstraint commands. In this case, since every optimization sequence must contain (a) one or more NonlinearConstraint commands and/or (b) a single Minimize command, the optimization sequence must contain a single Minimize command. Command Interactions The Minimize command is only used within an Optimize/EndOptimize Optimization sequence. See the Optimize command documentation for a complete worked example using the NonlinearConstraint command. Optimize command NonlinearConstraint commands can only occur within an Optimize/EndOptimize command sequence. Vary command Every Optimization sequence must contain at least one Vary command. Vary commands are used to define the control variables associated with an Optimization sequence. Minimize command A Minimize command is used within an Optimization sequence to define the Objective function that will be minimized. Note that an optimization sequence is allowed to contain, at most, one Minimize command. (An Optimization sequence is not required to contain a Minimize command) Examples % Constrain SMA of Sat to be 7000 km, using SQP1 NonLinearConstraint SQP1( Sat.SMA = 7000 ); % Constrain SMA of Sat to be less than or equal to 7000 km, % using SQP1 NonLinearConstraint SQP1( Sat.SMA <= 7000 ); % Constrain the SMA of Sat to be greater than or equal to 7000 km, % using VF13ad1 NonLinearConstraint VF13ad1( Sat.SMA >= 7000 ); Test Procedures Assumptions None. Existing Tests There are 3 files of the form *.tc. Test Name Description nonlinear_constraint_arr ay NonlinearConstraint_Lo werBound_RealNumber NonlinearConstraint_Lo werBound_Variable Recommended Additional Tests 1 Unique Validation Test Name Summary Appendix A - Miscellaneous Data Note that this data is primarily for the internal use of the feature lead. It does not need to be reviewed by the SDE and STE. NOTES 1