latom.analyzer.analyzer_heo_2d

@authors: Alberto FOSSA’ Giuliana Elena MICELI

Functions

deepcopy(x[, memo, _nil])

Deep copy operation on arbitrary Python objects.

save(obj, filename)

Save an object.

time()

Return the current time in seconds since the Epoch.

Classes

ImpulsiveBurn(sc, dv)

ImpulsiveBurn class describes an impulsive burn.

MassEnergyContinuation(twr, m_prop_frac, en)

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

TwoDim3PhasesLLO2HEOAnalyzer(body, sc, alt, …)

Analyzer class defines the methods to analyze the results of a two dimensional 3 phases LLO to HEO simulation.

TwoDim3PhasesLLO2HEONLP(body, sc, alt, rp, …)

TwoDim3PhasesLLO2HEONLP transcribes an optimal control problem for a three-phases ascent trajectory from a circular Low Lunar Orbit (LLO) to an Highly Elliptical Orbit (HEO) into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.

TwoDimAnalyzer(body, sc)

TwoDimAnalyzer class defines the methods to analyze the results of a two dimensional simulation.

TwoDimAscAnalyzer(body, sc, alt)

TwoDimAscAnalyzer class defines the methods to analyze the results of a two dimensional ascent simulation from the Moon surface to a given Low Lunar Orbit.

TwoDimControlsTimeSeries(time, controls[, …])

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

TwoDimLLO2ApoAnalyzer(body, sc, alt, rp, t, …)

TwoDimLLO2HEOAnalyzer class defines the methods to analyze the results of a two dimensional simulation from a Low Lunar Orbit to an Highly Elliptical Orbit.

TwoDimLLO2ApoContinuationAnalyzer(body, sc, …)

TwoDimLLO2ApoContinuationAnalyzer class defines the methods to analyze the results of a two dimensional simulation from a Low Lunar Orbit to an Highly Elliptical Orbit using a continuation method over several thrust/weight ratios.

TwoDimLLO2ApoNLP(body, sc, alt, rp, t, …)

TwoDimLLO2HEONLP transcribes a continuous-time optimal control problem for a two-dimensional transfer trajectory from a Low Lunar Orbit (LLO) to an Highly Elliptical Orbit (HEO) into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.

TwoDimLLO2HEOAnalyzer(body, sc, alt, rp, t, …)

TwoDimLLO2HEOAnalyzer class defines the methods to analyze the results of a two dimensional simulation from a Low Lunar Orbit to an Highly Elliptical Orbit.

TwoDimLLO2HEONLP(body, sc, alt, rp, t, …)

TwoDimLLO2HEONLP transcribes a continuous-time optimal control problem for a two-dimensional transfer trajectory from a Low Lunar Orbit (LLO) to an Highly Elliptical Orbit (HEO) into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.

TwoDimMultiPhaseSolPlot(r, time, states, …)

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

TwoDimMultiPhasesLLO2HEOAnalyzer(body, sc)

Analyzer class defines the methods to analyze the results of a two dimensional multi phases LLO to HEO simulation

TwoDimOrb(gm, **kwargs)

Defines a two-dimensional orbit from its keplerian parameters.

TwoDimSolPlot(r, time, states, controls[, …])

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

TwoDimStatesTimeSeries(r, time, states[, …])

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

TwoDimTrajectoryContinuation(r_moon, r_llo, sol)

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

class latom.analyzer.analyzer_heo_2d.TwoDimLLO2HEOAnalyzer(body, sc, alt, rp, t, t_bounds, method, nb_seg, order, solver, snopt_opts=None, rec_file=None, check_partials=False, u_bound='lower')[source]

Bases: latom.analyzer.analyzer_2d.TwoDimAscAnalyzer

TwoDimLLO2HEOAnalyzer class defines the methods to analyze the results of a two dimensional simulation from a Low Lunar Orbit to an Highly Elliptical Orbit.

