Double distillation column: the infinite horizon vs the finite horizon

Double distillation column: the infinite horizon vs the finite horizon#

The model is the declared double column from models/double_column.py: two 41-tray columns in series separating a ternary mixture, the DAE example. The weir flows, vapor compositions, tray temperatures, and purity aliases are algebraic and undeclared; they ride along with the declared states. Two cases of the same model. Case 1 runs five sampling steps with the infinite-horizon terminal segment (drto.infinite_horizon, Dinh et al. 2025) carrying the tail, which deactivates the declared terminal cost since the tail owns the cost-to-go. Case 2 runs the full twenty-five step finite horizon with the terminal cost live.

Both cases initialize before the solve (initialize.py): the states interpolate linearly from the initial condition to the steady state, and the algebraic and cost variables then come from their defining equations at those states. A stand-in until initialization lands in drto.

Case 1: five samples plus the infinite-horizon tail#

import pyomo.environ as pyo
import pyomo_pounce  # registers pounce with the native factory
from pyomo.contrib.solver.common.factory import SolverFactory
import drto
from models.double_column import double_column
from drto import plot_states, plot_controls, plot_stage_cost
#import idaes
m1 = double_column(N=5)
pyo.TransformationFactory("dae.collocation").apply_to(m1, wrt=m1.t, nfe=5, ncp=3, scheme="LAGRANGE-RADAU")
pyo.TransformationFactory("drto.infinite_horizon").apply_to(
    m1,
    nfe=3,                    # finite elements on the terminal segment
    ncp=5,                    # Gauss-Legendre points per element
    beta=1.2,                 # tail overestimation factor, > 1
    gamma="rule",             # the mesh rule, tanh(gamma*h) = tau_11; pass a number to override
    profile="collocation",    # segment control profile (pyomo-cvp)
)
pyo.TransformationFactory("drto.parameterize").apply_to(m1)  # the finite-horizon profiles
drto.build_objective(m1)
drto.cold_start_dynamic(m1)
SolverFactory("pounce").solve(m1, tee=True)
#SolverFactory("ipopt").solve(m1, options={"linear_solver": "ma57"}, tee=True)
********************************************************************************

                    ####    ###   /   # /#   #/  ####  #####
                    #   #  #   # /#   #/ ##  /  #      #
                    ####   #   #/ #   /  # #/#  #      ####
                    #      #   /  #  /#  # /##  #      #
                    #       ##/    #/#   #/  #   ####  #####

********************************************************************************
This program contains POUNCE, a pure-Rust interior-point optimization solver
for nonlinear, conic, and global problems (its NLP core is ported from Ipopt).
Released under the Eclipse Public License (EPL) — drop-in compatible with Ipopt.
         For more information visit https://github.com/jkitchin/pounce
********************************************************************************

This is POUNCE version 0.11.0, running with linear solver FERAL.

Reading C:\Users\Devin\AppData\Local\Temp\tmpk673iydw\unknownqtksa2z9.nl...
Parsed 26269 vars, 25895 cons, jac_nnz=127432, h_nnz=59698 in 0.09s
Problem class: NLP. Selected solver: NLP filter line-search interior-point (pounce-nlp) [solver_selection=auto].

Number of nonzeros in equality constraint Jacobian...:   127272
Number of nonzeros in inequality constraint Jacobian.:      160
Number of nonzeros in Lagrangian Hessian.............:    59698

Total number of variables............................:    26269
                     variables with only lower bounds:     2940
                variables with lower and upper bounds:    15698
                     variables with only upper bounds:        0
Total number of equality constraints.................:    25863
Total number of inequality constraints...............:       32
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:       32
        inequality constraints with only upper bounds:        0

iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
   0  5.1145027e+03 5.05e+00 1.01e+02   -1.0 0.00e+00      - 0.00e+00 0.00e+00   0
   1  3.0220028e+02 4.89e+00 9.87e+01   -1.0 2.09e+01      - 9.72e-03 3.16e-02f  1
   2  2.9020142e+03 4.35e+00 9.07e+01   -1.0 2.23e+01      - 1.15e-01 1.10e-01h  1
   3  3.9378370e+02 3.63e+00 1.49e+02   -1.0 3.09e+01      - 2.53e-01 1.65e-01f  1
   4  5.5375188e+02 3.02e+00 2.04e+02   -1.0 3.77e+01      - 5.35e-01 1.68e-01h  1
   5  6.0295876e+02 2.57e+00 1.63e+02   -1.0 3.33e+01      - 9.19e-02 1.49e-01h  1
   6  6.6504847e+02 2.94e+00 7.03e+02   -1.0 2.99e+01      - 3.28e-02 2.28e-01h  1
   7  7.4548950e+02 5.35e+00 5.35e+02   -1.0 2.74e+01      - 4.13e-02 3.60e-01h  1
   8  8.6210119e+02 3.84e+00 4.29e+02   -1.0 2.59e+01      - 1.17e-01 5.44e-01h  1
   9  9.3058556e+02 2.70e+00 3.71e+02   -1.0 1.68e+01      - 6.68e-01 3.92e-01h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  10  9.9529664e+02 2.93e+00 4.93e+02   -1.0 1.58e+01      - 2.76e-01 2.30e-01f  1
  11  1.0379809e+03 3.48e+00 4.95e+02   -1.0 3.10e+01      - 1.47e-01 1.22e-01f  1
  12  1.0813640e+03 4.79e+00 4.63e+02   -1.0 5.83e+01      - 1.45e-01 9.97e-02f  1
  13  1.1005008e+03 5.02e+00 4.50e+02   -1.0 8.52e+01      - 8.22e-02 3.88e-02f  1
  14  1.1544705e+03 5.33e+00 3.56e+02   -1.0 4.83e+01      - 1.44e-01 1.16e-01f  1
  15  1.2406040e+03 4.73e+00 6.31e+02   -1.0 2.01e+01      - 2.88e-01 2.36e-01h  1
  16  1.3065580e+03 4.10e+00 1.01e+03   -1.0 2.22e+01      - 8.14e-01 1.88e-01h  1
  17  1.3146402e+03 4.66e+00 8.98e+02   -1.0 3.82e+02      - 4.17e-02 1.31e-02f  2
  18  1.4035909e+03 4.17e+00 1.84e+03   -1.0 2.29e+01      - 9.57e-01 2.44e-01h  1
  19  1.5466690e+03 2.54e+00 2.08e+03   -1.0 1.47e+01      - 9.02e-01 4.99e-01h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  20  1.7049097e+03 9.82e-01 5.08e+03   -1.0 9.57e+00      - 8.55e-01 9.31e-01h  1
  21  1.7661751e+03 7.17e-01 1.32e+04   -1.0 1.70e+01      - 2.87e-01 3.78e-01h  1
  22  1.8259961e+03 2.63e-01 7.12e+03   -1.0 3.28e+00      - 7.89e-01 1.00e+00h  1
  23  1.8359345e+03 9.36e-02 4.90e+04   -1.0 3.15e+00      - 7.99e-01 1.00e+00f  1
  24  1.8384252e+03 1.86e-01 8.69e+03   -1.0 4.30e+00      - 1.00e+00 1.00e+00h  1
  25  1.8388985e+03 2.13e-02 7.29e+02   -1.0 1.59e+00      - 1.00e+00 1.00e+00h  1
  26  1.8388856e+03 2.13e-05 9.13e-01   -1.0 6.29e-02      - 1.00e+00 1.00e+00h  1
  27  1.3601745e+03 8.21e-01 7.49e+04   -1.7 1.59e+01      - 2.55e-01 5.99e-01f  1
  28  1.1947447e+03 8.57e-01 8.52e+04   -1.7 1.26e+01      - 1.22e-01 3.35e-01f  1
  29  1.1061704e+03 7.68e-01 4.49e+04   -1.7 9.21e+00      - 3.64e-01 2.10e-01f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  30  9.6915511e+02 8.68e-01 7.47e+04   -1.7 1.16e+01      - 9.44e-02 3.46e-01f  1
  31  8.3735110e+02 7.54e-01 8.37e+04   -1.7 8.71e+00      - 3.41e-01 4.68e-01f  1
  32  7.1235782e+02 7.43e-01 1.88e+05   -1.7 7.98e+00      - 1.75e-01 7.09e-01f  1
  33  6.5673756e+02 7.49e-01 1.51e+05   -1.7 6.57e+00      - 3.19e-01 6.70e-01f  1
  34  6.3348499e+02 4.95e-01 7.50e+04   -1.7 6.21e+00      - 5.11e-01 8.31e-01f  1
  35  6.2388457e+02 2.56e-01 2.93e+04   -1.7 2.96e+00      - 7.71e-01 5.28e-01h  1
  36  6.1730410e+02 6.82e-02 3.06e+03   -1.7 2.66e+00      - 1.00e+00 1.00e+00f  1
  37  6.1668305e+02 1.46e-03 9.49e+01   -1.7 3.04e-01      - 1.00e+00 1.00e+00h  1
  38  6.1665145e+02 4.65e-06 1.33e-01   -1.7 1.38e-02      - 1.00e+00 1.00e+00h  1
  39  5.1418580e+02 6.43e-01 1.52e+04   -2.5 2.15e+01      - 1.92e-01 3.81e-01f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  40  4.4514802e+02 9.79e-01 5.79e+04   -2.5 1.59e+01      - 2.90e-01 4.49e-01f  1
  41  4.1400364e+02 7.88e-01 1.37e+05   -2.5 9.10e+00      - 1.56e-01 2.96e-01f  1
  42  3.9096737e+02 6.65e-01 1.55e+05   -2.5 1.03e+01      - 1.62e-01 2.42e-01f  1
  43  3.5928799e+02 7.52e-01 1.12e+05   -2.5 9.67e+00      - 3.58e-01 3.90e-01f  1
  44  3.3791502e+02 6.41e-01 7.87e+04   -2.5 6.23e+00      - 3.11e-01 4.36e-01h  1
  45  3.0813812e+02 6.45e-01 1.51e+04   -2.5 4.44e+00      - 3.11e-01 1.00e+00h  1
  46  3.0444116e+02 1.15e-01 3.83e+04   -2.5 2.28e+00      - 6.89e-01 1.00e+00h  1
  47  3.0377675e+02 9.41e-03 1.48e+03   -2.5 5.49e-01      - 1.00e+00 1.00e+00h  1
  48  3.0382010e+02 8.74e-05 5.57e+00   -2.5 5.05e-02      - 1.00e+00 1.00e+00h  1
  49  3.0382011e+02 2.70e-08 1.76e-03   -2.5 2.09e-03      - 1.00e+00 1.00e+00h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  50  2.8462305e+02 4.89e-01 1.06e+04   -3.8 6.66e+00      - 3.30e-01 4.72e-01f  1
  51  2.7707475e+02 5.18e-01 3.71e+04   -3.8 5.26e+00      - 3.81e-01 4.93e-01h  1
  52  2.7337382e+02 4.82e-01 1.94e+04   -3.8 4.15e+00      - 2.72e-01 5.14e-01h  1
  53  2.7302902e+02 4.14e-01 2.53e+04   -3.8 2.94e+00      - 2.61e-01 1.56e-01h  1
  54  2.7253165e+02 2.73e-01 1.63e+04   -3.8 2.49e+00      - 4.99e-01 3.85e-01h  1
  55  2.7225289e+02 1.09e-01 4.77e+03   -3.8 1.51e+00      - 1.00e+00 6.57e-01h  1
  56  2.7224192e+02 3.91e-03 1.69e+02   -3.8 5.26e-01      - 1.00e+00 1.00e+00h  1
  57  2.7225899e+02 5.78e-06 1.27e-01   -3.8 9.84e-03      - 1.00e+00 1.00e+00h  1
  58  2.7225900e+02 2.48e-10 1.55e-06   -3.8 1.16e-04      - 1.00e+00 1.00e+00h  1
  59  2.7175975e+02 9.43e-03 1.65e+03   -5.7 9.13e-01      - 8.48e-01 7.70e-01f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  60  2.7171616e+02 3.87e-03 9.16e+02   -5.7 2.40e-01      - 7.78e-01 6.25e-01h  1
  61  2.7169760e+02 6.34e-04 8.74e+01   -5.7 9.72e-02      - 7.21e-01 8.59e-01h  1
  62  2.7169579e+02 1.98e-04 5.90e+01   -5.7 4.69e-02      - 1.00e+00 6.99e-01h  1
  63  2.7169538e+02 9.93e-05 2.95e+01   -5.7 5.81e-03      - 1.00e+00 5.00e-01f  2
  64  2.7169497e+02 2.56e-07 7.56e-03   -5.7 2.13e-03      - 1.00e+00 1.00e+00h  1
  65  2.7169497e+02 5.71e-11 3.50e-08   -5.7 3.28e-05      - 1.00e+00 1.00e+00h  1
  66  2.7169052e+02 1.55e-06 6.41e+00   -8.6 1.38e-02      - 7.67e-01 8.14e-01f  1
  67  2.7168960e+02 2.43e-07 4.03e+00   -8.6 2.90e-03      - 8.04e-01 9.14e-01h  1
  68  2.7168953e+02 5.06e-08 1.07e+00   -8.6 5.64e-04      - 9.76e-01 8.04e-01f  1
  69  2.7168952e+02 2.31e-09 3.26e-05   -8.6 2.34e-04      - 1.00e+00 1.00e+00f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  70  2.7168952e+02 9.13e-11 3.65e-08   -8.6 6.82e-05      - 1.00e+00 1.00e+00h  1
  71  2.7168952e+02 1.07e-11 4.16e-09   -8.6 2.37e-05      - 1.00e+00 1.00e+00h  1


