The Mountain Car Problem#

The mountain car problem proposes a vehicle stuck in a “well.” It lacks the power to directly climb out of the well, but instead must accelerate repeatedly forwards and backwards until it has achieved the energy necessary to exit the well.

The problem is a popular machine learning test case, though the methods in Dymos are capable of solving it. It first appeared in the PhD thesis of Andrew Moore in 1990. [Moo90]. The implementation here is based on that given by Melnikov, Makmal, and Briegel [MMB14].

State and control variables#

This system has two state variables, the position (\(x\)) and velocity (\(v\)) of the car.

This system has a single control variable (\(u\)), the effort put into moving. This control is contrained to the range \([-1 \, 1]\).

The dynamics of the system are governed by

(65)#\[\begin{align} \dot{x} &= v \\ \dot{v} &= 0.001 * u - 0.0025 * \cos(3 x) \end{align}\]

Problem Definition#

We seek to minimize the time required to exit the well in the positive direction.

(66)#\[\begin{align} \mathrm{Minimize} \, J &= t_f \end{align}\]

Subject to the initial conditions

(67)#\[\begin{align} x_0 &= -0.5 \\ v_0 &= 0.0 \end{align}\]

the control constraints

(68)#\[\begin{align} |u| \le 1 \end{align}\]

and the terminal constraints

(69)#\[\begin{align} x_f &= 0.5 \\ v_f &\ge 0.0 \end{align}\]

Defining the ODE#

The following code implements the equations of motion for the mountain car problem.

A few things to note:

  1. By providing the tag dymos.state_rate_source:{name}, we’re letting Dymos know what states need to be integrated, there’s no need to specify a rate source when using this ODE in our Phase.

  2. Pairing the above tag with dymos.state_units:{units} means we don’t have to specify units when setting properties for the state in our run script.

  3. We only use compute_partials to override the values of \(\frac{\partial \dot{v}}{\partial x}\) because \(\frac{\partial \dot{v}}{\partial u}\) and \(\frac{\partial \dot{x}}{\partial v}\) are constant and their value is specified during setup.

import numpy as np
import openmdao.api as om


class MountainCarODE(om.ExplicitComponent):
    
    def initialize(self):
        self.options.declare('num_nodes', types=int)
        
    def setup(self):
        nn = self.options['num_nodes']
        
        self.add_input('x', shape=(nn,), units='m')
        self.add_input('v', shape=(nn,), units='m/s')
        self.add_input('u', shape=(nn,), units='unitless')
        
        self.add_output('x_dot', shape=(nn,), units='m/s',
                        tags=['dymos.state_rate_source:x', 'dymos.state_units:m'])
        self.add_output('v_dot', shape=(nn,), units='m/s**2',
                        tags=['dymos.state_rate_source:v', 'dymos.state_units:m/s'])
        
        ar = np.arange(nn, dtype=int)
        
        self.declare_partials(of='x_dot', wrt='v', rows=ar, cols=ar, val=1.0)
        self.declare_partials(of='v_dot', wrt='u', rows=ar, cols=ar, val=0.001)
        self.declare_partials(of='v_dot', wrt='x', rows=ar, cols=ar)

    def compute(self, inputs, outputs):
        x = inputs['x']
        v = inputs['v']
        u = inputs['u']
        outputs['x_dot'] = v
        outputs['v_dot'] = 0.001 * u - 0.0025 * np.cos(3*x)

    def compute_partials(self, inputs, partials):
        x = inputs['x']
        partials['v_dot', 'x'] = 3 * 0.0025 * np.sin(3 * x)
        

Solving the minimum-time mountain car problem with Dymos#

The following script solves the minimum-time mountain car problem with Dymos. Note that this example requires the IPOPT optimizer via the pyoptsparse package. Scipy’s SLSQP optimizer is generally not capable of solving this problem.

To begin, import the packages we require:

import dymos as dm
import matplotlib.pyplot as plt
from matplotlib import animation

Next, we set two constants. U_MAX is the maximum allowable magnitude of the acceleration. The references show this problem being solved with \(-1 \le u \le 1\).

Variable NUM_SEG is the number of equally spaced polynomial segments into which time is being divided. Within each of these segments, the time-history of each state and control is being treated as a polynomial (we’re using the default order of 3).

# The maximum absolute value of the acceleration authority of the car
U_MAX = 1.0

# The number of segments into which the problem is discretized
NUM_SEG = 30

We then instantiate an OpenMDAO problem and set the optimizer and its options.

For IPOPT, setting option nlp_scaling_method to 'gradient-based' can substantially improve the convergence of the optimizer without the need for us to set all of the scaling manually.

The call to declare_coloring tells the optimizer to attempt to find a sparsity pattern that minimizes the work required to compute the derivatives across the model.

#
# Initialize the Problem and the optimization driver
#
p = om.Problem()
               
p.driver = om.pyOptSparseDriver(optimizer='IPOPT')
p.driver.opt_settings['print_level'] = 0
p.driver.opt_settings['max_iter'] = 500
p.driver.opt_settings['mu_strategy'] = 'adaptive'
p.driver.opt_settings['bound_mult_init_method'] = 'mu-based'
p.driver.opt_settings['tol'] = 1.0E-8
p.driver.opt_settings['nlp_scaling_method'] = 'gradient-based'  # for faster convergence

p.driver.declare_coloring()

Next, we add a Dymos Trajectory group to the problem’s model and add a phase to it.

In this case we’re using the Radau pseudospectral transcription to solve the problem.

#
# Create a trajectory and add a phase to it
#
traj = p.model.add_subsystem('traj', dm.Trajectory())
tx = transcription=dm.Radau(num_segments=NUM_SEG)
phase = traj.add_phase('phase0', dm.Phase(ode_class=MountainCarODE, transcription=tx))

At this point, we set the options on the main variables used in a Dymos phase.

In addition to time, we have two states (x and v) and a single control (u).

There are no parameters and no polynomial controls. We could have tried to use a polynomial control here, but as we will see the solution contains large discontinuities in the control value, which make it ill-suited for a polynomial control. Polynomial controls are modeled as a single (typically low-order) polynomial across the entire phase.

We’re fixing the initial time and states to whatever values we provide before executing the problem. We will constrain the final values with nonlinear constraints in the next step.

The scaler values (ref) are all set to 1 here. We’re using IPOPT’s gradient-based scaling option and will let it work the scaling out for us.

Bounds on time duration are guesses, and the bounds on the states and controls come from the implementation in the references.

Also, we don’t need to specify targets for any of the variables here because their names are the targets in the top-level of the model. The rate source and units for the states are obtained from the tags in the ODE component we previously defined.

#
# Set the variables
#
phase.set_time_options(fix_initial=True, duration_bounds=(.05, 10000), duration_ref=1)

phase.add_state('x', fix_initial=True, fix_final=False, lower=-1.2, upper=0.5, ref=1, defect_ref=1)
phase.add_state('v', fix_initial=True, fix_final=False, lower=-0.07, upper=0.07, ref=1, defect_ref=1)
phase.add_control('u', lower=-U_MAX, upper=U_MAX, ref=1, continuity=True, rate_continuity=False)

Next we define the optimal control problem by specifying the objective, boundary constraints, and path constraints.

Why do we have a path constraint on the control u when we’ve already specified its bounds?

Excellent question! In the Radau transcription, the \(n^{th}\) order control polynomial is governed by design variables provided at \(n\) points in the segment that do not contain the right-most endpoint. Instead, this value is interpolated based on the values of the first \((n-1)\). Since this value is not a design variable, it is necessary to constrain its value separately. We could forgo specifying any bounds on u since it’s completely covered by the path constraint, but specifying the bounds on the design variable values can sometimes help by telling the optimizer, “Don’t even bother trying values outside of this range.”.

Note that sometimes the opposite is true, and giving the optimizer the freedom to explore a larger design space, only to eventually be “reined-in” by the path constraint can sometimes be valuable.

The purpose of this interactive documentation is to let the user experiment. If you remove the path constraint, you might notice some outlying control values in the solution below.

#
# Minimize time at the end of the phase
#
phase.add_objective('time', loc='final', ref=1000)

phase.add_boundary_constraint('x', loc='final', lower=0.5)
phase.add_boundary_constraint('v', loc='final', lower=0.0)
phase.add_path_constraint('u', lower=-U_MAX, upper=U_MAX)

#
# Setup the Problem
#
p.setup()
--- Constraint Report [traj] ---
    --- phase0 ---
        [final]   5.0000e-01 <= x  [m]
        [final]   0.0000e+00 <= v  [m/s]
        [path]    -1.0000e+00 <= u <= 1.0000e+00  [unitless]