The Highly Elliptical Orbit is chosen as first planar approximation of a three-dimensional Near Rectilinear Halo Orbit. The transfer is modelled as a single phase trajectory performed at variable thrust.

Parameters
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics alt : float

  • alt (float) – Value of the initial LLO altitude [m]

  • rp (float) – Value for the target HEO periselene radius [m]

  • t (float) – Value for the guessed trajectory time of flight [s]

  • t_bounds (float) – Value for the time of flight bounds [-]

  • method (str) – NLP transcription method

  • nb_seg (int) – Number of segments for the transcription

  • order (int) – Transcription order

  • solver (str) – NLP solver

  • snopt_opts (dict) – Sets some SNOPT’s options. Default is None

  • rec_file (str) – Directory path for the solution recording file. Default is None

  • check_partials (bool) – Checking of partial derivatives. Default is False

  • u_bound (str) – Sets the bound of the radial velocity. Can be lower, upper or None. Default is lower

Variables
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • phase_name (str) – Describes the phase name in case of multi-phase trajectories

  • nlp (NLP) – Instance of NLP object describing the type of Non Linear Problem solver used

  • tof (float) – Value of the time of flight resulting by the simulation [s]

  • tof_exp (float) – Value of the time of flight of the explicit simulation [s]

  • err (float) – Value of the error between the optimized simulation results and the explicit simulation results

  • rm_res (float) – Value of the central body radius [-] or [m]

  • states_scalers (ndarray) – Reference values of the states with which perform the scaling

  • controls_scalers (ndarray) – Reference values of the controls with which perform the scaling

plot()[source]

Plots the states and controls resulting from the simulation and the ones from the explicit computation in time. The semi-major axis and the eccentricity of the HEO are also displayed.

get_discretization_phase(p, phase_name, scaled=False)

Access the time of flight, the states on the states discretization nodes and the controls on the control discretization nodes for a given Problem and Phase.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • states (ndarray) – States values on the state discretization nodes for the optimized simulation phase

  • controls (ndarray) – Controls values on the controls discretization nodes for the optimized simulation phase

get_solution_dictionary(p, scaled=False)
Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

sol – Dictionary containing the NLP solution

Return type

dict

get_solutions(explicit=True, scaled=False)

Access the simulation solution.

Parameters
  • explicit (bool) – Computes also the explicit simulation. Default is True

  • scaled (bool) – Scales the simulation results. Default is False

