zeroing out lamda_dot from lamda

Number of nonzeros in equality constraint Jacobian...:        4
Number of nonzeros in inequality constraint Jacobian.:        0
Number of nonzeros in Lagrangian Hessian.............:        0

Total number of variables............................:        2
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        2
                     variables with only upper bounds:        0
Total number of equality constraints.................:        2
Total number of inequality constraints...............:        0
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  0.0000000e+00 1.55e+06 0.00e+00   0.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  0.0000000e+00 7.22e+03 2.26e+03  -0.3 2.26e+03    -  9.87e-01 1.00e+00h  1
   2  0.0000000e+00 2.63e+00 0.00e+00  -2.2 1.38e+01    -  9.90e-01 1.00e+00h  1

Number of Iterations....: 2

                                   (scaled)                 (unscaled)
Objective...............:   0.0000000000000000e+00    0.0000000000000000e+00
Dual infeasibility......:   0.0000000000000000e+00    0.0000000000000000e+00
Constraint violation....:   3.9982864938865398e-01    2.6311239302158356e+00
Variable bound violation:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   0.0000000000000000e+00    0.0000000000000000e+00
Overall NLP error.......:   3.9982864938865398e-01    2.6311239302158356e+00


Number of objective function evaluations             = 3
Number of objective gradient evaluations             = 3
Number of equality constraint evaluations            = 3
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 3
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 0
Total seconds in IPOPT                               = 29.344

orbital checks 3f156b3d779053a85765b7fe23e9aa19d4c7ebcf
orbital debugging showing SGM failing to get any derivative wrt measurement time

orbital 1
 hohmann
           message: `gtol` termination condition is satisfied.
           success: True
            status: 1
               fun: 0.2850000000002871
                 x: [ 8.410e+01  2.840e+03]
               nit: 31
              nfev: 21
              njev: 21
              nhev: 0
          cg_niter: 32
      cg_stop_cond: 1
              grad: [ 7.090e-10 -2.129e-10]
   lagrangian_grad: [ 5.908e-10 -2.167e-10]
            constr: [array([ 2.756e+03,  8.410e+01])]
               jac: [<2x2 sparse matrix of type '<class 'numpy.float64'>'
                    	with 3 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0]
       constr_njev: [0]
       constr_nhev: [0]
                 v: [array([-3.757e-12, -1.220e-10])]
            method: tr_interior_point
        optimality: 5.90770181681498e-10
  constr_violation: 0.0
    execution_time: 8.587608814239502
         tr_radius: 478515625.0
    constr_penalty: 1.0
 barrier_parameter: 1.0240000000000006e-08
 barrier_tolerance: 1.0240000000000006e-08
             niter: 31
179.99991416987746
25493.366133786385
11488.12223081889
84.09738462221331 2839.87910003586
time: 8.874380575001851
opt grad  wrt tig 7.09006e-10
opt grad  wrt tem -2.12934e-10


 unconstrained Delta v
           message: `gtol` termination condition is satisfied.
           success: True
            status: 1
               fun: 0.5941437859549465
                 x: [ 9.280e+01  2.259e+03]
               nit: 27
              nfev: 21
              njev: 21
              nhev: 0
          cg_niter: 25
      cg_stop_cond: 4
              grad: [-4.658e-09 -2.242e-09]
   lagrangian_grad: [-5.185e-09 -2.265e-09]
            constr: [array([ 2.166e+03,  9.280e+01]), array([-9.686e+02])]
               jac: [<2x2 sparse matrix of type '<class 'numpy.float64'>'
                    	with 3 stored elements in Compressed Sparse Row format>, <1x2 sparse matrix of type '<class 'numpy.float64'>'
                    	with 2 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0, 21]
       constr_njev: [0, 21]
       constr_nhev: [0, 0]
                 v: [array([-2.397e-11, -5.511e-10]), array([ 5.286e-11])]
            method: tr_interior_point
        optimality: 5.185299538189361e-09
  constr_violation: 0.0
    execution_time: 17.792963981628418
         tr_radius: 341763764.17411375
    constr_penalty: 1.0
 barrier_parameter: 5.120000000000003e-08
 barrier_tolerance: 5.120000000000003e-08
             niter: 27