<openmdao.core.problem.Problem at 0x7f23f4f33c10>

We then set the initial guesses for the variables in the problem and solve it.

Since fix_initial=True is set for time and the states, those values are not design variables and will remain at the values given below throughout the solution process.

We’re using the phase interp method to provide initial guesses for the states and controls. In this case, by giving it two values, it is linearly interpolating from the first value to the second value, and then returning the interpolated value at the input nodes for the given variable.

Finally, we use the dymos.run_problem method to execute the problem. This interface allows us to do some things that the standard OpenMDAO problem.run_driver interface does not. It will automatically record the final solution achieved by the optimizer in case named 'final' in a file called dymos_solution.db. By specifying simulate=True, it will automatically follow the solution with an explicit integration using scipy.solve_ivp. The results of the simulation are stored in a case named final in the file dymos_simulation.db. This explicit simulation demonstrates how the system evolved with the given controls, and serves as a check that we’re using a dense enough grid (enough segments and segments of sufficient order) to accurately represent the solution.

If those two solution didn’t agree reasonably well, we could rerun the problem with a more dense grid. Instead, we’re asking Dymos to automatically change the grid if necessary by specifying refine_method='ph'. This will attempt to repeatedly solve the problem and change the number of segments and segment orders until the solution is in reasonable agreement.

#
# Set the initial values
#
p['traj.phase0.t_initial'] = 0.0
p['traj.phase0.t_duration'] = 500.0

p.set_val('traj.phase0.states:x', phase.interp('x', ys=[-0.5, 0.5]))
p.set_val('traj.phase0.states:v', phase.interp('v', ys=[0, 0.07]))
p.set_val('traj.phase0.controls:u', np.sin(phase.interp('u', ys=[0, 1.0])))

#
# Solve for the optimal trajectory
#
dm.run_problem(p, run_driver=True, simulate=True, refine_method='ph', refine_iteration_limit=5)
Hide code cell output
Model viewer data has already been recorded for Driver.
Model viewer data has already been recorded for Driver.
Full total jacobian was computed 3 times, taking 0.692341 seconds.
Total jacobian shape: (332, 271) 
Jacobian shape: (332, 271)  ( 1.68% nonzero)
FWD solves: 9   REV solves: 0
Total colors vs. total size: 9 vs 271  (96.7% improvement)

Sparsity computed using tolerance: 1e-25
Time to compute sparsity: 0.692341 sec.
Time to compute coloring: 0.293330 sec.
Memory to compute coloring: 0.250000 MB.
Optimization Problem -- Optimization using pyOpt_sparse
================================================================================
    Objective Function: _objfunc

    Solution: 