get_time_series(p, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

get_time_series_phase(p, phase_name, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [-] or [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

run_driver()

Runs the optimization.

Returns

failed – Returns the result of the optimization 0 or 1

Return type

int

save(rec_file)

Pickle the whole Analyzer class.

Parameters

rec_file (str) – Directory path to the file where the Analyzer is serialized

class latom.analyzer.analyzer_heo_2d.TwoDimLLO2ApoAnalyzer(body, sc, alt, rp, t, t_bounds, method, nb_seg, order, solver, snopt_opts=None, rec_file=None, check_partials=False)[source]

Bases: latom.analyzer.analyzer_2d.TwoDimAscAnalyzer

TwoDimLLO2HEOAnalyzer class defines the methods to analyze the results of a two dimensional simulation from a Low Lunar Orbit to an Highly Elliptical Orbit.

The Highly Elliptical Orbit is chosen as first planar approximation of a three-dimensional Near Rectilinear Halo Orbit. The optimal control problem is solved for a single phase trajectory performed at constant thrust that injects the spacecraft from the Low Lunar Orbit to an intermediate transfer trajectory whose aposelene radius coincides with the one of the target Highly Elliptical Orbit. The final insertion manoeuvre is then modelled as an ideal impulsive burn due to its limited dV magnitude.

Parameters
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • alt (float) – Value of the final orbit altitude [m]

  • rp (float) – Value for the target HEO periselene radius [m]

  • t (float) – Value for the target HEO period [s]

  • t_bounds (float) – Value for the time of flight bounds [-]

  • method (str) – NLP transcription method

  • nb_seg (int) – Number of segments for the transcription

  • order (int) – Transcription order

  • solver (str) – NLP solver

  • snopt_opts (dict) – Sets some SNOPT’s options. Default is None

  • rec_file (str) – Directory path for the solution recording file. Default is None

  • check_partials (bool) – Checking of partial derivatives. Default is False

Variables
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • phase_name (str) – Describes the phase name in case of multi-phase trajectories

  • nlp (NLP) – Instance of NLP object describing the type of Non Linear Problem solver used

  • tof (float) – Value of the time of flight resulting by the simulation [s]

  • tof_exp (float) – Value of the time of flight of the explicit simulation [s]

  • err (float) – Value of the error between the optimized simulation results and the explicit simulation results

  • rm_res (float) – Value of the central body radius [- or m]

  • = ndarray (states_scalers) – Reference values of the states with which perform the scaling

  • controls_scalers (ndarray) – Reference values of the controls with which perform the scaling

  • alt (float) – Value of the final orbit altitude [m]

  • phase_name – Name assigned to the problem phase

  • transfer (HohmannTransfer) – Instance of HohmannTransfer computing the keplerian parameters of the transfer orbit

  • insertion_burn (ImpulsiveBurn) – Instance of ImpulsiveBurn defining the delta v required for an impulsive burn

  • dv_dep (float) – Delta v required for a manoeuvre [m/s]

compute_solution(nb=200)[source]

Retrieves the optimization results and computes the spacecraft states along the ballistic arc as well as the final insertion burn.

Parameters

nb (int, optional) – Number of points in which the spacecraft states along the ballistic arc are computed. Default is 200

get_solutions(explicit=True, scaled=False, nb=200)[source]

Access the simulation solution.

Parameters
  • explicit (bool) – Computes also the explicit simulation. Default is True

  • scaled (bool) – Scales the simulation results. Default is False

  • nb (int) – Number of points where the coasting arch is computed

plot()[source]

Plots the states and controls resulting from the simulation and the ones from the explicit computation in time. The semi-major axis and the eccentricity of the HEO are also displayed.

get_discretization_phase(p, phase_name, scaled=False)

Access the time of flight, the states on the states discretization nodes and the controls on the control discretization nodes for a given Problem and Phase.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • states (ndarray) – States values on the state discretization nodes for the optimized simulation phase

  • controls (ndarray) – Controls values on the controls discretization nodes for the optimized simulation phase

get_solution_dictionary(p, scaled=False)
Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

sol – Dictionary containing the NLP solution

Return type

dict

get_time_series(p, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

get_time_series_phase(p, phase_name, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [-] or [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

run_driver()

Runs the optimization.

Returns

failed – Returns the result of the optimization 0 or 1

Return type

int

save(rec_file)

Pickle the whole Analyzer class.

Parameters

rec_file (str) – Directory path to the file where the Analyzer is serialized

class latom.analyzer.analyzer_heo_2d.TwoDimLLO2ApoContinuationAnalyzer(body, sc, alt, rp, t, t_bounds, twr_list, method, nb_seg, order, solver, snopt_opts=None, check_partials=False, log_scale=False, significant_figures=4)[source]

Bases: latom.analyzer.analyzer_heo_2d.TwoDimLLO2ApoAnalyzer

TwoDimLLO2ApoContinuationAnalyzer class defines the methods to analyze the results of a two dimensional simulation from a Low Lunar Orbit to an Highly Elliptical Orbit using a continuation method over several thrust/weight ratios.

The Highly Elliptical Orbit is chosen as first planar approximation of a three-dimensional Near Rectilinear Halo Orbit. The optimal control problem is solved for a single phase trajectory performed at constant thrust that injects the spacecraft from the Low Lunar Orbit to an intermediate transfer trajectory whose aposelene radius coincides with the one of the target Highly Elliptical Orbit. The final insertion manoeuvre is then modelled as an ideal impulsive burn due to its limited dV magnitude.

Parameters
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • alt (float) – Value of the final orbit altitude [m]

  • rp (float) – Value for the target HEO periselene radius [m]

  • t (float) – Value for the target HEO period [s]

  • t_bounds (float) – Value for the time of flight bounds [-]

  • twr_list (iterable) – List of thrust/weight ratios over which the continuation of the solutions is performed [-]

  • method (str) – NLP transcription method

  • nb_seg (int) – Number of segments for the transcription

  • order (int) – Transcription order

  • solver (str) – NLP solver

  • snopt_opts (dict, optional) – Sets some SNOPT’s options. Default is None

  • check_partials (bool, optional) – Checking of partial derivatives. Default is False

  • log_scale (bool, optional) – True if twr_list is provided in logarithmic scale, False otherwise. Default is False

  • significant_figures (int, optional) – Significant figures to be considered while casting the list of thrust/weight ratios. Default is 4

Variables
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • phase_name (str) – Describes the phase name in case of multi-phase trajectories

  • nlp (NLP) – Instance of NLP object describing the type of Non Linear Problem solver used

  • tof (float) – Value of the time of flight resulting by the simulation [s]

  • tof_exp (float) – Value of the time of flight of the explicit simulation [s]

  • err (float) – Value of the error between the optimized simulation results and the explicit simulation results

  • rm_res (float) – Value of the central body radius [- or m]

  • states_scalers (ndarray) – Reference values of the states with which perform the scaling

  • controls_scalers (ndarray) – Reference values of the controls with which perform the scaling

  • alt (float) – Value of the final orbit altitude [m]

  • phase_name – Name assigned to the problem phase

  • transfer (HohmannTransfer) – Instance of HohmannTransfer computing the keplerian parameters of the transfer orbit

  • insertion_burn (ImpulsiveBurn) – Instance of ImpulsiveBurn defining the delta v required for an impulsive burn

  • dv_dep (float) – Delta v required for a manoeuvre [m/s]

  • twr_list (ndarray) – List of thrust/weight ratios over which the continuation is performed [-]

  • m_prop_list (ndarray) – List of propellant masses corresponding to twr_list [kg]

  • energy_list (ndarray) – List of specific energies of the spacecraft along the ballistic arc corresponding to twr_list [m^2/s^2]

  • sol_list (dict) – Dictionary of optimal solutions corresponding to twr_list

compute_energy_mprop(r, u, v, m_coast)[source]

Computes the specific energy of the spacecraft on the ballistic arc and the total propellant mass including the final insertion burn.

Parameters
  • r (float) – Radius at the end of the first powered phase [m]

  • u (float) – Radial velocity at the end of the first powered phase [m/s]

  • v (float) – Tangential velocity at the end of the first powered phase [m/s]

  • m_coast (float) – Spacecraft mass on the ballistic arc [kg]

Returns

  • en (float) – Specific energy of the spacecraft on the ballistic arc [m/s]

  • m_prop (float) – Total propellant mass including the final insertion burn [kg]

run_continuation(rec_file=None)[source]

Iterative solution of all optimal control problems corresponding to the different thrust/weight ratios in twr_list using a continuation method in which the solution of the problem i is set as initial guess for the problem i + 1. The first solution is computed using the initial guess provided by TwoDimLLO2HEOGuess class.

Parameters

rec_file (str or None, optional) – Directory path for the file in which the thrust/weight ratios, propellant masses, specific energies and solutions are recorded or None. Default is None

plot(labels=None)[source]

Plots the propellant fraction and spacecraft energy wrt thrust/weight ratio, the initial powered phases for different thrust/weight ratios and the last solution (smallest thrust/weight ratio) as for TwoDimLLO2ApoAnalyzer.

Parameters

labels (iterable or None, optional) – List of labels for the different trajectories displayed by TwoDimTrajectoryContinuation class or None. Default is None

compute_solution(nb=200)

Retrieves the optimization results and computes the spacecraft states along the ballistic arc as well as the final insertion burn.

Parameters

nb (int, optional) – Number of points in which the spacecraft states along the ballistic arc are computed. Default is 200

get_discretization_phase(p, phase_name, scaled=False)

Access the time of flight, the states on the states discretization nodes and the controls on the control discretization nodes for a given Problem and Phase.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • states (ndarray) – States values on the state discretization nodes for the optimized simulation phase

  • controls (ndarray) – Controls values on the controls discretization nodes for the optimized simulation phase

get_solution_dictionary(p, scaled=False)
Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

sol – Dictionary containing the NLP solution

Return type

dict

get_solutions(explicit=True, scaled=False, nb=200)

Access the simulation solution.

Parameters
  • explicit (bool) – Computes also the explicit simulation. Default is True

  • scaled (bool) – Scales the simulation results. Default is False

  • nb (int) – Number of points where the coasting arch is computed

get_time_series(p, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

get_time_series_phase(p, phase_name, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [-] or [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

run_driver()

Runs the optimization.

Returns

failed – Returns the result of the optimization 0 or 1

Return type

int

save(rec_file)

Pickle the whole Analyzer class.

Parameters

rec_file (str) – Directory path to the file where the Analyzer is serialized

class latom.analyzer.analyzer_heo_2d.TwoDimMultiPhasesLLO2HEOAnalyzer(body, sc)[source]

Bases: latom.analyzer.analyzer_2d.TwoDimAnalyzer

Analyzer class defines the methods to analyze the results of a two dimensional multi phases LLO to HEO simulation

Parameters
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

Variables
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • phase_name (str) – Describes the phase name in case of multi-phase trajectories

  • nlp (NLP) – Instance of NLP object describing the type of Non Linear Problem solver used

  • tof (float) – Value of the time of flight resulting by the simulation [s]

  • tof_exp (float) – Value of the time of flight of the explicit simulation [s]

  • err (float) – Value of the error between the optimized simulation results and the explicit simulation results

  • rm_res (float) – Value of the central body radius [-] or [m]

  • states_scalers (ndarray) – Reference values of the states with which perform the scaling

  • controls_scalers (ndarray) – Reference values of the controls with which perform the scaling

  • transfer (HohmannTransfer) – Instance of HohmannTransfer computing the keplerian parameters of the transfer orbit

  • dv (float) – Delta v required for a manoeuvre [m/s]

plot()[source]

Plots the states and controls resulting from the simulation and the ones from the explicit computation in time. The semi-major axis and the eccentricity of the HEO are also displayed.

get_discretization_phase(p, phase_name, scaled=False)

Access the time of flight, the states on the states discretization nodes and the controls on the control discretization nodes for a given Problem and Phase.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • states (ndarray) – States values on the state discretization nodes for the optimized simulation phase

  • controls (ndarray) – Controls values on the controls discretization nodes for the optimized simulation phase

get_solution_dictionary(p, scaled=False)
Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

sol – Dictionary containing the NLP solution

Return type

dict

get_solutions(explicit=True, scaled=False)

Access the simulation solution.

Parameters
  • explicit (bool) – Computes also the explicit simulation. Default is True

  • scaled (bool) – Scales the simulation results. Default is False

get_time_series(p, scaled=False)

Access the time series of the simulation.

Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

get_time_series_phase(p, phase_name, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [-] or [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

run_driver()

Runs the optimization.

Returns

failed – Returns the result of the optimization 0 or 1

Return type

int

save(rec_file)

Pickle the whole Analyzer class.

Parameters

rec_file (str) – Directory path to the file where the Analyzer is serialized

class latom.analyzer.analyzer_heo_2d.TwoDim3PhasesLLO2HEOAnalyzer(body, sc, alt, rp, t, t_bounds, method, nb_seg, order, solver, snopt_opts=None, rec_file=None, check_partials=False)[source]

Bases: latom.analyzer.analyzer_heo_2d.TwoDimMultiPhasesLLO2HEOAnalyzer

Analyzer class defines the methods to analyze the results of a two dimensional 3 phases LLO to HEO simulation.

It gives the results of an optimal trajectory from a Low Lunar Orbit of chosen altitude to an High Elliptical Orbit which can represent a transposition of an Halo orbit in 2D. The trajectory is modeled as the succession of three different phases: a first powered phase for departure, a coasting arch and a final powered phase for the injection.

Parameters
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics alt : float

  • alt (float) – Value of the initial LLO altitude [m]

  • rp (float) – Value for the target HEO periselene radius [m]

  • t (float) – Value for the guessed trajectory time of flight [s]

  • t_bounds (float) – Value for the time of flight bounds [-]

  • method (str) – NLP transcription method

  • nb_seg (int) – Number of segments for the transcription

  • order (int) – Transcription order

  • solver (str) – NLP solver

  • snopt_opts (dict) – Sets some SNOPT’s options. Default is None

  • rec_file (str) – Directory path for the solution recording file. Default is None

  • check_partials (bool) – Checking of partial derivatives. Default is False

Variables
  • body (Primary) – Instance of Primary class describing the central attracting body

  • sc (Spacecraft) – Instance of Spacecraft class describing the spacecraft characteristics

  • phase_name (str) – Describes the phase name in case of multi-phase trajectories. Can be dep, coast or arr.

  • nlp (NLP) – Instance of NLP object describing the type of Non Linear Problem solver used

  • tof (float) – Value of the time of flight resulting by the simulation [s]

  • tof_exp (float) – Value of the time of flight of the explicit simulation [s]

  • err (float) – Value of the error between the optimized simulation results and the explicit simulation results

  • rm_res (float) – Value of the central body radius [-] or [m]

  • states_scalers (ndarray) – Reference values of the states with which perform the scaling

  • controls_scalers (ndarray) – Reference values of the controls with which perform the scaling

get_discretization_phase(p, phase_name, scaled=False)

Access the time of flight, the states on the states discretization nodes and the controls on the control discretization nodes for a given Problem and Phase.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • states (ndarray) – States values on the state discretization nodes for the optimized simulation phase

  • controls (ndarray) – Controls values on the controls discretization nodes for the optimized simulation phase

get_solution_dictionary(p, scaled=False)
Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

sol – Dictionary containing the NLP solution

Return type

dict

get_time_series(p, scaled=False)[source]

Access the time series of the problem.

Parameters
  • p (Problem) – Instance of Problem class

  • scaled (bool) – Scales the simulation results

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [-] or [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

get_time_series_phase(p, phase_name, scaled=False)

Access the time series of one of the problem phases.

Parameters
  • p (Problem) – Instance of Problem class

  • phase_name (str) – Name defined for the problem phase

  • scaled (bool, optional) – If True scales the simulation results. Default is False

Returns

  • tof (float) – Time of flight resulting from the optimized simulation phase [-] or [s]

  • t (ndarray) – Time of flight time series for the optimized simulation phase [-] or [s]

  • states (ndarray) – States time series for the optimized simulation phase

  • controls (ndarray) – Controls time series for the optimized simulation phase

plot()

Plots the states and controls resulting from the simulation and the ones from the explicit computation in time. The semi-major axis and the eccentricity of the HEO are also displayed.

run_driver()

Runs the optimization.

Returns

failed – Returns the result of the optimization 0 or 1

Return type

int

save(rec_file)

Pickle the whole Analyzer class.

Parameters

rec_file (str) – Directory path to the file where the Analyzer is serialized

get_solutions(explicit=True, scaled=False)[source]

Access the simulation solution.

Parameters
  • explicit (bool) – Computes also the explicit simulation. Default is True

  • scaled (bool) – Scales the simulation results. Default is False