141.47817234313015
31.365512427750986


 constrained Delta v
           message: `gtol` termination condition is satisfied.
           success: True
            status: 1
               fun: 1.8877211716982683
                 x: [ 1.900e-03  9.476e+02]
               nit: 58
              nfev: 51
              njev: 51
              nhev: 0
          cg_niter: 52
      cg_stop_cond: 4
              grad: [ 1.441e-03 -2.894e-03]
   lagrangian_grad: [ 2.670e-09  1.125e-10]
            constr: [array([ 9.476e+02,  1.900e-03]), array([-3.419e-06])]
               jac: [<2x2 sparse matrix of type '<class 'numpy.float64'>'
                    	with 3 stored elements in Compressed Sparse Row format>, <1x2 sparse matrix of type '<class 'numpy.float64'>'
                    	with 2 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0, 51]
       constr_njev: [0, 51]
       constr_nhev: [0, 0]
                 v: [array([-1.395e-09, -1.413e-03]), array([ 3.015e-01])]
            method: tr_interior_point
        optimality: 2.669573372161339e-09
  constr_violation: 0.0
    execution_time: 45.939208984375
         tr_radius: 71879699.27453585
    constr_penalty: 1.0
 barrier_parameter: 1.2800000000000007e-06
 barrier_tolerance: 1.2800000000000007e-06
             niter: 58
61.896326223756404
9.999996580549904

orbital 2
 minimize position dispersions:
           message: `gtol` termination condition is satisfied.
           success: True
            status: 1
               fun: 12.914982069765916
                 x: [ 1.090e+03]
               nit: 12
              nfev: 4
              njev: 4
              nhev: 0
          cg_niter: 3
      cg_stop_cond: 0
              grad: [-6.970e-06]
   lagrangian_grad: [ 1.833e-09]
            constr: [array([ 1.090e+03])]
               jac: [<1x1 sparse matrix of type '<class 'numpy.float64'>'
                    	with 1 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0]
       constr_njev: [0]
       constr_nhev: [0]
                 v: [array([ 6.972e-06])]
            method: tr_interior_point
        optimality: 1.8332020120859744e-09
  constr_violation: 0.0
    execution_time: 1.5087459087371826
         tr_radius: 390625.0
    constr_penalty: 1.0
 barrier_parameter: 2.560000000000001e-07
 barrier_tolerance: 2.560000000000001e-07
             niter: 12



 minimize Delta-v dispersions:
           message: `gtol` termination condition is satisfied.
           success: True
            status: 1
               fun: 41.9533590868339
                 x: [ 6.100e+02]
               nit: 24
              nfev: 16
              njev: 16
              nhev: 0
          cg_niter: 15
      cg_stop_cond: 1
              grad: [ 1.340e-05]
   lagrangian_grad: [-2.046e-11]
            constr: [array([ 6.100e+02])]
               jac: [<1x1 sparse matrix of type '<class 'numpy.float64'>'
                    	with 1 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0]
       constr_njev: [0]
       constr_nhev: [0]
                 v: [array([-1.340e-05])]
            method: tr_interior_point
        optimality: 2.0460322458769895e-11
  constr_violation: 0.0
    execution_time: 8.019183874130249
         tr_radius: 547187.6906881843
    constr_penalty: 1.0
 barrier_parameter: 2.560000000000001e-07
 barrier_tolerance: 2.560000000000001e-07
             niter: 24

orbital 3 -- probably just need better orbital debugging to look at plots of gradients burn time minimization

 measurement time minimization
           message: `xtol` termination condition is satisfied.
           success: True
            status: 2
               fun: 7.2611805268544085
                 x: [ 8.510e+02]
               nit: 88
              nfev: 140
              njev: 140
              nhev: 0
          cg_niter: 76
      cg_stop_cond: 2
              grad: [-5.372e-03]
   lagrangian_grad: [-5.372e-03]
            constr: [array([ 8.510e+02]), array([ 7.261e+00])]
               jac: [<1x1 sparse matrix of type '<class 'numpy.float64'>'
                    	with 1 stored elements in Compressed Sparse Row format>, <1x1 sparse matrix of type '<class 'numpy.float64'>'
                    	with 1 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0, 140]
       constr_njev: [0, 140]
       constr_nhev: [0, 0]
                 v: [array([ 1.008e-08]), array([-3.847e-06])]
            method: tr_interior_point
        optimality: 0.0053720960507766076
  constr_violation: 0.0
    execution_time: 250.54488492012024
         tr_radius: 0.00010000000000000003
    constr_penalty: 1.0
 barrier_parameter: 2.048000000000001e-09
 barrier_tolerance: 2.048000000000001e-09
             niter: 88

