SSTO Earth Launch#

This example is based on the Time-Optimal Launch of a Titan II example given in Appendix B of Longuski [LGuzmanP14]. It finds the pitch profile for a single-stage-to-orbit launch vehicle that minimizes the time required to reach orbit insertion under constant thrust.

The free-body-diagram of the single-stage-to-orbit problem.

The vehicle dynamics are given by

(84)#\[\begin{align} \frac{dx}{dt} &= v_x \\ \frac{dy}{dt} &= v_y \\ \frac{dv_x}{dt} &= \frac{1}{m} (T \cos \theta - D \cos \gamma) \\ \frac{dv_y}{dt} &= \frac{1}{m} (T \sin \theta - D \sin \gamma) - g \\ \frac{dm}{dt} &= \frac{T}{g I_{sp}} \end{align}\]

The initial conditions are

(85)#\[\begin{align} x_0 &= 0 \\ y_0 &= 0 \\ v_{x0} &= 0 \\ v_{y0} &= 0 \\ m_0 &= 117000 \rm{\,kg} \end{align}\]

and the final conditions are

(86)#\[\begin{align} x_f &= \rm{free} \\ y_f &= 185 \rm{\,km} \\ v_{xf} &= V_{circ} \\ v_{yf} &= 0 \\ m_f &= \rm{free} \end{align}\]

Defining the ODE#

Generally, one could define the ODE system as a composite group of multile components. The atmosphere component computes density (\(\rho\)). The eom component computes the state rates. Decomposing the ODE into smaller calculations makes it easier to derive the analytic derivatives.

The notional XDSM diagram for the ODE system in the SSTO problem.

However, for this example we will demonstrate the use of complex-step differentiation and define the ODE as a single component. This saves time up front in the deevlopment of the ODE at a minor cost in execution time.

The unconnected inputs to the EOM at the top of the diagram are provided by the Dymos phase as states, controls, or time values. The outputs, including the state rates, are shown on the right side of the diagram. The Dymos phases use state rate values to ensure that the integration technique satisfies the dynamics of the system.

import openmdao.api as om
import numpy as np


class LaunchVehicleODE(om.ExplicitComponent):

    def initialize(self):
        self.options.declare('num_nodes', types=int,
                             desc='Number of nodes to be evaluated in the RHS')

        self.options.declare('g', types=float, default=9.80665,
                             desc='Gravitational acceleration, m/s**2')

        self.options.declare('rho_ref', types=float, default=1.225,
                             desc='Reference atmospheric density, kg/m**3')

        self.options.declare('h_scale', types=float, default=8.44E3,
                             desc='Reference altitude, m')

        self.options.declare('CD', types=float, default=0.5,
                             desc='coefficient of drag')

        self.options.declare('S', types=float, default=7.069,
                             desc='aerodynamic reference area (m**2)')

    def setup(self):
        nn = self.options['num_nodes']

        self.add_input('y',
                       val=np.zeros(nn),
                       desc='altitude',
                       units='m')

        self.add_input('vx',
                       val=np.zeros(nn),
                       desc='x velocity',
                       units='m/s')

        self.add_input('vy',
                       val=np.zeros(nn),
                       desc='y velocity',
                       units='m/s')

        self.add_input('m',
                       val=np.zeros(nn),
                       desc='mass',
                       units='kg')

        self.add_input('theta',
                       val=np.zeros(nn),
                       desc='pitch angle',
                       units='rad')

        self.add_input('thrust',
                       val=2100000 * np.ones(nn),
                       desc='thrust',
                       units='N')

        self.add_input('Isp',
                       val=265.2 * np.ones(nn),
                       desc='specific impulse',
                       units='s')
        # Outputs
        self.add_output('xdot',
                        val=np.zeros(nn),
                        desc='velocity component in x',
                        units='m/s')

        self.add_output('ydot',
                        val=np.zeros(nn),
                        desc='velocity component in y',
                        units='m/s')

        self.add_output('vxdot',
                        val=np.zeros(nn),
                        desc='x acceleration magnitude',
                        units='m/s**2')

        self.add_output('vydot',
                        val=np.zeros(nn),
                        desc='y acceleration magnitude',
                        units='m/s**2')

        self.add_output('mdot',
                        val=np.zeros(nn),
                        desc='mass rate of change',
                        units='kg/s')

        self.add_output('rho',
                        val=np.zeros(nn),
                        desc='density',
                        units='kg/m**3')

        # Setup partials
        # Complex-step derivatives
        self.declare_coloring(wrt='*', method='cs', show_sparsity=True)

    def compute(self, inputs, outputs):

        theta = inputs['theta']
        cos_theta = np.cos(theta)
        sin_theta = np.sin(theta)
        vx = inputs['vx']
        vy = inputs['vy']
        m = inputs['m']
        F_T = inputs['thrust']
        Isp = inputs['Isp']
        y = inputs['y']

        g = self.options['g']
        rho_ref = self.options['rho_ref']
        h_scale = self.options['h_scale']

        CDA = self.options['CD'] * self.options['S']

        outputs['rho'] = rho_ref * np.exp(-y / h_scale)
        outputs['xdot'] = vx
        outputs['ydot'] = vy
        outputs['vxdot'] = (F_T * cos_theta - 0.5 * CDA * outputs['rho'] * vx**2) / m
        outputs['vydot'] = (F_T * sin_theta - 0.5 * CDA * outputs['rho'] * vy**2) / m - g
        outputs['mdot'] = -F_T / (g * Isp)