--------------------------------------------------------------------------------
    Total Time:                    2.9504
       User Objective Time :       0.1635
       User Sensitivity Time :     1.2752
       Interface Time :            0.8099
       Opt Solver Time:            0.7018
    Calls to Objective Function :      97
    Calls to Sens Function :           94


   Objectives
      Index  Name                                 Value
          0  traj.phases.phase0.time.t     1.024792E-01

   Variables (c - continuous, i - integer, d - discrete)
      Index  Name                                                            Type      Lower Bound            Value      Upper Bound     Status
          0  traj.phase0.t_duration_0                                           c     5.000000E-02     1.024792E+02     1.000000E+04           
          1  traj.phases.phase0.indep_states.states:x_0                         c    -1.200000E+00    -4.993944E-01     5.000000E-01           
          2  traj.phases.phase0.indep_states.states:x_1                         c    -1.200000E+00    -4.965899E-01     5.000000E-01           
          3  traj.phases.phase0.indep_states.states:x_2                         c    -1.200000E+00    -4.952322E-01     5.000000E-01           
          4  traj.phases.phase0.indep_states.states:x_3                         c    -1.200000E+00    -4.912981E-01     5.000000E-01           
          5  traj.phases.phase0.indep_states.states:x_4                         c    -1.200000E+00    -4.840539E-01     5.000000E-01           
          6  traj.phases.phase0.indep_states.states:x_5                         c    -1.200000E+00    -4.813414E-01     5.000000E-01           
          7  traj.phases.phase0.indep_states.states:x_6                         c    -1.200000E+00    -4.744189E-01     5.000000E-01           
          8  traj.phases.phase0.indep_states.states:x_7                         c    -1.200000E+00    -4.633603E-01     5.000000E-01           
          9  traj.phases.phase0.indep_states.states:x_8                         c    -1.200000E+00    -4.595267E-01     5.000000E-01           
         10  traj.phases.phase0.indep_states.states:x_9                         c    -1.200000E+00    -4.502109E-01     5.000000E-01           
         11  traj.phases.phase0.indep_states.states:x_10                        c    -1.200000E+00    -4.362846E-01     5.000000E-01           
         12  traj.phases.phase0.indep_states.states:x_11                        c    -1.200000E+00    -4.316569E-01     5.000000E-01           
         13  traj.phases.phase0.indep_states.states:x_12                        c    -1.200000E+00    -4.211295E-01     5.000000E-01           
         14  traj.phases.phase0.indep_states.states:x_13                        c    -1.200000E+00    -4.089917E-01     5.000000E-01           
         15  traj.phases.phase0.indep_states.states:x_14                        c    -1.200000E+00    -4.062456E-01     5.000000E-01           
         16  traj.phases.phase0.indep_states.states:x_15                        c    -1.200000E+00    -4.017916E-01     5.000000E-01           
         17  traj.phases.phase0.indep_states.states:x_16                        c    -1.200000E+00    -4.002137E-01     5.000000E-01           
         18  traj.phases.phase0.indep_states.states:x_17                        c    -1.200000E+00    -4.008281E-01     5.000000E-01           
         19  traj.phases.phase0.indep_states.states:x_18                        c    -1.200000E+00    -4.042357E-01     5.000000E-01           
         20  traj.phases.phase0.indep_states.states:x_19                        c    -1.200000E+00    -4.134468E-01     5.000000E-01           
         21  traj.phases.phase0.indep_states.states:x_20                        c    -1.200000E+00    -4.174317E-01     5.000000E-01           
         22  traj.phases.phase0.indep_states.states:x_21                        c    -1.200000E+00    -4.284223E-01     5.000000E-01           
         23  traj.phases.phase0.indep_states.states:x_22                        c    -1.200000E+00    -4.476647E-01     5.000000E-01           
         24  traj.phases.phase0.indep_states.states:x_23                        c    -1.200000E+00    -4.546904E-01     5.000000E-01           
         25  traj.phases.phase0.indep_states.states:x_24                        c    -1.200000E+00    -4.723486E-01     5.000000E-01           
         26  traj.phases.phase0.indep_states.states:x_25                        c    -1.200000E+00    -5.000013E-01     5.000000E-01           
         27  traj.phases.phase0.indep_states.states:x_26                        c    -1.200000E+00    -5.094707E-01     5.000000E-01           
         28  traj.phases.phase0.indep_states.states:x_27                        c    -1.200000E+00    -5.322865E-01     5.000000E-01           
         29  traj.phases.phase0.indep_states.states:x_28                        c    -1.200000E+00    -5.659659E-01     5.000000E-01           
         30  traj.phases.phase0.indep_states.states:x_29                        c    -1.200000E+00    -5.770594E-01     5.000000E-01           
         31  traj.phases.phase0.indep_states.states:x_30                        c    -1.200000E+00    -6.030567E-01     5.000000E-01           
         32  traj.phases.phase0.indep_states.states:x_31                        c    -1.200000E+00    -6.398586E-01     5.000000E-01           
         33  traj.phases.phase0.indep_states.states:x_32                        c    -1.200000E+00    -6.516264E-01     5.000000E-01           
         34  traj.phases.phase0.indep_states.states:x_33                        c    -1.200000E+00    -6.786023E-01     5.000000E-01           
         35  traj.phases.phase0.indep_states.states:x_34                        c    -1.200000E+00    -7.154813E-01     5.000000E-01           
         36  traj.phases.phase0.indep_states.states:x_35                        c    -1.200000E+00    -7.269728E-01     5.000000E-01           
         37  traj.phases.phase0.indep_states.states:x_36                        c    -1.200000E+00    -7.527999E-01     5.000000E-01           
         38  traj.phases.phase0.indep_states.states:x_37                        c    -1.200000E+00    -7.869825E-01     5.000000E-01           
         39  traj.phases.phase0.indep_states.states:x_38                        c    -1.200000E+00    -7.973705E-01     5.000000E-01           
         40  traj.phases.phase0.indep_states.states:x_39                        c    -1.200000E+00    -8.202600E-01     5.000000E-01           
         41  traj.phases.phase0.indep_states.states:x_40                        c    -1.200000E+00    -8.495432E-01     5.000000E-01           
         42  traj.phases.phase0.indep_states.states:x_41                        c    -1.200000E+00    -8.581991E-01     5.000000E-01           
         43  traj.phases.phase0.indep_states.states:x_42                        c    -1.200000E+00    -8.768368E-01     5.000000E-01           
         44  traj.phases.phase0.indep_states.states:x_43                        c    -1.200000E+00    -8.996892E-01     5.000000E-01           
         45  traj.phases.phase0.indep_states.states:x_44                        c    -1.200000E+00    -9.061951E-01     5.000000E-01           
         46  traj.phases.phase0.indep_states.states:x_45                        c    -1.200000E+00    -9.193451E-01     5.000000E-01           
         47  traj.phases.phase0.indep_states.states:x_46                        c    -1.200000E+00    -9.313422E-01     5.000000E-01           
         48  traj.phases.phase0.indep_states.states:x_47                        c    -1.200000E+00    -9.331565E-01     5.000000E-01           
         49  traj.phases.phase0.indep_states.states:x_48                        c    -1.200000E+00    -9.339066E-01     5.000000E-01           
         50  traj.phases.phase0.indep_states.states:x_49                        c    -1.200000E+00    -9.268431E-01     5.000000E-01           
         51  traj.phases.phase0.indep_states.states:x_50                        c    -1.200000E+00    -9.226544E-01     5.000000E-01           
         52  traj.phases.phase0.indep_states.states:x_51                        c    -1.200000E+00    -9.095545E-01     5.000000E-01           
         53  traj.phases.phase0.indep_states.states:x_52                        c    -1.200000E+00    -8.835607E-01     5.000000E-01           
         54  traj.phases.phase0.indep_states.states:x_53                        c    -1.200000E+00    -8.734482E-01     5.000000E-01           
         55  traj.phases.phase0.indep_states.states:x_54                        c    -1.200000E+00    -8.469656E-01     5.000000E-01           
         56  traj.phases.phase0.indep_states.states:x_55                        c    -1.200000E+00    -8.030877E-01     5.000000E-01           
         57  traj.phases.phase0.indep_states.states:x_56                        c    -1.200000E+00    -7.874977E-01     5.000000E-01           
         58  traj.phases.phase0.indep_states.states:x_57                        c    -1.200000E+00    -7.489077E-01     5.000000E-01           
         59  traj.phases.phase0.indep_states.states:x_58                        c    -1.200000E+00    -6.895681E-01     5.000000E-01           
         60  traj.phases.phase0.indep_states.states:x_59                        c    -1.200000E+00    -6.694483E-01     5.000000E-01           
         61  traj.phases.phase0.indep_states.states:x_60                        c    -1.200000E+00    -6.212745E-01     5.000000E-01           
         62  traj.phases.phase0.indep_states.states:x_61                        c    -1.200000E+00    -5.507727E-01     5.000000E-01           
         63  traj.phases.phase0.indep_states.states:x_62                        c    -1.200000E+00    -5.276809E-01     5.000000E-01           
         64  traj.phases.phase0.indep_states.states:x_63                        c    -1.200000E+00    -4.738035E-01     5.000000E-01           
         65  traj.phases.phase0.indep_states.states:x_64                        c    -1.200000E+00    -3.980665E-01     5.000000E-01           
         66  traj.phases.phase0.indep_states.states:x_65                        c    -1.200000E+00    -3.739773E-01     5.000000E-01           
         67  traj.phases.phase0.indep_states.states:x_66                        c    -1.200000E+00    -3.189806E-01     5.000000E-01           
         68  traj.phases.phase0.indep_states.states:x_67                        c    -1.200000E+00    -2.442352E-01     5.000000E-01           
         69  traj.phases.phase0.indep_states.states:x_68                        c    -1.200000E+00    -2.210332E-01     5.000000E-01           
         70  traj.phases.phase0.indep_states.states:x_69                        c    -1.200000E+00    -1.689674E-01     5.000000E-01           
         71  traj.phases.phase0.indep_states.states:x_70                        c    -1.200000E+00    -1.000136E-01     5.000000E-01           
         72  traj.phases.phase0.indep_states.states:x_71                        c    -1.200000E+00    -7.898540E-02     5.000000E-01           
         73  traj.phases.phase0.indep_states.states:x_72                        c    -1.200000E+00    -3.234694E-02     5.000000E-01           
         74  traj.phases.phase0.indep_states.states:x_73                        c    -1.200000E+00     2.842786E-02     5.000000E-01           
         75  traj.phases.phase0.indep_states.states:x_74                        c    -1.200000E+00     4.678318E-02     5.000000E-01           
         76  traj.phases.phase0.indep_states.states:x_75                        c    -1.200000E+00     8.727668E-02     5.000000E-01           
         77  traj.phases.phase0.indep_states.states:x_76                        c    -1.200000E+00     1.397728E-01     5.000000E-01           
         78  traj.phases.phase0.indep_states.states:x_77                        c    -1.200000E+00     1.556151E-01     5.000000E-01           
         79  traj.phases.phase0.indep_states.states:x_78                        c    -1.200000E+00     1.906217E-01     5.000000E-01           
         80  traj.phases.phase0.indep_states.states:x_79                        c    -1.200000E+00     2.363128E-01     5.000000E-01           
         81  traj.phases.phase0.indep_states.states:x_80                        c    -1.200000E+00     2.502197E-01     5.000000E-01           
         82  traj.phases.phase0.indep_states.states:x_81                        c    -1.200000E+00     2.812260E-01     5.000000E-01           
         83  traj.phases.phase0.indep_states.states:x_82                        c    -1.200000E+00     3.224671E-01     5.000000E-01           
         84  traj.phases.phase0.indep_states.states:x_83                        c    -1.200000E+00     3.352414E-01     5.000000E-01           
         85  traj.phases.phase0.indep_states.states:x_84                        c    -1.200000E+00     3.641740E-01     5.000000E-01           
         86  traj.phases.phase0.indep_states.states:x_85                        c    -1.200000E+00     4.037941E-01     5.000000E-01           
         87  traj.phases.phase0.indep_states.states:x_86                        c    -1.200000E+00     4.163666E-01     5.000000E-01           
         88  traj.phases.phase0.indep_states.states:x_87                        c    -1.200000E+00     4.454198E-01     5.000000E-01           
         89  traj.phases.phase0.indep_states.states:x_88                        c    -1.200000E+00     4.865902E-01     5.000000E-01           
         90  traj.phases.phase0.indep_states.states:x_89                        c    -1.200000E+00     5.000000E-01     5.000000E-01          u
         91  traj.phases.phase0.indep_states.states:v_0                         c    -7.000000E-02     9.965210E-04     7.000000E-02           
         92  traj.phases.phase0.indep_states.states:v_1                         c    -7.000000E-02     2.351308E-03     7.000000E-02           
         93  traj.phases.phase0.indep_states.states:v_2                         c    -7.000000E-02     2.771163E-03     7.000000E-02           
         94  traj.phases.phase0.indep_states.states:v_3                         c    -7.000000E-02     3.709297E-03     7.000000E-02           
         95  traj.phases.phase0.indep_states.states:v_4                         c    -7.000000E-02     4.934983E-03     7.000000E-02           
         96  traj.phases.phase0.indep_states.states:v_5                         c    -7.000000E-02     5.302594E-03     7.000000E-02           
         97  traj.phases.phase0.indep_states.states:v_6                         c    -7.000000E-02     6.101560E-03     7.000000E-02           
         98  traj.phases.phase0.indep_states.states:v_7                         c    -7.000000E-02     7.093308E-03     7.000000E-02           
         99  traj.phases.phase0.indep_states.states:v_8                         c    -7.000000E-02     7.377472E-03     7.000000E-02           
        100  traj.phases.phase0.indep_states.states:v_9                         c    -7.000000E-02     7.970042E-03     7.000000E-02           
        101  traj.phases.phase0.indep_states.states:v_10                        c    -7.000000E-02     8.646126E-03     7.000000E-02           
        102  traj.phases.phase0.indep_states.states:v_11                        c    -7.000000E-02     8.823968E-03     7.000000E-02           
        103  traj.phases.phase0.indep_states.states:v_12                        c    -7.000000E-02     8.344440E-03     7.000000E-02           
        104  traj.phases.phase0.indep_states.states:v_13                        c    -7.000000E-02     5.797264E-03     7.000000E-02           
        105  traj.phases.phase0.indep_states.states:v_14                        c    -7.000000E-02     4.810080E-03     7.000000E-02           
        106  traj.phases.phase0.indep_states.states:v_15                        c    -7.000000E-02     2.530722E-03     7.000000E-02           
        107  traj.phases.phase0.indep_states.states:v_16                        c    -7.000000E-02    -6.522043E-04     7.000000E-02           
        108  traj.phases.phase0.indep_states.states:v_17                        c    -7.000000E-02    -1.659906E-03     7.000000E-02           
        109  traj.phases.phase0.indep_states.states:v_18                        c    -7.000000E-02    -3.951923E-03     7.000000E-02           
        110  traj.phases.phase0.indep_states.states:v_19                        c    -7.000000E-02    -7.042500E-03     7.000000E-02           
        111  traj.phases.phase0.indep_states.states:v_20                        c    -7.000000E-02    -7.994457E-03     7.000000E-02           
        112  traj.phases.phase0.indep_states.states:v_21                        c    -7.000000E-02    -1.011097E-02     7.000000E-02           
        113  traj.phases.phase0.indep_states.states:v_22                        c    -7.000000E-02    -1.285108E-02     7.000000E-02           
        114  traj.phases.phase0.indep_states.states:v_23                        c    -7.000000E-02    -1.366625E-02     7.000000E-02           
        115  traj.phases.phase0.indep_states.states:v_24                        c    -7.000000E-02    -1.542407E-02     7.000000E-02           
        116  traj.phases.phase0.indep_states.states:v_25                        c    -7.000000E-02    -1.757011E-02     7.000000E-02           
        117  traj.phases.phase0.indep_states.states:v_26                        c    -7.000000E-02    -1.817461E-02     7.000000E-02           
        118  traj.phases.phase0.indep_states.states:v_27                        c    -7.000000E-02    -1.941315E-02     7.000000E-02           
        119  traj.phases.phase0.indep_states.states:v_28                        c    -7.000000E-02    -2.076949E-02     7.000000E-02           
        120  traj.phases.phase0.indep_states.states:v_29                        c    -7.000000E-02    -2.110927E-02     7.000000E-02           
        121  traj.phases.phase0.indep_states.states:v_30                        c    -7.000000E-02    -2.172206E-02     7.000000E-02           
        122  traj.phases.phase0.indep_states.states:v_31                        c    -7.000000E-02    -2.218678E-02     7.000000E-02           
        123  traj.phases.phase0.indep_states.states:v_32                        c    -7.000000E-02    -2.224175E-02     7.000000E-02           
        124  traj.phases.phase0.indep_states.states:v_33                        c    -7.000000E-02    -2.220578E-02     7.000000E-02           
        125  traj.phases.phase0.indep_states.states:v_34                        c    -7.000000E-02    -2.180012E-02     7.000000E-02           
        126  traj.phases.phase0.indep_states.states:v_35                        c    -7.000000E-02    -2.158969E-02     7.000000E-02           
        127  traj.phases.phase0.indep_states.states:v_36                        c    -7.000000E-02    -2.097022E-02     7.000000E-02           
        128  traj.phases.phase0.indep_states.states:v_37                        c    -7.000000E-02    -1.982606E-02     7.000000E-02           
        129  traj.phases.phase0.indep_states.states:v_38                        c    -7.000000E-02    -1.940047E-02     7.000000E-02           
        130  traj.phases.phase0.indep_states.states:v_39                        c    -7.000000E-02    -1.832391E-02     7.000000E-02           
        131  traj.phases.phase0.indep_states.states:v_40                        c    -7.000000E-02    -1.663315E-02     7.000000E-02           
        132  traj.phases.phase0.indep_states.states:v_41                        c    -7.000000E-02    -1.605523E-02     7.000000E-02           
        133  traj.phases.phase0.indep_states.states:v_42                        c    -7.000000E-02    -1.466567E-02     7.000000E-02           
        134  traj.phases.phase0.indep_states.states:v_43                        c    -7.000000E-02    -1.262097E-02     7.000000E-02           
        135  traj.phases.phase0.indep_states.states:v_44                        c    -7.000000E-02    -1.194865E-02     7.000000E-02           
        136  traj.phases.phase0.indep_states.states:v_45                        c    -7.000000E-02    -9.552226E-03     7.000000E-02           
        137  traj.phases.phase0.indep_states.states:v_46                        c    -7.000000E-02    -4.436027E-03     7.000000E-02           
        138  traj.phases.phase0.indep_states.states:v_47                        c    -7.000000E-02    -2.654959E-03     7.000000E-02           
        139  traj.phases.phase0.indep_states.states:v_48                        c    -7.000000E-02     1.416691E-03     7.000000E-02           
        140  traj.phases.phase0.indep_states.states:v_49                        c    -7.000000E-02     7.022689E-03     7.000000E-02           
        141  traj.phases.phase0.indep_states.states:v_50                        c    -7.000000E-02     8.788340E-03     7.000000E-02           
        142  traj.phases.phase0.indep_states.states:v_51                        c    -7.000000E-02     1.280332E-02     7.000000E-02           
        143  traj.phases.phase0.indep_states.states:v_52                        c    -7.000000E-02     1.824300E-02     7.000000E-02           
        144  traj.phases.phase0.indep_states.states:v_53                        c    -7.000000E-02     1.993131E-02     7.000000E-02           
        145  traj.phases.phase0.indep_states.states:v_54                        c    -7.000000E-02     2.371308E-02     7.000000E-02           
        146  traj.phases.phase0.indep_states.states:v_55                        c    -7.000000E-02     2.867706E-02     7.000000E-02           
        147  traj.phases.phase0.indep_states.states:v_56                        c    -7.000000E-02     3.017093E-02     7.000000E-02           
        148  traj.phases.phase0.indep_states.states:v_57                        c    -7.000000E-02     3.341553E-02     7.000000E-02           
        149  traj.phases.phase0.indep_states.states:v_58                        c    -7.000000E-02     3.740867E-02     7.000000E-02           
        150  traj.phases.phase0.indep_states.states:v_59                        c    -7.000000E-02     3.853535E-02     7.000000E-02           
        151  traj.phases.phase0.indep_states.states:v_60                        c    -7.000000E-02     4.083178E-02     7.000000E-02           
        152  traj.phases.phase0.indep_states.states:v_61                        c    -7.000000E-02     4.328846E-02     7.000000E-02           
        153  traj.phases.phase0.indep_states.states:v_62                        c    -7.000000E-02     4.387933E-02     7.000000E-02           
        154  traj.phases.phase0.indep_states.states:v_63                        c    -7.000000E-02     4.488459E-02     7.000000E-02           
        155  traj.phases.phase0.indep_states.states:v_64                        c    -7.000000E-02     4.547610E-02     7.000000E-02           
        156  traj.phases.phase0.indep_states.states:v_65                        c    -7.000000E-02     4.547341E-02     7.000000E-02           
        157  traj.phases.phase0.indep_states.states:v_66                        c    -7.000000E-02     4.515067E-02     7.000000E-02           
        158  traj.phases.phase0.indep_states.states:v_67                        c    -7.000000E-02     4.405259E-02     7.000000E-02           
        159  traj.phases.phase0.indep_states.states:v_68                        c    -7.000000E-02     4.356708E-02     7.000000E-02           
        160  traj.phases.phase0.indep_states.states:v_69                        c    -7.000000E-02     4.225391E-02     7.000000E-02           
        161  traj.phases.phase0.indep_states.states:v_70                        c    -7.000000E-02     4.008490E-02     7.000000E-02           
        162  traj.phases.phase0.indep_states.states:v_71                        c    -7.000000E-02     3.933816E-02     7.000000E-02           
        163  traj.phases.phase0.indep_states.states:v_72                        c    -7.000000E-02     3.756361E-02     7.000000E-02           
        164  traj.phases.phase0.indep_states.states:v_73                        c    -7.000000E-02     3.505831E-02     7.000000E-02           
        165  traj.phases.phase0.indep_states.states:v_74                        c    -7.000000E-02     3.427298E-02     7.000000E-02           
        166  traj.phases.phase0.indep_states.states:v_75                        c    -7.000000E-02     3.251735E-02     7.000000E-02           
        167  traj.phases.phase0.indep_states.states:v_76                        c    -7.000000E-02     3.025194E-02     7.000000E-02           
        168  traj.phases.phase0.indep_states.states:v_77                        c    -7.000000E-02     2.958599E-02     7.000000E-02           
        169  traj.phases.phase0.indep_states.states:v_78                        c    -7.000000E-02     2.816864E-02     7.000000E-02           
        170  traj.phases.phase0.indep_states.states:v_79                        c    -7.000000E-02     2.649125E-02     7.000000E-02           
        171  traj.phases.phase0.indep_states.states:v_80                        c    -7.000000E-02     2.603443E-02     7.000000E-02           
        172  traj.phases.phase0.indep_states.states:v_81                        c    -7.000000E-02     2.513008E-02     7.000000E-02           
        173  traj.phases.phase0.indep_states.states:v_82                        c    -7.000000E-02     2.422384E-02     7.000000E-02           
        174  traj.phases.phase0.indep_states.states:v_83                        c    -7.000000E-02     2.402332E-02     7.000000E-02           
        175  traj.phases.phase0.indep_states.states:v_84                        c    -7.000000E-02     2.372586E-02     7.000000E-02           
        176  traj.phases.phase0.indep_states.states:v_85                        c    -7.000000E-02     2.369891E-02     7.000000E-02           
        177  traj.phases.phase0.indep_states.states:v_86                        c    -7.000000E-02     2.378626E-02     7.000000E-02           
        178  traj.phases.phase0.indep_states.states:v_87                        c    -7.000000E-02     2.416652E-02     7.000000E-02           
        179  traj.phases.phase0.indep_states.states:v_88                        c    -7.000000E-02     2.511968E-02     7.000000E-02           
        180  traj.phases.phase0.indep_states.states:v_89                        c    -7.000000E-02     2.552898E-02     7.000000E-02           
        181  traj.phases.phase0.control_group.indep_controls.controls:u_0       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        182  traj.phases.phase0.control_group.indep_controls.controls:u_1       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        183  traj.phases.phase0.control_group.indep_controls.controls:u_2       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        184  traj.phases.phase0.control_group.indep_controls.controls:u_3       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        185  traj.phases.phase0.control_group.indep_controls.controls:u_4       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        186  traj.phases.phase0.control_group.indep_controls.controls:u_5       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        187  traj.phases.phase0.control_group.indep_controls.controls:u_6       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        188  traj.phases.phase0.control_group.indep_controls.controls:u_7       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        189  traj.phases.phase0.control_group.indep_controls.controls:u_8       c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        190  traj.phases.phase0.control_group.indep_controls.controls:u_9       c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        191  traj.phases.phase0.control_group.indep_controls.controls:u_10      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        192  traj.phases.phase0.control_group.indep_controls.controls:u_11      c    -1.000000E+00     9.999998E-01     1.000000E+00          u
        193  traj.phases.phase0.control_group.indep_controls.controls:u_12      c    -1.000000E+00     9.999997E-01     1.000000E+00          u
        194  traj.phases.phase0.control_group.indep_controls.controls:u_13      c    -1.000000E+00    -2.521225E-01     1.000000E+00           
        195  traj.phases.phase0.control_group.indep_controls.controls:u_14      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        196  traj.phases.phase0.control_group.indep_controls.controls:u_15      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        197  traj.phases.phase0.control_group.indep_controls.controls:u_16      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        198  traj.phases.phase0.control_group.indep_controls.controls:u_17      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        199  traj.phases.phase0.control_group.indep_controls.controls:u_18      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        200  traj.phases.phase0.control_group.indep_controls.controls:u_19      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        201  traj.phases.phase0.control_group.indep_controls.controls:u_20      c    -1.000000E+00    -9.999999E-01     1.000000E+00          l
        202  traj.phases.phase0.control_group.indep_controls.controls:u_21      c    -1.000000E+00    -9.999999E-01     1.000000E+00          l
        203  traj.phases.phase0.control_group.indep_controls.controls:u_22      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        204  traj.phases.phase0.control_group.indep_controls.controls:u_23      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        205  traj.phases.phase0.control_group.indep_controls.controls:u_24      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        206  traj.phases.phase0.control_group.indep_controls.controls:u_25      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        207  traj.phases.phase0.control_group.indep_controls.controls:u_26      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        208  traj.phases.phase0.control_group.indep_controls.controls:u_27      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        209  traj.phases.phase0.control_group.indep_controls.controls:u_28      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        210  traj.phases.phase0.control_group.indep_controls.controls:u_29      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        211  traj.phases.phase0.control_group.indep_controls.controls:u_30      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        212  traj.phases.phase0.control_group.indep_controls.controls:u_31      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        213  traj.phases.phase0.control_group.indep_controls.controls:u_32      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        214  traj.phases.phase0.control_group.indep_controls.controls:u_33      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        215  traj.phases.phase0.control_group.indep_controls.controls:u_34      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        216  traj.phases.phase0.control_group.indep_controls.controls:u_35      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        217  traj.phases.phase0.control_group.indep_controls.controls:u_36      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        218  traj.phases.phase0.control_group.indep_controls.controls:u_37      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        219  traj.phases.phase0.control_group.indep_controls.controls:u_38      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        220  traj.phases.phase0.control_group.indep_controls.controls:u_39      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        221  traj.phases.phase0.control_group.indep_controls.controls:u_40      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        222  traj.phases.phase0.control_group.indep_controls.controls:u_41      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        223  traj.phases.phase0.control_group.indep_controls.controls:u_42      c    -1.000000E+00    -9.999999E-01     1.000000E+00          l
        224  traj.phases.phase0.control_group.indep_controls.controls:u_43      c    -1.000000E+00    -1.000000E+00     1.000000E+00          l
        225  traj.phases.phase0.control_group.indep_controls.controls:u_44      c    -1.000000E+00    -9.999998E-01     1.000000E+00          l
        226  traj.phases.phase0.control_group.indep_controls.controls:u_45      c    -1.000000E+00    -9.999997E-01     1.000000E+00          l
        227  traj.phases.phase0.control_group.indep_controls.controls:u_46      c    -1.000000E+00     2.521229E-01     1.000000E+00           
        228  traj.phases.phase0.control_group.indep_controls.controls:u_47      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        229  traj.phases.phase0.control_group.indep_controls.controls:u_48      c    -1.000000E+00     9.999996E-01     1.000000E+00          u
        230  traj.phases.phase0.control_group.indep_controls.controls:u_49      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        231  traj.phases.phase0.control_group.indep_controls.controls:u_50      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        232  traj.phases.phase0.control_group.indep_controls.controls:u_51      c    -1.000000E+00     9.999998E-01     1.000000E+00          u
        233  traj.phases.phase0.control_group.indep_controls.controls:u_52      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        234  traj.phases.phase0.control_group.indep_controls.controls:u_53      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        235  traj.phases.phase0.control_group.indep_controls.controls:u_54      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        236  traj.phases.phase0.control_group.indep_controls.controls:u_55      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        237  traj.phases.phase0.control_group.indep_controls.controls:u_56      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        238  traj.phases.phase0.control_group.indep_controls.controls:u_57      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        239  traj.phases.phase0.control_group.indep_controls.controls:u_58      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        240  traj.phases.phase0.control_group.indep_controls.controls:u_59      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        241  traj.phases.phase0.control_group.indep_controls.controls:u_60      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        242  traj.phases.phase0.control_group.indep_controls.controls:u_61      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        243  traj.phases.phase0.control_group.indep_controls.controls:u_62      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        244  traj.phases.phase0.control_group.indep_controls.controls:u_63      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        245  traj.phases.phase0.control_group.indep_controls.controls:u_64      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        246  traj.phases.phase0.control_group.indep_controls.controls:u_65      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        247  traj.phases.phase0.control_group.indep_controls.controls:u_66      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        248  traj.phases.phase0.control_group.indep_controls.controls:u_67      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        249  traj.phases.phase0.control_group.indep_controls.controls:u_68      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        250  traj.phases.phase0.control_group.indep_controls.controls:u_69      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        251  traj.phases.phase0.control_group.indep_controls.controls:u_70      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        252  traj.phases.phase0.control_group.indep_controls.controls:u_71      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        253  traj.phases.phase0.control_group.indep_controls.controls:u_72      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        254  traj.phases.phase0.control_group.indep_controls.controls:u_73      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        255  traj.phases.phase0.control_group.indep_controls.controls:u_74      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        256  traj.phases.phase0.control_group.indep_controls.controls:u_75      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        257  traj.phases.phase0.control_group.indep_controls.controls:u_76      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        258  traj.phases.phase0.control_group.indep_controls.controls:u_77      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        259  traj.phases.phase0.control_group.indep_controls.controls:u_78      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        260  traj.phases.phase0.control_group.indep_controls.controls:u_79      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        261  traj.phases.phase0.control_group.indep_controls.controls:u_80      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        262  traj.phases.phase0.control_group.indep_controls.controls:u_81      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        263  traj.phases.phase0.control_group.indep_controls.controls:u_82      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        264  traj.phases.phase0.control_group.indep_controls.controls:u_83      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        265  traj.phases.phase0.control_group.indep_controls.controls:u_84      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        266  traj.phases.phase0.control_group.indep_controls.controls:u_85      c    -1.000000E+00     1.000000E+00     1.000000E+00          u
        267  traj.phases.phase0.control_group.indep_controls.controls:u_86      c    -1.000000E+00     9.999998E-01     1.000000E+00          u
        268  traj.phases.phase0.control_group.indep_controls.controls:u_87      c    -1.000000E+00     9.999997E-01     1.000000E+00          u
        269  traj.phases.phase0.control_group.indep_controls.controls:u_88      c    -1.000000E+00     9.999999E-01     1.000000E+00          u
        270  traj.phases.phase0.control_group.indep_controls.controls:u_89      c    -1.000000E+00     9.999989E-01     1.000000E+00           

   Constraints (i - inequality, e - equality)
      Index  Name                                                 Type          Lower           Value           Upper    Status  Lagrange Multiplier (N/A)
          0  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.220446E-16    0.000000E+00              9.00000E+100
          1  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.962911E-17    0.000000E+00              9.00000E+100
          2  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.014762E-16    0.000000E+00              9.00000E+100
          3  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.222164E-18    0.000000E+00              9.00000E+100
          4  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.192535E-16    0.000000E+00              9.00000E+100
          5  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    8.444223E-17    0.000000E+00              9.00000E+100
          6  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.303669E-16    0.000000E+00              9.00000E+100
          7  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    3.762864E-16    0.000000E+00              9.00000E+100
          8  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    4.992461E-16    0.000000E+00              9.00000E+100
          9  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    8.903470E-16    0.000000E+00              9.00000E+100
         10  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.057750E-15    0.000000E+00              9.00000E+100
         11  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.614772E-15    0.000000E+00              9.00000E+100
         12  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.017725E-15    0.000000E+00              9.00000E+100
         13  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    7.756833E-15    0.000000E+00              9.00000E+100
         14  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.496850E-14    0.000000E+00              9.00000E+100
         15  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.349002E-14    0.000000E+00              9.00000E+100
         16  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    9.990849E-15    0.000000E+00              9.00000E+100
         17  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.088620E-14    0.000000E+00              9.00000E+100
         18  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.040195E-14    0.000000E+00              9.00000E+100
         19  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    8.961246E-15    0.000000E+00              9.00000E+100
         20  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    8.805694E-15    0.000000E+00              9.00000E+100
         21  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    8.337559E-15    0.000000E+00              9.00000E+100
         22  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    7.647206E-15    0.000000E+00              9.00000E+100
         23  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    6.473904E-15    0.000000E+00              9.00000E+100
         24  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    5.949473E-15    0.000000E+00              9.00000E+100
         25  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    4.725802E-15    0.000000E+00              9.00000E+100
         26  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    3.146584E-15    0.000000E+00              9.00000E+100
         27  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.216238E-15    0.000000E+00              9.00000E+100
         28  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.380704E-15    0.000000E+00              9.00000E+100
         29  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -7.940532E-16    0.000000E+00              9.00000E+100
         30  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -7.347955E-16    0.000000E+00              9.00000E+100
         31  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.980662E-15    0.000000E+00              9.00000E+100
         32  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -4.604323E-15    0.000000E+00              9.00000E+100
         33  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -4.882835E-15    0.000000E+00              9.00000E+100
         34  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -6.950928E-15    0.000000E+00              9.00000E+100
         35  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -8.574589E-15    0.000000E+00              9.00000E+100
         36  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -8.882730E-15    0.000000E+00              9.00000E+100
         37  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.071379E-14    0.000000E+00              9.00000E+100
         38  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.220116E-14    0.000000E+00              9.00000E+100
         39  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.255078E-14    0.000000E+00              9.00000E+100
         40  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.364705E-14    0.000000E+00              9.00000E+100
         41  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.450629E-14    0.000000E+00              9.00000E+100
         42  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.464850E-14    0.000000E+00              9.00000E+100
         43  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.593440E-14    0.000000E+00              9.00000E+100
         44  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.717288E-14    0.000000E+00              9.00000E+100
         45  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.782768E-14    0.000000E+00              9.00000E+100
         46  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.081427E-14    0.000000E+00              9.00000E+100
         47  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.225127E-14    0.000000E+00              9.00000E+100
         48  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.157128E-14    0.000000E+00              9.00000E+100
         49  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.096649E-14    0.000000E+00              9.00000E+100
         50  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.120537E-14    0.000000E+00              9.00000E+100
         51  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.126166E-14    0.000000E+00              9.00000E+100
         52  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.037576E-14    0.000000E+00              9.00000E+100
         53  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.011206E-14    0.000000E+00              9.00000E+100
         54  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.094760E-14    0.000000E+00              9.00000E+100
         55  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.927060E-14    0.000000E+00              9.00000E+100
         56  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.775953E-14    0.000000E+00              9.00000E+100
         57  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.699511E-14    0.000000E+00              9.00000E+100
         58  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.526478E-14    0.000000E+00              9.00000E+100
         59  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.245597E-14    0.000000E+00              9.00000E+100
         60  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -1.121156E-14    0.000000E+00              9.00000E+100
         61  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -8.888655E-15    0.000000E+00              9.00000E+100
         62  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -4.420625E-15    0.000000E+00              9.00000E+100
         63  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00   -2.939182E-15    0.000000E+00              9.00000E+100
         64  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    4.266555E-16    0.000000E+00              9.00000E+100
         65  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    5.096162E-15    0.000000E+00              9.00000E+100
         66  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    6.577605E-15    0.000000E+00              9.00000E+100
         67  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    9.741966E-15    0.000000E+00              9.00000E+100
         68  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.366483E-14    0.000000E+00              9.00000E+100
         69  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.464850E-14    0.000000E+00              9.00000E+100
         70  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.684104E-14    0.000000E+00              9.00000E+100
         71  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.898617E-14    0.000000E+00              9.00000E+100
         72  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.950764E-14    0.000000E+00              9.00000E+100
         73  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.040835E-14    0.000000E+00              9.00000E+100
         74  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.092982E-14    0.000000E+00              9.00000E+100
         75  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.103648E-14    0.000000E+00              9.00000E+100
         76  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.098908E-14    0.000000E+00              9.00000E+100
         77  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.047354E-14    0.000000E+00              9.00000E+100
         78  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.041428E-14    0.000000E+00              9.00000E+100
         79  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.984540E-14    0.000000E+00              9.00000E+100
         80  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.903950E-14    0.000000E+00              9.00000E+100
         81  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.904543E-14    0.000000E+00              9.00000E+100
         82  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.835804E-14    0.000000E+00              9.00000E+100
         83  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.774768E-14    0.000000E+00              9.00000E+100
         84  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.756991E-14    0.000000E+00              9.00000E+100
         85  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.758176E-14    0.000000E+00              9.00000E+100
         86  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.750473E-14    0.000000E+00              9.00000E+100
         87  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.790768E-14    0.000000E+00              9.00000E+100
         88  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    1.860692E-14    0.000000E+00              9.00000E+100
         89  traj.phases.phase0.collocation_constraint.defects:x     e   0.000000E+00    2.213275E-14    0.000000E+00              9.00000E+100
         90  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.577684E-16    0.000000E+00              9.00000E+100
         91  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    5.425783E-17    0.000000E+00              9.00000E+100
         92  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.470332E-16    0.000000E+00              9.00000E+100
         93  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.003625E-16    0.000000E+00              9.00000E+100
         94  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.777600E-17    0.000000E+00              9.00000E+100
         95  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    2.086982E-16    0.000000E+00              9.00000E+100
         96  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.596202E-16    0.000000E+00              9.00000E+100
         97  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.061083E-16    0.000000E+00              9.00000E+100
         98  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.301765E-16    0.000000E+00              9.00000E+100
         99  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    5.423932E-16    0.000000E+00              9.00000E+100
        100  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.960134E-16    0.000000E+00              9.00000E+100
        101  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    9.101613E-16    0.000000E+00              9.00000E+100
        102  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.423018E-15    0.000000E+00              9.00000E+100
        103  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.201689E-15    0.000000E+00              9.00000E+100
        104  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.436868E-16    0.000000E+00              9.00000E+100
        105  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.060581E-15    0.000000E+00              9.00000E+100
        106  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.392425E-16    0.000000E+00              9.00000E+100
        107  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -5.277639E-16    0.000000E+00              9.00000E+100
        108  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -2.286236E-15    0.000000E+00              9.00000E+100
        109  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.225710E-16    0.000000E+00              9.00000E+100
        110  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.762733E-16    0.000000E+00              9.00000E+100
        111  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.402926E-15    0.000000E+00              9.00000E+100
        112  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.141822E-15    0.000000E+00              9.00000E+100
        113  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.302929E-15    0.000000E+00              9.00000E+100
        114  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.468850E-15    0.000000E+00              9.00000E+100
        115  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.319225E-15    0.000000E+00              9.00000E+100
        116  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.385149E-15    0.000000E+00              9.00000E+100
        117  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.471813E-15    0.000000E+00              9.00000E+100
        118  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.145896E-15    0.000000E+00              9.00000E+100
        119  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.018677E-15    0.000000E+00              9.00000E+100
        120  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.051454E-15    0.000000E+00              9.00000E+100
        121  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.572975E-16    0.000000E+00              9.00000E+100
        122  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -4.743394E-16    0.000000E+00              9.00000E+100
        123  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -4.958434E-16    0.000000E+00              9.00000E+100
        124  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.242560E-16    0.000000E+00              9.00000E+100
        125  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -5.046164E-17    0.000000E+00              9.00000E+100
        126  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.270337E-16    0.000000E+00              9.00000E+100
        127  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.701807E-16    0.000000E+00              9.00000E+100
        128  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.629455E-17    0.000000E+00              9.00000E+100
        129  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -9.777521E-17    0.000000E+00              9.00000E+100
        130  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.329595E-16    0.000000E+00              9.00000E+100
        131  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -2.029576E-16    0.000000E+00              9.00000E+100
        132  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -4.551732E-16    0.000000E+00              9.00000E+100
        133  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.533293E-16    0.000000E+00              9.00000E+100
        134  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -9.607155E-16    0.000000E+00              9.00000E+100
        135  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.492553E-15    0.000000E+00              9.00000E+100
        136  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.710325E-15    0.000000E+00              9.00000E+100
        137  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    8.947913E-16    0.000000E+00              9.00000E+100
        138  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    2.430306E-15    0.000000E+00              9.00000E+100
        139  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    8.162748E-16    0.000000E+00              9.00000E+100
        140  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.489590E-15    0.000000E+00              9.00000E+100
        141  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    2.416974E-15    0.000000E+00              9.00000E+100
        142  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    2.289569E-15    0.000000E+00              9.00000E+100
        143  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.475464E-15    0.000000E+00              9.00000E+100
        144  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    4.183594E-15    0.000000E+00              9.00000E+100
        145  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    4.663581E-15    0.000000E+00              9.00000E+100
        146  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    5.896882E-15    0.000000E+00              9.00000E+100
        147  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.382054E-15    0.000000E+00              9.00000E+100
        148  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.632418E-15    0.000000E+00              9.00000E+100
        149  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.802784E-15    0.000000E+00              9.00000E+100
        150  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    6.750934E-15    0.000000E+00              9.00000E+100
        151  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    5.792811E-15    0.000000E+00              9.00000E+100
        152  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.909897E-15    0.000000E+00              9.00000E+100
        153  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    3.196583E-15    0.000000E+00              9.00000E+100
        154  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    8.870137E-16    0.000000E+00              9.00000E+100
        155  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -2.207859E-15    0.000000E+00              9.00000E+100
        156  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -3.098044E-15    0.000000E+00              9.00000E+100
        157  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -5.384303E-15    0.000000E+00              9.00000E+100
        158  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -7.505729E-15    0.000000E+00              9.00000E+100
        159  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -7.895904E-15    0.000000E+00              9.00000E+100
        160  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.828286E-15    0.000000E+00              9.00000E+100
        161  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.912729E-15    0.000000E+00              9.00000E+100
        162  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.699401E-15    0.000000E+00              9.00000E+100
        163  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.428667E-15    0.000000E+00              9.00000E+100
        164  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -7.251291E-15    0.000000E+00              9.00000E+100
        165  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.711675E-15    0.000000E+00              9.00000E+100
        166  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.073914E-15    0.000000E+00              9.00000E+100
        167  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -4.659507E-15    0.000000E+00              9.00000E+100
        168  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -4.126558E-15    0.000000E+00              9.00000E+100
        169  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -3.645830E-15    0.000000E+00              9.00000E+100
        170  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -2.462343E-15    0.000000E+00              9.00000E+100
        171  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.948282E-15    0.000000E+00              9.00000E+100
        172  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -1.866432E-15    0.000000E+00              9.00000E+100
        173  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -8.997912E-16    0.000000E+00              9.00000E+100
        174  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -3.853602E-16    0.000000E+00              9.00000E+100
        175  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00   -6.932688E-16    0.000000E+00              9.00000E+100
        176  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    4.167946E-16    0.000000E+00              9.00000E+100
        177  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    1.152516E-15    0.000000E+00              9.00000E+100
        178  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    4.111003E-16    0.000000E+00              9.00000E+100
        179  traj.phases.phase0.collocation_constraint.defects:v     e   0.000000E+00    5.135235E-15    0.000000E+00              9.00000E+100
        180  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -2.220446E-16    0.000000E+00              9.00000E+100
        181  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -2.220446E-16    0.000000E+00              9.00000E+100
        182  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        183  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        184  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -2.220446E-16    0.000000E+00              9.00000E+100
        185  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        186  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        187  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -1.110223E-16    0.000000E+00              9.00000E+100
        188  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -1.110223E-16    0.000000E+00              9.00000E+100
        189  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -1.110223E-16    0.000000E+00              9.00000E+100
        190  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        191  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        192  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        193  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        194  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        195  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    2.220446E-16    0.000000E+00              9.00000E+100
        196  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        197  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        198  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -1.110223E-16    0.000000E+00              9.00000E+100
        199  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        200  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -3.330669E-16    0.000000E+00              9.00000E+100
        201  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        202  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        203  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        204  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        205  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -1.110223E-16    0.000000E+00              9.00000E+100
        206  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    0.000000E+00    0.000000E+00              9.00000E+100
        207  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00   -3.330669E-16    0.000000E+00              9.00000E+100
        208  traj.phases.phase0.continuity_comp.defect_controls:u    e   0.000000E+00    1.110223E-16    0.000000E+00              9.00000E+100
        209  traj.phases.phase0->final_boundary_constraint->x        i   5.000000E-01    5.000000E-01    1.000000E+30         l    9.00000E+100
        210  traj.phases.phase0->final_boundary_constraint->v        i   0.000000E+00    2.552898E-02    1.000000E+30              9.00000E+100
        211  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        212  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        213  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        214  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        215  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        216  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        217  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        218  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        219  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        220  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        221  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        222  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        223  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        224  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        225  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999998E-01    1.000000E+00         u    9.00000E+100
        226  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999997E-01    1.000000E+00         u    9.00000E+100
        227  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999997E-01    1.000000E+00         u    9.00000E+100
        228  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -2.521225E-01    1.000000E+00              9.00000E+100
        229  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        230  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        231  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        232  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        233  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        234  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        235  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        236  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        237  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999999E-01    1.000000E+00         l    9.00000E+100
        238  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999999E-01    1.000000E+00         l    9.00000E+100
        239  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999999E-01    1.000000E+00         l    9.00000E+100
        240  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        241  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        242  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        243  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        244  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        245  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        246  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        247  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        248  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        249  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        250  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        251  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        252  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        253  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        254  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        255  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        256  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        257  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        258  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        259  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        260  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        261  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        262  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        263  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        264  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        265  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        266  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999999E-01    1.000000E+00         l    9.00000E+100
        267  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999999E-01    1.000000E+00         l    9.00000E+100
        268  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -1.000000E+00    1.000000E+00         l    9.00000E+100
        269  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999998E-01    1.000000E+00         l    9.00000E+100
        270  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999997E-01    1.000000E+00         l    9.00000E+100
        271  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00   -9.999997E-01    1.000000E+00         l    9.00000E+100
        272  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    2.521229E-01    1.000000E+00              9.00000E+100
        273  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        274  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999996E-01    1.000000E+00         u    9.00000E+100
        275  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999996E-01    1.000000E+00         u    9.00000E+100
        276  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        277  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        278  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999998E-01    1.000000E+00         u    9.00000E+100
        279  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999998E-01    1.000000E+00         u    9.00000E+100
        280  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        281  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        282  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        283  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        284  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        285  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        286  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        287  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        288  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        289  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        290  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        291  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        292  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        293  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        294  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        295  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        296  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        297  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        298  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        299  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        300  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        301  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        302  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        303  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        304  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        305  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        306  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        307  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        308  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        309  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        310  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        311  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        312  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        313  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        314  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        315  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        316  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        317  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        318  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        319  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        320  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        321  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        322  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        323  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        324  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    1.000000E+00    1.000000E+00         u    9.00000E+100
        325  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999998E-01    1.000000E+00         u    9.00000E+100
        326  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999997E-01    1.000000E+00         u    9.00000E+100
        327  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999997E-01    1.000000E+00         u    9.00000E+100
        328  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999999E-01    1.000000E+00         u    9.00000E+100
        329  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999989E-01    1.000000E+00              9.00000E+100
        330  traj.phases.phase0->path_constraint->u                  i  -1.000000E+00    9.999983E-01    1.000000E+00              9.00000E+100


   Exit Status
      Inform  Description
           0  Solve Succeeded
