Plots Subpackage

Modules List

latom.plots.continuation

@authors: Alberto FOSSA’ Giuliana Elena MICELI

latom.plots.response_surfaces

@authors: Alberto FOSSA’ Giuliana Elena MICELI

latom.plots.solutions

@authors: Alberto FOSSA’ Giuliana Elena MICELI

latom.plots.timeseries

@authors: Alberto FOSSA’ Giuliana Elena MICELI

latom.plots.trajectories

@authors: Alberto FOSSA’ Giuliana Elena MICELI

Documentation

@authors: Alberto FOSSA’ Giuliana Elena MICELI

class latom.plots.timeseries.TwoDimStatesTimeSeries(r, time, states, time_exp=None, states_exp=None, thrust=None, threshold=1e-06, r_safe=None, labels=('powered', 'coast'))[source]

Bases: object

Plot the two-dimensional simulation’s states in time.

Parameters
  • r (float) – Equatorial radius of central attracting body [m] or [-]

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • time_exp (ndarray or None, optional) – Time vector for explicit simulation [s] o [-] or None. Default is None

  • states_exp (ndarray or None, optional) – States time series for explicit simulation as [r, theta, u, v, m] or None. Default is None

  • thrust (ndarray or None) – Thrust time series [N] or [-] or None. Default is None

  • threshold (float) – Threshold value to determine the on/off control structure or None. Default is 1e-6

  • r_safe (ndarray or None, optional) – Time series for minimum safe altitude [m] or [-] or None. Default is None

  • threshold – The threshold for the thrust values

  • labels (iterable, optional) – Labels for the different phases. Default is (‘powered’, ‘coast’)

Variables
  • R (float) – Equatorial radius of central attracting body [m] or [-]

  • scaler (float) – Value to scale the distances

  • units (list) – List of measurement units for distances, velocities and time

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • time_exp (ndarray or None) – Time vector for explicit simulation [s] o [-] or None

  • states_exp (ndarray or None) – States time series for explicit simulation as [r, theta, u, v, m] or None

  • time_pow (ndarray) – Time vector for implicit NLP solution corresponding to a powered phase [s] or [-]

  • states_pow (ndarray) – States time series for implicit NLP solution corresponding to a powered phase as [r, theta, u, v, m]

  • time_coast (ndarray) – Time vector for implicit NLP solution corresponding to a coasting phase [s] or [-]

  • states_coast (ndarray) – States time series for implicit NLP solution corresponding to a coasting phase as [r, theta, u, v, m]

  • r_safe (ndarray or None) – Time series for minimum safe altitude [m] or [-] or None

  • labels (iterable) – Labels for the different phases

plot()[source]

Plot the two-dimensional simulation’s states and in time.

class latom.plots.timeseries.TwoDimControlsTimeSeries(time, controls, threshold=1e-06, units=('N', 's'))[source]

Bases: object

Plot the two-dimensional simulation’s controls in time.

Parameters
  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • controls (ndarray) – Controls time series for implicit NLP solution as [thrust, alpha]

  • threshold (float or None, optional) – Threshold value to determine the on/off control structure or None. Default is 1e-6

  • units (iterable, optional) – Measurements units for thrust, time. Default is (‘N’, ‘s’)

Variables
  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • thrust (ndarray) – Thrust magnitude time series for implicit NLP solution [N] or [-]

  • alpha (ndarray) – Thrust direction time series for implicit NLP solution [rad]

  • threshold (float or None) – Threshold value to determine the on/off control structure or None

  • units (iterable) – Measurements units for thrust, time

plot()[source]

Plot the two-dimensional simulation’s controls in time.

@authors: Alberto FOSSA’ Giuliana Elena MICELI

class latom.plots.trajectories.TwoDimAltProfile(r, states, states_exp=None, thrust=None, threshold=1e-06, r_safe=None, labels=('powered', 'coast'))[source]

Bases: object

Plot the two-dimensional simulation’s altitude profile over spawn angle.