burn time minimization
           message: `xtol` termination condition is satisfied.
           success: True
            status: 2
               fun: 1.1974578234547488
                 x: [ 8.510e+02]
               nit: 84
              nfev: 132
              njev: 132
              nhev: 0
          cg_niter: 72
      cg_stop_cond: 2
              grad: [ 1.643e-03]
   lagrangian_grad: [ 1.643e-03]
            constr: [array([ 8.510e+02]), array([ 7.261e+00])]
               jac: [<1x1 sparse matrix of type '<class 'numpy.float64'>'
                    	with 1 stored elements in Compressed Sparse Row format>, <1x1 sparse matrix of type '<class 'numpy.float64'>'
                    	with 1 stored elements in Compressed Sparse Row format>]
       constr_nfev: [0, 132]
       constr_njev: [0, 132]
       constr_nhev: [0, 0]
                 v: [array([-3.255e-09]), array([ 7.765e-08])]
            method: tr_interior_point
        optimality: 0.0016431186701373075
  constr_violation: 0.0
    execution_time: 269.34243512153625
         tr_radius: 0.00010000000000000003
    constr_penalty: 1.0
 barrier_parameter: 2.048000000000001e-09
 barrier_tolerance: 2.048000000000001e-09
             niter: 84

this got a little bit worse -- ? maybe? maybe not.
time to run: 0.3405105210003967
2.999999678848303 2.9999921648385457
[[-65.5, 40.5]]
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 3.0086716944601576e-11
       x: [ 3.000e+00  3.000e+00]
     nit: 12
     jac: [-4.048e-06 -7.514e-06]
    nfev: 22
    njev: 22


with fix for scikits_odes d7c8f0cd34a29ae86fe7163624da81a53dbcc19c
ct- lqr:
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 0.9746834687930379
       x: [ 1.000e+00  1.732e+00]
     nit: 6
     jac: [-2.432e-06  1.258e-06]
    nfev: 15
    njev: 15
0.9746834673185735 0.9746834687930379
False
      ARE sol: [[1.         1.73205081]] 
iterative sol: [[1.00000017 1.73206144]]
time to run: 1.2047577609992004
(about twice as fast)

sampled lqr:
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 0.9900428986048293
       x: [ 6.613e-01  1.327e+00]
     nit: 13
     jac: [ 2.511e-06 -6.112e-07]
    nfev: 23
    njev: 23
True
0.9900428986048293 0.9901382319424742
      ARE sol: [[0.65140165 1.31420219]] 
iterative sol: [[0.66131676 1.3266333 ]]
time to run: 12.1436151529997
(vs 14 seconds -- but 2 more nfev and njev, so the simulations are showing some speed)


time switch:
time to run: 0.6632084919983754
2.9999996788483005 2.9999921648385275
[[-65.5, 40.5]]
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 3.008671708973335e-11
       x: [ 3.000e+00  3.000e+00]
     nit: 12
     jac: [-4.048e-06 -7.514e-06]
    nfev: 22
    njev: 22
# jacobian and residual got a little worse :(

state switch:
time to run: 0.3447912620013085
-3.0000004416906383 0.9999981661411806
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 1.7944401261517384e-12
       x: [-3.000e+00  1.000e+00]
     nit: 11
     jac: [ 4.752e-07 -2.071e-06]
    nfev: 13
    njev: 13
a bit faster to run, fewer evals (--> more accurate derivative?) and again about half the residual.