--------------------------------------------------------------------------------
==================================================
          Grid Refinement - Iteration 1           
--------------------------------------------------
    Phase: traj.phases.phase0
        Refinement Options:
            Allow Refinement = True
            Tolerance = 0.0001
            Min Order = 3
            Max Order = 14
        Original Grid:
            Number of Segments = 30
            Segment Ends = [-1.0, -0.9333, -0.8667, -0.8, -0.7333, -0.6667, -0.6, -0.5333, -0.4667, -0.4, -0.3333, -0.2667, -0.2, -0.1333, -0.0667, 0.0, 0.0667, 0.1333, 0.2, 0.2667, 0.3333, 0.4, 0.4667, 0.5333, 0.6, 0.6667, 0.7333, 0.8, 0.8667, 0.9333, 1.0]
            Segment Order = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
            Error = [5.283e-07, 4.85e-07, 3.946e-07, 2.604e-07, 3.752e-05, 1.229e-06, 1.218e-06, 1.147e-06, 9.371e-07, 5.357e-07, 2.424e-07, 4.502e-07, 7.029e-07, 7.163e-07, 5.746e-07, 2.788e-05, 5.785e-07, 9.287e-07, 1.654e-06, 2.219e-06, 1.719e-06, 1.067e-06, 2.811e-06, 4.168e-06, 3.866e-06, 2.223e-06, 1.071e-06, 5.538e-07, 4.487e-07, 5.374e-07]
