XYPlot

Lead: Rizwan Qureshi

Developer: Linda O. Jun

Tester: John M. Bez

 

 

Explore

Known Bugs

Failing Tests

Other Findings

Requirements

Interface/Functional Spec

Overview

Description

Fields

GUI

Remarks

Examples

Test Procedures

Assumptions

Nominal Tests

Edge/Corner/Miscellaneous Tests

Unique Validation Tests

 

 

 

 

 

 

Explore

 

Known Bugs

 

JIRA Bugs:

 

I did a bug search in JIRA by selecting XYPlot (FRR-29) under components and found following P1 and P2 open bugs/issues for FRR-29 XYPlot feature:

      GMT-2411 GMAT crashes with XY Plot

      GMT-2370 XYPlot does not properly handle plotting a user array element

      GMT-2369 Aside from ShowPlot and SolverIterations, All other XYPlot options do not work in Command Mode

      GMT-2357 Reducing the window size does not rescale the plot until the size is slightly increased

      GMT-2324 XYPlot y axis expands to 1e99 when reset and rerun

      GMT-2014 XY Plot does not show "Current" iteration correctly for fmincon

      GMT-1474 XY plot zoom functions quirky during long runs

 

Failing Tests

Tests failing in the nightly regression reports related to this feature.

 

GMAT_XYPlots_20Parameters_OnePlot (script)

 

GMAT_XYPlots_25XYPlots_AllPlotXYZ

 

 

 

Other Findings

 

 

Issue 1: When I try to plot multiple variables in Script (I tried to plot up to 20 variables), as dependent variables against time being the independent variable, then GMAT crashes.

 

Recommendation:  Fix (Fix by: R2013a, Priority: P1    GMT-2411 is already created in JIRA that addresses this issue. I have attached the script to JIRA since script was not there.

 

 

 

Issue 2: When I try to plot user-defined array element which is a dependent variable against time being the independent variable, then GMAT gives following warning:

 

** Warning ** The XYPlot will not be shown. The first parameter selected for X axis or Y axis is NULL.

 

Also I added another script in same GMT-2370 called: Plotting_Array_element_in_XYPlot_causes_CRASH.script which shows that when either in GUI or script mode, when the user tries to plot array element, then GMAT crashes as well. Please see GMT-2370 for details.

.

 

Recommendation:  Fix (Fix by: R2013a, Priority: P1    GMT--2370 is already created in JIRA that addresses this issue. Shawn had already attached his script but I have attached my script in JIRA as well.

 

 

 

 

Issue 3:    When using SolverIterations Current option in both DC iterative processes, the generated plot has some Missing data in the plot.

 

Recommendation : Fix (Fix by: R2013a, Priority: P3  GMT-2867 created for this issue and assigned to Darrel.

 

 

 

Issue 4A: When using SolverIterations Current and All options with vf13ad optimizer and while using spacecraft parameters within Mission tree, then the generated plots for both Current and All SolverIterations options are not correct.

 

 

I have included DefaultOrbitView window in script. So select Current for both DefaultOrbitView.SolverIterations and XYPlot1.SolverIterations, then run script. You will see that OrbitView window generates current trajectory correctly but XYPlot is wrong. The XYPlot plots all perturbations/iterations and curves seem to return back to their starting point. The Current option should only show one curve on the plot. (See following script in JIRA: XYPlot_SolverIterations_Current_HohmannTransfer_VF13ad_optimizer.script).

 

I have included the DefaultOrbitView window in the script. So select All for both DefaultOrbitView.SolverIterations and XYPlot1.SolverIterations, then run the script. You will see that the OrbitView window generates all trajectories correctly but XYPlot is wrong. The XYPlot plots seem to plot all perturbations/iterations BUT curves seem to return back to their starting point on each iteration which is a wrong behavior. (See following script in JIRA:  XYPlot_SolverIterations_All_HohmannTransfer_VF13ad_optimizer.script)

 

None option for SolverIterations in XYPlot works fine.

 

Issue 4B: When using SolverIterations Current option with vf13ad optimizer and while using user-defined Variables (instead of spacecraft data) within Mission tree, then the generated plot is not correct. The Current option should only show the current pass plotted into the XYPlot but rather it shows all iterations/perturbations for x1 and x2 user-defined variables.

 

XYPlot generated by SolverIterations None and All options are correct.

 

See following script in JIRA:   XYplot_SolverIterations_Current_VF13ad1_optimizer.script for this bug.

 

 

Recommendation : Fix (Fix by: R2013a, Priority: P1 GMT-2874 created in JIRA and assigned to Darrel.

 

 

Requirements

To CCB lead (SPH): These are the final requirements and need to be migrated to formal SRS.

These were finalized by CCB as of 16 Aug. 2012 and are here for reference purposes only.  See the SRS for requirements. -SPH

 

 

FRR-29.1

The system shall support 2-D data plots with Cartesian axes.

FRR-29.2.0

The system shall allow the user to set the independent and dependent variables using any of the following:

FRR-29.2.1

1)                Scalar parameter ( see FRR-38 )

FRR-29.2.2

2)                User defined variable

FRR-29.2.3

3)                User defined array element

FRR-29.2.4

4)      Properties of tanks that are attached to spacecraft( see FRR-38)