with terminal corrections 1abfbb1a23e404af50898f9eaeda19d0292ce6a0
time switch:
time to run: 0.8685651909327134
2.999999947677332 3.0000006238262453
[[-65.5, 40.5]]
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 2.1833585276783939e-13
       x: [ 3.000e+00  3.000e+00]
     nit: 14
     jac: [-2.465e-06  5.815e-07]
    nfev: 27
    njev: 27

state switch:
time to run: 0.6207856080727652
-2.6856887501938513 1.2909457412015444
 message: Desired error not necessarily achieved due to precision loss.
 success: False
  status: 2
     fun: 0.05548831100176521
       x: [-2.686e+00  1.291e+00]
     nit: 2
     jac: [ 3.192e-01  2.159e-01]
    nfev: 30
    njev: 18


from main commit 7719955c084e1d2c1b0e1f86e94932f2b7487c76:

continuous-time LQR
 message: Desired error not necessarily achieved due to precision loss.
 success: False
  status: 2
     fun: 0.9746747701375789
       x: [ 9.999e-01  1.732e+00]
     nit: 8
     jac: [ 4.354e-07 -1.313e-05]
    nfev: 49
    njev: 38
0.9746747718381815 0.9746747701375789
True
      ARE sol: [[1.         1.73205081]] 
iterative sol: [[0.99994437 1.73191252]]
time to run: 5.897095435997471

with increased tolerance, CT-LQR
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 0.9746747705969403
       x: [ 1.000e+00  1.732e+00]
     nit: 7
     jac: [-2.325e-06 -8.454e-06]
    nfev: 14
    njev: 14
0.9746747718770562 0.9746747705969403
True
      ARE sol: [[1.         1.73205081]] 
iterative sol: [[0.9999575  1.73195099]]
time to run: 2.408215404022485


sampled LQR
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 0.9900483146246063
       x: [ 6.613e-01  1.327e+00]
     nit: 12
     jac: [ 2.759e-08 -1.168e-08]
    nfev: 21
    njev: 21
True
0.9900483146246063 0.9901436291165173
      ARE sol: [[0.65140165 1.31420219]] 
iterative sol: [[0.66131649 1.32663953]]
time to run: 14.537590428022668


time switch CG:
time to run: 0.4460119630675763
2.999_999_6788483014 2.999_99216483854
[[-65.5, 40.5]]
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 3.008671699433141e-11
       x: [ 3.000e+00  3.000e+00]
     nit: 12
     jac: [-4.048e-06 -7.514e-06]
    nfev: 22
    njev: 22

state switch CG
time to run: 0.4791095880791545
-3.0000029620072084 0.999999306880576
 message: Optimization terminated successfully.
 success: True
  status: 0
     fun: 3.660484274143412e-12
       x: [-3.000e+00  1.000e+00]
     nit: 9
     jac: [-1.510e-06 -6.931e-07]
    nfev: 16
    njev: 16


minimum time:
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  2.5118302e+01 0.00e+00 4.72e+01   0.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  2.1064550e+00 0.00e+00 1.32e+01   1.7 4.62e+01    -  9.81e-01 2.58e-02f  6
   2  6.4016479e-01 0.00e+00 2.26e+00  -4.6 2.75e-01    -  9.97e-01 1.00e+00f  1
   3  5.8092446e-01 0.00e+00 9.41e-01  -2.5 3.60e-02    -  1.00e+00 1.00e+00f  1
   4  5.6100514e-01 0.00e+00 8.50e-01  -4.3 2.26e-02    -  1.00e+00 1.00e+00f  1
   5  3.9328525e-01 0.00e+00 1.60e+00  -6.3 2.34e-01    -  1.00e+00 1.00e+00f  1
   6  4.6880330e-02 0.00e+00 1.52e+00 -11.0 1.09e+00    -  1.00e+00 1.00e+00f  1
   7  1.3615856e-02 0.00e+00 1.51e-01  -6.9 3.33e-01    -  1.00e+00 1.00e+00f  1
   8  1.6888661e-03 0.00e+00 1.86e-01  -9.1 1.18e-01    -  1.00e+00 1.00e+00f  1
   9  3.4865441e-04 0.00e+00 1.49e-01 -10.7 4.05e-02    -  1.00e+00 1.00e+00f  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10  1.1335534e-06 0.00e+00 7.23e-03 -11.0 8.99e-03    -  1.00e+00 1.00e+00f  1
  11  6.8613004e-10 0.00e+00 1.09e-04 -11.0 9.70e-04    -  1.00e+00 1.00e+00f  1
  12  1.4640699e-11 0.00e+00 2.03e-05 -11.0 3.72e-05    -  1.00e+00 1.00e+00f  1
  13  3.4863428e-12 0.00e+00 1.49e-05 -11.0 5.30e-06    -  1.00e+00 1.00e+00f  1
  14  1.0006573e-15 0.00e+00 1.82e-07 -11.0 9.55e-07    -  1.00e+00 1.00e+00f  1
  15  3.6969394e-19 0.00e+00 1.85e-09 -11.0 3.45e-08    -  1.00e+00 1.00e+00f  1