Successfully completed grid refinement.
==================================================
Simulating trajectory traj
Model viewer data has already been recorded for Driver.
Done simulating trajectory traj
False

Plotting the solution#

The recommended practice is to obtain values from the recorded cases. While the problem object can also be queried for values, building plotting scripts that use the case recorder files as the data source means that the problem doesn’t need to be solved just to change a plot. Here we load values of various variables from the solution and simulation for use in the animation to follow.

sol = om.CaseReader('dymos_solution.db').get_case('final')
sim = om.CaseReader('dymos_simulation.db').get_case('final')

t = sol.get_val('traj.phase0.timeseries.time')
x = sol.get_val('traj.phase0.timeseries.x')
v = sol.get_val('traj.phase0.timeseries.v')
u = sol.get_val('traj.phase0.timeseries.u')
h = np.sin(3 * x) / 3

t_sim = sim.get_val('traj.phase0.timeseries.time')
x_sim = sim.get_val('traj.phase0.timeseries.x')
v_sim = sim.get_val('traj.phase0.timeseries.v')
u_sim = sim.get_val('traj.phase0.timeseries.u')
h_sim = np.sin(3 * x_sim) / 3

Animating the Solution#

The collapsed code cell below contains the code used to produce an animation of the mountain car solution using Matplotlib.

