!pip install gekko matplotlib numpy werkzeug==1.0.0
Requirement already satisfied: gekko in /opt/anaconda3/lib/python3.8/site-packages (0.2.8) Requirement already satisfied: matplotlib in /opt/anaconda3/lib/python3.8/site-packages (3.2.2) Requirement already satisfied: numpy in /opt/anaconda3/lib/python3.8/site-packages (1.19.2) Requirement already satisfied: werkzeug==1.0.0 in /opt/anaconda3/lib/python3.8/site-packages (1.0.0) Requirement already satisfied: flask-cors in /opt/anaconda3/lib/python3.8/site-packages (from gekko) (3.0.9) Requirement already satisfied: flask in /opt/anaconda3/lib/python3.8/site-packages (from gekko) (1.1.2) Requirement already satisfied: python-dateutil>=2.1 in /opt/anaconda3/lib/python3.8/site-packages (from matplotlib) (2.8.1) Requirement already satisfied: cycler>=0.10 in /opt/anaconda3/lib/python3.8/site-packages (from matplotlib) (0.10.0) Requirement already satisfied: kiwisolver>=1.0.1 in /opt/anaconda3/lib/python3.8/site-packages (from matplotlib) (1.2.0) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /opt/anaconda3/lib/python3.8/site-packages (from matplotlib) (2.4.7) Requirement already satisfied: Six in /opt/anaconda3/lib/python3.8/site-packages (from flask-cors->gekko) (1.15.0) Requirement already satisfied: click>=5.1 in /opt/anaconda3/lib/python3.8/site-packages (from flask->gekko) (7.1.2) Requirement already satisfied: itsdangerous>=0.24 in /opt/anaconda3/lib/python3.8/site-packages (from flask->gekko) (1.1.0) Requirement already satisfied: Jinja2>=2.10.1 in /opt/anaconda3/lib/python3.8/site-packages (from flask->gekko) (2.11.2) Requirement already satisfied: MarkupSafe>=0.23 in /opt/anaconda3/lib/python3.8/site-packages (from Jinja2>=2.10.1->flask->gekko) (1.1.1)
from gekko import GEKKO
import numpy as np
import matplotlib.pyplot as plt
The following equations describe the movement of a vehicle:
\begin{align} \frac{dx}{dt} & = v \cos \theta \\ \frac{dy}{dt} & = v \sin \theta \\ \frac{dv}{dt} & = a_v \\ \frac{dv}{dt} & = h(x,y) +u_e-u_b+f(v) \\ \frac{d\theta}{dt} & = \phi \\ \end{align}where $x,y$ denote the position of the vehicle, $v$ is velocity and acceleration is $a$. For simplicity, $u_e$ and $u_b$ are combined into a single variable $u_v$. In addition, a region is created that must be avoided based on the grid for part c). The region is represented as 3 circular obstacles of radius = 6.5. The following equation is used to ensure the vehicle does not collide with the obstacle:
\begin{equation} (x-x_o)^2 + (y-y_o)^2 \geq r_o^2 \end{equation}# initialise parameters
v_max = 30
v_min = -4
uv_max = 2
uv_min = -2
x_s = 10
y_s = 10
x_f = 50
y_f = 40
v_bound = 0
phi_max = 0.7
# initialize GEKKO
m = GEKKO()
nt = 101
m.time = np.linspace(0,1,nt)
obs_1 = [35, 35]
obs_2 = [35, 25]
obs_3 = [35, 30]
# Variables
x = m.Var(value=x_s)
y = m.Var(value=y_s)
v = m.Var(value=0, lb=v_min, ub=v_max)
th = m.Var(value=0, lb=-np.pi, ub=np.pi) # bound heading to -pi/2 and pi/2
# optimize final time
tf = m.FV(value=1.0,lb=0.1,ub=100.0)
tf.STATUS = 1
# control changes every time period
uv = m.MV(value=0, lb=uv_min,ub=uv_max)
uv.STATUS = 1
phi = m.MV(value=0, lb=-phi_max, ub=phi_max)
phi.STATUS = 1
# define the ODEs that describe the movement of the vehicle
m.Equation(x.dt()==v*m.cos(th)*tf)
m.Equation(y.dt()==v*m.sin(th)*tf)
m.Equation(v.dt()==uv*tf)
m.Equation(th.dt()==phi*tf)
# define path constraints
m.Equation(x >= 0)
m.Equation(y >= 0)
m.Equation((x - obs_3[0])**2 + (y - obs_3[1])**2 >= 6.5 * 6.5) # we implement the obstacles as three overlapping circular blobs
m.Equation((x - obs_2[0])**2 + (y - obs_2[1])**2 >= 6.5 * 6.5)
m.Equation((x - obs_1[0])**2 + (y - obs_1[1])**2 >= 6.5 * 6.5)
# define boundary constraints
m.fix(x, pos=len(m.time)-1,val=x_f)
m.fix(y, pos=len(m.time)-1,val=y_f)
m.fix(v, pos=len(m.time)-1,val=0)
# Objective function
m.Obj(tf)
# Solve
m.options.IMODE = 6
m.options.MAX_ITER = 2000
m.solve(disp=True) # set to False to hide the solver logs
#Presentation of results
print('Final Time: ' + str(tf.value[0]))
apm 155.198.90.49_gk_model4 <br><pre> ---------------------------------------------------------------- APMonitor, Version 1.0.0 APMonitor Optimization Suite ---------------------------------------------------------------- --------- APM Model Size ------------ Each time step contains Objects : 0 Constants : 0 Variables : 12 Intermediates: 0 Connections : 6 Equations : 10 Residuals : 10 Number of state variables: 2295 Number of total equations: - 2100 Number of slack variables: - 500 --------------------------------------- Degrees of freedom : -305 * Warning: DOF <= 0 ********************************************** Dynamic Control with Interior Point Solver ********************************************** Info: Exact Hessian ****************************************************************************** This program contains Ipopt, a library for large-scale nonlinear optimization. Ipopt is released as open source code under the Eclipse Public License (EPL). For more information visit http://projects.coin-or.org/Ipopt ****************************************************************************** This is Ipopt version 3.12.10, running with linear solver ma57. Number of nonzeros in equality constraint Jacobian...: 4875 Number of nonzeros in inequality constraint Jacobian.: 800 Number of nonzeros in Lagrangian Hessian.............: 796 Total number of variables............................: 2295 variables with only lower bounds: 900 variables with lower and upper bounds: 400 variables with only upper bounds: 0 Total number of equality constraints.................: 1700 Total number of inequality constraints...............: 400 inequality constraints with only lower bounds: 400 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 1.0000024e+02 1.21e+03 1.00e+02 0.0 0.00e+00 - 0.00e+00 0.00e+00 0 1 9.9957784e+01 1.21e+03 1.00e+02 -5.7 1.64e+05 - 8.92e-06 4.76e-06h 1 2r 9.9957784e+01 1.21e+03 9.99e+02 2.6 0.00e+00 - 0.00e+00 2.39e-08R 2 3r 1.0331018e+02 1.13e+03 9.97e+02 2.4 5.86e+04 - 1.67e-04 3.03e-03f 1 4r 4.0165492e+02 1.10e+03 9.94e+02 3.1 1.76e+04 - 4.32e-03 2.00e-03f 1 5r 2.8372686e+02 8.58e+02 9.94e+02 -3.6 1.72e+04 - 8.98e-04 3.22e-03f 1 6r 2.8572786e+02 8.55e+02 9.98e+02 1.8 1.17e+01 2.0 9.62e-01 4.02e-02f 1 7r 3.2216336e+02 8.34e+02 1.01e+03 2.4 3.28e+01 1.5 3.37e-01 1.29e-01f 1 8r 8.6142226e+01 4.39e+02 1.00e+03 -3.6 1.23e+04 - 3.98e-03 7.46e-03f 1 9r 8.6032292e+01 4.17e+02 1.00e+03 -3.6 4.11e+03 - 9.82e-04 1.06e-03f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 10r 8.6288200e+01 3.99e+02 1.00e+03 1.1 5.58e+04 - 1.34e-04 1.13e-03f 1 11 1.1707586e+02 3.98e+02 1.02e+01 -5.5 4.41e+04 - 1.30e-03 1.15e-03h 1 12 1.1769701e+02 3.98e+02 9.99e+01 -5.5 2.62e+05 - 7.51e-04 1.15e-05h 1 13r 1.1769701e+02 3.98e+02 9.99e+02 2.5 0.00e+00 - 0.00e+00 5.88e-08R 2 14r 1.2133054e+02 3.02e+02 9.90e+02 -3.6 5.45e+03 - 1.12e-02 9.37e-03f 1 15r 1.2133054e+02 3.02e+02 9.99e+02 2.5 0.00e+00 - 0.00e+00 1.15e-07R 2 16r 2.3223117e+02 2.13e+02 9.79e+02 2.3 5.98e+03 - 1.02e-01 1.95e-02f 1 17 2.7544861e+02 2.13e+02 2.27e+02 -5.8 7.04e+04 - 1.34e-03 2.65e-04h 1 18 3.3006190e+02 2.13e+02 7.77e+02 0.7 2.07e+06 - 4.78e-05 9.37e-06h 2 19 3.8430506e+02 2.13e+02 6.27e+02 -1.3 3.60e+06 - 4.17e-05 6.95e-06h 4 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 20 4.4669538e+02 2.13e+02 4.24e+02 -1.9 2.76e+06 - 6.33e-05 8.72e-06h 4 21 4.9644979e+02 2.13e+02 3.29e+02 -5.8 1.48e+06 - 6.21e-05 7.14e-06h 5 22 5.3252740e+02 2.13e+02 2.64e+02 -5.8 9.45e+05 - 7.13e-05 5.26e-06h 6 23 5.8044898e+02 2.13e+02 1.00e+02 -5.8 6.87e+05 - 3.13e-04 7.02e-06h 6 24 4.3534948e+03 2.13e+02 1.68e+03 2.2 3.12e+05 - 3.60e-04 5.54e-04f 1 25 4.3971753e+03 2.13e+02 1.68e+03 0.1 1.59e+05 -2.0 5.54e-05 1.18e-05h 1 26 5.1009823e+03 2.13e+02 1.65e+03 0.1 2.95e+05 -2.5 2.45e-05 9.65e-05h 1 27r 5.1009823e+03 2.13e+02 9.99e+02 2.3 0.00e+00 -1.1 0.00e+00 5.00e-07R 4 28r 5.0525450e+03 2.13e+02 9.99e+02 -3.8 1.39e+04 - 4.84e-03 9.08e-05f 1 29r 4.8897574e+03 7.77e+01 9.99e+02 -3.8 1.60e+05 - 3.93e-05 1.31e-03f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 30r 4.8897574e+03 7.77e+01 9.99e+02 1.7 0.00e+00 - 0.00e+00 4.61e-07R 3 31r 3.4797404e+03 7.34e+01 1.55e+03 2.2 2.09e+04 - 5.17e-03 1.43e-03f 1 32 3.4014524e+03 7.33e+01 9.95e+01 0.1 1.61e+04 - 7.39e-03 5.60e-04f 1 33 3.4981901e+03 7.33e+01 9.95e+01 0.1 4.31e+05 - 4.88e-05 4.63e-05h 1 34 3.8077821e+03 7.33e+01 9.96e+01 0.1 3.29e+05 - 1.25e-04 8.51e-05h 1 35 5.2966177e+03 7.33e+01 3.21e+02 0.1 2.07e+05 - 3.28e-04 2.95e-04h 1 36r 5.2966177e+03 7.33e+01 9.99e+02 1.4 0.00e+00 - 0.00e+00 3.93e-07R 4 37r 4.2191998e+03 6.96e+01 9.96e+02 3.3 1.28e+04 - 1.06e-02 1.89e-03f 1 38r 3.8730788e+03 5.65e+01 9.88e+02 2.5 6.99e+02 - 2.88e-02 7.74e-03f 1 39 3.9244683e+03 5.65e+01 3.06e+02 -5.2 1.98e+04 - 7.06e-03 9.55e-05h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 40 5.4924166e+03 5.65e+01 7.57e+02 -5.2 3.97e+04 - 1.32e-03 5.33e-04h 1 41r 5.4924166e+03 5.65e+01 1.00e+03 1.3 0.00e+00 - 0.00e+00 3.57e-07R 5 42r 5.5827278e+03 5.29e+01 9.94e+02 3.2 3.34e+03 - 2.17e-02 3.96e-03f 1 43r 5.5369033e+03 3.31e+01 9.58e+02 2.8 1.35e+02 - 2.48e-01 3.04e-02f 1 44r 6.2781865e+03 2.99e+01 7.45e+02 2.4 8.70e+01 - 2.79e-01 2.22e-01f 1 45r 6.3982475e+03 2.83e+01 6.16e+02 2.1 6.27e+01 - 3.03e-01 1.74e-01f 1 46r 6.5283263e+03 2.13e+01 5.82e+02 0.9 4.22e+01 - 9.88e-02 2.11e-01f 1 47r 6.8292800e+03 2.11e+01 5.18e+02 1.6 7.72e+01 - 1.32e-01 1.30e-01f 1 48r 7.1050612e+03 2.07e+01 5.93e+02 2.2 2.33e+01 - 5.68e-01 2.04e-01f 1 49r 7.1620350e+03 2.04e+01 2.70e+02 1.2 7.96e+00 - 5.01e-01 6.24e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 50r 8.1347251e+03 2.06e+01 2.26e+02 1.2 5.68e+01 - 3.65e-01 1.71e-01f 1 51r 8.5820225e+03 2.07e+01 3.22e+02 0.7 5.84e+01 - 2.22e-01 7.66e-02f 1 52r 9.9859716e+03 2.07e+01 2.15e+02 -4.4 1.49e+03 -2.0 7.74e-03 1.49e-02f 1 53r 9.9726618e+03 2.09e+01 9.04e+02 1.5 4.45e+01 0.2 6.53e-01 5.80e-02f 1 54r 9.8476841e+03 2.11e+01 8.59e+01 1.4 1.74e+01 - 8.71e-01 1.00e+00f 1 55r 9.9711316e+03 2.12e+01 1.01e+02 -0.0 4.50e+00 - 9.26e-01 8.49e-01f 1 56r 9.9780731e+03 2.15e+01 2.08e+02 -5.3 3.55e+01 -0.2 1.43e-01 1.04e-01f 1 57r 9.9765975e+03 2.15e+01 3.44e+02 0.6 2.19e+00 1.1 4.54e-01 2.28e-01f 1 58r 9.9771585e+03 2.15e+01 9.41e+01 0.5 3.37e+00 0.6 8.73e-01 7.75e-01f 1 59r 9.9819235e+03 2.15e+01 9.74e+01 0.3 4.16e+01 - 2.89e-01 1.86e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 60r 9.8989274e+03 4.38e+01 3.24e+03 2.5 6.77e+02 - 1.11e-02 5.27e-02f 1 61r 9.9380525e+03 4.31e+01 3.16e+03 1.1 5.76e+01 0.1 4.78e-02 1.59e-02f 1 62r 9.9250201e+03 3.32e+01 2.39e+03 1.1 8.45e+00 0.6 2.73e-01 2.29e-01f 1 63r 9.9173152e+03 2.45e+01 1.81e+03 1.1 4.09e+00 1.0 5.74e-01 2.62e-01f 1 64r 9.9284020e+03 2.13e+01 1.04e+03 1.1 2.21e+00 1.4 2.19e-01 5.04e-01f 1 65r 9.9266463e+03 2.13e+01 9.88e+02 1.1 3.45e+01 - 1.00e+00 5.33e-02f 1 66r 9.9174161e+03 2.13e+01 8.36e+02 1.1 2.66e+01 - 1.00e+00 2.95e-01f 1 67r 9.9021038e+03 2.14e+01 6.13e+02 1.1 1.60e+01 - 1.00e+00 1.00e+00h 1 68r 9.9575308e+03 2.14e+01 3.71e+02 0.4 8.86e+00 - 2.78e-01 5.55e-01f 1 69r 9.9704585e+03 2.15e+01 3.49e+02 0.4 4.97e+01 - 2.01e-01 1.78e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 70r 9.9744896e+03 2.15e+01 4.00e+02 0.4 3.38e+01 - 4.55e-01 1.42e-01f 1 71r 9.9808407e+03 2.15e+01 3.61e+02 0.4 2.94e+01 - 4.99e-01 3.27e-01f 1 72r 9.9858060e+03 2.15e+01 2.21e+02 0.4 2.14e+01 - 7.19e-01 4.54e-01f 1 73r 9.9899244e+03 2.14e+01 1.75e+02 0.4 1.22e+01 - 1.00e+00 7.99e-01f 1 74r 9.9951267e+03 2.14e+01 1.96e+02 -0.4 2.65e+00 - 9.91e-01 5.91e-01f 1 75r 9.9968070e+03 2.14e+01 1.11e+02 -5.9 1.52e+00 0.9 4.02e-01 3.02e-01f 1 76r 9.9971110e+03 2.14e+01 1.76e+02 -0.2 7.32e+00 0.5 2.32e-01 1.73e-01f 1 77r 9.9972816e+03 2.14e+01 6.44e+02 -0.4 4.25e+02 - 2.64e-02 1.30e-02f 1 78r 9.9972520e+03 2.13e+01 1.39e+03 1.0 6.99e+02 - 2.99e-02 6.97e-03f 1 79r 9.9972339e+03 2.13e+01 1.15e+03 -0.1 3.98e+01 - 1.59e-01 3.58e-02h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 80r 9.9973614e+03 2.13e+01 1.18e+03 -0.1 5.75e+01 - 8.12e-02 5.22e-02f 1 81r 9.9974362e+03 2.12e+01 1.04e+03 -0.1 5.47e+01 - 6.56e-01 3.36e-02f 1 82r 9.9977748e+03 2.11e+01 9.50e+02 -0.1 5.30e+01 - 1.22e-01 2.48e-01f 1 83r 9.9978083e+03 2.10e+01 8.07e+02 -0.1 4.14e+01 - 3.23e-01 4.10e-02f 1 84r 9.9981643e+03 2.10e+01 2.62e+02 -0.1 3.98e+01 - 1.00e+00 5.32e-01f 1 85r 9.9994606e+03 2.10e+01 6.08e+01 -0.9 1.96e+01 - 1.00e+00 8.02e-01f 1 86r 9.9994889e+03 2.10e+01 3.99e+02 -0.6 9.43e+00 -0.0 8.45e-01 3.58e-01f 1 87r 9.9997782e+03 2.10e+01 4.83e+01 -0.8 1.69e+01 -0.5 1.00e+00 1.00e+00f 1 88r 9.9998941e+03 2.10e+01 1.18e+02 -1.5 8.00e+00 -0.1 9.99e-01 4.82e-01f 1 89r 9.9999302e+03 2.10e+01 1.46e+02 -1.4 3.35e+01 -0.6 3.70e-01 3.22e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 90r 9.9999280e+03 2.10e+01 4.64e+02 -0.9 1.41e+01 -0.1 9.32e-01 2.52e-02f 1 91r 9.9999379e+03 2.10e+01 2.69e+02 -1.1 2.35e+01 -0.6 3.94e-01 4.62e-01f 1 92r 9.9988600e+03 2.10e+01 4.01e+03 -0.2 5.91e+01 -1.1 4.56e-02 8.85e-01f 1 93r 9.9989077e+03 2.10e+01 3.52e+03 -0.4 9.34e+00 0.2 2.49e-01 7.37e-02f 1 94r 9.9990116e+03 2.10e+01 2.73e+03 -0.4 6.71e+00 0.7 2.38e-01 2.27e-01f 1 95r 9.9991439e+03 2.10e+01 1.92e+03 -0.4 7.31e+00 0.2 6.58e-02 2.67e-01f 1 96r 9.9991781e+03 2.10e+01 1.69e+03 -0.4 5.85e+00 0.6 6.38e-02 9.58e-02f 1 97r 9.9992033e+03 2.10e+01 1.54e+03 -0.4 2.56e+00 1.0 7.67e-02 8.96e-02h 1 98r 9.9992321e+03 2.10e+01 1.40e+03 -0.4 3.89e+00 0.6 9.41e-02 9.32e-02h 1 99r 9.9993107e+03 2.10e+01 1.05e+03 -0.4 2.23e+00 1.0 3.72e-02 3.01e-01h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 100r 9.9993281e+03 2.10e+01 9.84e+02 -0.4 4.05e+00 0.5 4.41e-02 5.75e-02f 1 101r 9.9993877e+03 2.10e+01 8.64e+02 -0.4 1.67e+00 0.9 7.66e-02 2.90e-01h 1 102r 9.9994053e+03 2.10e+01 7.12e+02 -0.4 4.28e+00 0.5 2.05e-01 1.39e-01f 1 103r 9.9994507e+03 2.10e+01 4.94e+02 -0.4 1.77e+00 0.9 2.30e-01 4.40e-01h 1 104r 9.9994568e+03 2.10e+01 4.40e+02 -0.4 4.40e+00 0.4 2.92e-01 1.48e-01f 1 105r 9.9994669e+03 2.10e+01 2.85e+02 -0.4 1.81e+00 0.8 4.46e-01 2.80e-01f 1 106r 9.9994689e+03 2.10e+01 3.69e+02 -0.4 4.55e+00 0.4 4.80e-01 1.01e-01f 1 107r 9.9994843e+03 2.10e+01 8.67e+01 -0.4 1.91e+00 0.8 1.00e+00 7.71e-01f 1 108r 9.9994838e+03 2.10e+01 9.94e+01 -0.4 4.43e+00 0.3 2.59e-01 2.09e-01f 1 109r 9.9994834e+03 2.10e+01 2.46e+02 -0.4 1.26e+01 -0.2 6.33e-02 1.33e-02f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 110r 9.9994843e+03 2.10e+01 3.49e+02 -0.4 3.63e+00 0.3 6.25e-01 2.46e-01f 1 111r 9.9994843e+03 2.10e+01 4.16e+02 -0.4 7.77e+00 -0.2 3.30e-01 1.12e-01f 1 112r 9.9994765e+03 2.10e+01 3.23e+02 -0.4 1.77e+01 -0.7 2.21e-01 3.11e-01h 1 113r 9.9994701e+03 2.10e+01 2.66e+02 -0.4 4.52e+01 - 1.31e-01 5.57e-02h 4 114r 9.9994681e+03 2.10e+01 6.97e+02 -0.4 7.20e+00 -0.3 6.83e-01 1.52e-01h 1 115r 9.9994617e+03 2.10e+01 5.17e+02 -0.4 4.13e+01 - 1.45e-01 6.09e-02h 4 116r 9.9994492e+03 2.10e+01 2.52e+02 -0.4 1.47e+01 -0.7 3.96e-01 3.26e-01h 1 117r 9.9994397e+03 2.10e+01 1.45e+02 -0.4 6.32e+00 -0.3 7.63e-01 5.70e-01h 1 118r 9.9994367e+03 2.10e+01 2.79e+02 -0.4 1.23e+01 -0.8 4.82e-01 8.85e-02h 4 119r 9.9994267e+03 2.10e+01 1.24e+02 -0.4 5.94e+00 -0.4 6.86e-01 5.91e-01H 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 120r 9.9996814e+03 2.10e+01 1.76e+02 -6.4 1.11e+01 -0.8 3.48e-01 3.92e-01f 1 121r 9.9996331e+03 2.10e+01 3.95e+02 -0.4 4.54e+00 0.5 3.43e-01 1.28e-01f 1 122r 9.9996372e+03 2.10e+01 6.65e+02 -0.7 2.84e+01 - 1.00e+00 2.01e-01h 1 123r 9.9996433e+03 2.10e+01 5.32e+02 -0.7 2.38e+01 - 2.06e-01 1.01e-01f 1 124r 9.9996795e+03 2.10e+01 2.76e+02 -0.7 2.14e+01 - 3.54e-01 5.43e-01f 1 125r 9.9996927e+03 2.10e+01 9.75e+01 -0.7 1.09e+01 - 6.68e-01 6.45e-01f 1 126r 9.9996935e+03 2.10e+01 3.64e+02 -0.7 2.18e+01 - 8.96e-01 9.64e-02f 1 127r 9.9997000e+03 2.10e+01 1.10e+03 -0.7 3.27e+00 - 1.51e-01 1.00e+00f 1 128r 9.9997024e+03 2.10e+01 4.85e+02 -0.7 2.83e+00 - 1.00e+00 1.00e+00h 1 129r 9.9997013e+03 2.10e+01 1.08e+01 -0.7 7.40e-01 - 1.00e+00 1.00e+00f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 130r 9.9999507e+03 2.10e+01 2.54e+01 -2.5 7.65e-01 - 9.85e-01 6.72e-01f 1 131r 9.9999615e+03 2.10e+01 2.41e+02 -2.0 1.11e+01 0.0 3.52e-01 1.03e-01f 1 132r 9.9999362e+03 2.10e+01 1.96e+02 -0.8 2.72e+01 -0.5 1.62e-01 1.57e-01f 1 133r 9.9999728e+03 2.10e+01 1.09e+02 -1.3 2.21e+01 - 1.00e+00 6.01e-01f 1 134r 9.9999875e+03 2.10e+01 6.55e+01 -1.3 1.14e+02 - 1.62e-01 2.48e-01f 1 135r 9.9999925e+03 2.10e+01 6.01e+01 -1.3 9.10e+01 - 1.90e-01 1.28e-01f 1 136r 1.0000012e+04 2.10e+01 8.94e+01 -1.3 7.92e+01 - 8.33e-01 7.12e-01f 1 137r 1.0000060e+04 2.10e+01 1.73e+01 -2.3 2.53e+01 - 9.98e-01 8.12e-01f 1 138r 1.0000065e+04 2.10e+01 5.99e+01 -7.9 6.33e+01 -0.9 3.07e-02 2.70e-01f 1 139r 1.0000064e+04 2.10e+01 1.09e+02 -1.8 3.97e+01 -0.5 1.25e-01 3.18e-02f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 140r 1.0000065e+04 2.10e+01 6.00e+01 -2.1 1.45e+02 - 2.98e-03 6.46e-02f 1 141r 1.0000065e+04 2.11e+01 7.34e+01 -2.1 1.62e+03 - 1.66e-04 3.46e-03f 1 142r 1.0000066e+04 2.12e+01 8.40e+01 -2.1 5.54e+01 -1.0 8.46e-02 1.29e-01f 1 143r 1.0000066e+04 2.13e+01 2.15e+02 -2.1 1.14e+02 -1.5 6.58e-04 7.87e-02f 1 144r 1.0000067e+04 2.13e+01 2.33e+02 -2.1 5.72e+01 -1.0 2.14e-01 6.70e-02f 1 145r 1.0000067e+04 2.16e+01 1.74e+02 -2.1 2.09e+02 -1.5 1.12e-03 1.00e-01f 1 146r 1.0000067e+04 2.16e+01 1.89e+02 -3.7 5.90e+01 -1.1 1.64e-01 2.66e-03f 1 147r 1.0000053e+04 2.16e+01 1.42e+02 -0.8 4.96e+01 -0.7 5.38e-02 9.45e-02f 1 148r 1.0000053e+04 2.16e+01 5.18e+02 -1.8 1.76e+02 - 3.68e-02 3.75e-03h 1 149r 1.0000056e+04 2.16e+01 5.17e+02 -1.8 1.12e+02 - 5.79e-03 1.69e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 150r 1.0000056e+04 2.16e+01 6.63e+02 -2.2 9.56e+01 - 2.09e-01 1.76e-03f 1 151r 1.0000059e+04 2.16e+01 3.78e+02 -7.7 7.09e+01 -1.1 1.59e-03 8.74e-02f 1 152r 1.0000059e+04 2.16e+01 3.78e+02 -1.1 2.66e+02 -0.7 8.78e-02 6.82e-04h 1 153r 1.0000059e+04 2.16e+01 3.73e+02 -1.8 7.99e+01 -1.2 6.22e-02 1.36e-02h 1 154r 1.0000067e+04 2.15e+01 1.51e+03 -2.5 9.83e+01 - 9.82e-04 3.96e-01f 1 155r 1.0000045e+04 2.14e+01 1.46e+03 0.2 6.86e+02 -0.8 1.63e-02 1.50e-02F 1 156r 1.0000044e+04 2.15e+01 1.41e+03 -1.5 3.95e+02 - 3.06e-02 3.04e-02h 1 157r 1.0000050e+04 2.14e+01 3.77e+02 -1.5 6.49e+00 -0.3 2.88e-01 1.00e+00f 1 158r 9.9999868e+03 2.15e+01 1.75e+02 -0.8 1.69e+01 -0.8 6.30e-01 5.64e-01f 1 159r 9.9999867e+03 2.15e+01 1.74e+02 -1.1 1.31e+02 -1.3 7.23e-02 1.45e-02f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 160r 9.9999864e+03 2.15e+01 1.70e+02 -1.1 1.57e+02 - 3.21e-03 2.77e-02f 2 161r 9.9999861e+03 2.15e+01 1.67e+02 -1.1 1.53e+02 - 2.39e-01 2.61e-02f 4 162r 9.9999858e+03 2.15e+01 1.71e+02 -1.1 1.49e+02 - 4.26e-02 2.18e-02h 5 163r 9.9999852e+03 2.15e+01 2.57e+02 -1.1 1.45e+02 - 2.12e-01 4.48e-02h 4 164r 9.9999849e+03 2.15e+01 3.03e+02 -1.1 1.39e+02 - 1.52e-01 2.69e-02h 5 165r 9.9999845e+03 2.15e+01 3.45e+02 -1.1 1.34e+02 - 1.78e-01 3.08e-02h 5 166r 9.9999840e+03 2.15e+01 4.98e+02 -1.1 1.30e+02 - 6.26e-01 3.54e-02h 5 167r 9.9999834e+03 2.15e+01 4.98e+02 -1.1 1.25e+02 - 2.49e-01 4.07e-02h 5 168r 9.9999829e+03 2.15e+01 5.40e+02 -1.1 1.20e+02 - 1.00e+00 3.89e-02h 5 169r 9.9999824e+03 2.15e+01 5.18e+02 -1.1 1.15e+02 - 3.07e-01 3.76e-02h 5 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 170r 9.9999744e+03 2.14e+01 3.93e+02 -1.1 1.10e+02 - 1.00e+00 5.79e-01w 1 171r 9.9999741e+03 2.13e+01 3.77e+02 -1.1 4.37e+01 - 4.51e-01 4.26e-02w 1 172r 9.9999732e+03 2.12e+01 3.19e+02 -1.1 4.18e+01 - 2.41e-01 1.78e-01w 1 173r 9.9999814e+03 2.15e+01 4.71e+02 -1.1 3.41e+01 - 1.00e+00 7.24e-02h 3 174r 9.9999805e+03 2.15e+01 4.36e+02 -1.1 1.02e+02 - 3.98e-01 6.81e-02h 4 175r 9.9999801e+03 2.15e+01 4.09e+02 -1.1 9.47e+01 - 1.00e+00 3.17e-02h 5 176r 9.9999797e+03 2.14e+01 3.93e+02 -1.1 9.15e+01 - 5.15e-01 3.34e-02h 5 177r 9.9999793e+03 2.14e+01 3.71e+02 -1.1 8.83e+01 - 1.00e+00 3.49e-02h 5 178r 9.9999789e+03 2.14e+01 3.53e+02 -1.1 8.51e+01 - 5.99e-01 3.56e-02h 5 179r 9.9999785e+03 2.14e+01 3.31e+02 -1.1 8.19e+01 - 6.31e-01 3.52e-02h 5 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 180r 9.9999782e+03 2.14e+01 3.10e+02 -1.1 7.89e+01 - 4.61e-01 3.49e-02h 5 181r 9.9999779e+03 2.14e+01 2.82e+02 -1.1 7.60e+01 - 5.47e-01 3.49e-02h 5 182r 9.9999776e+03 2.13e+01 2.69e+02 -1.1 7.32e+01 - 6.07e-01 3.53e-02h 5 183r 9.9999729e+03 2.11e+01 2.17e+02 -1.1 7.05e+01 - 4.61e-01 5.84e-01w 1 184r 9.9999726e+03 2.11e+01 1.77e+02 -1.1 2.80e+01 - 1.00e+00 2.63e-01w 1 185r 9.9999720e+03 2.10e+01 5.29e+01 -1.1 2.05e+01 - 1.00e+00 7.21e-01w 1 186r 9.9999718e+03 2.10e+01 3.64e+00 -1.1 5.55e+00 - 1.00e+00 1.00e+00h 1 187r 1.0000040e+04 2.10e+01 2.34e+01 -3.0 5.29e-01 - 9.96e-01 6.61e-01f 1 188r 9.9999954e+03 2.10e+01 3.24e+01 -0.6 7.91e+01 -0.9 2.30e-01 1.43e-01f 1 189r 9.9999954e+03 2.10e+01 6.94e+01 -1.3 1.22e+02 - 1.17e-01 4.53e-03h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 190r 1.0000025e+04 2.10e+01 3.63e+01 -1.3 4.62e+01 - 3.20e-01 1.00e+00f 1 191r 1.0000022e+04 2.10e+01 3.12e+01 -1.3 1.07e+00 - 4.79e-01 1.00e+00h 1 192r 1.0000065e+04 2.10e+01 1.10e+01 -7.3 4.57e-01 - 6.37e-01 7.62e-01f 1 193r 1.0000065e+04 2.10e+01 1.27e+02 -1.9 3.39e+01 -0.5 1.18e-01 2.87e-02f 1 194r 1.0000065e+04 2.10e+01 7.58e+01 -1.9 2.17e+02 - 2.04e-03 4.88e-02f 1 195r 1.0000065e+04 2.11e+01 8.68e+01 -1.9 2.12e+02 - 2.68e-03 2.40e-02f 1 196r 1.0000066e+04 2.12e+01 8.59e+01 -1.9 3.06e+02 - 1.82e-02 1.88e-02f 1 197r 1.0000066e+04 2.16e+01 1.55e+02 -1.9 9.24e+02 - 1.11e-02 2.62e-02f 1 198r 1.0000066e+04 2.16e+01 1.49e+02 -1.9 3.91e+01 -0.9 9.62e-02 1.73e-01f 1 199r 1.0000066e+04 2.16e+01 1.46e+02 -1.9 8.20e+01 -1.4 4.46e-03 9.08e-04f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 200r 1.0000066e+04 2.16e+01 1.62e+02 -1.9 3.19e+02 - 6.66e-02 2.46e-03f 1 201r 1.0000066e+04 2.16e+01 2.35e+02 -1.9 3.21e+02 - 6.56e-03 2.09e-02f 1 202r 1.0000067e+04 2.16e+01 9.23e+02 -1.9 3.71e+02 - 8.60e-03 1.86e-02f 1 203r 1.0000066e+04 2.16e+01 7.00e+02 -1.9 7.19e+00 -0.1 2.35e-01 2.40e-01f 1 204r 1.0000066e+04 2.16e+01 1.25e+03 -1.9 1.29e+03 - 6.37e-03 1.43e-03f 1 205r 1.0000066e+04 2.16e+01 7.57e+02 -1.9 1.42e+03 - 7.23e-04 4.73e-03f 1 206r 1.0000066e+04 2.15e+01 4.50e+02 -1.9 1.68e+01 -0.6 7.63e-03 3.17e-01f 1 207r 1.0000066e+04 2.15e+01 5.14e+02 -1.9 6.69e+01 -1.0 1.01e-01 1.16e-03f 1 208r 1.0000066e+04 2.14e+01 6.20e+02 -1.9 1.83e+01 -0.6 2.58e-01 7.60e-01f 1 209r 1.0000067e+04 2.13e+01 5.79e+02 -7.9 1.34e+02 -1.1 7.09e-02 4.17e-02f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 210r 1.0000066e+04 2.11e+01 3.71e+02 -1.7 1.56e+02 -0.7 1.63e-02 1.11e-01f 1 211r 1.0000066e+04 2.11e+01 3.65e+02 -2.0 1.85e+01 -1.1 4.73e-01 1.50e-02f 1 212r 1.0000068e+04 2.07e+01 2.99e+02 -2.0 3.82e+01 -0.7 1.57e-01 5.07e-01f 1 213r 1.0000068e+04 2.05e+01 3.05e+02 -2.0 6.18e+02 -1.2 8.86e-04 8.48e-03f 1 214r 1.0000068e+04 2.05e+01 3.30e+02 -2.0 5.28e+01 -0.8 3.46e-01 1.31e-03f 1 215r 1.0000069e+04 1.99e+01 3.29e+02 -2.0 3.11e+02 -1.2 1.20e-02 5.29e-02f 1 216r 1.0000069e+04 1.95e+01 2.76e+02 -2.0 5.51e+01 -0.8 1.45e-01 1.56e-01f 1 217r 1.0000069e+04 1.95e+01 9.99e+02 1.3 0.00e+00 - 0.00e+00 3.52e-07R 2 218r 1.0000058e+04 1.94e+01 9.96e+02 -0.8 2.83e+03 - 2.48e-03 2.63e-03f 1 219r 9.9968029e+03 1.92e+01 9.95e+02 1.5 1.20e+04 - 1.86e-04 3.39e-03f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 220r 9.9956297e+03 1.92e+01 1.40e+03 1.1 4.31e+02 - 4.81e-01 5.92e-03f 1 221r 9.9957493e+03 1.92e+01 9.45e+02 0.5 6.66e+02 - 3.89e-01 4.33e-02f 1 222r 9.9934910e+03 2.30e+01 7.59e+02 1.2 8.38e+02 - 9.59e-02 1.96e-01f 1 223r 9.9830879e+03 1.92e+01 5.66e+02 1.7 1.58e+02 - 2.90e-01 2.55e-01f 1 224r 9.9865937e+03 1.91e+01 2.61e+02 1.3 3.06e+01 - 1.00e+00 6.81e-01f 1 225r 9.9900933e+03 1.91e+01 1.78e+02 0.6 6.58e+01 - 8.62e-01 3.13e-01f 1 226r 9.9916899e+03 1.91e+01 2.09e+02 0.3 7.83e+01 - 7.06e-01 2.37e-01f 1 227r 9.9957962e+03 1.91e+01 2.82e+02 0.5 7.96e+01 - 9.43e-01 8.71e-01f 1 228r 9.9989095e+03 1.91e+01 1.10e+01 0.2 1.72e+01 - 9.01e-01 1.00e+00f 1 229r 9.9999160e+03 1.92e+01 1.02e+01 -5.7 3.00e+01 - 7.83e-01 8.80e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 230r 9.9999563e+03 1.92e+01 2.64e+02 -1.4 3.60e+00 0.0 9.29e-01 3.08e-01f 1 231r 9.9999198e+03 1.92e+01 1.05e+03 0.8 5.68e+02 - 6.00e-01 7.57e-03f 1 232r 9.9986686e+03 1.92e+01 1.67e+03 0.1 4.46e+01 - 1.15e-01 1.00e+00f 1 233r 9.9989393e+03 1.91e+01 8.15e+02 0.1 4.42e+00 -0.5 8.49e-01 4.18e-01f 1 234r 9.9635214e+03 1.91e+01 1.54e+03 2.1 1.67e+02 - 6.65e-02 3.25e-01f 1 235r 9.9712829e+03 1.93e+01 9.69e+02 1.5 9.94e+01 - 2.82e-01 3.56e-01f 1 236r 9.9920139e+03 1.92e+01 6.20e+02 0.8 4.04e+01 - 6.43e-01 7.21e-01f 1 237r 9.9931493e+03 1.92e+01 3.63e+02 0.8 2.71e+01 - 6.23e-01 3.93e-01f 1 238r 9.9950255e+03 1.91e+01 7.56e+01 0.8 1.40e+01 - 6.26e-01 1.00e+00f 1 239r 9.9990995e+03 1.92e+01 5.03e+00 0.1 1.99e+00 - 1.00e+00 1.00e+00f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 240r 9.9997302e+03 1.92e+01 9.43e+01 -1.3 7.97e+01 - 4.59e-01 7.66e-01f 1 241r 9.9997298e+03 1.92e+01 2.98e+02 -0.4 3.90e+02 - 3.61e-01 2.03e-03f 1 242r 9.9996669e+03 1.92e+01 1.00e+02 -0.4 8.31e+01 - 6.50e-01 6.58e-01f 1 243r 9.9996446e+03 1.91e+01 6.95e+00 -0.4 2.95e+01 - 1.00e+00 9.90e-01f 1 244r 1.0000074e+04 1.92e+01 4.19e+00 -2.0 9.26e-01 - 9.97e-01 9.99e-01f 1 245r 1.0000066e+04 1.92e+01 5.59e+02 -0.9 8.85e+02 - 3.13e-01 9.11e-02f 1 246r 1.0000067e+04 1.92e+01 5.52e+02 -7.5 6.63e+01 - 2.90e-02 1.36e-02f 1 247r 1.0000067e+04 1.92e+01 4.26e+02 -2.3 2.30e+00 -0.1 1.00e+00 6.09e-03f 1 248r 1.0000067e+04 1.92e+01 3.78e+02 -7.8 4.78e+02 - 5.35e-02 9.52e-02f 1 249r 1.0000050e+04 1.88e+01 5.44e+02 -1.5 7.35e+00 -0.5 1.97e-01 1.00e+00f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 250r 1.0000065e+04 1.87e+01 1.26e+02 -1.8 2.68e+00 -0.1 1.00e+00 6.23e-01f 1 251r 1.0000059e+04 1.84e+01 2.90e+02 -1.4 1.81e+01 -0.6 7.89e-01 3.19e-01f 1 252r 1.0000059e+04 1.84e+01 1.93e+02 -1.9 4.99e+00 -0.2 9.38e-01 1.42e-02f 1 253r 1.0000063e+04 1.82e+01 2.05e+02 -3.0 2.87e+01 -0.6 5.70e-02 1.19e-01f 1 254r 9.9999903e+03 1.72e+01 5.05e+02 -1.0 1.19e+01 -0.2 1.00e+00 1.00e+00f 1 255r 9.9999903e+03 1.72e+01 9.99e+02 1.2 0.00e+00 - 0.00e+00 2.96e-07R 6 256r 9.9999914e+03 1.72e+01 9.98e+02 -4.8 2.74e+02 - 1.63e-01 8.83e-04f 1 257r 9.9987310e+03 1.63e+01 9.69e+02 1.2 3.91e+03 - 1.23e-01 2.86e-02f 1 258r 9.9865794e+03 2.02e+01 2.30e+03 1.5 1.08e+02 - 6.92e-02 1.89e-01f 1 259r 9.9869040e+03 2.73e+01 2.08e+03 1.2 1.76e+04 - 4.99e-04 5.65e-04f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 260r 9.9885289e+03 4.26e+01 1.01e+03 1.2 5.11e+02 - 8.16e-02 5.24e-02f 1 261r 9.9895698e+03 4.12e+01 9.93e+02 -0.1 1.53e+02 - 1.00e-01 3.33e-02f 1 262r 9.9748695e+03 5.47e+01 9.52e+02 1.7 2.25e+02 - 2.83e-01 2.87e-01f 1 263r 9.9829822e+03 3.75e+01 6.14e+02 1.3 7.09e+01 - 6.03e-01 3.77e-01f 1 264r 9.9955835e+03 1.52e+01 2.39e+02 0.7 3.47e+01 - 8.19e-01 7.51e-01f 1 265 9.9912727e+03 1.53e+01 9.87e+01 1.2 3.38e+03 - 1.88e-01 2.84e-02f 1 266 9.1302652e+03 2.96e+01 8.80e+01 1.0 2.13e+03 - 8.30e-02 1.03e-01f 1 267 8.8643500e+03 5.73e+01 1.11e+02 1.7 1.73e+03 - 2.21e-01 1.23e-01f 1 268 8.3546851e+03 5.66e+01 1.01e+02 0.6 4.92e+02 - 1.92e-01 1.52e-01f 1 269 8.0558417e+03 5.75e+01 1.18e+02 0.7 5.71e+02 - 1.31e-01 1.09e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 270 7.6421782e+03 5.58e+01 1.68e+02 1.1 8.98e+02 - 1.60e-01 9.11e-02f 1 271 6.8804148e+03 6.42e+01 1.24e+02 1.9 2.75e+03 - 5.16e-02 4.31e-02f 1 272 6.1547577e+03 8.66e+01 3.46e+02 1.6 1.12e+03 - 9.33e-02 1.16e-01f 1 273 5.9386679e+03 8.31e+01 3.19e+02 -4.7 5.38e+02 - 1.09e-01 7.07e-02f 1 274 5.6008652e+03 8.01e+01 2.82e+02 -4.8 1.39e+03 - 5.58e-02 6.41e-02f 1 275 5.2229337e+03 7.09e+01 2.65e+02 -4.8 1.53e+03 - 2.14e-02 8.64e-02f 1 276 5.0643522e+03 6.30e+01 2.51e+02 -0.9 3.63e+02 - 2.16e-01 1.06e-01f 1 277 4.6091102e+03 4.92e+01 2.18e+02 -4.9 1.51e+03 - 7.16e-02 1.61e-01f 1 278 4.4870485e+03 4.58e+01 1.98e+02 -0.6 4.12e+02 - 1.51e-01 9.15e-02f 1 279 4.0632566e+03 4.85e+01 1.56e+02 -0.9 1.44e+03 - 7.89e-02 1.97e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 280 3.9884866e+03 4.45e+01 1.41e+02 -1.0 3.84e+02 - 1.25e-01 9.27e-02f 1 281 3.5976736e+03 4.56e+01 1.11e+02 -0.1 1.42e+03 - 7.49e-02 2.05e-01f 1 282 3.5441851e+03 4.25e+01 1.03e+02 -5.2 4.68e+02 - 1.23e-01 7.40e-02f 1 283 3.2679053e+03 3.98e+01 8.47e+01 -0.1 1.34e+03 - 5.28e-02 1.76e-01f 1 284 3.2315085e+03 3.85e+01 8.18e+01 -5.2 8.17e+02 - 1.19e-01 3.43e-02f 1 285 3.1512123e+03 3.53e+01 7.46e+01 -0.5 8.74e+02 - 3.07e-02 8.74e-02f 1 286 2.9702302e+03 3.13e+01 1.39e+02 -0.8 1.14e+03 - 2.33e-02 1.47e-01f 1 287 2.9303268e+03 3.01e+01 1.38e+02 -5.3 8.46e+02 - 7.32e-02 4.27e-02f 1 288 2.8692000e+03 2.82e+01 1.17e+02 -0.4 9.19e+02 - 7.10e-02 6.32e-02f 1 289 2.6948892e+03 2.77e+01 1.19e+02 -0.2 1.38e+03 - 4.57e-02 1.26e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 290 2.6385966e+03 2.60e+01 9.13e+01 0.2 6.46e+02 - 6.03e-02 6.34e-02f 1 291 2.4965528e+03 2.28e+01 6.68e+01 -0.7 9.15e+02 - 3.95e-02 1.52e-01f 1 292 2.4522013e+03 2.17e+01 6.24e+01 -5.4 5.06e+02 - 6.47e-02 5.66e-02f 1 293 2.3438699e+03 1.97e+01 5.37e+01 -0.4 7.26e+02 - 9.81e-02 1.04e-01f 1 294 2.1911773e+03 1.72e+01 4.31e+01 -0.3 8.56e+02 - 9.06e-02 1.30e-01f 1 295 2.0653520e+03 1.54e+01 6.36e+01 -0.3 9.67e+02 - 2.98e-02 1.23e-01f 1 296 2.0011075e+03 1.41e+01 5.68e+01 -5.5 5.07e+02 - 5.60e-02 8.56e-02f 1 297 1.9068268e+03 1.42e+01 4.97e+01 -0.2 1.20e+03 - 5.80e-02 7.45e-02f 1 298 1.7769023e+03 1.45e+01 5.11e+01 -0.5 5.39e+02 - 7.15e-02 1.73e-01f 1 299 1.6614643e+03 1.39e+01 1.11e+02 -0.7 5.22e+02 - 3.87e-02 2.23e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 300 1.6283053e+03 1.28e+01 9.35e+01 -1.7 4.46e+02 - 1.05e-01 9.39e-02f 1 301 1.5832852e+03 1.20e+01 7.98e+01 -1.2 3.02e+02 - 6.94e-02 1.06e-01f 1 302 1.5360146e+03 1.12e+01 6.77e+01 -1.4 3.00e+02 - 5.14e-02 1.09e-01f 1 303 1.4327342e+03 1.11e+01 1.29e+02 -1.4 2.59e+02 - 1.31e-02 2.84e-01f 1 304 1.3851838e+03 8.85e+00 7.82e+01 -1.1 1.45e+02 - 3.14e-02 2.72e-01f 1 305 1.3673556e+03 8.04e+00 6.87e+01 -1.6 1.45e+02 - 1.06e-01 1.03e-01f 1 306 1.3479544e+03 7.35e+00 6.02e+01 -1.4 1.62e+02 - 5.49e-02 1.01e-01f 1 307 1.3280837e+03 6.76e+00 5.31e+01 -1.7 1.75e+02 - 5.47e-02 9.55e-02f 1 308 1.3075022e+03 6.25e+00 4.70e+01 -1.7 1.90e+02 - 5.53e-02 9.19e-02f 1 309 1.2863745e+03 5.81e+00 4.17e+01 -1.7 2.01e+02 - 5.38e-02 8.98e-02f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 310 1.2631030e+03 5.41e+00 3.65e+01 -0.8 2.17e+02 - 5.54e-02 9.56e-02f 1 311 1.2426882e+03 5.04e+00 3.24e+01 -1.5 2.06e+02 - 6.72e-02 8.80e-02f 1 312 1.2218154e+03 4.71e+00 2.88e+01 -1.2 2.16e+02 - 5.02e-02 8.78e-02f 1 313 1.1953932e+03 4.27e+00 2.37e+01 -1.1 1.88e+02 - 6.11e-02 1.31e-01f 1 314 1.1441070e+03 3.45e+00 5.98e+01 -1.4 1.42e+02 - 2.49e-02 3.46e-01f 1 315 1.1431444e+03 3.40e+00 5.89e+01 -6.0 7.16e+01 - 4.22e-02 1.43e-02h 1 316 1.1296968e+03 3.10e+00 5.00e+01 -1.5 1.25e+02 - 1.41e-01 1.10e-01f 1 317 1.1053258e+03 2.26e+00 2.19e+01 -1.7 7.95e+01 - 1.23e-01 3.37e-01f 1 318 1.1043896e+03 2.20e+00 2.13e+01 -6.1 4.07e+01 - 7.52e-02 2.92e-02h 1 319 1.0903670e+03 1.51e+00 1.42e+01 -2.0 4.56e+01 - 1.55e-01 3.62e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 320 1.0898578e+03 1.46e+00 1.12e+01 -6.2 3.61e+01 - 1.96e-01 3.86e-02h 1 321 1.0836726e+03 9.49e-01 5.88e+00 -1.7 5.23e+01 - 4.70e-01 4.21e-01f 1 322 1.0962919e+03 2.11e+00 5.34e+01 -0.1 5.92e+02 - 3.08e-03 1.63e-01f 1 323 1.1033871e+03 1.72e+00 3.42e+01 -0.6 1.72e+02 - 9.54e-01 7.15e-01f 1 324 1.1409484e+03 3.46e-01 6.56e+00 -0.6 1.64e+03 - 1.87e-01 1.00e+00f 1 325 1.1240217e+03 3.89e-01 2.33e+00 -1.4 2.48e+02 - 9.51e-01 6.44e-01f 1 326 1.0927889e+03 2.60e-01 5.96e-01 -2.0 1.02e+03 - 1.00e+00 8.57e-01f 1 327 1.0765398e+03 6.44e-02 1.11e-01 -2.8 1.54e+03 - 9.75e-01 1.00e+00f 1 328 1.0753091e+03 1.12e-02 2.23e-03 -3.4 2.81e+02 - 9.81e-01 1.00e+00h 1 329 1.0749881e+03 2.49e-03 2.34e-03 -4.3 6.91e+01 - 8.37e-01 9.94e-01h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 330 1.0749500e+03 3.44e-04 4.02e-05 -4.9 8.24e+00 - 1.00e+00 9.88e-01h 1 331 1.0749406e+03 5.62e-05 4.38e-05 -5.6 2.06e+00 - 1.00e+00 9.64e-01h 1 332 1.0749386e+03 7.89e-06 2.67e-05 -6.3 4.66e-01 - 1.00e+00 8.81e-01h 1 333 1.0749379e+03 1.38e-07 6.78e-08 -7.4 1.55e-01 - 1.00e+00 9.96e-01h 1 Number of Iterations....: 333 (scaled) (unscaled) Objective...............: 1.0749379337400549e+03 1.0749379337400549e+03 Dual infeasibility......: 6.7849130478080360e-08 6.7849130478080360e-08 Constraint violation....: 1.3769067663815804e-07 1.3769067663815804e-07 Complementarity.........: 1.0432651626184988e-07 1.0432651626184988e-07 Overall NLP error.......: 1.3769067663815804e-07 1.3769067663815804e-07 Number of objective function evaluations = 544 Number of objective gradient evaluations = 107 Number of equality constraint evaluations = 544 Number of inequality constraint evaluations = 544 Number of equality constraint Jacobian evaluations = 343 Number of inequality constraint Jacobian evaluations = 343 Number of Lagrangian Hessian evaluations = 333 Total CPU secs in IPOPT (w/o function evaluations) = 2.340 Total CPU secs in NLP function evaluations = 3.922 EXIT: Optimal Solution Found. The solution was found. The final value of the objective function is 1074.93793374005 --------------------------------------------------- Solver : IPOPT (v3.12) Solution time : 6.41460000000370 sec Objective : 1074.93793374005 Successful solution --------------------------------------------------- Final Time: 10.749373028
#Plot solution
tm = np.linspace(0,tf.value[0],nt)
plt.figure(1)
plt.plot(tm,x.value,'k-',label=r'$x$')
plt.plot(tm,y.value,'b-',label=r'$y$')
plt.plot(tm,v.value,'g-',label=r'$v$')
plt.plot(tm,th.value,'m-',label=r'$\theta$')
plt.plot(tm,uv.value,'r--',label=r'$a_v$')
plt.plot(tm,phi.value,'y--',label=r'$\phi$')
plt.legend(loc='best')
plt.xlabel('Time')
plt.show()
circle3 = plt.Circle((obs_1[0], obs_1[1]), 6.5, color='gray', clip_on=False)
circle2 = plt.Circle((obs_2[0], obs_2[1]), 6.5, color='gray', clip_on=False)
circle1 = plt.Circle((obs_3[0], obs_3[1]), 6.5, color='gray', clip_on=False)
plt.figure(1)
plt.plot(x.value,y.value,'k-',label=r'vehicle')
plt.gcf().gca().add_artist(circle3)
plt.gcf().gca().add_artist(circle2)
plt.gcf().gca().add_artist(circle1)
plt.legend(loc='upper left')
plt.xlabel('x position')
plt.ylabel('y position')
plt.ylim([0,50])
plt.xlim([0,50])
plt.show()
The following equations describe the movement of the rocket:
\begin{align} \frac{ds}{dt} & = v \\ \frac{dv}{dt} & = \frac{u-0.2v^2}{m_v} \\ \frac{dm_v}{dt} & = -0.01u^2 \\ \end{align}where $x$ denotes the position of the rocket, $v$ is velocity and fuel mass is $m_v$. The propulsion force $u$ controls the vehicle movement.
altitude = 150
# initialize GEKKO
m = GEKKO()
nt = 101
m.time = np.linspace(0,1,nt)
# Variables
s = m.Var(value=0)
v = m.Var(value=0, lb=0, ub=8)
m_v = m.Var(value=2)
# optimize final time
tf = m.FV(value=1.0,lb=0.1,ub=100.0)
tf.STATUS = 1
# control changes every time period
u = m.MV(value=0, lb=-2,ub=2)
u.STATUS = 1
# define the ODEs that describe the movement of the vehicle
m.Equation(s.dt()==v*tf)
m.Equation(v.dt()*m_v==(u-0.2*v**2)*tf)
m.Equation(m_v.dt()==tf*(-0.01*u**2))
# define path constraints
m.Equation(s >= 0)
# define boundary constraints
m.fix(s, pos=len(m.time)-1,val=altitude)
m.fix(v, pos=len(m.time)-1,val=0)
# Objective function
m.Obj(tf)
# Solve
m.options.IMODE = 6
m.options.MAX_ITER = 1000
m.solve(disp=True) # set to True to view solver logs
#Presentation of results
print('Final Time: ' + str(tf.value[0]))
apm 155.198.90.49_gk_model6 <br><pre> ---------------------------------------------------------------- APMonitor, Version 1.0.0 APMonitor Optimization Suite ---------------------------------------------------------------- --------- APM Model Size ------------ Each time step contains Objects : 0 Constants : 0 Variables : 6 Intermediates: 0 Connections : 4 Equations : 5 Residuals : 5 Number of state variables: 1197 Number of total equations: - 1100 Number of slack variables: - 100 --------------------------------------- Degrees of freedom : -3 * Warning: DOF <= 0 ********************************************** Dynamic Control with Interior Point Solver ********************************************** Info: Exact Hessian ****************************************************************************** This program contains Ipopt, a library for large-scale nonlinear optimization. Ipopt is released as open source code under the Eclipse Public License (EPL). For more information visit http://projects.coin-or.org/Ipopt ****************************************************************************** This is Ipopt version 3.12.10, running with linear solver ma57. Number of nonzeros in equality constraint Jacobian...: 2687 Number of nonzeros in inequality constraint Jacobian.: 400 Number of nonzeros in Lagrangian Hessian.............: 497 Total number of variables............................: 1197 variables with only lower bounds: 300 variables with lower and upper bounds: 200 variables with only upper bounds: 0 Total number of equality constraints.................: 900 Total number of inequality constraints...............: 200 inequality constraints with only lower bounds: 200 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 1.0000012e+02 1.50e+02 1.00e+02 0.0 0.00e+00 - 0.00e+00 0.00e+00 0 1 2.1159917e+03 1.50e+02 7.45e+02 1.8 1.47e+04 - 1.12e-04 2.51e-03f 1 2 2.1468385e+03 1.49e+02 7.44e+02 0.1 4.37e+03 - 6.11e-04 9.67e-04h 1 3 2.1552266e+03 1.49e+02 7.44e+02 0.1 1.04e+04 - 8.94e-04 3.22e-04h 1 4 2.4155190e+03 1.48e+02 7.26e+02 0.1 2.02e+03 -2.0 7.07e-04 1.03e-02h 1 5 2.4248712e+03 1.48e+02 7.26e+02 0.1 2.71e+04 -2.5 2.13e-04 2.72e-04h 1 6 2.4883285e+03 1.47e+02 7.24e+02 0.1 2.63e+03 -2.1 1.12e-02 2.72e-03h 1 7 2.5111061e+03 1.47e+02 7.23e+02 0.1 9.69e+03 -2.5 1.73e-03 8.79e-04h 1 8 2.6511502e+03 1.46e+02 7.16e+02 0.1 2.32e+03 -2.1 8.66e-03 6.04e-03h 1 9 2.7243030e+03 1.46e+02 7.14e+02 0.1 6.54e+03 -2.6 7.68e-04 3.05e-03h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 10 2.8403651e+03 1.45e+02 7.09e+02 0.1 1.94e+03 -2.2 1.98e-02 5.35e-03h 1 11 2.8901469e+03 1.45e+02 7.07e+02 0.1 4.13e+03 -2.6 4.10e-03 2.33e-03h 1 12 3.1308832e+03 1.43e+02 6.93e+02 0.1 1.40e+03 -2.2 6.33e-03 1.21e-02h 1 13 3.1554287e+03 1.43e+02 6.92e+02 0.1 6.68e+03 -2.7 2.68e-03 1.14e-03h 1 14 3.4013447e+03 1.41e+02 6.77e+02 0.1 1.31e+03 -2.3 1.28e-02 1.43e-02h 1 15 3.4776492e+03 1.40e+02 6.74e+02 0.1 6.12e+03 -2.7 2.82e-04 3.72e-03h 1 16 3.4868802e+03 1.40e+02 6.74e+02 0.1 7.19e+04 -3.2 1.60e-03 2.30e-04h 1 17 3.7152207e+03 1.38e+02 6.60e+02 0.1 3.16e+03 -2.8 1.55e-02 1.46e-02h 1 18 3.8416946e+03 1.37e+02 6.54e+02 0.1 1.02e+04 -3.3 9.12e-03 6.96e-03h 1 19 3.8537697e+03 1.37e+02 6.53e+02 0.1 7.85e+03 -2.8 1.17e-02 1.10e-03h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 20 3.9775252e+03 1.36e+02 6.47e+02 0.1 1.58e+04 -3.3 5.02e-03 7.68e-03h 1 21 3.9821491e+03 1.36e+02 6.47e+02 0.1 6.50e+03 -2.9 9.92e-04 4.12e-04h 1 22 4.0480158e+03 1.35e+02 6.43e+02 0.1 5.47e+03 -2.5 5.81e-03 6.09e-03h 1 23 4.1641035e+03 1.34e+02 6.36e+02 0.1 7.91e+03 -2.9 1.16e-03 9.28e-03h 1 24 4.2031095e+03 1.33e+02 6.33e+02 0.1 5.69e+03 -2.5 1.68e-03 4.90e-03h 1 25 4.2454566e+03 1.33e+02 6.29e+02 0.1 7.22e+03 -3.0 8.56e-03 5.68e-03h 1 26 4.2550963e+03 1.32e+02 6.28e+02 0.1 4.45e+03 -2.6 3.14e-03 2.47e-03h 1 27 4.2611543e+03 1.32e+02 6.27e+02 0.1 1.06e+04 -3.0 5.80e-03 7.17e-04h 1 28 4.3282063e+03 1.31e+02 6.23e+02 0.1 5.69e+03 -2.6 2.24e-04 6.40e-03h 1 29 4.4145509e+03 1.30e+02 6.18e+02 0.1 8.31e+03 -3.1 1.18e-02 7.04e-03h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 30 4.5398522e+03 1.29e+02 6.10e+02 0.1 6.17e+03 -2.7 5.15e-03 1.17e-02h 1 31 4.6106152e+03 1.28e+02 6.07e+02 0.1 9.19e+03 -3.1 2.53e-02 5.37e-03h 1 32 4.6597966e+03 1.27e+02 6.02e+02 0.1 8.29e+03 -2.7 2.65e-03 6.62e-03h 1 33 4.7593991e+03 1.26e+02 5.96e+02 0.1 1.15e+04 -3.2 3.65e-03 1.04e-02h 1 34 4.7608485e+03 1.26e+02 5.96e+02 0.1 1.01e+04 -2.8 1.76e-03 2.42e-04h 1 35 4.7825513e+03 1.25e+02 5.92e+02 0.1 6.73e+03 -3.2 1.73e-04 5.16e-03h 1 36 4.7806238e+03 1.25e+02 5.91e+02 0.1 1.06e+04 -2.8 2.82e-03 2.32e-03f 1 37 4.8690632e+03 1.24e+02 5.85e+02 0.1 6.49e+03 -3.3 7.57e-04 1.05e-02h 1 38 4.9096187e+03 1.23e+02 5.82e+02 0.1 8.29e+03 -2.9 5.66e-03 3.81e-03h 1 39 4.9905685e+03 1.22e+02 5.77e+02 0.1 7.63e+03 -3.3 2.21e-03 8.85e-03h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 40 4.9977272e+03 1.22e+02 5.76e+02 0.1 9.70e+03 -2.9 2.92e-03 6.69e-04h 1 41 5.1254581e+03 1.21e+02 5.68e+02 0.1 9.17e+03 -3.4 1.30e-03 1.27e-02h 1 42 5.1714418e+03 1.20e+02 5.65e+02 0.1 9.47e+03 -3.0 1.51e-02 5.14e-03h 1 43 5.2137645e+03 1.19e+02 5.63e+02 0.1 1.32e+04 -3.4 2.41e-02 4.26e-03h 1 44 5.2246878e+03 1.18e+02 5.57e+02 0.1 1.10e+04 -3.0 6.48e-04 9.78e-03f 1 45 5.2708820e+03 1.17e+02 5.49e+02 0.1 9.27e+03 -3.5 2.56e-03 1.39e-02h 1 46 5.3449961e+03 1.15e+02 5.44e+02 0.1 7.12e+03 - 1.62e-02 1.01e-02h 1 47 5.4445532e+03 1.14e+02 5.39e+02 0.1 7.31e+03 - 1.00e-02 8.30e-03h 1 48 5.8123573e+03 1.11e+02 5.16e+02 0.1 7.26e+03 - 1.36e-02 3.39e-02h 1 49 5.8148587e+03 1.10e+02 5.16e+02 0.1 3.24e+03 -3.1 6.13e-03 7.54e-04h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 50 5.8539088e+03 1.09e+02 5.09e+02 0.1 8.50e+03 -3.6 4.54e-03 1.31e-02f 1 51 5.8769360e+03 1.08e+02 5.04e+02 0.1 1.32e+04 - 1.27e-03 1.03e-02h 1 52 5.8591761e+03 1.07e+02 5.01e+02 0.1 1.62e+04 - 4.42e-03 5.09e-03f 1 53 5.9022160e+03 1.05e+02 4.92e+02 0.1 6.14e+03 - 2.20e-03 1.88e-02f 1 54 6.3108821e+03 9.92e+01 4.58e+02 0.1 3.31e+03 - 1.26e-02 5.81e-02h 1 55 6.5689765e+03 9.49e+01 4.36e+02 0.1 3.47e+03 - 5.92e-02 4.36e-02h 1 56 6.6318125e+03 9.36e+01 4.30e+02 0.1 2.30e+03 - 1.07e-02 1.33e-02h 1 57 7.3442335e+03 8.09e+01 3.58e+02 0.1 1.90e+03 - 4.25e-02 1.36e-01h 1 58 7.6031900e+03 7.50e+01 3.31e+02 0.1 1.77e+03 - 7.89e-02 7.19e-02h 1 59 7.6574333e+03 7.35e+01 3.24e+02 0.1 6.80e+02 - 1.12e-02 2.07e-02h 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 60 8.3404563e+03 5.64e+01 2.38e+02 0.1 9.26e+02 - 9.00e-02 2.32e-01h 1 61 8.6060825e+03 4.53e+01 1.89e+02 0.1 6.27e+02 - 1.13e-01 1.97e-01h 1 62 8.6951301e+03 3.60e+01 1.49e+02 0.1 3.87e+02 - 1.21e-01 2.07e-01f 1 63 8.5983148e+03 2.75e+01 1.15e+02 0.1 4.34e+02 - 1.20e-01 2.34e-01f 1 64 8.3878756e+03 2.27e+01 9.28e+01 0.1 4.91e+02 - 1.17e-01 1.97e-01f 1 65 8.0498830e+03 2.72e+01 1.60e+02 0.1 5.27e+02 - 1.13e-01 2.27e-01f 1 66 7.7124691e+03 2.63e+01 2.16e+02 0.1 7.19e+02 - 1.11e-01 1.95e-01f 1 67 7.3640482e+03 2.45e+01 2.67e+02 0.1 6.25e+02 - 1.14e-01 1.85e-01f 1 68 6.9682704e+03 2.64e+01 3.21e+02 0.1 4.12e+02 - 1.31e-01 1.99e-01f 1 69 6.5133092e+03 3.19e+01 4.25e+02 0.1 4.41e+02 - 1.27e-01 2.16e-01f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 70 5.9769406e+03 3.64e+01 5.69e+02 0.1 3.51e+02 - 1.52e-01 2.56e-01f 1 71 5.4356934e+03 3.48e+01 7.02e+02 0.1 3.17e+02 - 1.77e-01 2.66e-01f 1 72 4.9489790e+03 3.43e+01 8.27e+02 0.1 3.58e+02 - 1.90e-01 2.66e-01f 1 73 4.8248875e+03 3.27e+01 4.74e+01 0.1 9.96e+02 - 2.77e-01 1.26e-01f 1 74 4.8289975e+03 3.22e+01 8.60e+02 0.1 6.60e+02 - 1.75e-01 1.63e-02h 1 75 4.9660336e+03 2.13e+01 1.43e+03 0.1 4.54e+02 - 7.63e-01 5.44e-01f 1 76 5.0321887e+03 2.14e+01 6.28e+02 0.1 3.48e+02 - 3.86e-01 4.25e-01f 1 77 5.2780566e+03 9.59e-01 4.96e+03 0.1 1.41e+02 - 9.06e-02 1.00e+00f 1 78 5.1574203e+03 1.79e+00 1.56e+03 -0.1 1.13e+02 - 8.05e-01 1.00e+00f 1 79 5.1549198e+03 2.72e+00 1.15e+03 0.1 1.17e+03 - 3.81e-01 4.71e-02f 1 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls 80 5.1046833e+03 2.05e+00 4.32e+02 -0.4 4.10e+02 - 7.38e-01 6.61e-01f 1 81 5.0712395e+03 5.49e-01 5.98e+01 -1.8 5.37e+01 - 9.91e-01 6.29e-01f 1 82 5.0461563e+03 2.30e-02 2.05e-01 -2.9 5.28e+02 - 1.00e+00 9.92e-01f 1 83 5.0450449e+03 1.95e-04 2.57e-02 -4.3 3.88e+02 - 9.99e-01 9.92e-01f 1 84 5.0450168e+03 9.12e-07 5.04e-02 -4.8 1.17e+01 - 1.00e+00 9.95e-01h 1 85 5.0450104e+03 1.68e-07 2.91e+00 -6.5 2.96e+00 - 1.00e+00 8.16e-01f 1 86 5.0450090e+03 9.98e-09 5.70e-03 -6.5 5.36e-01 - 1.00e+00 1.00e+00h 1 87 5.0450089e+03 1.00e-08 4.81e-01 -8.4 5.80e-02 - 1.00e+00 9.89e-01f 1 88 5.0450089e+03 1.00e-08 6.02e-13 -9.9 1.41e-03 - 1.00e+00 1.00e+00h 1 Number of Iterations....: 88 (scaled) (unscaled) Objective...............: 5.0450088533388971e+03 5.0450088533388971e+03 Dual infeasibility......: 6.0232104778882708e-13 6.0232104778882708e-13 Constraint violation....: 9.9999907361236115e-09 9.9999907361236115e-09 Complementarity.........: 1.9072438640913431e-10 1.9072438640913431e-10 Overall NLP error.......: 9.9999907361236115e-09 9.9999907361236115e-09 Number of objective function evaluations = 89 Number of objective gradient evaluations = 89 Number of equality constraint evaluations = 89 Number of inequality constraint evaluations = 89 Number of equality constraint Jacobian evaluations = 89 Number of inequality constraint Jacobian evaluations = 89 Number of Lagrangian Hessian evaluations = 88 Total CPU secs in IPOPT (w/o function evaluations) = 0.283 Total CPU secs in NLP function evaluations = 0.593 EXIT: Optimal Solution Found. The solution was found. The final value of the objective function is 5045.00885333890 --------------------------------------------------- Solver : IPOPT (v3.12) Solution time : 0.898000000001048 sec Objective : 5045.00885333890 Successful solution --------------------------------------------------- Final Time: 50.45008587
tm = np.linspace(0,tf.value[0],nt)
plt.figure(1)
plt.subplot(4, 1, 1)
plt.plot(tm, s.value, 'k-',label=r'$s$')
plt.legend(loc='best')
plt.ylabel('Position')
plt.xlabel('Time')
plt.subplot(4, 1, 2)
plt.plot(tm, v.value, 'b-',label=r'$v$')
plt.legend(loc='upper left')
plt.ylabel('Velocity')
plt.xlabel('Time')
plt.subplot(4, 1, 3)
plt.plot(tm, m_v.value, 'm-',label=r'$m$')
plt.legend(loc='upper left')
plt.ylabel('Mass')
plt.xlabel('Time')
plt.subplot(4, 1, 4)
plt.plot(tm, u.value, 'r-',label=r'$u$')
plt.legend(loc='upper left')
plt.ylabel('Force')
plt.xlabel('Time')
plt.show()