Number of Iterations....: 71

                                   (scaled)                 (unscaled)
Objective...............:   2.7168951652698553e+01    2.7168951652698553e+02
Dual infeasibility......:   4.1606178189993102e-09    4.1606178189993102e-08
Constraint violation....:   1.0698553154497858e-11    1.0698553154497858e-11
Variable bound violation:   9.9874919807666677e-09    9.9874919807666677e-09
Complementarity.........:   2.8558282486374349e-09    2.8558282486374349e-08
Overall NLP error.......:   4.1606178189993102e-09    4.1606178189993102e-08

Violation of the model as declared (before the bound_relax_factor widening): 9.9874919807666677e-09


Number of objective function evaluations             = 75
Number of objective gradient evaluations             = 72
Number of equality constraint evaluations            = 75
Number of inequality constraint evaluations          = 75
Number of equality constraint Jacobian evaluations   = 72
Number of inequality constraint Jacobian evaluations = 72
Number of Lagrangian Hessian evaluations             = 72
Total seconds in POUNCE                              = 27.564

EXIT: Optimal Solution Found.

POUNCE 0.11.0: Optimal Solution Found.
Status: Solve_Succeeded
pounce: wrote C:\Users\Devin\AppData\Local\Temp\tmpk673iydw\unknownqtksa2z9.sol
<pyomo.contrib.solver.common.results.Results at 0x1ea6fff7f70>
drto.info(m1)
drto registry
states: 606, controls: 8
horizont (ContinuousSet, 16 points)
statesx1 (free), x2 (free), M1 (free), M2 (free)
dynamicsdM1[i,t] == L1[11,t] - L1[i,t] + VB1[0] - VB1[0] for i in tray, t in t
dynamicsdx1[i,j,t] == (L1[11,t]*(x1[11,j,t] - x1[i,j,t]) + VB1[0]*(y1[9,j,t] - x1[i,j,t]) - VB1[0]*(y1[i,j,t] - x1[i,j,t]))/M1[i,t] for i in tray, j in comp, t in t
dynamicsdM2[i,t] == L2[11,t] - L2[i,t] + VB2[0] - VB2[0] for i in tray, t in t
dynamicsdx2[i,j,t] == (L2[11,t]*(x2[11,j,t] - x2[i,j,t]) + VB2[0]*(y2[9,j,t] - x2[i,j,t]) - VB2[0]*(y2[i,j,t] - x2[i,j,t]))/M2[i,t] for i in tray, j in comp, t in t
controlsLT1 (piecewise_constant, free), VB1 (piecewise_constant, free), D1 (piecewise_constant, free), B1 (piecewise_constant, free), LT2 (piecewise_constant, free), VB2 (piecewise_constant, free), D2 (piecewise_constant, free), B2 (piecewise_constant, free)
tracking stage costcost[t] == (LT1[t] - LT1_ss)**2 + (VB1[t] - VB1_ss)**2 + (D1[t] - D1_ss)**2 + (B1[t] - B1_ss)**2 + (LT2[t] - LT2_ss)**2 + (VB2[t] - VB2_ss)**2 + (D2[t] - D2_ss)**2 + (B2[t] - B2_ss)**2 + 10*(SUM((x1[i,j,t] - x1_ss[i,j])**2 + (x2[i,j,t] - x2_ss[i,j])**2 for i in tray for j in comp) + SUM((M1[l,t] - M1_ss[l])**2 + (M2[l,t] - M2_ss[l])**2 for l in tray)) for t in sorted(t)[:-1]
terminal costterm == 10*(SUM((x1[i,j,5] - x1_ss[i,j])**2 + (x2[i,j,5] - x2_ss[i,j])**2 for i in tray for j in comp) + SUM((M1[l,5] - M1_ss[l])**2 + (M2[l,5] - M2_ss[l])**2 for l in tray))
initial conditionsx1_hat[i,j] == x1[i,j,0] for i in tray, j in comp
initial conditionsx2_hat[i,j] == x2[i,j,0] for i in tray, j in comp
initial conditionsM1_hat[i] == M1[i,0] for i in tray
initial conditionsM2_hat[i] == M2[i,0] for i in tray
steady-state targetsx1_ss (of x1), x2_ss (of x2), M1_ss (of M1), M2_ss (of M2)
steady-state control targetsLT1_ss (of LT1), VB1_ss (of VB1), D1_ss (of D1), B1_ss (of B1), LT2_ss (of LT2), VB2_ss (of VB2), D2_ss (of D2), B2_ss (of B2)
transformations
  1. drto.infinite_horizon: segment=3 elements x 5 Legendre points, beta=1.2, gamma=0.01563827, profile=collocation, horizon=kept, infinite tail appended, algebraic=9 components replicated, terminal_cost=terminal deactivated (the tail owns it), terminal=soft pin z(tau=1)=z_s on 4 states, mu=1000.0
  2. drto.parameterize: profiles=LT1 (piecewise_constant), VB1 (piecewise_constant), D1 (piecewise_constant), B1 (piecewise_constant), LT2 (piecewise_constant), VB2 (piecewise_constant), D2 (piecewise_constant), B2 (piecewise_constant)
  3. drto.build_objective: objective=sum of 1004 weighted cost terms