The green area represents the hilly terrain the car is traversing. The black circle is the center of the car, and the orange arrow is the applied control.

The applied control generally has the same sign as the velocity and is ‘bang-bang’, that is, it wants to be at its maximum possible magnitude. Interestingly, the sign of the control flips shortly before the sign of the velocity changes.

Hide code cell source
fig = plt.figure(constrained_layout=True, figsize=(12, 6))
gs = fig.add_gridspec(3, 2)

anim_ax = fig.add_subplot(gs[:, 0])
anim_ax.set_aspect('equal')

x_ax = fig.add_subplot(gs[0, 1:])
v_ax = fig.add_subplot(gs[1, 1:])
u_ax = fig.add_subplot(gs[2, 1:])

x_ax.set_ylabel('x')
v_ax.set_ylabel('v')
u_ax.set_ylabel('u')
u_ax.set_xlabel('t')

# set up the subplots as needed
anim_ax.set_xlim((-1.75, 0.75));          
anim_ax.set_ylim((-1.25, 1.25));
anim_ax.set_xlabel('x');
anim_ax.set_ylabel('h');

x_sol_line, = x_ax.plot(t, x, 'o', ms=1, label='solution')
v_ax.plot(t, v, 'o', ms=1)
u_ax.plot(t, u, 'o', ms=1)