FRR-29.2.5

5)       Properties of thrusters that are attached to spacecraft ( see FRR-38)

FRR-29.3

The system shall allow the user to specify multiple dependent variables on a single plot.

FRR-29.4

The system shall allow the user to optionally display a plot grid.

FRR-29.5.0

The system shall allow the user to specify how data is drawn to XY Plots during iterative processes such as differential correction and optimization. The following options shall be available:

FRR-29.5.1

1)                Plot all iterations/perturbations

FRR-29.5.2

2)                Plot current iteration/perturbation only

FRR-29.5.3

3)                Plot solution only

FRR-29.6

The system shall allow the user to optionally display or not display an XY-Plot.

FRR-29.7

The system shall allow the user to zoom in to a selected region of an XY-Plot.

FRR-29.8

The system shall allow the user to optionally save the plot data to a text file.

FRR-29.9

The system shall allow the user to optionally display a plot legend.

 

Interface/Functional Spec

Overview

 

XYPlot is a user-defined resource that plots data onto the X and Y axes of a graph.

Description

 

The XYPlot resource allows you to plot data onto the X and Y axis of the graph. You can choose to plot any number of parameters as a function of a single independent variable. GMAT allows you to plot user-defined variables, array elements, or spacecraft parameters. You can create multiple XYPlots by using either the GUI or script interface of GMAT. GMAT also provides the option of when to plot and stop plotting data to a XYPlot through the Toggle On/Off command. See the Remarks section below, for detailed discussion of the interaction between an XYPlot object and the Toggle command. GMAT’s Spacecraft and XYPlot objects also interact with each other throughout the entire mission duration. Discussion of the interaction between Spacecraft and XYPlot resources is also mentioned in Remarks section.      

 

See Also : Toggle command, Spacecraft resource

 

Fields

 

See the User Interface Spec spreadsheet for reference information for fields.

GUI

 

The figure below shows the default settings for the XYPlot resource:

 

          Figure: Default Name and Settings for the XYPlot Object Dialog Box

 

 


Remarks

 

Behavior when using XYPlot Resource & Toggle Command

 

The XYPlot resource plots data onto the X and Y axis of the graph at each propagation step of the entire mission duration. If you want to report data to a XYPlot at specific points in your mission, then a Toggle On/Off command can be inserted into the mission sequence to control when the XYPlot is to plot data. When Toggle Off command is issued for a XYPlot, no data is plotted onto the X and Y axis of the graph until a Toggle On command is issued. Similarly when a Toggle On command is used, data is plotted onto the X and Y axis at each integration step until a Toggle Off command is used.

 

Below is an example script snippet that shows how to use Toggle Off and Toggle On command while using the XYPlot resource. Spacecraft’s position magnitude and semi-major-axis are plotted as a function of time.

Create Spacecraft aSat;

Create Propagator aProp;

 

Create XYPlot aPlot;

GMAT aPlot.XVariable = aSat.ElapsedDays;

GMAT aPlot.YVariables = {aSat.Earth.RMAG, aSat.Earth.SMA};

 

BeginMissionSequence;

 

Toggle aPlot Off;

Propagate aProp(aSat) {aSat.ElapsedDays = 2};

Toggle aPlot On;

Propagate aProp(aSat) {aSat.ElapsedDays = 4};

 

 

Behavior when using XYPlot & Spacecraft resources

 

Spacecraft resource contains information about spacecraft’s orbit, its attitude, physical parameters (such as mass and drag coefficient) and any attached hardware, including thrusters and fuel tanks. Spacecraft resource interacts with XYPlot throughout the entire mission duration. The data retrieved from the spacecraft is what gets plotted onto the X and Y axis of the graph at each propagation step of the entire mission duration.

 

 

Behavior when reporting data in Iterative Processes

 

GMAT allows you to specify how data is plotted onto a plot during iterative processes such as differential correction or optimization. The SolverIterations field of an XYPlot resource supports three options which are described in the table below:

 

SolverIterations options

Description

Current