# multi-index states select by member: overhead purities and condenser holdups
plot_states(m1, states=["x1[41,1]", "x2[41,2]", "M1[41]", "M2[41]"]);
../_images/fa5c306e3cb94e50734185bd0914109b4fb2b5e3fa587194dee81075d685257f.png
plot_controls(m1);
../_images/ad4169d209cc8e6b4d2248991228cde5bbf0153d17cebd1e55e7e34bbbe0a1db.png
plot_stage_cost(m1);
../_images/0d350ebabaff1c90a36c58bf67ffeac6ea518766351a2e5383e964981c478b51.png

Case 2: twenty-five samples, finite horizon with the terminal cost#

m2 = double_column(N=25)
pyo.TransformationFactory("dae.collocation").apply_to(m2, wrt=m2.t, nfe=25, ncp=3, scheme="LAGRANGE-RADAU")
pyo.TransformationFactory("drto.parameterize").apply_to(m2)
drto.build_objective(m2)
drto.cold_start_dynamic(m2)
SolverFactory("pounce").solve(m2, tee=True)
#SolverFactory("ipopt").solve(m2, options={"linear_solver": "ma57"}, tee=True)
********************************************************************************

                    ####    ###   /   # /#   #/  ####  #####
                    #   #  #   # /#   #/ ##  /  #      #
                    ####   #   #/ #   /  # #/#  #      ####
                    #      #   /  #  /#  # /##  #      #
                    #       ##/    #/#   #/  #   ####  #####