x_sim_line, = x_ax.plot([], [], '-', linewidth=3, label='simulation')
v_sim_line, = v_ax.plot([], [], '-', linewidth=3)
u_sim_line, = u_ax.plot([], [], '-', linewidth=3)

plt.figlegend(ncol=2, handles=[x_sol_line, x_sim_line], loc='upper center',
              bbox_to_anchor=(0.78,0.98))

x_ax.grid(alpha=0.2)
txt_x = x_ax.text(0.8, 0.1, f'x = {x_sim[0, 0]:6.3f}', horizontalalignment='left',
                  verticalalignment='center', transform=x_ax.transAxes)

v_ax.grid(alpha=0.2)
txt_v = v_ax.text(0.8, 0.1, f'v = {v_sim[0, 0]:6.3f}', horizontalalignment='left',
                  verticalalignment='center', transform=v_ax.transAxes)

u_ax.grid(alpha=0.2)
txt_u = u_ax.text(0.8, 0.1, f'u = {u_sim[0, 0]:6.3f}', horizontalalignment='left',
                  verticalalignment='center', transform=u_ax.transAxes)

x_terrain = np.linspace(-1.75, 0.75, 100);
h_terrain = np.sin(3 * x_terrain) / 3;
terrain_line, = anim_ax.plot(x_terrain, h_terrain, '-', color='tab:gray', lw=2);
terrain = anim_ax.fill_between(x_terrain, h_terrain, -1.25*np.ones_like(x_terrain), color='tab:green');
car, = anim_ax.plot([], [], 'ko', ms=12);
u_vec = anim_ax.quiver(x_sim[0] + 0.005, h_sim[0] + 0.005, u_sim[0], [0], scale=10, angles='xy', color='tab:orange')