Parameters
  • r (float) – Equatorial radius of central attracting body [m] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • states_exp (ndarray or None, optional) – States time series for explicit simulation as [r, theta, u, v, m] or None. Default is None

  • thrust (ndarray or None, optional) – Thrust magnitude time series or None. Default is None

  • threshold (float or None, optional) – Threshold value to determine the on/off control structure or None. Default is 1e-6

  • r_safe (ndarray or None, optional) – Time series for minimum safe altitude [m] or [-] or None. Default is None

  • labels (iterable, optional) – Labels for the different phases. Default is (‘powered’, ‘coast’)

Variables
  • R (float) – Equatorial radius of central attracting body [m] or [-]

  • scaler (float) – Value to scale the distances

  • units (str) – Measurement unit for distances

  • r (ndarray) – Position time series for implicit NLP solution [m] or [-]

  • theta (ndarray) – Angle time series for implicit NLP solution [rad]

  • r_pow (ndarray) – Position time series for implicit NLP solution corresponding to powered phases [m] or [-]

  • theta_pow (ndarray) – Angle time series for implicit NLP solution corresponding to powered phases [m] or [-]

  • r_coast (ndarray) – Position time series for implicit NLP solution corresponding to coasting phases [m] or [-]

  • theta_coast (ndarray) – Angle time series for implicit NLP solution corresponding to coasting phases [m] or [-]

  • r_exp (ndarray) – Position time series for explicit simulation [m] or [-]

  • theta_exp (ndarray) – Angle time series for explicit simulation [m] or [-]

  • r_safe (ndarray or None) – Time series for minimum safe altitude [m] or [-] or None

  • labels (iterable, optional) – Labels for the different phases

plot()[source]

Plot the two-dimensional simulation’s altitude profile over spawn angle.

class latom.plots.trajectories.TwoDimTrajectory(r_moon, r_llo, states, kind='ascent', nb=2000)[source]

Bases: object

Plots the two-dimensional trajectories in the xy plane.

Parameters
  • r_moon (float) – Moon radius [m] or [-]

  • r_llo (float) – Initial Low Lunar Orbit radius [m] o [-]

  • states (dict) – Dictionary that maps states values obtained from the simulation

  • kind (str, optional) – Defines the kind of trajectory. It can be ‘ascent’ or ‘descent’. Default is ascent

  • nb (float, optional) – Number of points in which the Moon surface and the initial orbits are discretized. Default is 2000

Variables
  • scaler (float) – scaler for lengths

  • units (str) – Unit of measurement for lengths

  • x_moon (ndarray) – x coordinates for the Moon surface [km] or [-]

  • y_moon (ndarray) – y coordinates for the Moon surface [km] or [-]

  • x_llo (ndarray) – x coordinates for the initial orbit [km] or [-]

  • y_llo (ndarray) – y coordinates for the initial orbit [km] or [-]

  • x (dict) – x coordinates for the ascent trajectories [km] or [-]

  • y (dict) – y coordinates for the ascent trajectories [km] or [-]

  • kind (str) – Defines the kind of trajectory. It can be ‘ascent’ or ‘descent’

static get_scalers(r)[source]

Defines the scaling parameter for lengths and corresponding measurement unit.

Parameters

r (float) – Moon radius in dimensional or non-dimensional units [m] or [-]

Returns

  • scaler (float) – Scaler value [-]

  • units (str) – Measurement unit

static polar2cartesian(r, scaler=1.0, **kwargs)[source]

Transforms the polar coordinates into cartesian coordinates.

Parameters
  • r (ndarray) – Position series [km] or [-]

  • scaler (float) – Scaler value [-]

Other Parameters
  • nb (int) – Number of equally spaced points between 0 and 2*pi in which the x and y coordinates are computed

  • angle (ndarray) – Angles for which the x and y coordinates are computed

Returns

  • x (ndarray) – X coordinates series [km] or [-]

  • y (ndarray) – X coordinates series [km] or [-]

static set_axes_decorators(ax, title, units)[source]

Sets the plot axes decorators.

Parameters
  • ax (Axes) – Instance of Axes class

  • title (str) – Title of the plot

  • units (str) – Measurement units

plot()[source]

Plots the two-dimensional trajectories in the xy plane.

class latom.plots.trajectories.TwoDimSurface2LLO(r_moon, states, kind='ascent', nb=2000)[source]

Bases: latom.plots.trajectories.TwoDimTrajectory

Plots the two-dimensional trajectories from the Moon surface to a Low Lunar Orbit and vice versa.