********************************************************************************
This program contains POUNCE, a pure-Rust interior-point optimization solver
for nonlinear, conic, and global problems (its NLP core is ported from Ipopt).
Released under the Eclipse Public License (EPL) — drop-in compatible with Ipopt.
         For more information visit https://github.com/jkitchin/pounce
********************************************************************************

This is POUNCE version 0.11.0, running with linear solver FERAL.

Reading C:\Users\Devin\AppData\Local\Temp\tmp02yly2za\unknown49olgrtg.nl...
Parsed 61685 vars, 61485 cons, jac_nnz=287815, h_nnz=143885 in 0.19s
Problem class: NLP. Selected solver: NLP filter line-search interior-point (pounce-nlp) [solver_selection=auto].

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

Total number of variables............................:    61685
                     variables with only lower bounds:     6003
                variables with lower and upper bounds:    36960
                     variables with only upper bounds:        0
Total number of equality constraints.................:    61485
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  5.6421478e+02 5.05e+00 1.00e+00   -1.0 0.00e+00      - 0.00e+00 0.00e+00   0
   1  5.6167681e+02 4.18e+00 4.17e+02   -1.0 1.56e+01      - 2.23e-01 1.72e-01f  1
   2  5.6305203e+02 4.15e+00 5.73e+02   -1.0 2.86e+01      - 1.93e-01 8.54e-03h  1
   3  5.8552876e+02 3.66e+00 1.24e+03   -1.0 2.25e+01      - 2.25e-01 1.18e-01f  1
   4  6.4582543e+02 3.31e+00 7.62e+02   -1.0 2.52e+01      - 1.09e-01 2.79e-01h  1
   5  6.6770697e+02 3.15e+00 7.27e+02   -1.0 3.20e+01      - 1.42e-01 7.42e-02h  1
   6  7.4194703e+02 3.33e+00 7.51e+02   -1.0 3.52e+01      - 1.09e-01 2.48e-01h  1
   7  7.9091848e+02 3.17e+00 1.65e+03   -1.0 3.70e+01      - 6.11e-02 2.14e-01h  1
   8  7.9919848e+02 2.77e+00 1.92e+03   -1.0 3.69e+01      - 5.27e-02 1.50e-01h  1
   9  7.9276492e+02 3.07e+00 2.02e+03   -1.0 4.98e+01      - 5.38e-02 1.48e-01h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  10  7.7757834e+02 3.51e+00 1.99e+03   -1.0 5.32e+01      - 5.48e-02 1.33e-01h  1
  11  7.6103565e+02 3.89e+00 1.88e+03   -1.0 5.91e+01      - 4.81e-02 1.13e-01f  1
  12  7.4871744e+02 4.29e+00 1.75e+03   -1.0 9.50e+01      - 6.48e-02 7.18e-02f  1
  13  7.2487850e+02 4.47e+00 1.70e+03   -1.0 4.87e+01   -2.0 7.26e-02 1.67e-01h  1
  14  6.9833735e+02 6.03e+00 1.72e+03   -1.0 1.41e+02      - 5.28e-02 9.81e-02f  1
  15  6.8830716e+02 7.26e+00 1.71e+03   -1.0 3.23e+02      - 1.96e-02 2.89e-02f  1
  16  6.6284579e+02 8.05e+00 1.56e+03   -1.0 9.52e+01   -2.5 6.47e-02 1.38e-01f  1
  17  6.5364156e+02 7.92e+00 1.49e+03   -1.0 1.73e+02      - 1.71e-02 4.57e-02f  1
  18  6.4955250e+02 7.75e+00 1.45e+03   -1.0 2.21e+02      - 2.99e-02 2.37e-02f  1
  19  6.2993160e+02 7.15e+00 1.31e+03   -1.0 6.28e+01   -2.1 3.18e-02 1.37e-01f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  20  6.1866664e+02 7.36e+00 1.26e+03   -1.0 1.71e+02      - 3.18e-02 3.71e-02f  1
  21  5.8259677e+02 8.11e+00 1.10e+03   -1.0 1.64e+02      - 6.21e-02 1.17e-01f  1
  22  5.6507713e+02 9.12e+00 9.66e+02   -1.0 8.62e+01   -2.5 5.22e-02 1.19e-01f  1
  23  5.3832745e+02 7.89e+00 7.71e+02   -1.0 5.55e+01      - 1.12e-01 2.03e-01h  1
  24  5.0766927e+02 5.95e+00 7.87e+02   -1.0 3.10e+01      - 2.29e-01 4.11e-01h  1
  25  5.0587050e+02 4.65e+00 6.18e+02   -1.0 1.89e+01      - 2.11e-01 2.86e-01h  1
  26  5.1263742e+02 4.59e+00 1.16e+03   -1.0 2.08e+01      - 3.16e-01 2.55e-01h  1
  27  5.1455642e+02 4.50e+00 1.21e+03   -1.0 2.33e+01      - 1.56e-01 2.95e-02f  1
  28  5.2186247e+02 4.73e+00 1.01e+03   -1.0 2.82e+01   -2.1 8.70e-02 6.82e-02h  1
  29  5.2958848e+02 4.08e+00 1.18e+03   -1.0 9.72e+00   -1.7 4.44e-01 1.70e-01h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  30  5.2997220e+02 4.07e+00 1.17e+03   -1.0 6.19e+01      - 2.07e-02 1.23e-02f  1
  31  5.3537253e+02 3.80e+00 9.94e+02   -1.0 2.49e+01      - 4.76e-02 1.61e-01h  1
  32  5.3417902e+02 3.81e+00 9.99e+02   -1.0 3.75e+02      - 2.15e-03 1.59e-03f  1
  33  5.4504613e+02 2.62e+00 3.56e+03   -1.0 1.55e+01      - 2.37e-01 3.49e-01h  1
  34  5.4813619e+02 2.24e+00 3.81e+03   -1.0 1.50e+01      - 1.32e-01 1.60e-01h  1
  35  5.4801257e+02 1.88e+00 5.20e+04   -1.0 1.29e+01      - 6.61e-02 1.76e-01h  1
  36  5.4663746e+02 1.86e+00 4.43e+04   -1.0 3.20e+01   -2.2 2.48e-02 1.46e-02f  1
  37  5.4987579e+02 1.33e+00 3.30e+04   -1.0 1.18e+01      - 3.04e-01 3.11e-01h  1
  38  5.4991430e+02 9.80e-01 5.91e+04   -1.0 1.09e+01      - 2.25e-01 3.22e-01h  1
  39  5.4549980e+02 9.68e-01 1.31e+05   -1.0 1.33e+01      - 5.56e-02 1.78e-01h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  40  5.4759334e+02 6.93e-01 1.90e+04   -1.0 4.86e+00      - 5.51e-01 3.88e-01h  1
  41  5.4726970e+02 5.53e-01 1.14e+05   -1.0 4.58e+00      - 3.99e-01 2.31e-01h  1
  42  5.4563034e+02 3.61e-01 3.41e+05   -1.0 2.91e+00      - 2.18e-01 6.98e-01h  1
  43  5.4554254e+02 3.20e-01 4.28e+05   -1.0 8.02e-01   -0.8 3.30e-01 4.37e-01h  1
  44  5.4614178e+02 2.81e-01 7.20e+05   -1.0 7.36e-01   -0.4 3.69e-01 1.00e+00h  1
  45  5.4664939e+02 2.61e-01 1.38e+06   -1.0 1.49e+01      - 2.16e-01 1.38e-01f  1
  46  5.4855180e+02 3.23e-01 2.49e+06   -1.0 9.49e+00      - 7.26e-02 3.06e-01f  1
  47  5.5331959e+02 5.76e-01 4.88e+06   -1.0 3.70e+00      - 3.49e-01 1.00e+00f  1
  48  5.5591867e+02 1.37e-01 2.07e+06   -1.0 1.29e+00      - 4.88e-01 1.00e+00f  1
  49  5.5582070e+02 4.94e-03 7.28e+04   -1.0 5.64e-01      - 1.00e+00 1.00e+00f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  50  5.5593795e+02 3.09e-04 1.18e+03   -1.0 1.08e-01      - 1.00e+00 1.00e+00h  1
  51  5.5594059e+02 1.48e-07 9.97e-01   -1.0 2.35e-03      - 1.00e+00 1.00e+00h  1
  52  3.6303783e+02 4.85e+00 6.35e+06   -3.8 1.25e+01      - 2.75e-01 1.00e+00f  1
  53  3.6784170e+02 3.87e+00 4.72e+06   -3.8 6.18e+00      - 2.69e-01 2.09e-01h  1
  54  3.6402721e+02 2.34e+00 4.03e+06   -3.8 6.29e+00      - 3.76e-02 4.27e-01h  1
  55  3.6309293e+02 2.28e+00 3.84e+06   -3.8 7.19e+00      - 5.78e-02 2.31e-02f  1
  56  3.4601121e+02 1.75e+00 3.11e+06   -3.8 8.33e+00      - 1.35e-01 3.49e-01f  1
  57  3.3957308e+02 1.60e+00 2.63e+06   -3.8 6.53e+00      - 1.62e-01 9.46e-02f  1
  58  3.3162885e+02 1.47e+00 2.40e+06   -3.8 5.92e+00      - 8.43e-02 9.07e-02f  1
  59  3.2329484e+02 1.36e+00 2.17e+06   -3.8 6.17e+00      - 9.61e-02 7.74e-02f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  60  2.8865441e+02 1.08e+00 1.83e+06   -3.8 6.51e+00      - 1.57e-01 3.06e-01f  1
  61  2.8844531e+02 1.08e+00 1.79e+06   -3.8 6.24e+00      - 2.11e-02 2.03e-03f  1
  62  2.6921658e+02 9.09e-01 1.62e+06   -3.8 6.11e+00      - 1.39e-01 1.90e-01f  1
  63  2.6061454e+02 8.28e-01 1.36e+06   -3.8 5.33e+00      - 1.25e-01 1.05e-01f  1
  64  2.5095281e+02 7.38e-01 1.41e+06   -3.8 4.96e+00      - 1.07e-01 1.39e-01f  1
  65  2.4872832e+02 7.07e-01 9.01e+05   -3.8 4.09e+00      - 2.54e-01 4.45e-02f  1
  66  2.3939534e+02 6.02e-01 7.71e+05   -3.8 3.96e+00      - 1.42e-01 2.06e-01f  1
  67  2.3288552e+02 5.16e-01 1.26e+06   -3.8 3.37e+00      - 1.37e-01 1.93e-01f  1
  68  2.2956227e+02 4.64e-01 5.34e+05   -3.8 3.21e+00      - 1.93e-01 1.21e-01f  1
  69  2.2397146e+02 4.20e-01 4.75e+05   -3.8 3.34e+00      - 1.26e-01 2.29e-01f  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  70  2.2396111e+02 4.20e-01 4.25e+06   -3.8 4.04e+00      - 4.58e-03 5.38e-04h  1
  71  2.2282983e+02 4.06e-01 4.21e+06   -3.8 4.05e+00      - 7.50e-02 5.88e-02f  1
  72  2.2247646e+02 3.98e-01 4.31e+06   -3.8 2.93e+00      - 1.83e-03 1.95e-02h  1
  73  2.1811536e+02 3.53e-01 2.64e+06   -3.8 1.83e+00      - 1.11e-02 2.50e-01f  1
  74  2.1774364e+02 3.44e-01 2.56e+06   -3.8 1.90e+00      - 1.18e-01 2.80e-02h  1
  75  2.1456601e+02 3.08e-01 1.97e+06   -3.8 1.81e+00      - 7.41e-02 2.54e-01f  1
  76  2.1241055e+02 2.70e-01 1.45e+07   -3.8 1.96e+00      - 3.84e-02 2.34e-01f  1
  77  2.1179690e+02 2.51e-01 1.30e+07   -3.8 1.85e+00      - 3.38e-02 9.53e-02f  1
  78  2.0838525e+02 4.10e-01 8.53e+06   -3.8 1.82e+00      - 4.41e-02 6.30e-01f  1
  79  2.0870179e+02 3.23e-01 2.11e+07   -3.8 1.64e+00      - 1.94e-02 5.43e-01h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  80  2.0870158e+02 3.23e-01 2.11e+07   -3.8 1.15e+00      - 1.50e-02 3.00e-04h  1
  81  2.0850932e+02 2.55e-01 1.56e+07   -3.8 1.12e+00      - 8.32e-02 2.67e-01f  1
  82  2.0842899e+02 2.28e-01 1.39e+07   -3.8 2.16e+00      - 6.97e-02 1.09e-01h  1
  83  2.0782772e+02 2.43e-01 1.24e+07   -3.8 2.84e+00      - 1.22e-02 6.76e-01f  1
  84  2.0892682e+02 6.74e-02 2.48e+07   -3.8 5.96e-01      - 2.04e-02 1.00e+00h  1
  85  2.0880222e+02 3.52e-02 1.23e+06   -3.8 5.06e-01      - 4.79e-01 1.00e+00h  1
  86  2.0872718e+02 3.50e-02 8.83e+04   -3.8 9.38e-01      - 5.30e-01 1.00e+00h  1
  87  2.0883807e+02 1.01e-03 3.60e+04   -3.8 3.89e-02      - 4.35e-01 1.00e+00h  1
  88  2.0880910e+02 3.15e-03 2.25e+04   -3.8 1.25e-01      - 3.70e-01 1.00e+00h  1
  89  2.0882262e+02 2.33e-05 9.71e-03   -3.8 1.03e-02      - 1.00e+00 1.00e+00h  1