Number of Iterations....: 15

                                   (scaled)                 (unscaled)
Objective...............:   3.6969393961980235e-19    3.6969393961980235e-19
Dual infeasibility......:   1.8467756219875384e-09    1.8467756219875384e-09
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Variable bound violation:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   9.9999999999999994e-12    9.9999999999999994e-12
Overall NLP error.......:   1.8467756219875384e-09    1.8467756219875384e-09


Number of objective function evaluations             = 25
Number of objective gradient evaluations             = 16
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 0
Total seconds in IPOPT                               = 0.583

EXIT: Optimal Solution Found.
time to run: 0.5835203368915245
3.0000000000720406 3.0000000008153815

state switched minimum time
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  2.0000000e+00 0.00e+00 2.00e+00   0.0 0.00e+00    -  0.00e+00 0.00e+00   0
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.9103417579638755, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   1  6.7157288e-01 0.00e+00 8.28e-01 -11.0 2.00e+00    -  1.00e+00 5.00e-01f  2
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.95366884012536, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   2  1.2893378e-02 0.00e+00 1.01e-01 -11.0 8.99e-01    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.981778624907767, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   3  5.3364968e-03 0.00e+00 9.64e-02 -11.0 1.48e-01    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.950466434004882, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   4  9.9494463e-04 0.00e+00 3.34e-02 -11.0 5.36e-02    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.939420993072642, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   5  2.3832048e-04 0.00e+00 1.23e-02 -11.0 2.11e-02    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.930912134421119, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   6  1.4643881e-05 0.00e+00 2.90e-03 -11.0 1.03e-02    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.92860613907688, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   7  3.3394576e-07 0.00e+00 4.47e-04 -11.0 3.36e-03    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.928218648983621, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   8  4.7012115e-10 0.00e+00 1.62e-05 -11.0 6.21e-04    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.928202463368474, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
   9  1.1486778e-12 0.00e+00 7.89e-07 -11.0 2.30e-05    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.9282032441915735, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
  10  3.9006304e-16 0.00e+00 1.50e-08 -11.0 1.06e-06    -  1.00e+00 1.00e+00f  1