Solving the problem#

import matplotlib.pyplot as plt
import openmdao.api as om
import dymos as dm

#
# Setup and solve the optimal control problem
#
p = om.Problem(model=om.Group())
p.driver = om.pyOptSparseDriver()
p.driver.declare_coloring(tol=1.0E-12)

from dymos.examples.ssto.launch_vehicle_ode import LaunchVehicleODE

#
# Initialize our Trajectory and Phase
#
traj = dm.Trajectory()

phase = dm.Phase(ode_class=LaunchVehicleODE,
                 transcription=dm.GaussLobatto(num_segments=12, order=3, compressed=False))

traj.add_phase('phase0', phase)
p.model.add_subsystem('traj', traj)

#
# Set the options for the variables
#
phase.set_time_options(fix_initial=True, duration_bounds=(10, 500))

phase.add_state('x', fix_initial=True, ref=1.0E5, defect_ref=10000.0,
                rate_source='xdot')
phase.add_state('y', fix_initial=True, ref=1.0E5, defect_ref=10000.0,
                rate_source='ydot')
phase.add_state('vx', fix_initial=True, ref=1.0E3, defect_ref=1000.0,
                rate_source='vxdot')
phase.add_state('vy', fix_initial=True, ref=1.0E3, defect_ref=1000.0,
                rate_source='vydot')
phase.add_state('m', fix_initial=True, ref=1.0E3, defect_ref=100.0,
                rate_source='mdot')

phase.add_control('theta', units='rad', lower=-1.57, upper=1.57, targets=['theta'])
phase.add_parameter('thrust', units='N', opt=False, val=2100000.0, targets=['thrust'])

#
# Set the options for our constraints and objective
#
phase.add_boundary_constraint('y', loc='final', equals=1.85E5, linear=True)
phase.add_boundary_constraint('vx', loc='final', equals=7796.6961)
phase.add_boundary_constraint('vy', loc='final', equals=0)

phase.add_objective('time', loc='final', scaler=0.01)

p.model.linear_solver = om.DirectSolver()

#
# Setup and set initial values
#
p.setup(check=True)

phase.set_time_val(initial=0.0, duration=150.0)
phase.set_state_val('x', [0, 1.15E5])
phase.set_state_val('y', [0, 1.85E5])
phase.set_state_val('vy', [1.0E-6, 0])
phase.set_state_val('m', [117000, 1163])
phase.set_control_val('theta', [1.5, -0.76])
phase.set_parameter_val('thrust', 2.1, units='MN')

#
# Solve the Problem
#
dm.run_problem(p, simulate=True)
--- Constraint Report [traj] ---
    --- phase0 ---
        [final]   1.8500e+05 == y [m]
        [final]   7.7967e+03 == vx [m/s]
        [final]   0.0000e+00 == vy [m/s]

INFO: checking out_of_order
INFO: checking system
INFO: checking solvers
INFO: checking dup_inputs
INFO: checking missing_recorders
WARNING: The Problem has no recorder of any kind attached
INFO: checking unserializable_options
INFO: checking comp_has_no_outputs
INFO: checking auto_ivc_warnings
Model viewer data has already been recorded for Driver.
INFO: checking out_of_order
INFO: checking system
INFO: checking solvers
INFO: checking dup_inputs
INFO: checking missing_recorders
WARNING: The Problem has no recorder of any kind attached
INFO: checking unserializable_options
INFO: checking comp_has_no_outputs
INFO: checking auto_ivc_warnings
Coloring for 'traj.phases.phase0.rhs_disc' (class LaunchVehicleODE)