Parameters
  • r_moon (float) – Moon radius [m] or [-]

  • states (dict) – Dictionary that maps states values obtained from the simulation

  • kind (str, optional) – Defines the kind of trajectory. It can be ‘ascent’ or ‘descent’. Default is ascent

  • nb (float, optional) – Number of points in which the Moon surface and the initial orbits are discretized. Default is 2000

static get_scalers(r)

Defines the scaling parameter for lengths and corresponding measurement unit.

Parameters

r (float) – Moon radius in dimensional or non-dimensional units [m] or [-]

Returns

  • scaler (float) – Scaler value [-]

  • units (str) – Measurement unit

plot()

Plots the two-dimensional trajectories in the xy plane.

static polar2cartesian(r, scaler=1.0, **kwargs)

Transforms the polar coordinates into cartesian coordinates.

Parameters
  • r (ndarray) – Position series [km] or [-]

  • scaler (float) – Scaler value [-]

Other Parameters
  • nb (int) – Number of equally spaced points between 0 and 2*pi in which the x and y coordinates are computed

  • angle (ndarray) – Angles for which the x and y coordinates are computed

Returns

  • x (ndarray) – X coordinates series [km] or [-]

  • y (ndarray) – X coordinates series [km] or [-]

static set_axes_decorators(ax, title, units)

Sets the plot axes decorators.

Parameters
  • ax (Axes) – Instance of Axes class

  • title (str) – Title of the plot

  • units (str) – Measurement units

class latom.plots.trajectories.TwoDimLLO2NRHO(r_moon, a_nrho, e_nrho, states, kind='ascent', nb=2000)[source]

Bases: latom.plots.trajectories.TwoDimTrajectory

Plots the two-dimensional trajectories from a Low Lunar Orbit to a Near rectilinear Halo Orbit.

Parameters
  • r_moon (float) – Moon radius [m] or [-]

  • a_nrho (float) – Semi-major axis of the NRHO [m] or [-]

  • e_nrho (float) – Eccentricity of the NRHO [-]

  • states (dict) – Dictionary that maps states values obtained from the simulation

  • kind (str, optional) – Defines the kind of trajectory. It can be ‘ascent’ or ‘descent’. Default is ascent

  • nb (float, optional) – Number of points in which the Moon surface and the initial orbits are discretized. Default is 2000

Variables
  • x_nrho (ndarray) – X coordinate series for the NRHO [km] or [-]

  • y_nrho (ndarray) – Y coordinate series for the NRHO [km] or [-]

static get_scalers(r)

Defines the scaling parameter for lengths and corresponding measurement unit.

Parameters

r (float) – Moon radius in dimensional or non-dimensional units [m] or [-]

Returns

  • scaler (float) – Scaler value [-]

  • units (str) – Measurement unit

plot()

Plots the two-dimensional trajectories in the xy plane.

static polar2cartesian(r, scaler=1.0, **kwargs)

Transforms the polar coordinates into cartesian coordinates.

Parameters
  • r (ndarray) – Position series [km] or [-]

  • scaler (float) – Scaler value [-]

Other Parameters
  • nb (int) – Number of equally spaced points between 0 and 2*pi in which the x and y coordinates are computed

  • angle (ndarray) – Angles for which the x and y coordinates are computed

Returns

  • x (ndarray) – X coordinates series [km] or [-]

  • y (ndarray) – X coordinates series [km] or [-]

static set_axes_decorators(ax, title, units)

Sets the plot axes decorators.

Parameters
  • ax (Axes) – Instance of Axes class

  • title (str) – Title of the plot

  • units (str) – Measurement units

@authors: Alberto FOSSA’ Giuliana Elena MICELI

class latom.plots.solutions.TwoDimSolPlot(r, time, states, controls, time_exp=None, states_exp=None, r_safe=None, threshold=1e-06, kind='ascent', a=None, e=None)[source]

Bases: object

Plot the two-dimensional simulation’s states and controls in time and in the xy plane.