iter      objective   inf_pr   inf_du lg(mu)    ||d|| lg(rg) alpha_du alpha_pr  ls
  90  2.0882265e+02 2.67e-08 9.02e-04   -3.8 3.08e-04      - 1.00e+00 1.00e+00h  1
  91  2.0881120e+02 2.95e-04 1.41e+03   -5.7 4.43e-02      - 8.52e-01 9.90e-01f  1
  92  2.0881656e+02 6.44e-08 9.56e-03   -5.7 7.43e-04      - 1.00e+00 1.00e+00h  1
  93  2.0881656e+02 8.12e-14 4.75e-09   -5.7 5.64e-07      - 1.00e+00 1.00e+00h  1
  94  2.0881655e+02 4.67e-08 7.99e-02   -8.6 5.57e-04      - 9.99e-01 1.00e+00h  1
  95  2.0881655e+02 5.68e-14 6.69e-11   -8.6 5.14e-08      - 1.00e+00 1.00e+00h  1


Number of Iterations....: 95

                                   (scaled)                 (unscaled)
Objective...............:   2.0881655256813400e+02    2.0881655256813400e+02
Dual infeasibility......:   6.6869695115044883e-11    6.6869695115044883e-11
Constraint violation....:   5.6843418860808015e-14    5.6843418860808015e-14
Variable bound violation:   9.5461387683570820e-09    9.5461387683570820e-09
Complementarity.........:   2.5059041974829522e-09    2.5059041974829522e-09
Overall NLP error.......:   2.5059041974829522e-09    2.5059041974829522e-09