# See https://brushingupscience.com/2019/08/01/elaborate-matplotlib-animations/ for quiver animation

ANIM_DURATION = 5
PAUSE_DURATION = 2
ANIM_FPS = 20

num_points = t_sim.size
num_frames = ANIM_DURATION * ANIM_FPS
pause_frames = PAUSE_DURATION * ANIM_FPS

idx_from_frame_num = np.linspace(0, num_points-1, num_frames, dtype=int)

def drawframe(n):

    if n >= idx_from_frame_num.size:
        idx = num_points - 1
    else:
        idx = idx_from_frame_num[n]

    x = x_sim[idx]
    v = v_sim[idx]
    u = u_sim[idx]
    t = t_sim[idx]
    h = np.sin(3 * x) / 3 + 0.025
    car.set_data(x, h)
    
    dh_dx = np.cos(3 * x)

    u_vec.set_offsets(np.atleast_2d(np.asarray([x + 0.005, h + 0.005]).T))
    u_vec.set_UVC(u * np.cos(dh_dx), u * np.sin(dh_dx))

    x_sim_line.set_data(t_sim[:idx], x_sim[:idx])
    v_sim_line.set_data(t_sim[:idx], v_sim[:idx])
    u_sim_line.set_data(t_sim[:idx], u_sim[:idx])

    txt_x.set_text(f'x = {x[0]:6.3f}')
    txt_v.set_text(f'v = {v[0]:6.3f}')
    txt_u.set_text(f'u = {u[0]:6.3f}')
    
    return car, u_vec, x_sim_line, v_sim_line, u_sim_line

# # blit=True re-draws only the parts that have changed.
# # repeat_delay has no effect when using to_jshtml, so pad drawframe to show the final frame for PAUSE_FRAMES extra frames.
anim = animation.FuncAnimation(fig, drawframe, frames=num_frames + pause_frames, interval=1000/ANIM_FPS, blit=True);
plt.close()  # Don't let jupyter display the un-animated plot

from IPython.display import HTML
js = anim.to_jshtml()
with open('mountain_car_anim.html', 'w') as f:
    print(js, file=f)
HTML(filename='mountain_car_anim.html')

References#

[MMB14]

Alexey A Melnikov, Adi Makmal, and Hans J Briegel. Projective simulation applied to the grid-world and the mountain-car problem. arXiv preprint arXiv:1405.5459, 2014.

[Moo90]

Andrew William Moore. Efficient memory-based learning for robot control. Technical Report UCAM-CL-TR-209, University of Cambridge, Computer Laboratory, November 1990. URL: https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-209.pdf, doi:10.48456/tr-209.