Parameters
  • r (float) – Equatorial radius of central attracting body [m] or [-]

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • controls (ndarray) – Controls time series for implicit NLP solution as [thrust, alpha]

  • time_exp (ndarray or None, optional) – Time vector for explicit simulation [s] o [-] or None. Default is None

  • states_exp (ndarray or None, optional) – States time series for explicit simulation as [r, theta, u, v, m] or None. Default is None

  • r_safe (ndarray or None, optional) – Time series for minimum safe altitude [m] or [-] or None. Default is None

  • threshold (float or None, optional) – Threshold value to determine the on/off control structure or None. Default is 1e-6

  • kind (str, optional) – Defines the kind of trajectory. The possible values are ascent or descent. Default is ascent

  • a (float or None, optional) – HEO orbit’s semi-major axis [m] or [-] or None for surface to LLO transfers. Default is None

  • e (float or None, optional) – HEO orbit’s eccentricity [-] or None for surface to LLO transfers. Default is None

Variables
  • R (float) – Equatorial radius of central attracting body [m] or [-]

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • controls (ndarray) – Controls time series for implicit NLP solution as [thrust, alpha]

  • time_exp (ndarray or None) – Time vector for explicit simulation [s] o [-] or None

  • states_exp (ndarray or None) – States time series for explicit simulation as [r, theta, u, v, m] or None

  • r_safe (ndarray or None) – Time series for minimum safe altitude [m] or [-] or None

  • threshold (float or None) – Threshold value to determine the on/off control structure or None

  • kind (str) – Defines the kind of trajectory. The possible values are ascent or descent

  • states_plot (TwoDimStatesTimeSeries) – Instance of TwoDimStatesTimeSeries class to display the states variables as function of time

  • alt_plot (TwoDimAltProfile) – Instance of TwoDimAltProfile class to display the altitude over spawn angle

  • controls_plot (TwoDimControlsTimeSeries) – Instance of TwoDimControlsTimeSeries class to display the controls variables as function of time

  • trajectory_plot (TwoDimLLO2NRHO or TwoDimSurface2LLO) – Instance of TwoDimLLO2NRHO or TwoDimSurface2LLO class to create a LLO to NRHO trajectory plot or a Surface to Moon trajectory plot

plot()[source]

Plots the two-dimensional simulation’s states and controls in time and in the xy plane.

class latom.plots.solutions.TwoDimMultiPhaseSolPlot(r, time, states, controls, time_exp=None, states_exp=None, r_safe=None, threshold=1e-06, kind='ascent', a=None, e=None, dtheta=None)[source]

Bases: latom.plots.solutions.TwoDimSolPlot

Plots the two-dimensional multi phase simulation’s states and controls in time and in the xy plane.

Parameters
  • r (float) – Equatorial radius of central attracting body [m] or [-]

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • controls (ndarray) – Controls time series for implicit NLP solution as [thrust, alpha]

  • time_exp (ndarray or None, optional) – Time vector for explicit simulation [s] o [-] or None. Default is None

  • states_exp (ndarray or None, optional) – States time series for explicit simulation as [r, theta, u, v, m] or None. Default is None

  • r_safe (ndarray or None, optional) – Time series for minimum safe altitude [m] or [-] or None. Default is None

  • threshold (float or None, optional) – Threshold value to determine the on/off control structure or None. Default is 1e-6

  • kind (str, optional) – Defines the kind of trajectory. The possible values are ascent or descent. Default is ascent

  • a (float or None, optional) – HEO orbit’s semi-major axis [m] or [-] or None for surface to LLO transfers. Default is None

  • e (float or None, optional) – HEO orbit’s eccentricity [-] or None for surface to LLO transfers. Default is None

  • dtheta (float or None, optional) – Angle to translate the position angle time series [rad]

plot()

Plots the two-dimensional simulation’s states and controls in time and in the xy plane.

class latom.plots.solutions.TwoDimDescTwoPhasesSolPlot(r, time, states, controls, time_exp=None, states_exp=None)[source]

Bases: object

Plot the two-dimensional two-phases descent simulation’s states and controls in time and in the xy plane.

Parameters
  • r (float) – Equatorial radius of central attracting body [m] or [-]

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • controls (ndarray) – Controls time series for implicit NLP solution as [thrust, alpha]

  • time_exp (ndarray or None, optional) – Time vector for explicit simulation [s] o [-] or None. Default is None

  • states_exp (ndarray or None, optional) – States time series for explicit simulation as [r, theta, u, v, m] or None. Default is None