Shows only current iteration/perturbation in an iterative process and plots current iteration to a plot.

All

Shows all iterations/perturbations in an iterative process and plots all iterations/perturbations to a plot.

None

Shows only the final solution after the end of an iterative process and plots only that final solution to the plot.

 

Examples

 

Propagate an orbit and plot the spacecraft’s altitude as a function of time at every integrator step:

Create Spacecraft aSat;

Create Propagator aProp;

 

Create XYPlot aPlot;

GMAT aPlot.XVariable = aSat.ElapsedSecs;

GMAT aPlot.YVariables = {aSat.Earth.Altitude};

 

BeginMissionSequence;

 

Propagate aProp(aSat) {aSat.ElapsedDays = 4};

 

 

Plotting data during an iterative process. Notice SolverIterations field is selected as All. This means all iterations/perturbations will be plotted.

Create Spacecraft aSat;

Create Propagator aProp;

 

Create ImpulsiveBurn TOI;

Create DifferentialCorrector aDC;

 

Create XYPlot aPlot;

GMAT aPlot.SolverIterations = All;

GMAT aPlot.XVariable = aSat.ElapsedDays;

GMAT aPlot.YVariables = {aSat.Earth.RMAG};

 

BeginMissionSequence;

 

Propagate aProp(aSat) {aSat.Earth.Periapsis};

Target aDC;

  Vary aDC(TOI.Element1 = 0.24, {Perturbation = 0.001, Lower = 0.0, Upper = 3.14159, MaxStep = 0.5});

   Maneuver TOI(aSat);

   Propagate aProp(aSat) {aSat.Earth.Apoapsis};

   Achieve aDC(aSat.Earth.RMAG = 42165);

EndTarget;

 

 

 

Test Procedures

Assumptions

 

      All tests use both default and non-default values

 

 

File Naming Conventions

 

The goal of the naming convention is to allow people to intuitively understand the purpose of the test by the name of the test file. The file naming conventions in this section are guidelines to be used when they “make sense” and are to be modified when they don’t “make sense”. They’re not strict rules.

 

XYPlot uses the following format for nominal tests:

 

GMAT_XYPlots_ <description of test>

XYPlot_ <description of test>

 

 

Use the following format for validation tests:

XYPlot_Validation_<Field>_ <description of test>

 

Nominal Tests

 

Priority

Status

Summary

P1

Done

RHQ

Test whether the system supports 2-D data plots with Cartesian axes.

P1

Done

RHQ

Test whether the system allows the user to set the independent and dependent variables as defined in FRR-32

P1

Done

RHQ

Test whether the system allows the user to set the independent and dependent variables using user-defined variables

P1

Done

RHQ

Test whether the system allows the user to set the independent and dependent variables using user-defined array elements

      P1

Done

RHQ

Test whether the system allows the user to specify multiple dependent variables on a single plot.

     P1

Done

RHQ

Test whether the system allows the user to optionally display a plot grid.

 

  P1

Done

RHQ

Test whether the system allows the user to specify how data is written to XYPlot during iterative process such as Differential Correction. Testing includes employing all available options for SolverIterations.

  P1

Done

RHQ

Test whether the system allows the user to specify how data is written to XYPlot during iterative process such as optimization.

Testing includes employing all available options for SolverIterations.

  P1

Done

RHQ

Test whether the system allows the user to optionally display or not display an XY-Plot.

  P1

Done

RHQ

Test whether the system allows the user to zoom in to a selected region of an XY-Plot.

P1

Done

RHQ

Test plotting spacecraft parameters with different dependencies (EarthFixed, MoonSat with MoonInertial, MarsSat with MarsInertial etc), just to make sure dependencies are handled accurately

 

P1

Done

RHQ

Test plotting attached hardware ( fuel tank and thruster) properties during a finite and impulsive burn

 

Edge/Corner/Miscellaneous Tests

 

I cannot think of any as of yet.

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

 

Unique Validation Tests

These are unique validation tests that are required for special field or object couplings for this XYPlot feature.

Priority

Status

Summary

P1

SPH

Done

Test range constraints on ShowGrid field

P1

SPH

Done

 

Test range constraints on ShowPlot field

P1

SPH

Done

Test range constraints on SolverIterations field

P1

SPH

Done

Test range constraints on XVariable field

P1

SPH

Done

Test range constraints on YVariables field

 

 

Unique Mode Tests

 

I cannot think of any unique mode tests for this object.

 

Priority

Status

Summary

 

 

 

 

 

 

 

 

 

 

 

 

Unique GUI Tests

 

These are tests that are unique to the GUI interface for this feature that are not covered by the standard GUI test template and procedures.

 

Priority

Status

Summary