Violation of the model as declared (before the bound_relax_factor widening): 9.5461387683570820e-09


Number of objective function evaluations             = 96
Number of objective gradient evaluations             = 1
Number of equality constraint evaluations            = 96
Number of inequality constraint evaluations          = 96
Number of equality constraint Jacobian evaluations   = 96
Number of inequality constraint Jacobian evaluations = 96
Number of Lagrangian Hessian evaluations             = 96
Total seconds in POUNCE                              = 114.329

EXIT: Optimal Solution Found.

POUNCE 0.11.0: Optimal Solution Found.
Status: Solve_Succeeded
pounce: wrote C:\Users\Devin\AppData\Local\Temp\tmp02yly2za\unknown49olgrtg.sol
<pyomo.contrib.solver.common.results.Results at 0x1ea73f1bd90>
drto.info(m2)
drto registry
states: 580, controls: 8
horizont (ContinuousSet, 76 points)
statesx1 (free), x2 (free), M1 (free), M2 (free)
dynamicsdM1[i,t] == L1[11,t] - L1[i,t] + VB1[i] - VB1[i] for i in tray, t in t
dynamicsdx1[i,j,t] == (L1[11,t]*(x1[11,j,t] - x1[i,j,t]) + VB1[i]*(y1[9,j,t] - x1[i,j,t]) - VB1[i]*(y1[i,j,t] - x1[i,j,t]))/M1[i,t] for i in tray, j in comp, t in t
dynamicsdM2[i,t] == L2[11,t] - L2[i,t] + VB2[i] - VB2[i] for i in tray, t in t
dynamicsdx2[i,j,t] == (L2[11,t]*(x2[11,j,t] - x2[i,j,t]) + VB2[i]*(y2[9,j,t] - x2[i,j,t]) - VB2[i]*(y2[i,j,t] - x2[i,j,t]))/M2[i,t] for i in tray, j in comp, t in t
controlsLT1 (piecewise_constant, free), VB1 (piecewise_constant, free), D1 (piecewise_constant, free), B1 (piecewise_constant, free), LT2 (piecewise_constant, free), VB2 (piecewise_constant, free), D2 (piecewise_constant, free), B2 (piecewise_constant, free)
tracking stage costcost[t] == (LT1[t] - LT1_ss)**2 + (VB1[t] - VB1_ss)**2 + (D1[t] - D1_ss)**2 + (B1[t] - B1_ss)**2 + (LT2[t] - LT2_ss)**2 + (VB2[t] - VB2_ss)**2 + (D2[t] - D2_ss)**2 + (B2[t] - B2_ss)**2 + 10*(SUM((x1[i,j,t] - x1_ss[i,j])**2 + (x2[i,j,t] - x2_ss[i,j])**2 for i in tray for j in comp) + SUM((M1[l,t] - M1_ss[l])**2 + (M2[l,t] - M2_ss[l])**2 for l in tray)) for t in sorted(t)[:-1]
terminal costterm == 10*(SUM((x1[i,j,25] - x1_ss[i,j])**2 + (x2[i,j,25] - x2_ss[i,j])**2 for i in tray for j in comp) + SUM((M1[l,25] - M1_ss[l])**2 + (M2[l,25] - M2_ss[l])**2 for l in tray))
initial conditionsx1_hat[i,j] == x1[i,j,0] for i in tray, j in comp
initial conditionsx2_hat[i,j] == x2[i,j,0] for i in tray, j in comp
initial conditionsM1_hat[i] == M1[i,0] for i in tray
initial conditionsM2_hat[i] == M2[i,0] for i in tray
steady-state targetsx1_ss (of x1), x2_ss (of x2), M1_ss (of M1), M2_ss (of M2)
steady-state control targetsLT1_ss (of LT1), VB1_ss (of VB1), D1_ss (of D1), B1_ss (of B1), LT2_ss (of LT2), VB2_ss (of VB2), D2_ss (of D2), B2_ss (of B2)
transformations
  1. drto.parameterize: profiles=LT1 (piecewise_constant), VB1 (piecewise_constant), D1 (piecewise_constant), B1 (piecewise_constant), LT2 (piecewise_constant), VB2 (piecewise_constant), D2 (piecewise_constant), B2 (piecewise_constant)
  2. drto.build_objective: objective=sum of 26 weighted cost terms
plot_states(m2, states=["x1[41,1]", "x2[41,2]", "M1[41]", "M2[41]"]);
../_images/3a608f39509e7ad8c3df04e889a9716dc89aa6681fa6b3086b60ee3774d78308.png
plot_controls(m2);
../_images/2405388db8815425267b8c14a2bee5534753f1ef74df29f0782427c6bca19cbb.png
plot_stage_cost(m2);
../_images/cd1ace0ad5841df070b6ee66f5da55dbb92efc5535db5d101f2e5ea5a60c79a9.png