/Users/bmargoli/python/simupy/simupy/block_diagram.py:574: UserWarning: Simulation encountered NaN outputs and quit during update after event channel [1]. This may have been intentional! NaN outputs at time t=4.928203230860623, state x=[nan nan nan], output y=[nan nan  0.]
  warnings.warn(
  11  6.7473450e-19 0.00e+00 6.17e-10 -11.0 2.02e-08    -  1.00e+00 1.00e+00f  1

Number of Iterations....: 11

                                   (scaled)                 (unscaled)
Objective...............:   6.7473450483635297e-19    6.7473450483635297e-19
Dual infeasibility......:   6.1706590635232230e-10    6.1706590635232230e-10
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Variable bound violation:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   0.0000000000000000e+00    0.0000000000000000e+00
Overall NLP error.......:   6.1706590635232230e-10    6.1706590635232230e-10


Number of objective function evaluations             = 17
Number of objective gradient evaluations             = 12
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 0
Total seconds in IPOPT                               = 0.819

EXIT: Optimal Solution Found.
time to run: 0.8351516530383378
-3.0000000008446843 1.0000000004571155


new changes:

sp lqr unchanged
     fun: 0.9900483146246063
     jac: array([ 2.75901268e-08, -1.16815240e-08])
 message: 'Optimization terminated successfully.'
    nfev: 21
     nit: 12
    njev: 21
  status: 0
 success: True
       x: array([0.66131649, 1.32663953])
True
0.9900483146246063 0.9901436291165177
      ARE sol: [[0.65140165 1.31420219]] 
iterative sol: [[0.66131649 1.32663953]]

time takes one more call 
     fun: 3.008671643193588e-11
     jac: array([-4.04760434e-06, -7.51402417e-06])
 message: 'Optimization terminated successfully.'
    nfev: 22
     nit: 12
    njev: 22
  status: 0
 success: True
       x: array([2.99999968, 2.99999216])

orbital exactly matches previous results, I believe I had this on the previous commit but didn't update results
barrier_parameter: 5.120000000000003e-08
 barrier_tolerance: 5.120000000000003e-08
          cg_niter: 29
      cg_stop_cond: 1
            constr: [array([2755.7739505 ,   84.08964518])]
       constr_nfev: [0]
       constr_nhev: [0]
       constr_njev: [0]
    constr_penalty: 1.0
  constr_violation: 0.0
    execution_time: 13.30492091178894
               fun: 0.2850000000279469
              grad: array([-4.48257988e-09, -1.47125494e-09])
               jac: [<2x2 sparse matrix of type '<class 'numpy.float64'>'
	with 3 stored elements in Compressed Sparse Row format>]
   lagrangian_grad: array([-5.07195247e-09, -1.49003908e-09])
           message: '`gtol` termination condition is satisfied.'
            method: 'tr_interior_point'
              nfev: 19
              nhev: 0
               nit: 28
             niter: 28
              njev: 19
        optimality: 5.07195247211123e-09
            status: 1
           success: True
         tr_radius: 95703125.0
                 v: [array([-1.87841380e-11, -6.08156734e-10])]
                 x: array([  84.08964518, 2839.86359568])

I believe this was on f332b533595ce24c0b9ed520d967918d5ec4dc65  ~1?
difference for ct lqr seems to be the boundar conditions on x_interp in adjoint wrapper

     fun: 0.9746747717488164
     jac: array([ 1.13771775e-06, -1.03498718e-06])
 message: 'Optimization terminated successfully.'
    nfev: 17
     nit: 9
    njev: 17
  status: 0
 success: True
       x: array([0.99999795, 1.73204583])

also makes sp lqr better:
     fun: 0.9900483146246063
     jac: array([ 2.75901268e-08, -1.16815240e-08])
 message: 'Optimization terminated successfully.'
    nfev: 21
     nit: 12
    njev: 21
  status: 0
 success: True
       x: array([0.66131649, 1.32663953])

time switch:
     fun: 1.4629706826047088e-11
     jac: array([-1.77024510e-06, -5.28002925e-06])
 message: 'Optimization terminated successfully.'
    nfev: 20
     nit: 12
    njev: 20
  status: 0
 success: True
       x: array([3.00004072, 2.99995361])

state switch still broken  need to be going backwards?

orbital good after fixing adjoint max step
 barrier_parameter: 1.0240000000000006e-08
 barrier_tolerance: 1.0240000000000006e-08
          cg_niter: 42
      cg_stop_cond: 4
            constr: [array([2755.80431968,   84.09947268])]
       constr_nfev: [0]
       constr_nhev: [0]
       constr_njev: [0]
    constr_penalty: 1.0
  constr_violation: 0.0
    execution_time: 79.29979491233826
               fun: 0.28500000003972525
              grad: array([-4.66382733e-09,  3.44991352e-09])
               jac: [<2x2 sparse matrix of type '<class 'numpy.float64'>'
	with 3 stored elements in Compressed Sparse Row format>]
   lagrangian_grad: array([-4.78115410e-09,  3.44615572e-09])
           message: '`gtol` termination condition is satisfied.'
            method: 'tr_interior_point'
              nfev: 29
              nhev: 0
               nit: 39
             niter: 39
              njev: 29
        optimality: 4.78115410496791e-09
            status: 1
           success: True
         tr_radius: 807183690.8363969
                 v: [array([-3.75779664e-12, -1.21084574e-10])]
                 x: array([  84.09947268, 2839.90379236])

---------------------------------------------------------------
d3dc65303f5739b2121b006025d1bc1111eae029:
---------------------------------------------------------------

ct lqr:
==============
     fun: 0.9746747699384586
     jac: array([ 3.07157188e-06, -1.89278169e-05])
 message: 'Desired error not necessarily achieved due to precision loss.'
    nfev: 54
     nit: 12
    njev: 44
  status: 2
 success: False
       x: array([0.99991925, 1.7318495 ])

sp lqr:
==============
     fun: 0.9900483146316192
     jac: array([-4.27906575e-06,  6.51896247e-06])
 message: 'Optimization terminated successfully.'
    nfev: 21
     nit: 13
    njev: 21
  status: 0
 success: True
       x: array([0.66131857, 1.32664499])


time switched:
==============
     fun: 1.4629661992728185e-11
     jac: array([-1.77025536e-06, -5.28002070e-06])
 message: 'Optimization terminated successfully.'
    nfev: 20
     nit: 12
    njev: 20
  status: 0
 success: True
       x: array([3.00004072, 2.99995361])

state switched:
===============

garbage :(


orbital:
==============
 barrier_parameter: 1.0240000000000006e-08
 barrier_tolerance: 1.0240000000000006e-08
          cg_niter: 42
      cg_stop_cond: 4
            constr: [array([2755.80431968,   84.09947268])]
       constr_nfev: [0]
       constr_nhev: [0]
       constr_njev: [0]
    constr_penalty: 1.0
  constr_violation: 0.0
    execution_time: 81.1555073261261
               fun: 0.28500000003972525
              grad: array([-4.66382733e-09,  3.44991352e-09])
               jac: [<2x2 sparse matrix of type '<class 'numpy.float64'>'
	with 3 stored elements in Compressed Sparse Row format>]
   lagrangian_grad: array([-4.78115410e-09,  3.44615572e-09])
           message: '`gtol` termination condition is satisfied.'
            method: 'tr_interior_point'
              nfev: 29
              nhev: 0
               nit: 39
             niter: 39
              njev: 29
        optimality: 4.78115410496791e-09
            status: 1
           success: True
         tr_radius: 807183690.8363969
                 v: [array([-3.75779664e-12, -1.21084574e-10])]
                 x: array([  84.09947268, 2839.90379236])


--------------------------------------------
on 36c232c5794eda25b6fe7c985c90a962ab5df4ba:
--------------------------------------------
ct and sp lqr are same,
time switch is broken,
state switch is even worse (CG doesn't move at all)
orbital seems fine

--------------------------------------------
on 8ab8a7e57324c86dbb6704a2fae9a3435eaeb608
--------------------------------------------

ct lqr:
==============
     fun: 0.974674771911601
     jac: array([-6.73104891e-09, -9.07986995e-09])
 message: 'Optimization terminated successfully.'
    nfev: 18
     nit: 9
    njev: 18
  status: 0
 success: True
       x: array([0.99999949, 1.73205199])

sp lqr:
==============
     fun: 0.9900483146246069
     jac: array([ 2.75901246e-08, -1.16815248e-08])
 message: 'Optimization terminated successfully.'
    nfev: 21
     nit: 12
    njev: 21
  status: 0
 success: True
       x: array([0.66131649, 1.32663953])

same number of fev but fewer iters? very slightly better performance
     fun: 0.9900483146 246069
     fun: 0.9900483146 316192


time switched:
==============
     fun: 6.437154366120429e-13
     jac: array([5.26732230e-06, 5.80823391e-07])
 message: 'Optimization terminated successfully.'
    nfev: 37
     nit: 15
    njev: 37
  status: 0
 success: True
       x: array([3.00004126, 2.99995965])


state switched:
===============

works but only because of typo with options that may not make sense

orbital
========
simupy doesn't simulate one of the adjoint intervals to sufficient tolerance in time for some reason