Variables
  • R (float) – Equatorial radius of central attracting body [m] or [-]

  • time (ndarray) – Time vector for implicit NLP solution [s] or [-]

  • states (ndarray) – States time series for implicit NLP solution as [r, theta, u, v, m]

  • controls (ndarray) – Controls time series for implicit NLP solution as [thrust, alpha]

  • time_exp (ndarray or None) – Time vector for explicit simulation [s] o [-] or None

  • states_exp (ndarray or None) – States time series for explicit simulation as [r, theta, u, v, m] or None

  • states_plot (TwoDimStatesTimeSeries) – Instance of TwoDimStatesTimeSeries class to display the states variables as function of time

  • alt_plot (TwoDimAltProfile) – Instance of TwoDimAltProfile class to display the altitude over spawn angle

  • controls_plot (TwoDimControlsTimeSeries) – Instance of TwoDimControlsTimeSeries class to display the controls variables as function of time

  • trajectory_plot (TwoDimSurface2LLO) – Instance of TwoDimSurface2LLO class to create a Surface to Moon trajectory plot

plot()[source]

Plot the two-dimensional two-phases descent simulation’s states and controls in time and in the xy plane.

@authors: Alberto FOSSA’ Giuliana Elena MICELI

class latom.plots.continuation.MassEnergyContinuation(twr, m_prop_frac, en)[source]

Bases: object

Plots the propellant fraction and spacecraft specific energy as function of the thrust/weight ratio.

Parameters
  • twr (ndarray) – List of thrust/weight ratios [-]

  • m_prop_frac (ndarray) – List of propellant fractions [-]

  • en (ndarray) – List of spacecraft specific energies [m^2/s^2]

Variables
  • twr (ndarray) – List of thrust/weight ratios [-]

  • m_prop_frac (ndarray) – List of propellant fractions [-]

  • energy (ndarray) – List of spacecraft specific energies [m^2/s^2]

plot()[source]

Plots the propellant fraction and spacecraft specific energy as function of the thrust/weight ratio.

class latom.plots.continuation.TwoDimTrajectoryContinuation(r_moon, r_llo, sol, nb=2000, labels=None)[source]

Bases: object

Plots the ascent trajectories from an initial Low Lunar Orbit to an intermediate ballistic arc for different thrust/weight ratios.

Parameters
  • r_moon (float) – Moon radius [m] or [-]

  • r_llo (float) – Initial Low Lunar Orbit radius [m] o [-]

  • sol (dict) – Dictionary that maps each thrust/weight ratio to the corresponding optimal trajectory

  • nb (float, optional) – Number of points in which the Moon surface and the initial orbits are discretized. Default is 2000

Variables
  • scaler (float) – scaler for lengths

  • units (str) – Unit of measurement for lengths

  • x_moon (ndarray) – x coordinates for the Moon surface [km] or [-]

  • y_moon (ndarray) – y coordinates for the Moon surface [km] or [-]

  • x_llo (ndarray) – x coordinates for the initial orbit [km] or [-]

  • y_llo (ndarray) – y coordinates for the initial orbit [km] or [-]

  • x (dict) – x coordinates for the ascent trajectories [km] or [-]

  • y (dict) – y coordinates for the ascent trajectories [km] or [-]

plot()[source]

Plots the ascent trajectories from an initial Low Lunar Orbit to an intermediate ballistic arc for different thrust/weight ratios.

@authors: Alberto FOSSA’ Giuliana Elena MICELI

class latom.plots.response_surfaces.RespSurf(isp, twr, param, title, nb_lines=50, log_scale=False)[source]

Bases: object

Plots the response surface resulting from the surrogate models computations.

Parameters
  • isp (ndarray) – List of isp values [s]

  • twr (ndarray) – List of thrust/weight ratios [-]

  • param (ndarray) – List of parameters

  • title (str) – Title of the plot

  • nb_lines (int) – Numbers of lines of response surfaces

  • log_scale (bool) – Defines if the twr scale is logarithmic

Variables
  • isp (ndarray) – List of isp values [s]

  • twr (ndarray) – List of thrust/weight ratios [-]

  • param (ndarray) – List of parameters

  • title (str) – Title of the plot

  • nb_lines (int) – Numbers of lines of response surfaces

plot()[source]

Plots the response surface resulting from the surrogate models computations