latom.nlp.nlp_2d¶
@authors: Alberto FOSSA’ Giuliana Elena MICELI
Classes
|
MultiPhaseNLP transcribes a continuous-time optimal control problem in trajectory optimization constituted by multiple phases into a Non Linear Programming Problem (NLP) using the libraries OpenMDAO and dymos. |
|
ODE2dConstThrust class defines the equations of motion for a two dim. |
|
ODE2dVToff class defines the equations of motion for a two dim. |
|
ODE2dVarThrust class defines the equations of motion for a two dim. |
|
ODE2dVertical class defines the equations of motion for a two dim. |
|
SinglePhaseNLP transcribes a continuous-time optimal control problem in trajectory optimization constituted by a single phase into a Non Linear Programming Problem (NLP) using the libraries OpenMDAO and dymos. |
|
TwoDimAscConstNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimAscGuess provides an initial guess for a two-dimensional ascent trajectory from the Moon surface to a circular LLO. |
|
TwoDimAscVToffNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimAscVarNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimConstNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimDescConstNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimDescGuess provides an initial guess for a two-dimensional descent trajectory from a circular LLO to the Moon surface. |
|
TwoDimDescTwoPhasesNLP transcribes a continuous-time optimal control problem for a two-dimensional descent trajectory into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimAscVToffNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimDescVarNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimVToffNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
|
TwoDimVarNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries. |
-
class
latom.nlp.nlp_2d.TwoDimNLP(body, sc, alt, alpha_bounds, method, nb_seg, order, solver, ode_class, ode_kwargs, ph_name, snopt_opts=None, rec_file=None)[source]¶ Bases:
latom.nlp.nlp.SinglePhaseNLPTwoDimNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional trajectory is described in polar coordinates centered at the center of the attracting body.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
alpha_bounds (iterable) – Lower and upper bounds on thrust vector direction [rad]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ode_class (ExplicitComponent) – Instance of OpenMDAO ExplicitComponent describing the Ordinary Differential Equations (ODEs) that drive the system dynamics
ode_kwargs (dict) – Keywords arguments to be passed to ode_class
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
- Variables
alt (float) – Orbit altitude [m]
alpha_bounds (ndarray) – Lower and upper bounds on thrust vector direction [rad]
r_circ (float) – Orbit radius [m]
v_circ (float) – Orbital velocity [m/s]
guess (TwoDimGuess) – Initial guess to be provided before solving the NLP
-
set_states_options(theta, u_bound=None)[source]¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_controls_options(throttle=True)[source]¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)[source]¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)[source]¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimConstNLP(body, sc, alt, theta, alpha_bounds, tof, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, u_bound=None)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimNLPTwoDimConstNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines is supposed to have a constant magnitude throughout the whole phase.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
theta (float) – Guessed spawn angle [rad]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
tof (float) – Guessed time of flight [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of TOF [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_options(theta, tof, t_bounds, u_bound=None)[source]¶ Set options on state and control variables, time and objective function.
- Parameters
theta (float) – Guessed spawn angle [rad]
tof (float) – Guessed time of flight [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of TOF [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimAscConstNLP(body, sc, alt, theta, alpha_bounds, tof, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, u_bound='lower')[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimConstNLPTwoDimAscConstNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional ascent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines is supposed to have a constant magnitude throughout the whole phase.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
theta (float) – Guessed spawn angle [rad]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
tof (float) – Guessed time of flight [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default islower
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_options(theta, tof, t_bounds, u_bound=None)¶ Set options on state and control variables, time and objective function.
- Parameters
theta (float) – Guessed spawn angle [rad]
tof (float) – Guessed time of flight [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of TOF [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimDescConstNLP(body, sc, alt, vp, theta, alpha_bounds, tof, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, u_bound='upper')[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimConstNLPTwoDimDescConstNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional descent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines is supposed to have a constant magnitude throughout the whole phase.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
theta (float) – Guessed spawn angle [rad]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
tof (float) – Guessed time of flight [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default isupper
- Variables
vp (float) – Velocity at the periapsis of the Hohmann transfer where the final powered descent is initiated [m/s]
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_options(theta, tof, t_bounds, u_bound=None)¶ Set options on state and control variables, time and objective function.
- Parameters
theta (float) – Guessed spawn angle [rad]
tof (float) – Guessed time of flight [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of TOF [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimVarNLP(body, sc, alt, alpha_bounds, t_bounds, method, nb_seg, order, solver, ph_name, guess, snopt_opts=None, rec_file=None, check_partials=False, u_bound=None, fix_final=False)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimNLPTwoDimVarNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines varies in magnitude during the phase.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
guess (TwoDimGuess) – Initial guess for the NLP solution
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is Nonefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalse
- Variables
guess (TwoDimGuess) – Initial guess for the NLP solution
-
set_options(theta, t_bounds, u_bound=None)[source]¶ Set options on state and control variables, time and objective function.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimAscVarNLP(body, sc, alt, alpha_bounds, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, u_bound='lower', fix_final=False)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimVarNLPTwoDimAscVarNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional ascent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines varies in magnitude during the phase.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [-]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default islowerfix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalse
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_options(theta, t_bounds, u_bound=None)¶ Set options on state and control variables, time and objective function.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimDescVarNLP(body, sc, alt, alpha_bounds, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, u_bound='upper', fix_final=False)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimVarNLPTwoDimDescVarNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional descent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines varies in magnitude during the phase.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default isupperfix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalse
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_options(theta, t_bounds, u_bound=None)¶ Set options on state and control variables, time and objective function.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimVToffNLP(body, sc, alt, alt_safe, slope, alpha_bounds, t_bounds, method, nb_seg, order, solver, ph_name, guess, snopt_opts=None, rec_file=None, check_partials=False, u_bound=None, fix_final=False)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimVarNLPTwoDimVToffNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional ascent/descent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines varies in magnitude during the phase. An appropriate path constraint is imposed on the spacecraft state to guarantee a vertical take-off or landing.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
alt_safe (float) – Minimum altitude above the Moon surface to be maintained by the spacecraft far from the launch site [m]
slope (float) – Slope of the path constraint on the spacecraft radius and angle close to the launch site. Higher the value, steeper the ascent/descent [-]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
guess (TwoDimGuess) – Initial guess for the NLP solution
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is Nonefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalse
- Variables
alt_safe (float) – Minimum altitude above the Moon surface to be maintained by the spacecraft far from the launch site [m]
slope (float) – Slope of the path constraint on the spacecraft radius and angle close to the launch site. Higher the value, steeper the ascent [-]
guess (TwoDimGuess) – Initial guess for the NLP solution
-
set_options(theta, t_bounds, u_bound=None)[source]¶ Set the states and controls options and the path constraint.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimAscVToffNLP(body, sc, alt, alt_safe, slope, alpha_bounds, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, u_bound='lower', fix_final=False)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimVToffNLPTwoDimAscVToffNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional ascent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines varies in magnitude during the phase. An appropriate path constraint is imposed on the spacecraft state to guarantee a vertical take-off.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
alt_safe (float) – Minimum altitude above the Moon surface to be maintained by the spacecraft far from the launch site [m]
slope (float) – Slope of the path constraint on the spacecraft radius and angle close to the launch site. Higher the value, steeper the ascent [-]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default islowerfix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalse
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_options(theta, t_bounds, u_bound=None)¶ Set the states and controls options and the path constraint.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimDescVLandNLP(body, sc, alt, alt_safe, slope, alpha_bounds, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, u_bound='upper', fix_final=True)[source]¶ Bases:
latom.nlp.nlp_2d.TwoDimVToffNLPTwoDimAscVToffNLP class transcribes a two-dimensional, continuous-time optimal control problem in trajectory optimization into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-dimensional descent trajectory is described in polar coordinates centered at the center of the attracting body. The thrust delivered by the spacecraft engines varies in magnitude during the phase. An appropriate path constraint is imposed on the spacecraft state to guarantee a vertical landing.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Orbit altitude [m]
alt_safe (float) – Minimum altitude above the Moon surface to be maintained by the spacecraft far from the launch site [m]
slope (float) – Slope of the path constraint on the spacecraft radius and angle close to the launch site. Higher the value, steeper the descent [-]
alpha_bounds (tuple) – Lower and upper bounds on thrust vector direction [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int) – Number of segments in which each phase is discretized
order (int) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (str) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falseu_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default isupperfix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalse
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_controls_options(throttle=True)¶ Set options on control variables.
- Parameters
throttle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess(check_partials=False, fix_final=False, throttle=True)¶ Set the initial guess for the iterative solution of the NLP.
- Parameters
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix_final (bool, optional) –
Trueif the final time is fixed,Falseotherwise. Default isFalsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_initial_guess_interpolation(bcs=array([[1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.]]), check_partials=False, throttle=True)¶ Set the initial guess for the solution of the NLP interpolating the Boundary Conditions (BCs) imposed on the state and control variables.
- Parameters
bcs (ndarray, optional) – Boundary Conditions on state and control variables. Default is all ones
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsethrottle (bool, optional) –
Truefor variable thrust magnitude,Falseotherwise. Default is ‘True`
-
set_objective()¶ Set the NLP objective as the minimization of the opposite of the final spacecraft mass.
-
set_options(theta, t_bounds, u_bound=None)¶ Set the states and controls options and the path constraint.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_states_options(theta, u_bound=None)¶ Set options on the state variables of the NLP.
- Parameters
theta (float) – Reference value for spawn angle [rad]
u_bound (str or None, optional) – Bounds on spacecraft radial velocity between
lowerandupperor None. Default is None
-
set_time_guess(tof)¶ Compute the time grid on the phase to retrieve the time instants corresponding to states, controls and all discretization nodes.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
-
set_time_options(tof, t_bounds)¶ Set the time options on the phase.
- Parameters
tof (float) – Phase time of flight (TOF) [s]
t_bounds (tuple) – Time of flight lower and upper bounds expressed as a fraction of tof
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.
-
class
latom.nlp.nlp_2d.TwoDimDescTwoPhasesNLP(body, sc, alt, alt_switch, vp, theta, alpha_bounds, tof, t_bounds, method, nb_seg, order, solver, ph_name, snopt_opts=None, rec_file=None, check_partials=False, fix='alt')[source]¶ Bases:
latom.nlp.nlp.MultiPhaseNLPTwoDimDescTwoPhasesNLP transcribes a continuous-time optimal control problem for a two-dimensional descent trajectory into a Non Linear Programming Problem (NLP) using the OpenMDAO and dymos libraries.
The two-phases transfer is constituted by an initial deorbit burn to lower the periapsis of the departure orbit, an Hohmann transfer, a first powered phase from its periapsis to a predetermined altitude or time to go and a final vertical descent at full thrust.
- Parameters
body (Primary) – Instance of Primary class representing the central attracting body
sc (Spacecraft) – Instance of Spacecraft class representing the spacecraft
alt (float) – Periselene altitude at which the powered descent is initiated [m]
alt_switch (float) – Altitude at which the vertical descent is triggered [m]
vp (float) – Periselene velocity at which the powered descent is initiated [m/s]
theta (float) – Guessed spawn angle [rad]
alpha_bounds (iterable) – Lower and upper bounds on thrust vector direction [rad]
tof (iterable) – Guessed time of flight for the two phases [s]
t_bounds (tuple) – Time of flight bounds expressed as fraction of tof [-]
method (str) – Transcription method used to discretize the continuous time trajectory into a finite set of nodes, allowed
gauss-lobatto,radau-psandrunge-kuttanb_seg (int or tuple) – Number of segments in which each phase is discretized
order (int or tuple) – Transcription order within each phase, must be odd
solver (str) – NLP solver, must be supported by OpenMDAO
ph_name (tuple) – Name of the phase within OpenMDAO
snopt_opts (dict or None, optional) – SNOPT optional settings expressed as key-value pairs. Refer to the SNOPT User Guide for more details. Default is None
rec_file (str or None, optional) – Name of the file in which the computed solution is recorded or None. Default is None
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
Falsefix (str, optional) –
altto trigger the vertical phase at fixed altitude equal to alt_switch,timeto trigger the vertical phase at fixed time to go equal to the second component of tof. Default isalt
- Variables
alt (float) – Periselene altitude at which the powered descent is initiated [m]
alt_switch (float) – Altitude at which the vertical descent is triggered [m]
rp (float) – Periselene radius at which the powered descent is initiated [m]
r_switch (float) – Radius at which the vertical descent is triggered [m]
vp (float) – Periselene velocity at which the powered descent is initiated [m/s]
alpha_bounds (iterable) – Lower and upper bounds on thrust vector direction [rad]
tof (iterable) – Guessed time of flight for the two phases [s]
fix (str, optional) –
altto trigger the vertical phase at fixed altitude equal to alt_switch,timeto trigger the vertical phase at fixed time to go equal to the second component of tof. Default isalt
-
set_options(theta, t_bounds)[source]¶ Set the time, states and control options for both phases and add the NLP objective.
- Parameters
theta (float) – Guessed spawn angle [rad]
t_bounds (iterable) – Time of flight bounds expressed as fraction of tof [-]
-
set_initial_guess(theta, check_partials=False)[source]¶ Set the initial guess for the NLP solution as simple linear interpolation of the Boundary Conditions.
- Parameters
theta (float) – Guessed spawn angle [rad]
check_partials (bool, optional) – Check the partial derivatives computed analytically against complex step method. Default is
False
-
cleanup()¶ Clean up resources.
-
exp_sim(rec_file=None)¶ Explicitly simulate the implicitly obtained optimal solution using Scipy solve_ivp method.
-
set_time_phase(ti, tof, phase, phase_name)¶ Compute the time grid within one phase to retrieve the time instants corresponding to the state, control and all discretization nodes.
- Parameters
ti (float) – Initial time [-]
tof (float) – Time of flight (TOF) [-]
phase (Phase) – Current phase
phase_name (str) – Current phase name
- Returns
state_nodes (ndarray) – Indexes corresponding to the state discretization nodes
control_nodes (ndarray) – Indexes corresponding to the control discretization nodes
t_state (ndarray) – Time instants on the state discretization nodes [-]
t_control (ndarray) – Time instants on the control discretization nodes [-]
t_all (ndarray) – Time instants on all discretization nodes [-]
-
setup()¶ Set up the Jacobian type, linear solver and derivatives type.