Jacobian shape: (144, 168)  (1.40% nonzero)
FWD solves: 5   REV solves: 0
Total colors vs. total size: 5 vs 168  (97.02% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity:   0.0262 sec
Time to compute coloring:   0.0121 sec
Memory to compute coloring:   0.1250 MB

Coloring for 'traj.phases.phase0.rhs_col' (class LaunchVehicleODE)

Jacobian shape: (72, 84)  (2.98% nonzero)
FWD solves: 5   REV solves: 0
Total colors vs. total size: 5 vs 84  (94.05% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity:   0.0125 sec
Time to compute coloring:   0.0063 sec
Memory to compute coloring:   0.0000 MB
Full total jacobian for problem 'problem' was computed 3 times, taking 0.07972949400004836 seconds.
Total jacobian shape: (74, 152) 


Jacobian shape: (74, 152)  (5.38% nonzero)
FWD solves: 12   REV solves: 0
Total colors vs. total size: 12 vs 152  (92.11% improvement)

Sparsity computed using tolerance: 1e-12
Time to compute sparsity:   0.0797 sec
Time to compute coloring:   0.0541 sec
Memory to compute coloring:   0.0000 MB
Coloring created on: 2024-08-15 12:53:28
Optimization Problem -- Optimization using pyOpt_sparse
================================================================================
    Objective Function: _objfunc

    Solution: 
--------------------------------------------------------------------------------
    Total Time:                    1.5875
       User Objective Time :       0.0648
       User Sensitivity Time :     0.9221
       Interface Time :            0.1371
       Opt Solver Time:            0.4635
    Calls to Objective Function :      51
    Calls to Sens Function :           48


   Objectives
      Index  Name                     Value
          0  traj.phase0.t     1.431612E+00

   Variables (c - continuous, i - integer, d - discrete)
      Index  Name                            Type      Lower Bound            Value      Upper Bound     Status
          0  traj.phase0.t_duration_0           c     1.000000E+01     1.431612E+02     5.000000E+02           
          1  traj.phase0.states:x_0             c    -1.000000E+16     1.423870E-03     1.000000E+16           
          2  traj.phase0.states:x_1             c    -1.000000E+16     1.423870E-03     1.000000E+16           
          3  traj.phase0.states:x_2             c    -1.000000E+16     5.539810E-03     1.000000E+16           
          4  traj.phase0.states:x_3             c    -1.000000E+16     5.539810E-03     1.000000E+16           
          5  traj.phase0.states:x_4             c    -1.000000E+16     1.299270E-02     1.000000E+16           
          6  traj.phase0.states:x_5             c    -1.000000E+16     1.299270E-02     1.000000E+16           
          7  traj.phase0.states:x_6             c    -1.000000E+16     2.477512E-02     1.000000E+16           
          8  traj.phase0.states:x_7             c    -1.000000E+16     2.477512E-02     1.000000E+16           
          9  traj.phase0.states:x_8             c    -1.000000E+16     4.205719E-02     1.000000E+16           
         10  traj.phase0.states:x_9             c    -1.000000E+16     4.205719E-02     1.000000E+16           
         11  traj.phase0.states:x_10            c    -1.000000E+16     6.704410E-02     1.000000E+16           
         12  traj.phase0.states:x_11            c    -1.000000E+16     6.704410E-02     1.000000E+16           
         13  traj.phase0.states:x_12            c    -1.000000E+16     1.024324E-01     1.000000E+16           
         14  traj.phase0.states:x_13            c    -1.000000E+16     1.024324E-01     1.000000E+16           
         15  traj.phase0.states:x_14            c    -1.000000E+16     1.531004E-01     1.000000E+16           
         16  traj.phase0.states:x_15            c    -1.000000E+16     1.531004E-01     1.000000E+16           
         17  traj.phase0.states:x_16            c    -1.000000E+16     2.286348E-01     1.000000E+16           
         18  traj.phase0.states:x_17            c    -1.000000E+16     2.286348E-01     1.000000E+16           
         19  traj.phase0.states:x_18            c    -1.000000E+16     3.530010E-01     1.000000E+16           
         20  traj.phase0.states:x_19            c    -1.000000E+16     3.530010E-01     1.000000E+16           
         21  traj.phase0.states:x_20            c    -1.000000E+16     5.931618E-01     1.000000E+16           
         22  traj.phase0.states:x_21            c    -1.000000E+16     5.931618E-01     1.000000E+16           
         23  traj.phase0.states:x_22            c    -1.000000E+16     1.124444E+00     1.000000E+16           
         24  traj.phase0.states:y_0             c    -1.000000E+16     6.071941E-03     1.000000E+16           
         25  traj.phase0.states:y_1             c    -1.000000E+16     6.071941E-03     1.000000E+16           
         26  traj.phase0.states:y_2             c    -1.000000E+16     2.558451E-02     1.000000E+16           
         27  traj.phase0.states:y_3             c    -1.000000E+16     2.558451E-02     1.000000E+16           
         28  traj.phase0.states:y_4             c    -1.000000E+16     6.038537E-02     1.000000E+16           
         29  traj.phase0.states:y_5             c    -1.000000E+16     6.038537E-02     1.000000E+16           
         30  traj.phase0.states:y_6             c    -1.000000E+16     1.127399E-01     1.000000E+16           
         31  traj.phase0.states:y_7             c    -1.000000E+16     1.127399E-01     1.000000E+16           
         32  traj.phase0.states:y_8             c    -1.000000E+16     1.861696E-01     1.000000E+16           
         33  traj.phase0.states:y_9             c    -1.000000E+16     1.861696E-01     1.000000E+16           
         34  traj.phase0.states:y_10            c    -1.000000E+16     2.860066E-01     1.000000E+16           
         35  traj.phase0.states:y_11            c    -1.000000E+16     2.860066E-01     1.000000E+16           
         36  traj.phase0.states:y_12            c    -1.000000E+16     4.198521E-01     1.000000E+16           
         37  traj.phase0.states:y_13            c    -1.000000E+16     4.198521E-01     1.000000E+16           
         38  traj.phase0.states:y_14            c    -1.000000E+16     5.976777E-01     1.000000E+16           
         39  traj.phase0.states:y_15            c    -1.000000E+16     5.976777E-01     1.000000E+16           
         40  traj.phase0.states:y_16            c    -1.000000E+16     8.326284E-01     1.000000E+16           
         41  traj.phase0.states:y_17            c    -1.000000E+16     8.326284E-01     1.000000E+16           
         42  traj.phase0.states:y_18            c    -1.000000E+16     1.140649E+00     1.000000E+16           
         43  traj.phase0.states:y_19            c    -1.000000E+16     1.140649E+00     1.000000E+16           
         44  traj.phase0.states:y_20            c    -1.000000E+16     1.525001E+00     1.000000E+16           
         45  traj.phase0.states:y_21            c    -1.000000E+16     1.525001E+00     1.000000E+16           
         46  traj.phase0.states:y_22            c    -1.000000E+16     1.850000E+00     1.000000E+16           
         47  traj.phase0.states:vx_0            c    -1.000000E+18     2.327869E-02     1.000000E+18           
         48  traj.phase0.states:vx_1            c    -1.000000E+18     2.327869E-02     1.000000E+18           
         49  traj.phase0.states:vx_2            c    -1.000000E+18     4.659191E-02     1.000000E+18           
         50  traj.phase0.states:vx_3            c    -1.000000E+18     4.659191E-02     1.000000E+18           
         51  traj.phase0.states:vx_4            c    -1.000000E+18     7.980599E-02     1.000000E+18           
         52  traj.phase0.states:vx_5            c    -1.000000E+18     7.980599E-02     1.000000E+18           
         53  traj.phase0.states:vx_6            c    -1.000000E+18     1.191955E-01     1.000000E+18           
         54  traj.phase0.states:vx_7            c    -1.000000E+18     1.191955E-01     1.000000E+18           
         55  traj.phase0.states:vx_8            c    -1.000000E+18     1.737234E-01     1.000000E+18           
         56  traj.phase0.states:vx_9            c    -1.000000E+18     1.737234E-01     1.000000E+18           
         57  traj.phase0.states:vx_10           c    -1.000000E+18     2.487371E-01     1.000000E+18           
         58  traj.phase0.states:vx_11           c    -1.000000E+18     2.487371E-01     1.000000E+18           
         59  traj.phase0.states:vx_12           c    -1.000000E+18     3.510681E-01     1.000000E+18           
         60  traj.phase0.states:vx_13           c    -1.000000E+18     3.510681E-01     1.000000E+18           
         61  traj.phase0.states:vx_14           c    -1.000000E+18     5.108624E-01     1.000000E+18           
         62  traj.phase0.states:vx_15           c    -1.000000E+18     5.108624E-01     1.000000E+18           
         63  traj.phase0.states:vx_16           c    -1.000000E+18     7.858760E-01     1.000000E+18           
         64  traj.phase0.states:vx_17           c    -1.000000E+18     7.858760E-01     1.000000E+18           
         65  traj.phase0.states:vx_18           c    -1.000000E+18     1.384927E+00     1.000000E+18           
         66  traj.phase0.states:vx_19           c    -1.000000E+18     1.384927E+00     1.000000E+18           
         67  traj.phase0.states:vx_20           c    -1.000000E+18     2.869862E+00     1.000000E+18           
         68  traj.phase0.states:vx_21           c    -1.000000E+18     2.869862E+00     1.000000E+18           
         69  traj.phase0.states:vx_22           c    -1.000000E+18     7.796696E+00     1.000000E+18           
         70  traj.phase0.states:vy_0            c    -1.000000E+18     1.045598E-01     1.000000E+18           
         71  traj.phase0.states:vy_1            c    -1.000000E+18     1.045598E-01     1.000000E+18           
         72  traj.phase0.states:vy_2            c    -1.000000E+18     2.250738E-01     1.000000E+18           
         73  traj.phase0.states:vy_3            c    -1.000000E+18     2.250738E-01     1.000000E+18           
         74  traj.phase0.states:vy_4            c    -1.000000E+18     3.613861E-01     1.000000E+18           
         75  traj.phase0.states:vy_5            c    -1.000000E+18     3.613861E-01     1.000000E+18           
         76  traj.phase0.states:vy_6            c    -1.000000E+18     5.211650E-01     1.000000E+18           
         77  traj.phase0.states:vy_7            c    -1.000000E+18     5.211650E-01     1.000000E+18           
         78  traj.phase0.states:vy_8            c    -1.000000E+18     7.172279E-01     1.000000E+18           
         79  traj.phase0.states:vy_9            c    -1.000000E+18     7.172279E-01     1.000000E+18           
         80  traj.phase0.states:vy_10           c    -1.000000E+18     9.670879E-01     1.000000E+18           
         81  traj.phase0.states:vy_11           c    -1.000000E+18     9.670879E-01     1.000000E+18           
         82  traj.phase0.states:vy_12           c    -1.000000E+18     1.290602E+00     1.000000E+18           
         83  traj.phase0.states:vy_13           c    -1.000000E+18     1.290602E+00     1.000000E+18           
         84  traj.phase0.states:vy_14           c    -1.000000E+18     1.708746E+00     1.000000E+18           
         85  traj.phase0.states:vy_15           c    -1.000000E+18     1.708746E+00     1.000000E+18           
         86  traj.phase0.states:vy_16           c    -1.000000E+18     2.253313E+00     1.000000E+18           
         87  traj.phase0.states:vy_17           c    -1.000000E+18     2.253313E+00     1.000000E+18           
         88  traj.phase0.states:vy_18           c    -1.000000E+18     2.923999E+00     1.000000E+18           
         89  traj.phase0.states:vy_19           c    -1.000000E+18     2.923999E+00     1.000000E+18           
         90  traj.phase0.states:vy_20           c    -1.000000E+18     3.379547E+00     1.000000E+18           
         91  traj.phase0.states:vy_21           c    -1.000000E+18     3.379547E+00     1.000000E+18           
         92  traj.phase0.states:vy_22           c    -1.000000E+18    -4.033708E-23     1.000000E+18           
         93  traj.phase0.states:m_0             c    -1.000000E+18     1.073668E+02     1.000000E+18           
         94  traj.phase0.states:m_1             c    -1.000000E+18     1.073668E+02     1.000000E+18           
         95  traj.phase0.states:m_2             c    -1.000000E+18     9.773367E+01     1.000000E+18           
         96  traj.phase0.states:m_3             c    -1.000000E+18     9.773367E+01     1.000000E+18           
         97  traj.phase0.states:m_4             c    -1.000000E+18     8.810050E+01     1.000000E+18           
         98  traj.phase0.states:m_5             c    -1.000000E+18     8.810050E+01     1.000000E+18           
         99  traj.phase0.states:m_6             c    -1.000000E+18     7.846734E+01     1.000000E+18           
        100  traj.phase0.states:m_7             c    -1.000000E+18     7.846734E+01     1.000000E+18           
        101  traj.phase0.states:m_8             c    -1.000000E+18     6.883417E+01     1.000000E+18           
        102  traj.phase0.states:m_9             c    -1.000000E+18     6.883417E+01     1.000000E+18           
        103  traj.phase0.states:m_10            c    -1.000000E+18     5.920100E+01     1.000000E+18           
        104  traj.phase0.states:m_11            c    -1.000000E+18     5.920100E+01     1.000000E+18           
        105  traj.phase0.states:m_12            c    -1.000000E+18     4.956784E+01     1.000000E+18           
        106  traj.phase0.states:m_13            c    -1.000000E+18     4.956784E+01     1.000000E+18           
        107  traj.phase0.states:m_14            c    -1.000000E+18     3.993467E+01     1.000000E+18           
        108  traj.phase0.states:m_15            c    -1.000000E+18     3.993467E+01     1.000000E+18           
        109  traj.phase0.states:m_16            c    -1.000000E+18     3.030151E+01     1.000000E+18           
        110  traj.phase0.states:m_17            c    -1.000000E+18     3.030151E+01     1.000000E+18           
        111  traj.phase0.states:m_18            c    -1.000000E+18     2.066834E+01     1.000000E+18           
        112  traj.phase0.states:m_19            c    -1.000000E+18     2.066834E+01     1.000000E+18           
        113  traj.phase0.states:m_20            c    -1.000000E+18     1.103517E+01     1.000000E+18           
        114  traj.phase0.states:m_21            c    -1.000000E+18     1.103517E+01     1.000000E+18           
        115  traj.phase0.states:m_22            c    -1.000000E+18     1.402009E+00     1.000000E+18           
        116  traj.phase0.controls:theta_0       c    -1.570000E+00     1.477517E+00     1.570000E+00           
        117  traj.phase0.controls:theta_1       c    -1.570000E+00     1.468233E+00     1.570000E+00           
        118  traj.phase0.controls:theta_2       c    -1.570000E+00     1.474148E+00     1.570000E+00           
        119  traj.phase0.controls:theta_3       c    -1.570000E+00     1.474148E+00     1.570000E+00           
        120  traj.phase0.controls:theta_4       c    -1.570000E+00     1.477669E+00     1.570000E+00           
        121  traj.phase0.controls:theta_5       c    -1.570000E+00     1.461203E+00     1.570000E+00           
        122  traj.phase0.controls:theta_6       c    -1.570000E+00     1.461203E+00     1.570000E+00           
        123  traj.phase0.controls:theta_7       c    -1.570000E+00     1.442523E+00     1.570000E+00           
        124  traj.phase0.controls:theta_8       c    -1.570000E+00     1.439401E+00     1.570000E+00           
        125  traj.phase0.controls:theta_9       c    -1.570000E+00     1.439401E+00     1.570000E+00           
        126  traj.phase0.controls:theta_10      c    -1.570000E+00     1.438089E+00     1.570000E+00           
        127  traj.phase0.controls:theta_11      c    -1.570000E+00     1.424836E+00     1.570000E+00           
        128  traj.phase0.controls:theta_12      c    -1.570000E+00     1.424836E+00     1.570000E+00           
        129  traj.phase0.controls:theta_13      c    -1.570000E+00     1.406383E+00     1.570000E+00           
        130  traj.phase0.controls:theta_14      c    -1.570000E+00     1.389470E+00     1.570000E+00           
        131  traj.phase0.controls:theta_15      c    -1.570000E+00     1.389470E+00     1.570000E+00           
        132  traj.phase0.controls:theta_16      c    -1.570000E+00     1.375128E+00     1.570000E+00           
        133  traj.phase0.controls:theta_17      c    -1.570000E+00     1.364390E+00     1.570000E+00           
        134  traj.phase0.controls:theta_18      c    -1.570000E+00     1.364390E+00     1.570000E+00           
        135  traj.phase0.controls:theta_19      c    -1.570000E+00     1.348778E+00     1.570000E+00           
        136  traj.phase0.controls:theta_20      c    -1.570000E+00     1.319811E+00     1.570000E+00           
        137  traj.phase0.controls:theta_21      c    -1.570000E+00     1.319811E+00     1.570000E+00           
        138  traj.phase0.controls:theta_22      c    -1.570000E+00     1.283485E+00     1.570000E+00           
        139  traj.phase0.controls:theta_23      c    -1.570000E+00     1.245798E+00     1.570000E+00           
        140  traj.phase0.controls:theta_24      c    -1.570000E+00     1.245798E+00     1.570000E+00           
        141  traj.phase0.controls:theta_25      c    -1.570000E+00     1.187473E+00     1.570000E+00           
        142  traj.phase0.controls:theta_26      c    -1.570000E+00     1.089238E+00     1.570000E+00           
        143  traj.phase0.controls:theta_27      c    -1.570000E+00     1.089238E+00     1.570000E+00           
        144  traj.phase0.controls:theta_28      c    -1.570000E+00     9.418841E-01     1.570000E+00           
        145  traj.phase0.controls:theta_29      c    -1.570000E+00     7.362030E-01     1.570000E+00           
        146  traj.phase0.controls:theta_30      c    -1.570000E+00     7.362030E-01     1.570000E+00           
        147  traj.phase0.controls:theta_31      c    -1.570000E+00     4.319487E-01     1.570000E+00           
        148  traj.phase0.controls:theta_32      c    -1.570000E+00    -1.112473E-02     1.570000E+00           
        149  traj.phase0.controls:theta_33      c    -1.570000E+00    -1.112473E-02     1.570000E+00           
        150  traj.phase0.controls:theta_34      c    -1.570000E+00    -4.570600E-01     1.570000E+00           
        151  traj.phase0.controls:theta_35      c    -1.570000E+00    -7.698997E-01     1.570000E+00           

   Constraints (i - inequality, e - equality)
      Index  Name                                                        Type          Lower           Value           Upper    Status  Lagrange Multiplier (N/A)
          0  traj.phases.phase0->final_boundary_constraint->y               e   1.850000E+05    1.850000E+05    1.850000E+05              9.00000E+100
          1  traj.phases.phase0->final_boundary_constraint->vx              e   7.796696E+03    7.796696E+03    7.796696E+03              9.00000E+100
          2  traj.phases.phase0->final_boundary_constraint->vy              e   0.000000E+00   -4.033708E-20    0.000000E+00              9.00000E+100
          3  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00   -1.188094E-10    0.000000E+00              9.00000E+100
          4  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00    1.371170E-10    0.000000E+00              9.00000E+100
          5  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00   -2.557595E-10    0.000000E+00              9.00000E+100
          6  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00    2.888822E-10    0.000000E+00              9.00000E+100
          7  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00   -1.643805E-10    0.000000E+00              9.00000E+100
          8  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00   -7.405642E-10    0.000000E+00              9.00000E+100
          9  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00    3.453421E-10    0.000000E+00              9.00000E+100
         10  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00    4.648820E-10    0.000000E+00              9.00000E+100
         11  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00   -8.441018E-10    0.000000E+00              9.00000E+100
         12  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00    5.812102E-10    0.000000E+00              9.00000E+100
         13  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00    2.671539E-10    0.000000E+00              9.00000E+100
         14  traj.phase0.collocation_constraint.defects:x                   e   0.000000E+00   -6.157080E-09    0.000000E+00              9.00000E+100
         15  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    4.185466E-10    0.000000E+00              9.00000E+100
         16  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    9.614961E-09    0.000000E+00              9.00000E+100
         17  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    2.809379E-08    0.000000E+00              9.00000E+100
         18  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    3.174746E-08    0.000000E+00              9.00000E+100
         19  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    1.376446E-08    0.000000E+00              9.00000E+100
         20  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00   -3.754024E-08    0.000000E+00              9.00000E+100
         21  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00   -5.322523E-08    0.000000E+00              9.00000E+100
         22  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    2.998141E-09    0.000000E+00              9.00000E+100
         23  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    2.476582E-09    0.000000E+00              9.00000E+100
         24  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    1.813846E-09    0.000000E+00              9.00000E+100
         25  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    2.495048E-10    0.000000E+00              9.00000E+100
         26  traj.phase0.collocation_constraint.defects:y                   e   0.000000E+00    8.522371E-09    0.000000E+00              9.00000E+100
         27  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    3.499577E-09    0.000000E+00              9.00000E+100
         28  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    3.213875E-09    0.000000E+00              9.00000E+100
         29  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    8.760738E-09    0.000000E+00              9.00000E+100
         30  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    1.050294E-08    0.000000E+00              9.00000E+100
         31  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    1.502428E-08    0.000000E+00              9.00000E+100
         32  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    3.872966E-08    0.000000E+00              9.00000E+100
         33  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    1.357671E-08    0.000000E+00              9.00000E+100
         34  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    3.378725E-09    0.000000E+00              9.00000E+100
         35  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    2.245357E-08    0.000000E+00              9.00000E+100
         36  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    6.435004E-09    0.000000E+00              9.00000E+100
         37  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    2.368123E-09    0.000000E+00              9.00000E+100
         38  traj.phase0.collocation_constraint.defects:vx                  e   0.000000E+00    2.374244E-08    0.000000E+00              9.00000E+100
         39  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00    2.920377E-08    0.000000E+00              9.00000E+100
         40  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00    1.258180E-08    0.000000E+00              9.00000E+100
         41  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00   -2.350687E-08    0.000000E+00              9.00000E+100
         42  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00   -1.084222E-07    0.000000E+00              9.00000E+100
         43  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00   -1.702733E-07    0.000000E+00              9.00000E+100
         44  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00   -2.750436E-08    0.000000E+00              9.00000E+100
         45  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00   -1.483104E-08    0.000000E+00              9.00000E+100
         46  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00    2.808630E-08    0.000000E+00              9.00000E+100
         47  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00    6.222977E-08    0.000000E+00              9.00000E+100
         48  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00    9.789008E-09    0.000000E+00              9.00000E+100
         49  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00    1.080768E-09    0.000000E+00              9.00000E+100
         50  traj.phase0.collocation_constraint.defects:vy                  e   0.000000E+00   -2.001000E-08    0.000000E+00              9.00000E+100
         51  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00    6.781475E-15    0.000000E+00              9.00000E+100
         52  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00    6.781475E-15    0.000000E+00              9.00000E+100
         53  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00   -8.815917E-14    0.000000E+00              9.00000E+100
         54  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00    7.459622E-14    0.000000E+00              9.00000E+100
         55  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00   -7.459622E-14    0.000000E+00              9.00000E+100
         56  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00    4.747032E-14    0.000000E+00              9.00000E+100
         57  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00   -4.747032E-14    0.000000E+00              9.00000E+100
         58  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00    4.747032E-14    0.000000E+00              9.00000E+100
         59  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00   -2.034442E-14    0.000000E+00              9.00000E+100
         60  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00   -6.781475E-15    0.000000E+00              9.00000E+100
         61  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00    2.034442E-14    0.000000E+00              9.00000E+100
         62  traj.phase0.collocation_constraint.defects:m                   e   0.000000E+00   -6.781475E-15    0.000000E+00              9.00000E+100
         63  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         64  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         65  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         66  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         67  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         68  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         69  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         70  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         71  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         72  traj.phase0.continuity_comp.defect_states:x                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         73  traj.phase0.continuity_comp.defect_states:x                    e   2.678272E-12    0.000000E+00    2.678272E-12              9.00000E+100
         74  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         75  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         76  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         77  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         78  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         79  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         80  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         81  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         82  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         83  traj.phase0.continuity_comp.defect_states:y                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         84  traj.phase0.continuity_comp.defect_states:y                    e   8.235664E-12    0.000000E+00    8.235664E-12              9.00000E+100
         85  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         86  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         87  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         88  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         89  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         90  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         91  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         92  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         93  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         94  traj.phase0.continuity_comp.defect_states:vx                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         95  traj.phase0.continuity_comp.defect_states:vx                   e  -2.081668E-17    0.000000E+00   -2.081668E-17              9.00000E+100
         96  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         97  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         98  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
         99  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        100  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        101  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        102  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        103  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        104  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        105  traj.phase0.continuity_comp.defect_states:vy                   e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        106  traj.phase0.continuity_comp.defect_states:vy                   e  -2.584939E-24    0.000000E+00   -2.584939E-24              9.00000E+100
        107  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        108  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        109  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        110  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        111  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        112  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        113  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        114  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        115  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        116  traj.phase0.continuity_comp.defect_states:m                    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        117  traj.phase0.continuity_comp.defect_states:m                    e  -8.952838E-13   -1.818989E-12   -8.952838E-13              9.00000E+100
        118  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    2.669709E-15    0.000000E+00              9.00000E+100
        119  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    6.891574E-15    0.000000E+00              9.00000E+100
        120  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    3.880391E-17    0.000000E+00              9.00000E+100
        121  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00   -4.004563E-15    0.000000E+00              9.00000E+100
        122  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    9.468154E-15    0.000000E+00              9.00000E+100
        123  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    2.530015E-15    0.000000E+00              9.00000E+100
        124  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    6.208625E-16    0.000000E+00              9.00000E+100
        125  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    1.303811E-15    0.000000E+00              9.00000E+100
        126  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00   -3.228485E-15    0.000000E+00              9.00000E+100
        127  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00   -1.490070E-15    0.000000E+00              9.00000E+100
        128  traj.phase0.continuity_comp.defect_control_rates:theta_rate    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        129  traj.phase0.continuity_comp.defect_controls:theta              e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        130  traj.phase0.continuity_comp.defect_controls:theta              e   2.168404E-17    0.000000E+00    2.168404E-17              9.00000E+100
        131  traj.phase0.continuity_comp.defect_controls:theta              e  -4.065758E-17   -2.220446E-16   -4.065758E-17              9.00000E+100
        132  traj.phase0.continuity_comp.defect_controls:theta              e  -1.149181E-16   -1.145955E-16   -1.149181E-16              9.00000E+100
        133  traj.phase0.continuity_comp.defect_controls:theta              e   3.702715E-17   -4.612403E-17    3.702715E-17              9.00000E+100
        134  traj.phase0.continuity_comp.defect_controls:theta              e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        135  traj.phase0.continuity_comp.defect_controls:theta              e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        136  traj.phase0.continuity_comp.defect_controls:theta              e  -4.177734E-18    1.818101E-16   -4.177734E-18              9.00000E+100
        137  traj.phase0.continuity_comp.defect_controls:theta              e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        138  traj.phase0.continuity_comp.defect_controls:theta              e   3.964971E-16    4.342420E-16    3.964971E-16              9.00000E+100
        139  traj.phase0.continuity_comp.defect_controls:theta              e  -1.734723E-16   -1.734723E-16   -1.734723E-16              9.00000E+100


   Exit Status
      Inform  Description
           0  Optimization terminated successfully.
--------------------------------------------------------------------------------
/usr/share/miniconda/envs/test/lib/python3.11/site-packages/openmdao/visualization/opt_report/opt_report.py:625: UserWarning: Attempting to set identical low and high ylims makes transformation singular; automatically expanding.
  ax.set_ylim([ymin_plot, ymax_plot])
INFO: checking out_of_order
INFO: checking system
INFO: checking solvers
INFO: checking dup_inputs
INFO: checking missing_recorders
WARNING: The Problem has no recorder of any kind attached
INFO: checking unserializable_options
INFO: checking comp_has_no_outputs
INFO: checking auto_ivc_warnings
Simulating trajectory traj
Model viewer data has already been recorded for Driver.
INFO: checking out_of_order
INFO: checking system
INFO: checking solvers
INFO: checking dup_inputs
INFO: checking missing_recorders
WARNING: The Problem has no recorder of any kind attached
INFO: checking unserializable_options
INFO: checking comp_has_no_outputs
INFO: checking auto_ivc_warnings
/usr/share/miniconda/envs/test/lib/python3.11/site-packages/openmdao/core/group.py:1101: DerivativesWarning:Constraints or objectives [ode_eval.control_interp.control_rates:theta_rate2] cannot be impacted by the design variables of the problem because no partials were defined for them in their parent component(s).
Done simulating trajectory traj
Problem: problem
Driver:  pyOptSparseDriver
  success     : True
  iterations  : 53
  runtime     : 1.8470E+00 s
  model_evals : 53
  model_time  : 4.9853E-02 s
  deriv_evals : 49
  deriv_time  : 7.2574E-01 s
  exit_status : SUCCESS
Hide code cell source
sol = om.CaseReader('dymos_solution.db').get_case('final')
sim = om.CaseReader('dymos_simulation.db').get_case('final')

fig, [traj_ax, control_ax] = plt.subplots(nrows=2, ncols=1, figsize=(10, 8))

traj_ax.plot(sol.get_val('traj.phase0.timeseries.x'),
             sol.get_val('traj.phase0.timeseries.y'),
             marker='o',
             ms=4,
             linestyle='None',
             label='solution')

traj_ax.plot(sim.get_val('traj.phase0.timeseries.x'),
             sim.get_val('traj.phase0.timeseries.y'),
             marker=None,
             linestyle='-',
             label='simulation')

traj_ax.set_xlabel('range (m)')
traj_ax.set_ylabel('altitude (m)')
traj_ax.set_aspect('equal')
traj_ax.grid(True)

control_ax.plot(sol.get_val('traj.phase0.timeseries.time'),
             sol.get_val('traj.phase0.timeseries.theta'),
             marker='o',
             ms=4,
             linestyle='None')

control_ax.plot(sim.get_val('traj.phase0.timeseries.time'),
             sim.get_val('traj.phase0.timeseries.theta'),
             linestyle='-',
             marker=None)

control_ax.set_xlabel('time (s)')
control_ax.set_ylabel('theta (deg)')
control_ax.grid(True)

plt.suptitle('Single Stage to Orbit Solution Using A Dynamic Control')
fig.legend(loc='lower center', ncol=2)

plt.show()
../../_images/83b2d60baae08fd74522e85207bb0ec8797dad7ccb6009fcfb8032a424beb035.png

References#

[LGuzmanP14]

James M Longuski, José J Guzmán, and John E Prussing. Optimal control with aerospace applications. Springer, 1 edition, 2014. ISBN 978-1-4939-4917-5. doi:https://doi.org/10.1007/978-1-4614-8945-0.