Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot trajectory in RIC frame #210

Closed
ChristopherRabotin opened this issue Aug 5, 2023 · 0 comments · Fixed by #211
Closed

Plot trajectory in RIC frame #210

ChristopherRabotin opened this issue Aug 5, 2023 · 0 comments · Fixed by #211
Labels
Interface: Python Kind: Improvement This is a proposed improvement Priority: high Status: Design Issue at Design phase of the quality assurance process

Comments

@ChristopherRabotin
Copy link
Member

High level description

Currently, Nyx allows plotting individual trajectory data in various reference frames, but has no capability to visualize one trajectory alongside many others in the same plot.

Stakeholders have a need to compare a single trajectory (such as a nominal mission profile) against N number of alternate trajectories (such as dispersed cases from a Monte Carlo analysis). Doing this comparison in the Radial-In-track-Cross track (RIC) frame centered on the nominal trajectory would provide valuable insights.

To enable this, we need to add a new plotting method to Nyx that accepts one OrbitTraj as the nominal trajectory, plus a list of N other OrbitTraj objects to plot relative to it in the RIC frame. Users should be able to specify plot formatting options like line colors, legend labels, etc.

This will allow convenient generation of comparative trajectory plots, improving Nyx's capabilities for visualization and analysis. Key use cases are assessing trajectory dispersions, evaluating maneuver alternatives, and gaining insights across Monte Carlo data sets.

Requirements

Thanks for the clarifications! Here is an updated requirements section with those changes:

Requirements

  • Add new method plot_traj_errors_ric() to Python API
  • Inputs:
    • nominal_df: Pandas DataFrame with nominal trajectory
    • error_dfs: List of Pandas DataFrames with error trajectories
  • Signature matches existing plot_trajectory() besides inputs
  • Automatically convert all inputs to RIC frame of nominal
  • Plot shows:
    • Nominal trajectory in Cartesian
    • Error trajectories relative to nominal in RIC frame
      • Same plotting options as plot_trajectory() (colors, styles, labels, etc)
  • Support varying number of error trajectories (from 1 to N)
  • Expand docs and tests accordingly
  • Ensure RIC transform uses the Rust implementation

Design

TDB: consider expanding the DCM from dcm_from_traj_frame to be a 6x6 that accounts for the transport theorem.

Claude claims the following which must be independently verified:

Good point! To fully account for the transport theorem when converting between reference frames, we need a 6x6 transformation matrix rather than just a 3x3 rotation matrix.
Here are some ways we could expand the requirements to handle that:

  • Nominal OrbitTraj must contain both position and velocity data
  • Extract raan, inc, aol as before to define RIC frame
  • Construct 6x6 transformation matrix that includes:
    • Top left 3x3: The rotation matrix as already defined
    • Top right 3x3: Cross product terms between angular velocity and position
    • Bottom left 3x3: Zero matrix
    • Bottom right 3x3: The rotation matrix again
  • Apply 6x6 transform to map error traj position + velocity into RIC
  • Validate inputs contain both r and v before transforming
  • Update tests to check transformed positions and velocities
  • Make 6x6 matrix construction part of core Nyx math library
  • Document math for deriving full 6x6 transport theorem matrix

This should be verified that two identical trajectories return the same DCM at the very least. Not sure how else to expand on this test case.

@ChristopherRabotin ChristopherRabotin added Status: Design Issue at Design phase of the quality assurance process Kind: Improvement This is a proposed improvement Interface: Python Priority: high labels Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interface: Python Kind: Improvement This is a proposed improvement Priority: high Status: Design Issue at Design phase of the quality assurance process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant