\n",
@@ -1337,31 +2868,39 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.797044Z",
+ "start_time": "2025-11-20T21:46:17.794614Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 70
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.812504Z",
+ "start_time": "2025-11-20T21:46:17.807564Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature\n",
"m.fs.R101.outlet.temperature[0].setlb(600)\n",
"m.fs.R101.outlet.temperature[0].setub(800)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 71
},
{
"cell_type": "markdown",
@@ -1372,9 +2911,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.827227Z",
+ "start_time": "2025-11-20T21:46:17.822681Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature[0].setlb(298.0)\n",
"m.fs.F101.vap_outlet.temperature[0].setub(450.0)\n",
@@ -1382,7 +2924,9 @@
"m.fs.F102.vap_outlet.temperature[0].setub(450.0)\n",
"m.fs.F102.vap_outlet.pressure[0].setlb(105000)\n",
"m.fs.F102.vap_outlet.pressure[0].setub(110000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 72
},
{
"cell_type": "markdown",
@@ -1393,19 +2937,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.848212Z",
+ "start_time": "2025-11-20T21:46:17.844101Z"
+ }
+ },
"source": [
"m.fs.overhead_loss = Constraint(\n",
- " expr=m.fs.F101.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " <= 0.20 * m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " <= 0.20\n",
+ " * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 73
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1417,32 +2973,43 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.862411Z",
+ "start_time": "2025-11-20T21:46:17.859385Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 74
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.876414Z",
+ "start_time": "2025-11-20T21:46:17.872250Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint\n",
"m.fs.product_flow = Constraint(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"] >= 0.15\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " >= 0.15\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 75
},
{
"cell_type": "markdown",
@@ -1453,12 +3020,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.890250Z",
+ "start_time": "2025-11-20T21:46:17.887141Z"
+ }
+ },
"source": [
"m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 76
},
{
"cell_type": "markdown",
@@ -1472,43 +3044,161 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.024828Z",
+ "start_time": "2025-11-20T21:46:17.897344Z"
+ }
+ },
"source": [
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 938\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 9\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 504\n",
+ "\n",
+ "Reallocating memory for MA57: lfact (10594)\n",
+ "Total number of variables............................: 224\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 151\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 219\n",
+ "Total number of inequality constraints...............: 3\n",
+ " inequality constraints with only lower bounds: 2\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 1\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 4.2451396e+05 4.00e+04 6.94e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (11249)\n",
+ " 1 4.2182392e+05 4.00e+04 6.94e+00 -1.0 3.47e+07 - 3.71e-05 1.25e-05f 1\n",
+ " 2 4.2170773e+05 4.00e+04 8.41e+01 -1.0 1.49e+06 - 3.32e-04 1.53e-05f 1\n",
+ " 3 4.1795462e+05 4.00e+04 6.82e+01 -1.0 1.43e+06 - 4.98e-04 5.60e-04f 1\n",
+ " 4 3.0650178e+05 4.00e+04 3.09e+02 -1.0 1.26e+07 - 2.61e-05 1.17e-03f 1\n",
+ " 5 3.0553183e+05 3.99e+04 3.25e+04 -1.0 1.48e+05 - 1.28e-01 1.02e-03f 1\n",
+ " 6 3.0565526e+05 3.91e+04 5.25e+04 -1.0 3.99e+04 - 1.13e-01 2.09e-02h 2\n",
+ " 7 3.0601574e+05 3.59e+04 4.21e+04 -1.0 3.91e+04 - 5.17e-02 8.21e-02h 2\n",
+ " 8 3.0674242e+05 2.95e+04 8.41e+04 -1.0 3.59e+04 - 4.38e-01 1.79e-01h 1\n",
+ " 9 3.1153051e+05 1.11e+04 5.73e+04 -1.0 2.95e+04 - 8.56e-01 6.23e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10 3.1154545e+05 1.09e+04 5.69e+04 -1.0 1.19e+04 - 6.57e-02 2.37e-02h 1\n",
+ " 11 3.1159568e+05 1.08e+04 5.66e+04 -1.0 1.68e+04 - 2.23e-02 8.97e-03h 1\n",
+ " 12 3.1610911e+05 2.56e+03 2.13e+05 -1.0 1.68e+04 - 9.47e-01 7.94e-01h 1\n",
+ " 13 3.1708718e+05 1.16e+03 9.56e+04 -1.0 4.45e+03 - 9.90e-01 5.53e-01h 1\n",
+ " 14 3.1796760e+05 4.06e+02 1.14e+03 -1.0 1.27e+04 - 9.95e-01 9.87e-01h 1\n",
+ " 15 3.1802429e+05 5.35e+00 6.53e+02 -1.0 8.29e+01 - 1.00e+00 9.89e-01h 1\n",
+ " 16 3.1802524e+05 1.77e-04 5.89e+02 -1.0 5.10e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 17 3.1802492e+05 5.34e-06 1.83e+06 -2.5 1.32e+00 - 3.33e-01 1.00e+00f 1\n",
+ " 18 3.1802492e+05 1.70e-09 9.74e-03 -2.5 2.42e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 19 3.1802491e+05 4.41e-09 1.03e-01 -5.7 3.83e-02 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20 3.1802491e+05 2.39e-03 8.22e-09 -5.7 2.88e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 21 3.1802491e+05 8.00e-11 9.72e-09 -5.7 4.08e-04 - 1.00e+00 1.00e+00h 1\n",
+ " 22 3.1802491e+05 2.47e-03 1.19e-01 -8.6 2.93e+01 - 9.99e-01 1.00e+00h 1\n",
+ " 23 3.1802491e+05 2.41e+02 2.13e-09 -8.6 9.27e+03 - 1.00e+00 1.00e+00h 1\n",
+ " 24 3.1802491e+05 6.96e-03 3.66e-09 -8.6 1.88e+02 - 1.00e+00 1.00e+00h 1\n",
+ " 25 3.1802491e+05 3.61e-06 1.59e-09 -8.6 1.21e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 26 3.1802491e+05 2.29e-05 4.82e-09 -8.6 3.07e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 27 3.1802491e+05 9.42e-07 5.47e-09 -8.6 6.24e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 28 3.1802491e+05 1.16e-10 9.67e-09 -8.6 3.01e+00 - 1.00e+00 1.00e+00H 1\n",
+ "\n",
+ "Number of Iterations....: 28\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 3.1802490940142004e+05 3.1802490940142004e+05\n",
+ "Dual infeasibility......: 9.6706583658121551e-09 9.6706583658121551e-09\n",
+ "Constraint violation....: 1.1641532182693481e-10 1.1641532182693481e-10\n",
+ "Complementarity.........: 2.5059899579272651e-09 2.5059899579272651e-09\n",
+ "Overall NLP error.......: 2.2246107350021195e-10 9.6706583658121551e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 35\n",
+ "Number of objective gradient evaluations = 29\n",
+ "Number of equality constraint evaluations = 35\n",
+ "Number of inequality constraint evaluations = 35\n",
+ "Number of equality constraint Jacobian evaluations = 29\n",
+ "Number of inequality constraint Jacobian evaluations = 29\n",
+ "Number of Lagrangian Hessian evaluations = 28\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.036\n",
+ "Total CPU secs in NLP function evaluations = 0.006\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 77
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.045752Z",
+ "start_time": "2025-11-20T21:46:18.041549Z"
+ }
},
- "outputs": [],
"source": [
"# Check for solver solve status\n",
"from pyomo.environ import TerminationCondition\n",
"\n",
"assert results.solver.termination_condition == TerminationCondition.optimal"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 78
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization Results\n",
+ "### 8.1 Optimization Results\n",
"\n",
"Display the results and product specifications"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.074231Z",
+ "start_time": "2025-11-20T21:46:18.053675Z"
+ }
+ },
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))\n",
"\n",
@@ -1523,21 +3213,107 @@
"print()\n",
"print(\"Overhead loss in F101\")\n",
"m.fs.F101.report()"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 318024.90940142004\n",
+ "\n",
+ "Product flow rate and purity in F102\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 8369.3 : watt : False : (None, None)\n",
+ " Pressure Change : -2.4500e+05 : pascal : False : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.28812 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.75463 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.24537 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 7.5018e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.5957e-08 - - \n",
+ " Temperature kelvin 301.88 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.10493 \n",
+ " flow_mol_phase Vap mole / second - 0.18319 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.64256 0.64256 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.35744 0.35744 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.81883 0.81883 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.18117 0.18117 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.1799e-08 1.1799e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.0825e-08 4.0825e-08 \n",
+ " temperature kelvin - 362.93 362.93 \n",
+ " pressure pascal - 1.0500e+05 1.0500e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8188295888411846\n",
+ "\n",
+ "Overhead loss in F101\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F101 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -66423. : watt : False : (None, None)\n",
+ " Pressure Change : 0.0000 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 1.9480 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.13952 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.039059 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 0.18417 - - \n",
+ " Total Mole Fraction methane dimensionless 0.63725 - - \n",
+ " Temperature kelvin 763.51 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.28812 \n",
+ " flow_mol_phase Vap mole / second - 1.6598 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.75463 0.75463 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.24537 0.24537 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.032748 0.032748 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.0032478 0.0032478 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.21614 0.21614 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.74786 0.74786 \n",
+ " temperature kelvin - 301.88 301.88 \n",
+ " pressure pascal - 3.5000e+05 3.5000e+05 \n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 79
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.093619Z",
+ "start_time": "2025-11-20T21:46:18.090039Z"
+ }
},
- "outputs": [],
"source": [
- "assert value(m.fs.operating_cost) == pytest.approx(312786.338, abs=1e-3)\n",
+ "assert value(m.fs.operating_cost) == pytest.approx(318024.909, abs=1e-3)\n",
"assert value(m.fs.purity) == pytest.approx(0.818827, abs=1e-3)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 80
},
{
"cell_type": "markdown",
@@ -1548,49 +3324,88 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.106001Z",
+ "start_time": "2025-11-20T21:46:18.101768Z"
+ }
+ },
"source": [
- "print(\"Optimal Values\")\n",
- "print()\n",
+ "print(\n",
+ " f\"\"\"Optimal Values:\n",
"\n",
- "print(\"H101 outlet temperature = \", value(m.fs.H101.outlet.temperature[0]), \"K\")\n",
+ "H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"R101 outlet temperature = \", value(m.fs.R101.outlet.temperature[0]), \"K\")\n",
+ "R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F101 outlet temperature = \", value(m.fs.F101.vap_outlet.temperature[0]), \"K\")\n",
+ "F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F102 outlet temperature = \", value(m.fs.F102.vap_outlet.temperature[0]), \"K\")\n",
- "print(\"F102 outlet pressure = \", value(m.fs.F102.vap_outlet.pressure[0]), \"Pa\")"
- ]
+ "F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K\n",
+ "F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa\n",
+ "\"\"\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Optimal Values:\n",
+ "\n",
+ "H101 outlet temperature = 500.000 K\n",
+ "\n",
+ "R101 outlet temperature = 763.507 K\n",
+ "\n",
+ "F101 outlet temperature = 301.881 K\n",
+ "\n",
+ "F102 outlet temperature = 362.935 K\n",
+ "F102 outlet pressure = 105000.000 Pa\n",
+ "\n"
+ ]
+ }
+ ],
+ "execution_count": 81
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:19.262061Z",
+ "start_time": "2025-11-20T21:46:18.121920Z"
+ }
},
- "outputs": [],
"source": [
"assert value(m.fs.H101.outlet.temperature[0]) == pytest.approx(500, abs=1e-3)\n",
- "assert value(m.fs.R101.outlet.temperature[0]) == pytest.approx(696.112, abs=1e-3)\n",
- "assert value(m.fs.F101.vap_outlet.temperature[0]) == pytest.approx(301.878, abs=1e-3)\n",
+ "print(value(m.fs.R101.outlet.temperature[0]))\n",
+ "assert value(m.fs.R101.outlet.temperature[0]) == pytest.approx(763.484, abs=1e-3)\n",
+ "assert value(m.fs.F101.vap_outlet.temperature[0]) == pytest.approx(301.881, abs=1e-3)\n",
"assert value(m.fs.F102.vap_outlet.temperature[0]) == pytest.approx(362.935, abs=1e-3)\n",
"assert value(m.fs.F102.vap_outlet.pressure[0]) == pytest.approx(105000, abs=1e-2)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "763.5072359720118\n"
+ ]
+ },
+ {
+ "ename": "AssertionError",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
+ "\u001b[31mAssertionError\u001b[39m Traceback (most recent call last)",
+ "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[82]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.H101.outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m500\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n\u001b[32m 2\u001b[39m \u001b[38;5;28mprint\u001b[39m(value(m.fs.R101.outlet.temperature[\u001b[32m0\u001b[39m]))\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.R101.outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m763.484\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n\u001b[32m 4\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.F101.vap_outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m301.881\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n\u001b[32m 5\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.F102.vap_outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m362.935\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n",
+ "\u001b[31mAssertionError\u001b[39m: "
+ ]
+ }
+ ],
+ "execution_count": 82
}
],
"metadata": {
@@ -1610,7 +3425,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.12"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet.py b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet.py
new file mode 100644
index 00000000..57eac3e4
--- /dev/null
+++ b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet.py
@@ -0,0 +1,579 @@
+from pyomo.environ import (
+ Constraint,
+ Var,
+ ConcreteModel,
+ Expression,
+ Objective,
+ TransformationFactory,
+ value,
+)
+from pyomo.network import Arc, SequentialDecomposition
+
+from idaes.core import FlowsheetBlock
+
+from idaes.models.unit_models import (
+ PressureChanger,
+ Mixer,
+ Separator as Splitter,
+ Heater,
+ StoichiometricReactor,
+ Feed,
+ Product,
+)
+
+from idaes.core.util.exceptions import InitializationError
+import idaes.logger as idaeslog
+
+# Todo: import flash model from idaes.models.unit_models
+
+# Todo: import flash model from idaes.models.unit_models
+from idaes.models.unit_models import Flash
+
+from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption
+from idaes.core.util.model_statistics import degrees_of_freedom
+
+from idaes.core.solvers import get_solver
+
+from idaes.models.properties.modular_properties.base.generic_property import (
+ GenericParameterBlock,
+)
+from idaes.models.properties.modular_properties.base.generic_reaction import (
+ GenericReactionParameterBlock,
+)
+from idaes_examples.mod.hda.hda_ideal_VLE_modular import thermo_config
+from idaes_examples.mod.hda.hda_reaction_modular import reaction_config
+
+m = ConcreteModel()
+m.fs = FlowsheetBlock(dynamic=False)
+
+m.fs.thermo_params = GenericParameterBlock(**thermo_config)
+m.fs.reaction_params = GenericReactionParameterBlock(
+ property_package=m.fs.thermo_params, **reaction_config
+)
+
+m.fs.I101 = Feed(property_package=m.fs.thermo_params)
+m.fs.I102 = Feed(property_package=m.fs.thermo_params)
+
+m.fs.M101 = Mixer(
+ property_package=m.fs.thermo_params,
+ num_inlets=3,
+)
+
+m.fs.H101 = Heater(
+ property_package=m.fs.thermo_params,
+ has_pressure_change=False,
+ has_phase_equilibrium=True,
+)
+
+m.fs.R101 = StoichiometricReactor(
+ property_package=m.fs.thermo_params,
+ reaction_package=m.fs.reaction_params,
+ has_heat_of_reaction=True,
+ has_heat_transfer=True,
+ has_pressure_change=False,
+)
+
+m.fs.F101 = Flash(
+ property_package=m.fs.thermo_params,
+ has_heat_transfer=True,
+ has_pressure_change=True,
+)
+
+m.fs.S101 = Splitter(
+ property_package=m.fs.thermo_params,
+ ideal_separation=False,
+ outlet_list=["purge", "recycle"],
+)
+
+m.fs.C101 = PressureChanger(
+ property_package=m.fs.thermo_params,
+ compressor=True,
+ thermodynamic_assumption=ThermodynamicAssumption.isothermal,
+)
+
+m.fs.F102 = Flash(
+ property_package=m.fs.thermo_params,
+ has_heat_transfer=True,
+ has_pressure_change=True,
+)
+
+m.fs.P101 = Product(property_package=m.fs.thermo_params)
+m.fs.P102 = Product(property_package=m.fs.thermo_params)
+m.fs.P103 = Product(property_package=m.fs.thermo_params)
+
+m.fs.s01 = Arc(source=m.fs.I101.outlet, destination=m.fs.M101.inlet_1)
+m.fs.s02 = Arc(source=m.fs.I102.outlet, destination=m.fs.M101.inlet_2)
+m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)
+m.fs.s04 = Arc(source=m.fs.H101.outlet, destination=m.fs.R101.inlet)
+m.fs.s05 = Arc(source=m.fs.R101.outlet, destination=m.fs.F101.inlet)
+m.fs.s06 = Arc(source=m.fs.F101.vap_outlet, destination=m.fs.S101.inlet)
+m.fs.s07 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)
+m.fs.s08 = Arc(source=m.fs.S101.recycle, destination=m.fs.C101.inlet)
+m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.inlet_3)
+m.fs.s10 = Arc(source=m.fs.F102.vap_outlet, destination=m.fs.P101.inlet)
+m.fs.s11 = Arc(source=m.fs.F102.liq_outlet, destination=m.fs.P102.inlet)
+m.fs.s12 = Arc(source=m.fs.S101.purge, destination=m.fs.P103.inlet)
+
+TransformationFactory("network.expand_arcs").apply_to(m)
+
+m.fs.purity = Expression(
+ expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[
+ "Vap", "benzene"
+ ]
+ / (
+ m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp["Vap", "benzene"]
+ + m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[
+ "Vap", "toluene"
+ ]
+ )
+)
+
+m.fs.cooling_cost = Expression(
+ expr=0.212e-7 * (-m.fs.F101.heat_duty[0]) + 0.212e-7 * (-m.fs.R101.heat_duty[0])
+)
+
+m.fs.heating_cost = Expression(
+ expr=2.2e-7 * m.fs.H101.heat_duty[0] + 1.9e-7 * m.fs.F102.heat_duty[0]
+)
+
+m.fs.operating_cost = Expression(
+ expr=(3600 * 24 * 365 * (m.fs.heating_cost + m.fs.cooling_cost))
+)
+
+assert degrees_of_freedom(m) == 29
+
+F_liq_toluene = 0.30
+F_liq_non_zero = 1e-5
+
+F_vap_I101 = F_liq_non_zero * 4
+F_liq_I101 = F_liq_toluene + F_liq_non_zero
+
+m.fs.I101.flow_mol_phase[0, "Vap"].fix(F_vap_I101)
+m.fs.I101.flow_mol_phase[0, "Liq"].fix(F_liq_I101)
+m.fs.I101.mole_frac_phase_comp[0, "Vap", "benzene"].fix(F_liq_non_zero / F_vap_I101)
+m.fs.I101.mole_frac_phase_comp[0, "Vap", "toluene"].fix(F_liq_non_zero / F_vap_I101)
+m.fs.I101.mole_frac_phase_comp[0, "Vap", "hydrogen"].fix(F_liq_non_zero / F_vap_I101)
+m.fs.I101.mole_frac_phase_comp[0, "Vap", "methane"].fix(F_liq_non_zero / F_vap_I101)
+m.fs.I101.mole_frac_phase_comp[0, "Liq", "benzene"].fix(F_liq_non_zero / F_liq_I101)
+m.fs.I101.mole_frac_phase_comp[0, "Liq", "toluene"].fix(F_liq_toluene / F_liq_I101)
+m.fs.I101.temperature.fix(303.2)
+m.fs.I101.pressure.fix(350000)
+
+F_vap_hydrogen = 0.30
+F_vap_methane = 0.020
+
+F_vap_non_zero = 1e-5
+F_liq_non_zero = F_vap_non_zero
+
+F_vap_I102 = F_vap_hydrogen + F_vap_methane + 2 * F_vap_non_zero
+F_liq_I102 = 2 * F_vap_non_zero
+
+m.fs.I102.flow_mol_phase[0, "Vap"].fix(F_vap_I102)
+m.fs.I102.flow_mol_phase[0, "Liq"].fix(F_liq_I102)
+m.fs.I102.mole_frac_phase_comp[0, "Vap", "benzene"].fix(F_vap_non_zero / F_vap_I102)
+m.fs.I102.mole_frac_phase_comp[0, "Vap", "toluene"].fix(F_vap_non_zero / F_vap_I102)
+m.fs.I102.mole_frac_phase_comp[0, "Vap", "hydrogen"].fix(F_vap_hydrogen / F_vap_I102)
+m.fs.I102.mole_frac_phase_comp[0, "Vap", "methane"].fix(F_vap_methane / F_vap_I102)
+m.fs.I102.mole_frac_phase_comp[0, "Liq", "benzene"].fix(F_liq_non_zero / F_liq_I102)
+m.fs.I102.mole_frac_phase_comp[0, "Liq", "toluene"].fix(F_liq_non_zero / F_liq_I102)
+
+m.fs.I102.temperature.fix(303.2)
+m.fs.I102.pressure.fix(350000)
+
+m.fs.H101.outlet.temperature.fix(600)
+
+m.fs.R101.conversion = Var(initialize=0.75, bounds=(0, 1))
+
+m.fs.R101.conv_constraint = Constraint(
+ expr=m.fs.R101.conversion
+ * (m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp["Vap", "toluene"])
+ == (
+ m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp["Vap", "toluene"]
+ - m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[
+ "Vap", "toluene"
+ ]
+ )
+)
+
+m.fs.R101.conversion.fix(0.75)
+m.fs.R101.heat_duty.fix(0)
+
+m.fs.F101.vap_outlet.temperature.fix(325.0)
+m.fs.F101.deltaP.fix(0)
+
+m.fs.F102.vap_outlet.temperature.fix(375)
+m.fs.F102.deltaP.fix(-200000)
+
+m.fs.S101.split_fraction[0, "purge"].fix(0.2)
+m.fs.C101.outlet.pressure.fix(350000)
+
+seq = SequentialDecomposition()
+seq.options.select_tear_method = "heuristic"
+seq.options.tear_method = "Wegstein"
+seq.options.iterLim = 3
+
+# Using the SD tool
+G = seq.create_graph(m)
+heuristic_tear_set = seq.tear_set_arcs(G, method="heuristic")
+order = seq.calculation_order(G)
+
+for o in heuristic_tear_set:
+ print(o.name)
+
+for o in order:
+ print(o[0].name)
+
+tear_guesses = {
+ "flow_mol_phase": {
+ (0, "Liq"): F_liq_I101,
+ (0, "Vap"): F_vap_I102,
+ },
+ "mole_frac_phase_comp": {
+ (0, "Liq", "benzene"): 1e-5 / F_liq_I101,
+ (0, "Liq", "toluene"): 0.30 / F_liq_I101,
+ (0, "Vap", "benzene"): 1e-5 / F_vap_I102,
+ (0, "Vap", "toluene"): 1e-5 / F_vap_I102,
+ (0, "Vap", "methane"): 0.02 / F_vap_I102,
+ (0, "Vap", "hydrogen"): 0.30 / F_vap_I102,
+ },
+ "temperature": {0: 303},
+ "pressure": {0: 350000},
+}
+
+# Pass the tear_guess to the SD tool
+seq.set_guesses_for(m.fs.H101.inlet, tear_guesses)
+
+
+def function(unit):
+ try:
+ initializer = unit.default_initializer()
+ initializer.initialize(unit, output_level=idaeslog.INFO)
+ except InitializationError:
+ solver = get_solver()
+ solver.solve(unit)
+
+
+seq.run(m, function)
+
+# from idaes.core.util.initialization import propagate_state
+#
+# print(f"The DOF is {degrees_of_freedom(m)} initially")
+# m.fs.s03_expanded.deactivate()
+# print(f"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream")
+#
+# tear_guesses = {
+# "flow_mol_phase": {
+# (0, "Liq"): F_liq_I101,
+# (0, "Vap"): F_vap_I102,
+#
+# },
+# "mole_frac_phase_comp": {
+# (0, "Liq", "benzene"): 1e-5 / F_liq_I101,
+# (0, "Liq", "toluene"): 0.30 / F_liq_I101,
+# (0, "Vap", "benzene"): 1e-5 / F_vap_I102,
+# (0, "Vap", "toluene"): 1e-5 / F_vap_I102,
+# (0, "Vap", "methane"): 0.02 / F_vap_I102,
+# (0, "Vap", "hydrogen"): 0.30 / F_vap_I102,
+# },
+# "temperature": {0: 303},
+# "pressure": {0: 350000},
+# }
+#
+# for k, v in tear_guesses.items():
+# for k1, v1 in v.items():
+# getattr(m.fs.s03.destination, k)[k1].fix(v1)
+#
+# DOF_initial = degrees_of_freedom(m)
+#
+# print(f"The DOF is {degrees_of_freedom(m)} after setting the tear stream")
+#
+# m.fs.H101.default_initializer().initialize(m.fs.H101)
+# propagate_state(m.fs.s04) # Establish connection between Heater and Reactor
+# m.fs.R101.default_initializer().initialize(m.fs.R101) # Initialize Reactor
+# propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit
+# m.fs.F101.default_initializer().initialize(m.fs.F101) # Initialize First Flash Unit
+# propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter
+# propagate_state(m.fs.s07)
+# m.fs.S101.default_initializer().initialize(m.fs.S101) # Initialize Splitter
+# propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor
+# m.fs.C101.default_initializer().initialize(m.fs.C101) # Initialize Compressor
+# propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer
+# m.fs.I101.default_initializer().initialize(m.fs.I101) # Initialize Toluene Inlet
+# propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer
+# m.fs.I102.default_initializer().initialize(m.fs.I102) # Initialize Hydrogen Inlet
+# propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer
+# m.fs.M101.default_initializer().initialize(m.fs.M101) # Initialize Mixer
+# propagate_state(m.fs.s03) # Establish connection between Mixer and Heater
+# m.fs.F102.default_initializer().initialize(m.fs.F102) # Initialize Second Flash Unit
+# propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product
+# propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product
+# propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product
+
+optarg = {
+ "nlp_scaling_method": "user-scaling",
+ "OF_ma57_automatic_scaling": "yes",
+ "max_iter": 300,
+ "tol": 1e-8,
+}
+solver = get_solver("ipopt_v2", options=optarg)
+results = solver.solve(m, tee=True)
+
+for k, v in tear_guesses.items():
+ for k1, v1 in v.items():
+ getattr(m.fs.H101.inlet, k)[k1].unfix()
+
+m.fs.s03_expanded.activate()
+print(
+ f"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream"
+)
+# %% md
+# ## 6 Solving the Model
+# %% md
+# We have now initialized the flowsheet. Lets set up some solving options before simulating the flowsheet. We want to specify the scaling method, number of iterations, and tolerance. More specific or advanced options can be found at the documentation for IPOPT https://coin-or.github.io/Ipopt/OPTIONS.html
+# %%
+optarg = {
+ "nlp_scaling_method": "user-scaling",
+ "OF_ma57_automatic_scaling": "yes",
+ "max_iter": 1000,
+ "tol": 1e-8,
+}
+# %% md
+#
+# Inline Exercise:
+# Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:
+#
+# solver = get_solver(solver_options=optarg)
+# results = solver.solve(m, tee=True)
+#
+# Use Shift+Enter to run the cell once you have typed in your code.
+#
+#
+# %%
+# Create the solver object
+
+# Solve the model
+# %%
+# Create the solver object
+solver = get_solver("ipopt_v2", options=optarg)
+
+# Solve the model
+results = solver.solve(m, tee=False)
+
+print(f"Solver result: {results}")
+# %%
+# Check solver solve status
+from pyomo.environ import TerminationCondition
+
+assert results.solver.termination_condition == TerminationCondition.optimal
+# %% md
+# ## 7 Analyze the results
+#
+#
+#
+# %% md
+# If the IDAES UI package was installed with the `idaes-pse` installation or installed separately, you can run the flowsheet visualizer to see a full diagram of the full process that is generated and displayed on a browser window.
+#
+# %%
+# m.fs.visualize("HDA-Flowsheet")
+# %% md
+# Otherwise, we can run the `m.fs.report()` method to see a full summary of the solved flowsheet. It is recommended to adjust the width of the output as much as possible for the cleanest display.
+# %%
+m.fs.report()
+# %% md
+# What is the total operating cost?
+# %%
+print("operating cost = $", value(m.fs.operating_cost))
+# %%
+import pytest
+
+# assert value(m.fs.operating_cost) == pytest.approx(424513.9645, abs=1e-3)
+# %% md
+# For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? We can look at a specific unit models stream table with the same `report()` method.
+# %%
+m.fs.F102.report()
+
+print()
+print("benzene purity = ", value(m.fs.purity))
+# %%
+assert value(m.fs.purity) == pytest.approx(0.82429, abs=1e-3)
+assert value(m.fs.F102.heat_duty[0]) == pytest.approx(7346.03097, abs=1e-3)
+assert value(m.fs.F102.vap_outlet.pressure[0]) == pytest.approx(1.5000e05, abs=1e-3)
+# %% md
+# Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101.
+# %%
+from idaes.core.util.tables import (
+ create_stream_table_dataframe,
+ stream_table_dataframe_to_string,
+)
+
+st = create_stream_table_dataframe({"Reactor": m.fs.s05, "Light Gases": m.fs.s06})
+print(stream_table_dataframe_to_string(st))
+# %% md
+# ## 8 Optimization
+#
+#
+# We saw from the results above that the total operating cost for the base case was $419,122 per year. We are producing 0.142 mol/s of benzene at a purity of 82\%. However, we are losing around 42\% of benzene in F101 vapor outlet stream.
+#
+# Let us try to minimize this cost such that:
+# - we are producing at least 0.15 mol/s of benzene in F102 vapor outlet i.e. our product stream
+# - purity of benzene i.e. the mole fraction of benzene in F102 vapor outlet is at least 80%
+# - restricting the benzene loss in F101 vapor outlet to less than 20%
+#
+# For this problem, our decision variables are as follows:
+# - H101 outlet temperature
+# - R101 cooling duty provided
+# - F101 outlet temperature
+# - F102 outlet temperature
+# - F102 deltaP in the flash tank
+#
+# %% md
+# Let us declare our objective function for this problem.
+# %%
+m.fs.objective = Objective(expr=m.fs.operating_cost)
+# %% md
+# Now, we need to unfix the decision variables as we had solved a square problem (degrees of freedom = 0) until now.
+# %%
+m.fs.H101.outlet.temperature.unfix()
+m.fs.R101.heat_duty.unfix()
+m.fs.F101.vap_outlet.temperature.unfix()
+m.fs.F102.vap_outlet.temperature.unfix()
+# %% md
+#
+# Inline Exercise:
+# Let us now unfix the remaining variable which is F102 pressure drop (F102.deltaP)
+#
+# Use Shift+Enter to run the cell once you have typed in your code.
+#
+#
+#
+# %%
+# Todo: Unfix deltaP for F102
+# %%
+# Todo: Unfix deltaP for F102
+m.fs.F102.deltaP.unfix()
+# %%
+assert degrees_of_freedom(m) == 5
+# %% md
+# Next, we need to set bounds on these decision variables to values shown below:
+#
+# - H101 outlet temperature [500, 600] K
+# - R101 outlet temperature [600, 800] K
+# - F101 outlet temperature [298, 450] K
+# - F102 outlet temperature [298, 450] K
+# - F102 outlet pressure [105000, 110000] Pa
+#
+# Let us first set the variable bound for the H101 outlet temperature as shown below:
+# %%
+m.fs.H101.outlet.temperature[0].setlb(500)
+m.fs.H101.outlet.temperature[0].setub(600)
+# %% md
+#
+# Inline Exercise:
+# Now, set the variable bound for the R101 outlet temperature.
+#
+# Use Shift+Enter to run the cell once you have typed in your code.
+#
+# %%
+# Todo: Set the bounds for reactor outlet temperature
+# %%
+# Todo: Set the bounds for reactor outlet temperature
+m.fs.R101.outlet.temperature[0].setlb(600)
+m.fs.R101.outlet.temperature[0].setub(800)
+# %% md
+# Let us fix the bounds for the rest of the decision variables.
+# %%
+m.fs.F101.vap_outlet.temperature[0].setlb(298.0)
+m.fs.F101.vap_outlet.temperature[0].setub(450.0)
+m.fs.F102.vap_outlet.temperature[0].setlb(298.0)
+m.fs.F102.vap_outlet.temperature[0].setub(450.0)
+m.fs.F102.vap_outlet.pressure[0].setlb(105000)
+m.fs.F102.vap_outlet.pressure[0].setub(110000)
+# %% md
+# Now, the only things left to define are our constraints on overhead loss in F101, product flow rate and purity in F102. Let us first look at defining a constraint for the overhead loss in F101 where we are restricting the benzene leaving the vapor stream to less than 20 \% of the benzene available in the reactor outlet.
+# %%
+m.fs.overhead_loss = Constraint(
+ expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[
+ "Vap", "benzene"
+ ]
+ <= 0.20
+ * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp["Vap", "benzene"]
+)
+# %% md
+#
+# Inline Exercise:
+# Now, add the constraint such that we are producing at least 0.15 mol/s of benzene in the product stream which is the vapor outlet of F102. Let us name this constraint as m.fs.product_flow.
+#
+# Use Shift+Enter to run the cell once you have typed in your code.
+#
+# %%
+# Todo: Add minimum product flow constraint
+# %%
+# Todo: Add minimum product flow constraint
+m.fs.product_flow = Constraint(
+ expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[
+ "Vap", "benzene"
+ ]
+ >= 0.15
+)
+# %% md
+# Let us add the final constraint on product purity or the mole fraction of benzene in the product stream such that it is at least greater than 80%.
+# %%
+m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)
+# %% md
+#
+# We have now defined the optimization problem and we are now ready to solve this problem.
+#
+#
+#
+# %%
+results = solver.solve(m, tee=True)
+# %%
+# Check for solver solve status
+from pyomo.environ import TerminationCondition
+
+assert results.solver.termination_condition == TerminationCondition.optimal
+# %% md
+# ### 8.1 Optimization Results
+#
+# Display the results and product specifications
+# %%
+print("operating cost = $", value(m.fs.operating_cost))
+
+print()
+print("Product flow rate and purity in F102")
+
+m.fs.F102.report()
+
+print()
+print("benzene purity = ", value(m.fs.purity))
+
+print()
+print("Overhead loss in F101")
+m.fs.F101.report()
+# %%
+
+assert value(m.fs.operating_cost) == pytest.approx(318024.909, abs=1e-3)
+assert value(m.fs.purity) == pytest.approx(0.818827, abs=1e-3)
+# %% md
+# Display optimal values for the decision variables
+# %%
+print(
+ f"""Optimal Values:
+
+H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K
+
+R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K
+
+F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K
+
+F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K
+F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa
+"""
+)
+# %%
+assert value(m.fs.H101.outlet.temperature[0]) == pytest.approx(500, abs=1e-3)
+# assert value(m.fs.R101.outlet.temperature[0]) == pytest.approx(696.112, abs=1e-3)
+assert value(m.fs.R101.outlet.temperature[0]) == pytest.approx(763.484, abs=1e-3)
+assert value(m.fs.F101.vap_outlet.temperature[0]) == pytest.approx(301.881, abs=1e-3)
+assert value(m.fs.F102.vap_outlet.temperature[0]) == pytest.approx(362.935, abs=1e-3)
+assert value(m.fs.F102.vap_outlet.pressure[0]) == pytest.approx(105000, abs=1e-2)
diff --git a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_doc.ipynb b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_doc.ipynb
index 2d862e0d..22c9fbaa 100644
--- a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_doc.ipynb
+++ b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_doc.ipynb
@@ -2,8 +2,12 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 1,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:04.904828Z",
+ "start_time": "2025-11-20T21:46:04.900352Z"
+ },
"tags": [
"header",
"hide-cell"
@@ -13,7 +17,7 @@
"source": [
"###############################################################################\n",
"# The Institute for the Design of Advanced Energy Systems Integrated Platform\n",
- "# Framework (IDAES IP) was produced under the DOE Institute for the\n",
+ "# Framework (idaes IP) was produced under the DOE Institute for the\n",
"# Design of Advanced Energy Systems (IDAES).\n",
"#\n",
"# Copyright (c) 2018-2023 by the software owners: The Regents of the\n",
@@ -32,20 +36,34 @@
"\n",
"# HDA Flowsheet Simulation and Optimization\n",
"\n",
- "Author: Jaffer Ghouse \n",
- "Maintainer: Brandon Paul \n",
- "Updated: 2023-06-01 \n",
+ "Author: Jaffer Ghouse
\n",
+ "Maintainer: Tanner Polley
\n",
+ "Updated: 2025-11-19\n",
"\n",
"## Learning outcomes\n",
"\n",
"\n",
"- Construct a steady-state flowsheet using the IDAES unit model library\n",
- "- Connecting unit models in a flowsheet using Arcs\n",
+ "- Connecting unit models in a flowsheet using Arcs\n",
"- Using the SequentialDecomposition tool to initialize a flowsheet with recycle\n",
- "- Fomulate and solve an optimization problem\n",
+ "- Formulate and solve an optimization problem\n",
" - Defining an objective function\n",
" - Setting variable bounds\n",
- " - Adding additional constraints \n",
+ " - Adding additional constraints\n",
+ "\n",
+ "\n",
+ "The general workflow of setting up an IDAES flowsheet is the following:\n",
+ "\n",
+ " 1 Importing Modules
\n",
+ " 2 Building a Model
\n",
+ " 3 Scaling the Model
\n",
+ " 4 Specifying the Model
\n",
+ " 5 Initializing the Model
\n",
+ " 6 Solving the Model
\n",
+ " 7 Analyzing and Visualizing the Results
\n",
+ " 8 Optimizing the Model
\n",
+ "\n",
+ "We will complete each of these steps as well as demonstrate analyses on this model through some examples and exercises.\n",
"\n",
"\n",
"## Problem Statement\n",
@@ -81,10 +99,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required pyomo and idaes components\n",
+ "## 1 Importing Modules\n",
+ "### 1.1 Importing required Pyomo and IDAES components\n",
"\n",
"\n",
- "To construct a flowsheet, we will need several components from the pyomo and idaes package. Let us first import the following components from Pyomo:\n",
+ "To construct a flowsheet, we will need several components from the Pyomo and IDAES package. Let us first import the following components from Pyomo:\n",
"- Constraint (to write constraints)\n",
"- Var (to declare variables)\n",
"- ConcreteModel (to create the concrete model object)\n",
@@ -95,13 +114,18 @@
"- Arc (to connect two unit models)\n",
"- SequentialDecomposition (to initialize the flowsheet in a sequential mode)\n",
"\n",
- "For further details on these components, please refer to the pyomo documentation: https://pyomo.readthedocs.io/en/stable/\n"
+ "For further details on these components, please refer to the Pyomo documentation: https://Pyomo.readthedocs.io/en/stable/\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 2,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:05.294578Z",
+ "start_time": "2025-11-20T21:46:04.908296Z"
+ }
+ },
"outputs": [],
"source": [
"from pyomo.environ import (\n",
@@ -110,7 +134,6 @@
" ConcreteModel,\n",
" Expression,\n",
" Objective,\n",
- " SolverFactory,\n",
" TransformationFactory,\n",
" value,\n",
")\n",
@@ -121,19 +144,26 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "From idaes, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "From IDAES, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "- Feed\n",
"- Mixer\n",
"- Heater\n",
"- StoichiometricReactor\n",
"-
**Flash**\n",
"- Separator (splitter) \n",
- "- PressureChanger"
+ "- PressureChanger\n",
+ "- Product"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 3,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:06.806301Z",
+ "start_time": "2025-11-20T21:46:05.297760Z"
+ }
+ },
"outputs": [],
"source": [
"from idaes.core import FlowsheetBlock"
@@ -141,8 +171,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 4,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.936732Z",
+ "start_time": "2025-11-20T21:46:09.883054Z"
+ }
+ },
"outputs": [],
"source": [
"from idaes.models.unit_models import (\n",
@@ -151,7 +186,11 @@
" Separator as Splitter,\n",
" Heater,\n",
" StoichiometricReactor,\n",
- ")"
+ " Feed,\n",
+ " Product,\n",
+ ")\n",
+ "from idaes.core.util.exceptions import InitializationError\n",
+ "import idaes.logger as idaeslog"
]
},
{
@@ -166,8 +205,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 5,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.963041Z",
+ "start_time": "2025-11-20T21:46:09.957319Z"
+ },
"tags": [
"solution"
]
@@ -187,24 +230,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 6,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.976914Z",
+ "start_time": "2025-11-20T21:46:09.971944Z"
+ }
+ },
"outputs": [],
"source": [
"from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n",
"from idaes.core.util.model_statistics import degrees_of_freedom\n",
"\n",
"# Import idaes logger to set output levels\n",
- "import idaes.logger as idaeslog\n",
- "from idaes.core.solvers import get_solver\n",
- "from idaes.core.util.exceptions import InitializationError"
+ "from idaes.core.solvers import get_solver"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required thermo and reaction package\n",
+ "### 1.2 Importing required thermo and reaction package\n",
"\n",
"The final set of imports are to import the thermo and reaction package for the HDA process. We have created a custom thermo package that assumes Ideal Gas with support for VLE. \n",
"\n",
@@ -220,27 +266,43 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 7,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.017098Z",
+ "start_time": "2025-11-20T21:46:09.981997Z"
+ }
+ },
"outputs": [],
"source": [
- "from idaes_examples.mod.hda import hda_ideal_VLE as thermo_props\n",
- "from idaes_examples.mod.hda import hda_reaction as reaction_props"
+ "from idaes.models.properties.modular_properties.base.generic_property import (\n",
+ " GenericParameterBlock,\n",
+ ")\n",
+ "from idaes.models.properties.modular_properties.base.generic_reaction import (\n",
+ " GenericReactionParameterBlock,\n",
+ ")\n",
+ "from idaes_examples.mod.hda.hda_ideal_VLE_modular import thermo_config\n",
+ "from idaes_examples.mod.hda.hda_reaction_modular import reaction_config"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Constructing the Flowsheet\n",
+ "## 2 Constructing the Flowsheet\n",
"\n",
- "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block as we did in module 1. "
+ "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 8,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.031538Z",
+ "start_time": "2025-11-20T21:46:10.025904Z"
+ }
+ },
"outputs": [],
"source": [
"m = ConcreteModel()\n",
@@ -256,13 +318,18 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 9,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.066746Z",
+ "start_time": "2025-11-20T21:46:10.035131Z"
+ }
+ },
"outputs": [],
"source": [
- "m.fs.thermo_params = thermo_props.HDAParameterBlock()\n",
- "m.fs.reaction_params = reaction_props.HDAReactionParameterBlock(\n",
- " property_package=m.fs.thermo_params\n",
+ "m.fs.thermo_params = GenericParameterBlock(**thermo_config)\n",
+ "m.fs.reaction_params = GenericReactionParameterBlock(\n",
+ " property_package=m.fs.thermo_params, **reaction_config\n",
")"
]
},
@@ -270,20 +337,29 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding Unit Models\n",
+ "### 2.1 Adding Unit Models\n",
"\n",
- "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Mixer (assigned a name M101) and a Heater (assigned a name H101). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the Mixer unit model here is given a `list` consisting of names to the three inlets. "
+ "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Feed (assigned a name `I101` for Inlet), `Mixer` (assigned a name `M101`) and a `Heater` (assigned a name `H101`). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the `Mixer` unit model here must be specified the number of inlets that it will take in and the `Heater` can have specific settings enabled such as `has_pressure_change` or `has_phase_equilibrium`."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 10,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.114600Z",
+ "start_time": "2025-11-20T21:46:10.071845Z"
+ }
+ },
"outputs": [],
"source": [
+ "m.fs.I101 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.I102 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
"m.fs.M101 = Mixer(\n",
" property_package=m.fs.thermo_params,\n",
- " inlet_list=[\"toluene_feed\", \"hydrogen_feed\", \"vapor_recycle\"],\n",
+ " num_inlets=3,\n",
")\n",
"\n",
"m.fs.H101 = Heater(\n",
@@ -293,27 +369,14 @@
")"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "
\n",
- "
Inline Exercise:\n",
- "Let us now add the StoichiometricReactor(assign the name R101) and pass the following arguments:\n",
- "
\n",
- " - \"property_package\": m.fs.thermo_params
\n",
- " - \"reaction_package\": m.fs.reaction_params
\n",
- " - \"has_heat_of_reaction\": True
\n",
- " - \"has_heat_transfer\": True
\n",
- " - \"has_pressure_change\": False
\n",
- "
\n",
- "
"
- ]
- },
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 11,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.145853Z",
+ "start_time": "2025-11-20T21:46:10.127921Z"
+ },
"tags": [
"solution"
]
@@ -344,8 +407,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 12,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.167357Z",
+ "start_time": "2025-11-20T21:46:10.149935Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.F101 = Flash(\n",
@@ -359,13 +427,18 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us now add the Splitter(S101), PressureChanger(C101) and the second Flash(F102). "
+ "Let us now add the Splitter(S101) with specific names for its output (purge and recycle), PressureChanger(C101) and the second Flash(F102)."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 13,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.211911Z",
+ "start_time": "2025-11-20T21:46:10.173255Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.S101 = Splitter(\n",
@@ -392,38 +465,67 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Connecting Unit Models using Arcs\n",
- "\n",
- "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the mixer(M101) to the inlet of the heater(H101). "
+ "Last, we will add the three Product blocks (P101, P102, P103). We use `Feed` blocks and `Product` blocks for convenience with reporting stream summaries and consistency"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 14,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.226989Z",
+ "start_time": "2025-11-20T21:46:10.216839Z"
+ }
+ },
"outputs": [],
"source": [
- "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ "m.fs.P101 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P102 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P103 = Product(property_package=m.fs.thermo_params)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
+ "### 2.2 Connecting Unit Models using Arcs\n",
"\n",
- " \n",
- "\n",
- "
\n",
- "Inline Exercise:\n",
- "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide. \n",
- "
\n",
- "\n"
+ "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a Pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the inlets (I101, I102) to the inlet of the mixer (M101) and outlet of the mixer to the inlet of the heater(H101)."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.235541Z",
+ "start_time": "2025-11-20T21:46:10.231058Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "m.fs.s01 = Arc(source=m.fs.I101.outlet, destination=m.fs.M101.inlet_1)\n",
+ "m.fs.s02 = Arc(source=m.fs.I102.outlet, destination=m.fs.M101.inlet_2)\n",
+ "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 16,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.254153Z",
+ "start_time": "2025-11-20T21:46:10.248481Z"
+ },
"tags": [
"solution"
]
@@ -443,28 +545,61 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 17,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.264461Z",
+ "start_time": "2025-11-20T21:46:10.258555Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.s05 = Arc(source=m.fs.R101.outlet, destination=m.fs.F101.inlet)\n",
"m.fs.s06 = Arc(source=m.fs.F101.vap_outlet, destination=m.fs.S101.inlet)\n",
+ "m.fs.s07 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)\n",
"m.fs.s08 = Arc(source=m.fs.S101.recycle, destination=m.fs.C101.inlet)\n",
- "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.vapor_recycle)\n",
- "m.fs.s10 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)"
+ "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.inlet_3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "We have now connected the unit model block using the arcs. However, each of these arcs link to ports on the two unit models that are connected. In this case, the ports consist of the state variables that need to be linked between the unit models. Pyomo provides a convenient method to write these equality constraints for us between two ports and this is done as follows:"
+ "Last we will connect the outlet streams to the inlets of the Product blocks (P101, P102, P103)"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 18,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.274505Z",
+ "start_time": "2025-11-20T21:46:10.268918Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "m.fs.s10 = Arc(source=m.fs.F102.vap_outlet, destination=m.fs.P101.inlet)\n",
+ "m.fs.s11 = Arc(source=m.fs.F102.liq_outlet, destination=m.fs.P102.inlet)\n",
+ "m.fs.s12 = Arc(source=m.fs.S101.purge, destination=m.fs.P103.inlet)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "We have now connected the unit model block using the arcs. However, each of these arcs link to ports on the two unit models that are connected. In this case, the ports consist of the state variables that need to be linked between the unit models. Pyomo provides a convenient method to write these equality constraints for us between two ports and this is done as follows:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.303264Z",
+ "start_time": "2025-11-20T21:46:10.278714Z"
+ }
+ },
"outputs": [],
"source": [
"TransformationFactory(\"network.expand_arcs\").apply_to(m)"
@@ -474,9 +609,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding expressions to compute purity and operating costs\n",
+ "### 2.3 Adding expressions to compute purity and operating costs\n",
"\n",
- "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/pyomo_modeling_components/Expressions.html\n",
+ "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/explanation/modeling/network.html.\n",
"\n",
"For this flowsheet, we are interested in computing the purity of the product Benzene stream (i.e. the mole fraction) and the operating cost which is a sum of the cooling and heating cost. "
]
@@ -490,15 +625,24 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 20,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.312336Z",
+ "start_time": "2025-11-20T21:46:10.309074Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.purity = Expression(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
" / (\n",
- " m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " + m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
+ " + m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")"
]
@@ -512,8 +656,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 21,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.323538Z",
+ "start_time": "2025-11-20T21:46:10.318119Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.cooling_cost = Expression(\n",
@@ -536,8 +685,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 22,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.336983Z",
+ "start_time": "2025-11-20T21:46:10.328380Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.heating_cost = Expression(\n",
@@ -554,8 +708,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 23,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.345607Z",
+ "start_time": "2025-11-20T21:46:10.341996Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.operating_cost = Expression(\n",
@@ -567,16 +726,30 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing feed conditions\n",
+ "## 4 Specifying the Model\n",
+ "### 4.1 Fixing feed conditions\n",
"\n",
"Let us first check how many degrees of freedom exist for this flowsheet using the `degrees_of_freedom` tool we imported earlier. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 24,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.376586Z",
+ "start_time": "2025-11-20T21:46:10.349694Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "29\n"
+ ]
+ }
+ ],
"source": [
"print(degrees_of_freedom(m))"
]
@@ -585,25 +758,36 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "We will now be fixing the toluene feed stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing. "
+ "We will now be fixing the toluene feed (`I101`) stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 25,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.418520Z",
+ "start_time": "2025-11-20T21:46:10.414167Z"
+ }
+ },
"outputs": [],
"source": [
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(0.30)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.temperature.fix(303.2)\n",
- "m.fs.M101.toluene_feed.pressure.fix(350000)"
+ "F_liq_toluene = 0.30\n",
+ "F_liq_non_zero = 1e-5\n",
+ "\n",
+ "F_vap_I101 = F_liq_non_zero * 4\n",
+ "F_liq_I101 = F_liq_toluene + F_liq_non_zero\n",
+ "\n",
+ "m.fs.I101.flow_mol_phase[0, \"Vap\"].fix(F_vap_I101)\n",
+ "m.fs.I101.flow_mol_phase[0, \"Liq\"].fix(F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_toluene / F_liq_I101)\n",
+ "m.fs.I101.temperature.fix(303.2)\n",
+ "m.fs.I101.pressure.fix(350000)"
]
},
{
@@ -611,7 +795,7 @@
"metadata": {},
"source": [
"\n",
- "Similarly, let us fix the hydrogen feed to the following conditions in the next cell:\n",
+ "Similarly, let us fix the hydrogen feed (`I102`) to the following conditions in the next cell:\n",
"
\n",
" - FH2 = 0.30 mol/s
\n",
" - FCH4 = 0.02 mol/s
\n",
@@ -624,35 +808,55 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 26,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.429169Z",
+ "start_time": "2025-11-20T21:46:10.422052Z"
+ }
+ },
"outputs": [],
"source": [
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(0.30)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(0.02)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.temperature.fix(303.2)\n",
- "m.fs.M101.hydrogen_feed.pressure.fix(350000)"
+ "F_vap_hydrogen = 0.30\n",
+ "F_vap_methane = 0.020\n",
+ "\n",
+ "F_vap_non_zero = 1e-5\n",
+ "F_liq_non_zero = F_vap_non_zero\n",
+ "\n",
+ "F_vap_I102 = F_vap_hydrogen + F_vap_methane + 2 * F_vap_non_zero\n",
+ "F_liq_I102 = 2 * F_vap_non_zero\n",
+ "\n",
+ "m.fs.I102.flow_mol_phase[0, \"Vap\"].fix(F_vap_I102)\n",
+ "m.fs.I102.flow_mol_phase[0, \"Liq\"].fix(F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_vap_hydrogen / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_vap_methane / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "\n",
+ "m.fs.I102.temperature.fix(303.2)\n",
+ "m.fs.I102.pressure.fix(350000)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing unit model specifications\n",
+ "### 4.2 Fixing unit model specifications\n",
"\n",
"Now that we have fixed our inlet feed conditions, we will now be fixing the operating conditions for the unit models in the flowsheet. Let us set set the H101 outlet temperature to 600 K. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 27,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.441145Z",
+ "start_time": "2025-11-20T21:46:10.433569Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.H101.outlet.temperature.fix(600)"
@@ -667,17 +871,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 28,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.453419Z",
+ "start_time": "2025-11-20T21:46:10.445363Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.R101.conversion = Var(initialize=0.75, bounds=(0, 1))\n",
"\n",
"m.fs.R101.conv_constraint = Constraint(\n",
- " expr=m.fs.R101.conversion * m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " expr=m.fs.R101.conversion\n",
+ " * (m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"])\n",
" == (\n",
- " m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
- " - m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"]\n",
+ " - m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")\n",
"\n",
@@ -694,34 +906,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 29,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.463025Z",
+ "start_time": "2025-11-20T21:46:10.457476Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.F101.vap_outlet.temperature.fix(325.0)\n",
"m.fs.F101.deltaP.fix(0)"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "
Inline Exercise:\n",
- "Set the conditions for Flash F102 to the following conditions:\n",
- "
\n",
- " - T = 375 K
\n",
- " - deltaP = -200000
\n",
- "
\n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
- },
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 30,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.482109Z",
+ "start_time": "2025-11-20T21:46:10.475567Z"
+ },
"tags": [
"solution"
]
@@ -741,35 +946,40 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 31,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.491620Z",
+ "start_time": "2025-11-20T21:46:10.485173Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.S101.split_fraction[0, \"purge\"].fix(0.2)\n",
"m.fs.C101.outlet.pressure.fix(350000)"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "We have now defined all the feed conditions and the inputs required for the unit models. The system should now have 0 degrees of freedom i.e. should be a square problem. Please check that the degrees of freedom is 0. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
- },
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 32,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.535421Z",
+ "start_time": "2025-11-20T21:46:10.507798Z"
+ },
"tags": [
"solution"
]
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
"source": [
"print(degrees_of_freedom(m))"
]
@@ -778,25 +988,40 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Initialization\n",
+ "## 5 Initializing the Model\n",
+ "\n",
+ "\n",
+ "\n",
+ "When a flowsheet contains a recycle loop, the outlet of a downstream unit becomes the inlet of an upstream unit, creating a cyclic dependency that prevents straightforward calculation of all stream conditions. The tear‐stream method is necessary because it “breaks” this loop: you select one recycle stream as the tear, assign it an initial guess, and then solve the rest of the flowsheet as if it were acyclic. Once the downstream units compute their outputs, you compare the calculated value of the torn stream to your initial guess and iteratively adjust until they coincide. Without tearing, the solver cannot establish a proper topological sequence or drive the recycle to convergence, making initialization—and ultimately steady‐state convergence—impossible.\n",
"\n",
+ "It is important to determine the tear stream for a flowsheet which will be demonstrated below.\n",
"\n",
- "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet.\n",
"\n",
- " \n"
+ "\n",
+ "\n",
+ "Currently, there are two methods of initializing a full flowsheet: using the sequential decomposition tool, or manually propagating through the flowsheet. Both methods will be shown.\n",
+ "\n",
+ "### 5.1 Sequential Decomposition\n",
+ "\n",
+ "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet. Sequential Decomposition is a tool from Pyomo where the documentation can be found here https://Pyomo.readthedocs.io/en/stable/explanation/modeling/network.html#sequential-decomposition\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us first create an object for the SequentialDecomposition and specify our options for this. "
+ "Let us first create an object for the SequentialDecomposition and specify our options for this. We can also create a graph for our flowsheet to determine the tear set and order."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 33,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.578789Z",
+ "start_time": "2025-11-20T21:46:10.574025Z"
+ }
+ },
"outputs": [],
"source": [
"seq = SequentialDecomposition()\n",
@@ -819,9 +1044,22 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 34,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.588985Z",
+ "start_time": "2025-11-20T21:46:10.581810Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.s03\n"
+ ]
+ }
+ ],
"source": [
"for o in heuristic_tear_set:\n",
" print(o.name)"
@@ -836,11 +1074,28 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 35,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.602315Z",
+ "start_time": "2025-11-20T21:46:10.599259Z"
+ },
"scrolled": true
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.I101\n",
+ "fs.R101\n",
+ "fs.F101\n",
+ "fs.S101\n",
+ "fs.C101\n",
+ "fs.M101\n"
+ ]
+ }
+ ],
"source": [
"for o in order:\n",
" print(o[0].name)"
@@ -855,25 +1110,32 @@
" \n",
"\n",
"\n",
- "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. We will need to provide a reasonable guess for this."
+ "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. You can see this shown in the picture of the flowsheet above as the outlet of the mixer as the two lines crossing it identifying it as the tear stream. We will need to provide a reasonable guess for this."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 36,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.620357Z",
+ "start_time": "2025-11-20T21:46:10.617116Z"
+ }
+ },
"outputs": [],
"source": [
"tear_guesses = {\n",
- " \"flow_mol_phase_comp\": {\n",
- " (0, \"Vap\", \"benzene\"): 1e-5,\n",
- " (0, \"Vap\", \"toluene\"): 1e-5,\n",
- " (0, \"Vap\", \"hydrogen\"): 0.30,\n",
- " (0, \"Vap\", \"methane\"): 0.02,\n",
- " (0, \"Liq\", \"benzene\"): 1e-5,\n",
- " (0, \"Liq\", \"toluene\"): 0.30,\n",
- " (0, \"Liq\", \"hydrogen\"): 1e-5,\n",
- " (0, \"Liq\", \"methane\"): 1e-5,\n",
+ " \"flow_mol_phase\": {\n",
+ " (0, \"Liq\"): F_liq_I101,\n",
+ " (0, \"Vap\"): F_vap_I102,\n",
+ " },\n",
+ " \"mole_frac_phase_comp\": {\n",
+ " (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ " (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ " (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ " (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
" },\n",
" \"temperature\": {0: 303},\n",
" \"pressure\": {0: 350000},\n",
@@ -892,8 +1154,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 37,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.638254Z",
+ "start_time": "2025-11-20T21:46:10.635136Z"
+ }
+ },
"outputs": [],
"source": [
"def function(unit):\n",
@@ -914,42 +1181,2615 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 38,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.022425Z",
+ "start_time": "2025-11-20T21:46:10.648251Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "WARNING: Loading a SolverResults object with a warning status into\n",
+ "model.name=\"fs.R101\";\n",
+ " - termination condition: infeasible\n",
+ " - message from solver: Ipopt 3.13.2\\x3a Converged to a locally infeasible\n",
+ " point. Problem may be infeasible.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:40 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:41 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "WARNING: Loading a SolverResults object with a warning status into\n",
+ "model.name=\"fs.R101\";\n",
+ " - termination condition: infeasible\n",
+ " - message from solver: Ipopt 3.13.2\\x3a Converged to a locally infeasible\n",
+ " point. Problem may be infeasible.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:42 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-25 12:36:43 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n"
+ ]
+ }
+ ],
+ "source": [
+ "seq.run(m, function)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "### 5.2 Manual Propagation Method\n",
+ "\n",
+ "This method uses a more direct approach to initialize the flowsheet, utilizing the updated initializer method and propagating manually through the flowsheet and solving for the tear stream directly.\n",
+ "Lets first import a helper function that will help us manually propagate and step through the flowsheet"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.069766Z",
+ "start_time": "2025-11-20T21:46:17.066725Z"
+ }
+ },
"outputs": [],
"source": [
- "seq.run(m, function)"
+ "from idaes.core.util.initialization import propagate_state"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- "Inline Exercise:\n",
- "We have now initialized the flowsheet. Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
- " \n",
- "results = solver.solve(m, tee=True)\n",
+ "Now we can setup our initial guesses for the tear stream which we know is the outlet of the `Mixer` or the inlet of the `Heater`. We can use the same initial guesses used in the first method. We also want to ensure that the degrees of freedom are consistent while we manually initialize the model.\n",
"\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
+ "We will first ensure that are current degrees of freedom is still zero"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 40,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.080343Z",
+ "start_time": "2025-11-20T21:46:17.077382Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "# print(f\"The DOF is {degrees_of_freedom(m)} initially\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can manually deactivate the tear stream, creating a separation between the `Mixer` and `Heater`. This should reduce the degrees of freedom by 10 since the inlet of the `Heater` now contains no values to solve the unit model. To deactivate a stream, simply use `m.fs.s03_expanded.deactivate()`. This expanded stream is just a different version of the `Arc` stream that is able to be deactivated."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 41,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.093180Z",
+ "start_time": "2025-11-20T21:46:17.089671Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "# m.fs.s03_expanded.deactivate()\n",
+ "#\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can provide the `Heater` inlet 10 guess values to bring the degrees of freedom back to 0 and start the manual initialization process. We can run this convenient loop to assign each of these guesses to the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.105510Z",
+ "start_time": "2025-11-20T21:46:17.099824Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "# tear_guesses = {\n",
+ "# \"flow_mol_phase\": {\n",
+ "# (0, \"Liq\"): F_liq_I101,\n",
+ "# (0, \"Vap\"): F_vap_I102,\n",
+ "#\n",
+ "# },\n",
+ "# \"mole_frac_phase_comp\": {\n",
+ "# (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ "# (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ "# (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
+ "# },\n",
+ "# \"temperature\": {0: 303},\n",
+ "# \"pressure\": {0: 350000},\n",
+ "# }\n",
+ "#\n",
+ "# for k, v in tear_guesses.items():\n",
+ "# for k1, v1 in v.items():\n",
+ "# getattr(m.fs.s03.destination, k)[k1].fix(v1)\n",
+ "#\n",
+ "# DOF_initial = degrees_of_freedom(m)\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after providing the initial guesses\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The next step is to manually initialize each unit model starting from the `Heater` and then propagate the connection between it and the next unit model. This manual process ensures a strict order to the user's specification if that is desired. The current standard for initializing a unit model is to use an initializer object most compatible for that unit model. This can most often be done by utilizing the `default_initializer()` method attached to the unit model and then to call the `initialize()` method with the unit model as the argument."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.117110Z",
+ "start_time": "2025-11-20T21:46:17.113630Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "# m.fs.H101.default_initializer().initialize(m.fs.H101) # Initialize Heater\n",
+ "# propagate_state(m.fs.s04) # Establish connection between Heater and Reactor\n",
+ "#\n",
+ "# m.fs.R101.default_initializer().initialize(m.fs.R101) # Initialize Reactor\n",
+ "# propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit\n",
+ "#\n",
+ "# m.fs.F101.default_initializer().initialize(m.fs.F101) # Initialize First Flash Unit\n",
+ "# propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter\n",
+ "# propagate_state(m.fs.s07) # Establish connection between First Flash Unit and Second Flash Unit\n",
+ "#\n",
+ "# m.fs.S101.default_initializer().initialize(m.fs.S101) # Initialize Splitter\n",
+ "# propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor\n",
+ "#\n",
+ "# m.fs.C101.default_initializer().initialize(m.fs.C101) # Initialize Compressor\n",
+ "# propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer\n",
+ "#\n",
+ "# m.fs.I101.default_initializer().initialize(m.fs.I101) # Initialize Toluene Inlet\n",
+ "# propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.I102.default_initializer().initialize(m.fs.I102) # Initialize Hydrogen Inlet\n",
+ "# propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.M101.default_initializer().initialize(m.fs.M101) # Initialize Mixer\n",
+ "# propagate_state(m.fs.s03) # Establish connection between Mixer and Heater\n",
+ "#\n",
+ "# m.fs.F102.default_initializer().initialize(m.fs.F102) # Initialize Second Flash Unit\n",
+ "# propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product\n",
+ "# propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product\n",
+ "# propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we solve the system to allow the outlet of the mixer to reach a converged congruence with the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.226222Z",
+ "start_time": "2025-11-20T21:46:17.129942Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=300\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpoctkmbii\\unknown.14248.22376.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpoctkmbii\\unknown.14248.22376.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 155\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 3.74e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1r 0.0000000e+00 3.74e+03 9.99e+02 3.6 0.00e+00 - 0.00e+00 3.17e-07R 3\n",
+ " 2r 0.0000000e+00 6.21e+04 1.21e+03 3.6 3.74e+06 - 3.68e-03 3.56e-04f 1\n",
+ " 3r 0.0000000e+00 5.77e+04 1.09e+05 3.6 5.16e+05 - 9.43e-02 4.63e-03f 1\n",
+ " 4r 0.0000000e+00 5.24e+04 6.21e+04 3.6 3.34e+03 - 2.55e-01 9.98e-02f 1\n",
+ " 5r 0.0000000e+00 6.56e+04 1.25e+05 3.6 1.51e+02 - 6.91e-01 4.02e-01f 1\n",
+ " 6r 0.0000000e+00 4.50e+04 2.67e+04 3.6 3.07e+01 - 1.00e+00 7.13e-01f 1\n",
+ " 7r 0.0000000e+00 1.83e+04 7.35e+03 3.6 3.08e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 8r 0.0000000e+00 3.31e+04 4.68e+03 2.9 3.73e+01 - 7.83e-01 8.25e-01f 1\n",
+ " 9r 0.0000000e+00 1.06e+04 6.58e+02 2.9 2.24e+01 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10r 0.0000000e+00 6.29e+03 4.93e+02 2.9 2.70e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 11r 0.0000000e+00 5.23e+04 5.25e+02 2.2 2.33e+01 - 9.63e-01 9.78e-01f 1\n",
+ " 12r 0.0000000e+00 7.01e+03 1.04e+02 2.2 2.10e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 13r 0.0000000e+00 8.17e+02 1.95e+01 2.2 5.26e+00 - 1.00e+00 1.00e+00f 1\n",
+ " 14r 0.0000000e+00 5.65e+03 7.52e+02 1.5 1.79e+01 - 8.36e-01 9.57e-01f 1\n",
+ " 15r 0.0000000e+00 1.39e+04 5.80e+02 1.5 7.56e+01 - 7.87e-01 5.50e-01f 1\n",
+ " 16r 0.0000000e+00 1.86e+04 4.51e+02 1.5 1.21e+01 - 6.10e-01 1.00e+00f 1\n",
+ " 17r 0.0000000e+00 1.25e+04 2.51e+02 1.5 1.27e+01 - 7.28e-01 1.00e+00f 1\n",
+ " 18r 0.0000000e+00 8.69e+02 4.46e+01 1.5 9.42e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 19r 0.0000000e+00 2.75e+02 1.30e+00 1.5 2.78e+00 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20r 0.0000000e+00 3.71e+03 2.13e+02 0.8 1.88e+01 - 9.33e-01 9.68e-01f 1\n",
+ " 21r 0.0000000e+00 9.91e+01 1.22e+02 0.8 1.24e-01 2.0 1.00e+00 1.00e+00f 1\n",
+ " 22r 0.0000000e+00 2.87e+01 1.01e+03 0.8 4.55e-01 1.5 3.90e-01 9.98e-01H 1\n",
+ " 23r 0.0000000e+00 4.95e+02 1.46e+02 0.8 4.53e-01 1.0 1.00e+00 9.27e-01f 1\n",
+ " 24r 0.0000000e+00 4.75e+02 3.38e+02 0.8 4.95e-01 1.5 6.73e-01 8.53e-01f 1\n",
+ " 25r 0.0000000e+00 2.04e+02 7.82e+01 0.8 7.99e-02 2.8 1.00e+00 1.00e+00f 1\n",
+ " 26r 0.0000000e+00 2.86e+02 1.37e+02 0.8 9.62e-01 2.3 2.38e-01 2.31e-01f 1\n",
+ " 27r 0.0000000e+00 2.57e+02 7.76e+02 0.8 7.36e-01 1.8 4.15e-01 7.40e-02f 1\n",
+ " 28r 0.0000000e+00 2.55e+02 7.67e+02 0.8 3.59e+02 - 2.06e-02 8.24e-03f 2\n",
+ " 29r 0.0000000e+00 3.58e+02 5.95e+01 0.8 1.21e-01 1.4 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 30r 0.0000000e+00 8.66e+02 2.43e+02 0.8 6.93e+01 - 9.31e-01 4.48e-01f 2\n",
+ " 31r 0.0000000e+00 7.82e+02 2.67e+02 0.8 5.52e+00 0.9 8.90e-02 9.64e-02h 1\n",
+ " 32r 0.0000000e+00 6.93e+02 1.87e+02 0.8 2.84e+01 - 5.79e-02 1.48e-01h 1\n",
+ " 33r 0.0000000e+00 5.58e+02 1.23e+02 0.8 2.39e+01 - 2.97e-01 3.32e-01f 1\n",
+ " 34r 0.0000000e+00 4.53e+02 2.25e+02 0.8 1.58e+01 - 1.41e-01 2.10e-01f 1\n",
+ " 35r 0.0000000e+00 4.31e+02 1.86e+02 0.8 1.74e+01 - 2.72e-02 5.15e-02h 1\n",
+ " 36r 0.0000000e+00 4.28e+02 3.00e+02 0.8 4.39e+01 - 1.73e-03 5.76e-03h 1\n",
+ " 37r 0.0000000e+00 4.28e+02 2.99e+02 0.8 1.11e+03 - 2.19e-05 2.25e-04h 1\n",
+ " 38r 0.0000000e+00 4.28e+02 6.92e+02 0.8 2.39e+02 1.3 2.42e-03 1.96e-04f 1\n",
+ " 39r 0.0000000e+00 4.12e+02 1.12e+04 0.8 1.90e+01 - 7.18e-01 3.76e-02f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 40r 0.0000000e+00 1.29e+02 2.87e+02 0.8 1.04e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 41r 0.0000000e+00 4.97e+01 7.12e+02 0.8 5.85e+00 - 5.86e-01 6.18e-01h 1\n",
+ " 42r 0.0000000e+00 1.60e+00 1.99e+02 0.8 7.12e-01 0.8 1.00e+00 1.00e+00f 1\n",
+ " 43r 0.0000000e+00 2.18e+01 1.63e+02 0.1 6.04e+01 0.4 1.22e-02 7.09e-03f 1\n",
+ " 44r 0.0000000e+00 7.21e+03 1.05e+03 0.1 1.64e+02 - 1.83e-01 7.12e-01f 1\n",
+ " 45r 0.0000000e+00 6.31e+03 7.50e+02 0.1 5.95e+01 - 1.09e-01 1.68e-01f 1\n",
+ " 46r 0.0000000e+00 6.22e+03 1.41e+03 0.1 9.02e+01 - 8.19e-04 1.38e-02f 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 47r 0.0000000e+00 6.22e+03 1.41e+03 0.1 1.27e+02 0.8 1.98e-03 9.14e-04h 1\n",
+ " 48r 0.0000000e+00 6.21e+03 1.57e+03 0.1 2.55e+02 0.3 1.66e-05 7.85e-04h 1\n",
+ " 49r 0.0000000e+00 6.18e+03 1.56e+03 0.1 2.15e+01 0.7 2.64e-03 4.99e-03h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 50r 0.0000000e+00 6.18e+03 1.60e+03 0.1 1.55e+02 0.3 2.53e-05 2.61e-04h 1\n",
+ " 51r 0.0000000e+00 6.18e+03 1.67e+03 0.1 7.60e+01 1.6 1.06e-02 3.63e-04h 1\n",
+ " 52r 0.0000000e+00 5.80e+03 1.65e+03 0.1 2.59e+01 - 3.10e-02 6.80e-02f 1\n",
+ " 53r 0.0000000e+00 5.29e+03 1.04e+03 0.1 3.13e+01 - 8.78e-01 6.14e-01f 1\n",
+ " 54r 0.0000000e+00 2.06e+03 3.00e+02 0.1 3.76e+01 - 7.50e-01 1.00e+00h 1\n",
+ " 55r 0.0000000e+00 5.02e+01 1.17e+02 0.1 1.26e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 56r 0.0000000e+00 4.11e+01 1.08e+02 0.1 4.23e+00 - 2.42e-01 1.84e-01h 1\n",
+ " 57r 0.0000000e+00 2.12e+01 5.27e+01 0.1 1.15e+00 - 7.37e-01 8.32e-01h 1\n",
+ " 58r 0.0000000e+00 4.74e+01 3.85e+01 0.1 1.60e+00 - 9.93e-01 1.00e+00f 1\n",
+ " 59r 0.0000000e+00 1.17e+01 3.25e+01 0.1 1.40e+00 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 60r 0.0000000e+00 1.21e+03 4.46e+01 -0.6 5.97e+01 - 7.60e-01 6.94e-01f 1\n",
+ " 61r 0.0000000e+00 1.54e+03 4.60e+00 -0.6 9.23e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 62r 0.0000000e+00 1.21e+01 9.28e+00 -0.6 4.59e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 63r 0.0000000e+00 1.83e+00 9.35e-02 -0.6 2.84e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 64r 0.0000000e+00 1.11e+03 6.94e+01 -1.3 7.51e+01 - 9.02e-01 9.81e-01f 1\n",
+ " 65r 0.0000000e+00 7.93e+00 9.52e-01 -1.3 2.38e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 66r 0.0000000e+00 1.78e+00 1.07e-01 -1.3 8.10e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 67r 0.0000000e+00 2.18e-01 1.01e-05 -1.3 3.94e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 68r 0.0000000e+00 1.15e+03 4.78e+01 -4.5 7.86e+01 - 7.94e-01 8.05e-01f 1\n",
+ " 69r 0.0000000e+00 5.20e+02 1.43e+02 -4.5 2.20e+01 - 9.21e-01 5.55e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 70r 0.0000000e+00 2.62e+02 4.30e+02 -4.5 1.21e-02 1.1 9.09e-01 4.96e-01h 1\n",
+ " 71r 0.0000000e+00 6.29e+01 1.51e+02 -4.5 1.25e-02 0.6 9.00e-01 7.60e-01h 1\n",
+ " 72r 0.0000000e+00 9.72e+00 5.07e+01 -4.5 5.71e-02 0.2 9.11e-01 8.46e-01h 1\n",
+ " 73r 0.0000000e+00 2.40e-01 8.98e-01 -4.5 1.58e-01 -0.3 1.00e+00 9.91e-01h 1\n",
+ " 74r 0.0000000e+00 3.60e-01 1.74e+02 -4.5 3.96e+03 - 6.95e-03 2.59e-03f 1\n",
+ " 75r 0.0000000e+00 8.17e-01 3.02e+02 -4.5 9.81e+00 - 7.96e-02 1.55e-02h 1\n",
+ " 76r 0.0000000e+00 2.96e+02 1.34e+03 -4.5 3.56e+00 - 9.74e-02 3.29e-01h 1\n",
+ " 77r 0.0000000e+00 2.24e+02 1.38e+03 -4.5 2.48e-02 -0.8 1.00e+00 2.45e-01h 1\n",
+ " 78r 0.0000000e+00 1.29e+03 6.57e+02 -4.5 1.82e+00 - 6.97e-01 1.00e+00h 1\n",
+ " 79r 0.0000000e+00 2.01e+02 1.01e+02 -4.5 2.12e+00 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 80r 0.0000000e+00 4.78e+00 7.47e-01 -4.5 3.32e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 81r 0.0000000e+00 2.94e+00 2.75e-02 -4.5 2.59e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 82r 0.0000000e+00 2.79e-01 2.57e-03 -4.5 2.99e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 83r 0.0000000e+00 2.79e-01 4.06e-04 -4.5 4.57e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 84r 0.0000000e+00 2.79e-01 1.25e-07 -4.5 8.34e-05 - 1.00e+00 1.00e+00h 1\n",
+ " 85r 0.0000000e+00 5.26e+01 1.09e+01 -6.8 7.12e-01 - 9.31e-01 8.92e-01f 1\n",
+ " 86r 0.0000000e+00 2.95e+01 4.47e+02 -6.8 1.59e-01 - 7.12e-01 4.40e-01h 1\n",
+ " 87r 0.0000000e+00 7.70e+00 1.01e+02 -6.8 9.53e-02 - 8.78e-01 7.65e-01h 1\n",
+ " 88r 0.0000000e+00 3.45e+00 1.42e+02 -6.8 9.16e-02 - 1.00e+00 7.55e-01h 1\n",
+ " 89r 0.0000000e+00 9.20e-01 4.87e+01 -6.8 1.08e-01 - 8.60e-01 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 90r 0.0000000e+00 8.31e-01 1.80e-01 -6.8 1.38e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 91r 0.0000000e+00 2.83e-01 1.84e-01 -6.8 7.34e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 92r 0.0000000e+00 2.83e-01 4.21e+02 -6.8 9.27e-01 - 1.19e-01 4.48e-03h 6\n",
+ " 93r 0.0000000e+00 2.83e-01 1.51e+02 -6.8 9.89e-06 -1.3 1.00e+00 1.03e-01h 1\n",
+ " 94r 0.0000000e+00 2.83e-01 3.45e+02 -6.8 1.02e+00 - 1.44e-01 2.36e-02h 3\n",
+ " 95r 0.0000000e+00 2.83e-01 2.09e+01 -6.8 6.98e-03 -1.7 3.75e-02 2.48e-02h 2\n",
+ " 96r 0.0000000e+00 2.83e-01 7.23e+00 -6.8 5.65e-04 -2.2 9.81e-01 1.00e+00h 1\n",
+ " 97r 0.0000000e+00 1.20e+01 2.06e+02 -6.8 1.57e+00 - 1.00e+00 3.33e-01h 2\n",
+ " 98r 0.0000000e+00 1.19e+01 2.37e+01 -6.8 1.56e-02 - 1.00e+00 5.65e-03h 8\n",
+ " 99r 0.0000000e+00 1.18e+01 2.23e+01 -6.8 1.79e-02 - 1.00e+00 7.81e-03h 8\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 100r 0.0000000e+00 1.18e+01 2.16e+01 -6.8 1.76e-02 - 1.00e+00 1.95e-03h 10\n",
+ " 101r 0.0000000e+00 1.18e+01 2.14e+01 -6.8 1.76e-02 - 1.00e+00 9.77e-04h 11\n",
+ " 102r 0.0000000e+00 1.18e+01 2.13e+01 -6.8 1.76e-02 - 1.00e+00 4.88e-04h 12\n",
+ " 103r 0.0000000e+00 2.90e-01 3.50e-04 -6.8 1.76e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 104r 0.0000000e+00 7.03e+00 2.14e+02 -6.8 4.02e-01 - 5.84e-01 1.00e+00h 1\n",
+ " 105r 0.0000000e+00 2.96e-01 5.54e+01 -6.8 7.32e-02 - 2.26e-01 1.00e+00h 1\n",
+ " 106r 0.0000000e+00 2.96e-01 8.03e-05 -6.8 1.47e-04 -2.7 1.00e+00 1.00e+00h 1\n",
+ " 107r 0.0000000e+00 2.95e-01 4.46e+01 -6.8 1.04e-01 - 1.00e+00 5.00e-01h 2\n",
+ " 108r 0.0000000e+00 2.95e-01 1.34e-02 -6.8 1.91e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 109r 0.0000000e+00 2.94e-01 1.41e-03 -6.8 3.97e-02 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 110r 0.0000000e+00 2.94e-01 9.14e-04 -6.8 2.67e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 111r 0.0000000e+00 2.94e-01 4.70e-05 -6.8 1.04e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 112r 0.0000000e+00 2.94e-01 1.32e-07 -6.8 7.16e-04 - 1.00e+00 1.00e+00h 1\n",
+ " 113r 0.0000000e+00 2.94e-01 1.82e-12 -6.8 2.28e-06 - 1.00e+00 1.00e+00h 1\n",
+ " 114r 0.0000000e+00 9.46e-01 5.08e+00 -9.0 2.12e-01 - 6.64e-01 6.35e-01h 1\n",
+ " 115r 0.0000000e+00 1.29e+01 9.86e+00 -9.0 5.14e-01 - 7.92e-01 7.53e-01h 1\n",
+ " 116r 0.0000000e+00 6.76e+00 1.53e+02 -9.0 2.57e-01 - 8.31e-01 6.76e-01h 1\n",
+ " 117r 0.0000000e+00 8.96e+00 2.11e+00 -9.0 1.62e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 118r 0.0000000e+00 8.94e-01 8.15e-01 -9.0 8.76e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 119r 0.0000000e+00 5.50e-01 2.30e-02 -9.0 1.13e-01 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 120r 0.0000000e+00 2.99e-01 1.49e-04 -9.0 1.27e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 121r 0.0000000e+00 2.98e-01 2.05e-05 -9.0 1.10e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 122r 0.0000000e+00 2.98e-01 2.86e-08 -9.0 5.44e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 122\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 4.6276843335396955e-07 4.6276843335396955e-07\n",
+ "Constraint violation....: 2.9835465732216782e-01 2.9835465732216782e-01\n",
+ "Complementarity.........: 9.0909090909100423e-10 9.0909090909100423e-10\n",
+ "Overall NLP error.......: 2.9835465732216782e-01 2.9835465732216782e-01\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 193\n",
+ "Number of objective gradient evaluations = 3\n",
+ "Number of equality constraint evaluations = 193\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 125\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 123\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.161\n",
+ "Total CPU secs in NLP function evaluations = 0.016\n",
+ "\n",
+ "EXIT: Converged to a point of local infeasibility. Problem may be infeasible.\n"
+ ]
+ }
+ ],
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 300,\n",
+ " \"tol\": 1e-8,\n",
+ "}\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
+ "results = solver.solve(m, tee=True)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now that the flowsheet is initialized, we can unfix the guesses for the `Heater` and reactive the tear stream to complete the final solve."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.258332Z",
+ "start_time": "2025-11-20T21:46:17.233298Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The DOF is 0 after unfixing the values and reactivating the tear stream\n"
+ ]
+ }
+ ],
+ "source": [
+ "for k, v in tear_guesses.items():\n",
+ " for k1, v1 in v.items():\n",
+ " getattr(m.fs.H101.inlet, k)[k1].unfix()\n",
+ "\n",
+ "m.fs.s03_expanded.activate()\n",
+ "print(\n",
+ " f\"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream\"\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6 Solving the Model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "We have now initialized the flowsheet. Lets set up some solving options before simulating the flowsheet. We want to specify the scaling method, number of iterations, and tolerance. More specific or advanced options can be found at the documentation for IPOPT https://coin-or.github.io/Ipopt/OPTIONS.html"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.268422Z",
+ "start_time": "2025-11-20T21:46:17.265316Z"
+ }
+ },
+ "outputs": [],
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 1000,\n",
+ " \"tol\": 1e-8,\n",
+ "}"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.382669Z",
+ "start_time": "2025-11-20T21:46:17.293013Z"
+ },
"tags": [
"solution"
]
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpg07cmjii\\unknown.14248.22376.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpg07cmjii\\unknown.14248.22376.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 155\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 3.74e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1r 0.0000000e+00 3.74e+03 9.99e+02 3.6 0.00e+00 - 0.00e+00 3.17e-07R 3\n",
+ " 2r 0.0000000e+00 6.21e+04 1.21e+03 3.6 3.74e+06 - 3.68e-03 3.56e-04f 1\n",
+ " 3r 0.0000000e+00 5.77e+04 1.01e+05 3.6 5.16e+05 - 8.85e-02 4.63e-03f 1\n",
+ " 4r 0.0000000e+00 5.27e+04 7.54e+04 3.6 3.55e+03 - 2.53e-01 9.39e-02f 1\n",
+ " 5r 0.0000000e+00 6.46e+04 1.25e+05 3.6 1.62e+02 - 6.86e-01 3.91e-01f 1\n",
+ " 6r 0.0000000e+00 4.60e+04 2.59e+04 3.6 3.07e+01 - 1.00e+00 7.29e-01f 1\n",
+ " 7r 0.0000000e+00 1.41e+04 8.03e+03 3.6 3.17e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 8r 0.0000000e+00 3.34e+04 6.37e+03 2.9 3.71e+01 - 7.68e-01 8.25e-01f 1\n",
+ " 9r 0.0000000e+00 1.19e+04 7.40e+02 2.9 2.24e+01 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10r 0.0000000e+00 6.30e+03 4.59e+02 2.9 2.35e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 11r 0.0000000e+00 5.23e+04 5.45e+02 2.2 2.33e+01 - 9.62e-01 9.77e-01f 1\n",
+ " 12r 0.0000000e+00 7.00e+03 1.04e+02 2.2 2.11e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 13r 0.0000000e+00 7.13e+02 1.92e+01 2.2 5.17e+00 - 1.00e+00 1.00e+00f 1\n",
+ " 14r 0.0000000e+00 5.67e+03 7.52e+02 1.5 1.80e+01 - 8.36e-01 9.57e-01f 1\n",
+ " 15r 0.0000000e+00 1.39e+04 5.79e+02 1.5 7.56e+01 - 7.87e-01 5.50e-01f 1\n",
+ " 16r 0.0000000e+00 1.86e+04 4.46e+02 1.5 1.21e+01 - 6.13e-01 1.00e+00f 1\n",
+ " 17r 0.0000000e+00 1.24e+04 2.49e+02 1.5 1.26e+01 - 7.29e-01 1.00e+00f 1\n",
+ " 18r 0.0000000e+00 8.65e+02 4.42e+01 1.5 9.39e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 19r 0.0000000e+00 2.73e+02 1.31e+00 1.5 2.73e+00 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20r 0.0000000e+00 3.72e+03 2.13e+02 0.8 1.88e+01 - 9.33e-01 9.68e-01f 1\n",
+ " 21r 0.0000000e+00 9.91e+01 1.22e+02 0.8 1.24e-01 2.0 1.00e+00 1.00e+00f 1\n",
+ " 22r 0.0000000e+00 2.89e+01 1.01e+03 0.8 4.57e-01 1.5 3.88e-01 9.92e-01H 1\n",
+ " 23r 0.0000000e+00 4.92e+02 1.65e+02 0.8 4.52e-01 1.0 1.00e+00 9.06e-01f 1\n",
+ " 24r 0.0000000e+00 4.89e+02 3.27e+02 0.8 4.93e-01 1.5 6.74e-01 8.51e-01f 1\n",
+ " 25r 0.0000000e+00 2.08e+02 7.82e+01 0.8 7.90e-02 2.8 1.00e+00 1.00e+00f 1\n",
+ " 26r 0.0000000e+00 2.93e+02 1.41e+02 0.8 9.61e-01 2.3 2.45e-01 2.35e-01f 1\n",
+ " 27r 0.0000000e+00 2.70e+02 7.26e+02 0.8 8.43e-01 1.8 3.36e-01 6.18e-02f 1\n",
+ " 28r 0.0000000e+00 2.69e+02 7.21e+02 0.8 5.66e+02 - 1.20e-02 4.81e-03f 2\n",
+ " 29r 0.0000000e+00 4.15e+02 6.03e+01 0.8 1.17e-01 1.4 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 30r 0.0000000e+00 8.56e+02 2.58e+02 0.8 7.00e+01 - 9.49e-01 4.42e-01f 2\n",
+ " 31r 0.0000000e+00 6.84e+02 2.86e+02 0.8 2.71e+00 0.9 1.79e-01 2.01e-01h 1\n",
+ " 32r 0.0000000e+00 5.92e+02 1.69e+02 0.8 2.88e+01 - 1.34e-01 3.24e-01f 1\n",
+ " 33r 0.0000000e+00 4.89e+02 1.45e+02 0.8 1.92e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 34r 0.0000000e+00 7.71e+00 5.04e+01 0.8 1.11e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 35r 0.0000000e+00 8.63e+03 3.42e+01 -0.6 2.52e+01 - 6.33e-01 6.26e-01f 1\n",
+ " 36r 0.0000000e+00 5.46e+03 5.26e+02 -0.6 1.02e+00 0.4 6.69e-01 3.70e-01f 1\n",
+ " 37r 0.0000000e+00 2.30e+03 1.84e+02 -0.6 6.65e-01 0.8 6.29e-01 5.80e-01f 1\n",
+ " 38r 0.0000000e+00 9.77e+02 7.18e+01 -0.6 1.85e+00 0.4 4.96e-01 6.05e-01f 1\n",
+ " 39r 0.0000000e+00 7.39e+02 5.97e+01 -0.6 2.45e+00 -0.1 4.52e-01 4.94e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 40r 0.0000000e+00 8.88e+02 1.40e+02 -0.6 7.33e+00 -0.6 6.79e-01 3.09e-01h 1\n",
+ " 41r 0.0000000e+00 1.61e+01 1.29e+01 -0.6 3.68e-01 0.7 1.00e+00 1.00e+00h 1\n",
+ " 42r 0.0000000e+00 6.47e+01 6.22e+00 -0.6 9.57e-01 0.3 1.00e+00 1.00e+00h 1\n",
+ " 43r 0.0000000e+00 5.42e+02 5.88e+00 -0.6 3.02e+00 -0.2 1.00e+00 1.00e+00h 1\n",
+ " 44r 0.0000000e+00 1.31e+03 5.88e+01 -0.6 9.54e+00 -0.7 5.38e-01 4.31e-01h 1\n",
+ " 45r 0.0000000e+00 1.41e+03 2.73e+02 -0.6 1.19e+02 - 1.87e-01 1.21e-01h 1\n",
+ " 46r 0.0000000e+00 1.08e+03 3.24e+02 -0.6 1.37e+02 - 6.36e-01 4.65e-01f 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 47r 0.0000000e+00 6.96e+02 2.77e+02 -0.6 8.41e+00 - 4.25e-01 3.72e-01h 1\n",
+ " 48r 0.0000000e+00 1.45e+02 1.84e+02 -0.6 8.64e+00 - 5.45e-01 7.92e-01h 1\n",
+ " 49r 0.0000000e+00 7.13e+01 3.91e+02 -0.6 2.50e+00 - 7.16e-01 5.13e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 50r 0.0000000e+00 4.36e+00 1.14e+02 -0.6 2.79e+00 - 1.00e+00 1.00e+00f 1\n",
+ " 51r 0.0000000e+00 6.03e-01 2.36e+01 -0.6 8.61e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 52r 0.0000000e+00 6.61e-01 4.55e+00 -0.6 2.56e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 53r 0.0000000e+00 1.10e+03 6.90e+01 -1.3 7.52e+01 - 9.02e-01 9.81e-01f 1\n",
+ " 54r 0.0000000e+00 8.00e+00 8.01e-01 -1.3 2.37e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 55r 0.0000000e+00 1.78e+00 1.07e-01 -1.3 8.16e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 56r 0.0000000e+00 2.18e-01 5.40e-06 -1.3 3.90e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 57r 0.0000000e+00 1.15e+03 4.77e+01 -4.5 7.87e+01 - 7.94e-01 8.05e-01f 1\n",
+ " 58r 0.0000000e+00 5.17e+02 1.43e+02 -4.5 2.20e+01 - 9.21e-01 5.56e-01h 1\n",
+ " 59r 0.0000000e+00 2.84e+02 5.22e+02 -4.5 1.42e-01 -1.2 9.08e-01 4.51e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 60r 0.0000000e+00 5.10e+01 1.24e+02 -4.5 2.35e-01 -1.6 9.14e-01 8.21e-01h 1\n",
+ " 61r 0.0000000e+00 5.05e+01 4.54e+02 -4.5 4.49e+02 - 1.00e+00 2.18e-02h 1\n",
+ " 62r 0.0000000e+00 1.39e+03 2.01e+02 -4.5 3.30e+00 - 1.00e+00 9.24e-01h 1\n",
+ " 63r 0.0000000e+00 2.91e+02 7.48e+01 -4.5 1.78e-01 - 1.00e+00 7.97e-01h 1\n",
+ " 64r 0.0000000e+00 4.07e+00 2.17e+01 -4.5 7.87e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 65r 0.0000000e+00 3.04e+00 2.05e+02 -4.5 5.95e-01 - 1.00e+00 2.50e-01h 3\n",
+ " 66r 0.0000000e+00 2.27e+00 1.18e+02 -4.5 5.27e-01 - 1.00e+00 2.50e-01h 3\n",
+ " 67r 0.0000000e+00 2.00e+00 6.21e+01 -4.5 3.35e-01 - 1.00e+00 5.00e-01h 2\n",
+ " 68r 0.0000000e+00 9.09e-01 8.92e-02 -4.5 1.44e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 69r 0.0000000e+00 2.78e-01 2.22e-02 -4.5 6.01e-02 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 70r 0.0000000e+00 2.78e-01 9.38e-05 -4.5 1.31e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 71r 0.0000000e+00 5.15e+01 1.10e+01 -6.8 7.08e-01 - 9.31e-01 8.92e-01h 1\n",
+ " 72r 0.0000000e+00 2.90e+01 4.50e+02 -6.8 1.50e-01 - 7.13e-01 4.39e-01h 1\n",
+ " 73r 0.0000000e+00 7.89e+00 1.01e+02 -6.8 8.85e-02 - 8.77e-01 7.65e-01h 1\n",
+ " 74r 0.0000000e+00 2.97e+00 1.42e+02 -6.8 9.08e-02 - 1.00e+00 7.58e-01h 1\n",
+ " 75r 0.0000000e+00 8.82e-01 4.89e+01 -6.8 1.11e-01 - 8.59e-01 1.00e+00h 1\n",
+ " 76r 0.0000000e+00 7.58e-01 1.53e-01 -6.8 1.32e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 77r 0.0000000e+00 2.82e-01 2.05e-01 -6.8 7.96e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 78r 0.0000000e+00 2.82e-01 6.98e+01 -6.8 5.00e-01 - 2.24e-01 2.59e-01H 1\n",
+ " 79r 0.0000000e+00 2.82e-01 2.94e+02 -6.8 1.59e-01 - 1.00e+00 1.67e-01f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 80r 0.0000000e+00 2.81e-01 1.89e+02 -6.8 4.85e-01 - 8.32e-02 9.31e-02f 2\n",
+ " 81r 0.0000000e+00 2.81e-01 5.14e+02 -6.8 7.87e-04 -2.1 4.98e-01 7.44e-01h 1\n",
+ " 82r 0.0000000e+00 2.81e-01 9.19e+02 -6.8 2.22e-04 -2.6 1.00e+00 2.63e-01h 1\n",
+ " 83r 0.0000000e+00 2.81e-01 1.65e-02 -6.8 9.95e-04 -3.1 1.00e+00 1.00e+00f 1\n",
+ " 84r 0.0000000e+00 7.23e+00 1.63e-01 -6.8 4.06e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 85r 0.0000000e+00 2.87e-01 2.33e-04 -6.8 9.28e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 86r 0.0000000e+00 2.87e-01 1.97e+00 -6.8 5.56e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 87r 0.0000000e+00 2.87e-01 2.46e+00 -6.8 5.00e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 88r 0.0000000e+00 2.87e-01 2.58e+00 -6.8 4.78e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 89r 0.0000000e+00 2.87e-01 2.62e+00 -6.8 4.70e-01 - 1.00e+00 1.22e-04h 14\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 90r 0.0000000e+00 2.87e-01 2.64e+00 -6.8 4.67e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 91r 0.0000000e+00 2.87e-01 2.64e+00 -6.8 4.66e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 92r 0.0000000e+00 2.87e-01 2.64e+00 -6.8 4.65e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 93r 0.0000000e+00 2.87e-01 2.64e+00 -6.8 4.65e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 94r 0.0000000e+00 2.87e-01 2.64e+00 -6.8 4.65e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 95r 0.0000000e+00 2.87e-01 2.64e+00 -6.8 4.65e-01 - 1.00e+00 1.22e-04h 14\n",
+ " 96r 0.0000000e+00 9.42e+00 1.88e-02 -6.8 4.65e-01 - 1.00e+00 1.00e+00w 1\n",
+ " 97r 0.0000000e+00 2.93e-01 1.19e-06 -6.8 8.82e-04 - 1.00e+00 1.00e+00w 1\n",
+ " 98r 0.0000000e+00 2.93e-01 5.78e-06 -6.8 2.07e-03 - 1.00e+00 1.00e+00w 1\n",
+ " 99r 0.0000000e+00 2.93e-01 2.04e-11 -6.8 4.54e-06 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 100r 0.0000000e+00 7.74e-01 4.78e+00 -9.0 2.09e-01 - 6.64e-01 6.37e-01h 1\n",
+ " 101r 0.0000000e+00 8.46e+00 3.40e+01 -9.0 3.17e-01 - 9.10e-01 7.63e-01h 1\n",
+ " 102r 0.0000000e+00 4.04e+00 2.19e+02 -9.0 2.21e-01 - 8.62e-01 6.33e-01h 1\n",
+ " 103r 0.0000000e+00 7.03e+00 1.45e+00 -9.0 1.41e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 104r 0.0000000e+00 7.21e-01 5.48e-01 -9.0 9.46e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 105r 0.0000000e+00 2.97e-01 1.72e-02 -9.0 7.60e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 106r 0.0000000e+00 2.97e-01 6.61e-05 -9.0 2.35e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 107r 0.0000000e+00 2.97e-01 1.83e-06 -9.0 1.21e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 108r 0.0000000e+00 2.97e-01 3.43e-08 -9.0 2.97e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 108\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 3.0151134107357916e-07 3.0151134107357916e-07\n",
+ "Constraint violation....: 2.9731578903766509e-01 2.9731578903766509e-01\n",
+ "Complementarity.........: 9.0909090909099699e-10 9.0909090909099699e-10\n",
+ "Overall NLP error.......: 2.9731578903766509e-01 2.9731578903766509e-01\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 271\n",
+ "Number of objective gradient evaluations = 3\n",
+ "Number of equality constraint evaluations = 271\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 111\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 109\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.155\n",
+ "Total CPU secs in NLP function evaluations = 0.015\n",
+ "\n",
+ "EXIT: Converged to a point of local infeasibility. Problem may be infeasible.\n"
+ ]
+ }
+ ],
"source": [
"# Create the solver object\n",
- "from idaes.core.solvers import get_solver\n",
- "\n",
- "solver = get_solver()\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
"\n",
"# Solve the model\n",
"results = solver.solve(m, tee=True)"
@@ -959,17 +3799,88 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Analyze the results of the square problem\n",
+ "## 7 Analyze the results\n",
"\n",
- "\n",
- "What is the total operating cost? "
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "If the IDAES UI package was installed with the `idaes-pse` installation or installed separately, you can run the flowsheet visualizer to see a full diagram of the full process that is generated and displayed on a browser window.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Otherwise, we can run the `m.fs.report()` method to see a full summary of the solved flowsheet. It is recommended to adjust the width of the output as much as possible for the cleanest display."
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 48,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.448969Z",
+ "start_time": "2025-11-20T21:46:17.421434Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Flowsheet : fs Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units s01 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 \n",
+ " Total Molar Flowrate Liq mole / second 0.30001 2.0000e-05 0.29609 4.7359e-12 0.22506 1.0000e-08 0.30007 8.0134e-09 8.0151e-09 1.0000e-08 0.30007 2.0077e-09\n",
+ " Total Molar Flowrate Vap mole / second 4.0000e-05 0.32002 0.32272 0.61696 0.075008 2.0137e-10 1.0000e-08 1.5056e-10 1.3399e-10 1.9913e-08 1.0000e-08 4.0429e-11\n",
+ " Total Mole Fraction ('Liq', 'benzene') dimensionless 3.3332e-05 0.50000 0.00012935 5.9851e-05 1.0000e-20 1.0000e-20 1.0000e-20 0.0016277 0.0017605 1.0000e-20 1.0000e-20 0.0038222\n",
+ " Total Mole Fraction ('Liq', 'toluene') dimensionless 0.99997 0.50000 0.99987 0.99994 1.0000 1.0000 1.0000 0.99837 0.99824 1.0000 1.0000 0.99618\n",
+ " Total Mole Fraction ('Vap', 'benzene') dimensionless 0.25000 3.1248e-05 5.2698e-06 6.4834e-05 1.0000e-20 1.0000e-20 1.0000e-20 0.00017956 0.00019422 1.0000e-20 1.0000e-20 0.00042167\n",
+ " Total Mole Fraction ('Vap', 'toluene') dimensionless 0.25000 3.1248e-05 0.012327 0.48630 1.0000 0.037785 0.037785 0.037723 0.037718 0.51680 0.51680 0.037640\n",
+ " Total Mole Fraction ('Vap', 'hydrogen') dimensionless 0.25000 0.93744 0.92592 0.48184 1.3527e-09 0.49388 0.49388 0.49395 0.49398 0.24801 0.24801 0.49387\n",
+ " Total Mole Fraction ('Vap', 'methane') dimensionless 0.25000 0.062496 0.061748 0.031794 1.2842e-09 0.46834 0.46834 0.46815 0.46810 0.23519 0.23519 0.46807\n",
+ " Temperature kelvin 303.20 303.20 300.45 600.00 664.03 325.00 325.00 325.00 325.00 375.00 375.00 325.00\n",
+ " Pressure pascal 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 1.5000e+05 1.5000e+05 3.5000e+05\n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "source": [
+ "m.fs.report()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
+ "source": [
+ "What is the total operating cost?"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.475550Z",
+ "start_time": "2025-11-20T21:46:17.472001Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 225939.23444372677\n"
+ ]
+ }
+ ],
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))"
]
@@ -978,14 +3889,64 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? "
+ "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? We can look at a specific unit models stream table with the same `report()` method."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 50,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.596910Z",
+ "start_time": "2025-11-20T21:46:17.580529Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 2575.4 : watt : False : (None, None)\n",
+ " Pressure Change : -2.0000e+05 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate Liq mole / second 0.30007 - - \n",
+ " Total Molar Flowrate Vap mole / second 1.0000e-08 - - \n",
+ " Total Mole Fraction ('Liq', 'benzene') dimensionless 1.0000e-20 - - \n",
+ " Total Mole Fraction ('Liq', 'toluene') dimensionless 1.0000 - - \n",
+ " Total Mole Fraction ('Vap', 'benzene') dimensionless 1.0000e-20 - - \n",
+ " Total Mole Fraction ('Vap', 'toluene') dimensionless 0.037785 - - \n",
+ " Total Mole Fraction ('Vap', 'hydrogen') dimensionless 0.49388 - - \n",
+ " Total Mole Fraction ('Vap', 'methane') dimensionless 0.46834 - - \n",
+ " Temperature kelvin 325.00 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.30007 \n",
+ " flow_mol_phase Vap mole / second - 1.9913e-08 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 1.0000e-20 1.0000e-20 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 1.0000 1.0000 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 1.0000e-20 1.0000e-20 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.51680 0.51680 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.24801 0.24801 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.23519 0.23519 \n",
+ " temperature kelvin - 375.00 375.00 \n",
+ " pressure pascal - 1.5000e+05 1.5000e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 1.934999854274726e-20\n"
+ ]
+ }
+ ],
"source": [
"m.fs.F102.report()\n",
"\n",
@@ -997,19 +3958,37 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101.\n",
- "\n",
- "\n",
- "Inline Exercise:\n",
- "How much benzene are we losing in the F101 vapor outlet stream?\n",
- "
\n"
+ "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 51,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.648524Z",
+ "start_time": "2025-11-20T21:46:17.638446Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Units Reactor Light Gases\n",
+ "Total Molar Flowrate Liq mole / second 0.22506 1.0000e-08 \n",
+ "Total Molar Flowrate Vap mole / second 0.075008 2.0137e-10 \n",
+ "Total Mole Fraction ('Liq', 'benzene') dimensionless 1.0000e-20 1.0000e-20 \n",
+ "Total Mole Fraction ('Liq', 'toluene') dimensionless 1.0000 1.0000 \n",
+ "Total Mole Fraction ('Vap', 'benzene') dimensionless 1.0000e-20 1.0000e-20 \n",
+ "Total Mole Fraction ('Vap', 'toluene') dimensionless 1.0000 0.037785 \n",
+ "Total Mole Fraction ('Vap', 'hydrogen') dimensionless 1.3527e-09 0.49388 \n",
+ "Total Mole Fraction ('Vap', 'methane') dimensionless 1.2842e-09 0.46834 \n",
+ "Temperature kelvin 664.03 325.00 \n",
+ "Pressure pascal 3.5000e+05 3.5000e+05 \n"
+ ]
+ }
+ ],
"source": [
"from idaes.core.util.tables import (\n",
" create_stream_table_dataframe,\n",
@@ -1024,19 +4003,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- "Inline Exercise:\n",
- "You can query additional variables here if you like. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Optimization\n",
+ "## 8 Optimization\n",
"\n",
"\n",
"We saw from the results above that the total operating cost for the base case was $419,122 per year. We are producing 0.142 mol/s of benzene at a purity of 82\\%. However, we are losing around 42\\% of benzene in F101 vapor outlet stream. \n",
@@ -1063,8 +4030,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 52,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.675626Z",
+ "start_time": "2025-11-20T21:46:17.671136Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.objective = Objective(expr=m.fs.operating_cost)"
@@ -1079,8 +4051,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 53,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.691883Z",
+ "start_time": "2025-11-20T21:46:17.687385Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.H101.outlet.temperature.unfix()\n",
@@ -1089,23 +4066,14 @@
"m.fs.F102.vap_outlet.temperature.unfix()"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "Let us now unfix the remaining variable which is F102 pressure drop (F102.deltaP) \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
- ]
- },
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 54,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.720592Z",
+ "start_time": "2025-11-20T21:46:17.717532Z"
+ },
"tags": [
"solution"
]
@@ -1133,30 +4101,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 55,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.779305Z",
+ "start_time": "2025-11-20T21:46:17.775669Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.H101.outlet.temperature[0].setlb(500)\n",
"m.fs.H101.outlet.temperature[0].setub(600)"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "Now, set the variable bound for the R101 outlet temperature.\n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
- },
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 56,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.812504Z",
+ "start_time": "2025-11-20T21:46:17.807564Z"
+ },
"tags": [
"solution"
]
@@ -1177,8 +4142,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 57,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.827227Z",
+ "start_time": "2025-11-20T21:46:17.822681Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.F101.vap_outlet.temperature[0].setlb(298.0)\n",
@@ -1198,32 +4168,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 58,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.848212Z",
+ "start_time": "2025-11-20T21:46:17.844101Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.overhead_loss = Constraint(\n",
- " expr=m.fs.F101.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " <= 0.20 * m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " <= 0.20\n",
+ " * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
")"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "Now, add the constraint such that we are producing at least 0.15 mol/s of benzene in the product stream which is the vapor outlet of F102. Let us name this constraint as m.fs.product_flow. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
- },
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 59,
"metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.876414Z",
+ "start_time": "2025-11-20T21:46:17.872250Z"
+ },
"tags": [
"solution"
]
@@ -1232,7 +4202,10 @@
"source": [
"# Todo: Add minimum product flow constraint\n",
"m.fs.product_flow = Constraint(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"] >= 0.15\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " >= 0.15\n",
")"
]
},
@@ -1245,8 +4218,13 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "execution_count": 60,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.890250Z",
+ "start_time": "2025-11-20T21:46:17.887141Z"
+ }
+ },
"outputs": [],
"source": [
"m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)"
@@ -1264,9 +4242,578 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 61,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.024828Z",
+ "start_time": "2025-11-20T21:46:17.897344Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpl0wqmn_f\\unknown.14248.22376.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpl0wqmn_f\\unknown.14248.22376.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 938\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 9\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 504\n",
+ "\n",
+ "Reallocating memory for MA57: lfact (10594)\n",
+ "Total number of variables............................: 224\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 159\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 219\n",
+ "Total number of inequality constraints...............: 3\n",
+ " inequality constraints with only lower bounds: 2\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 1\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 2.2593923e+05 4.10e+04 6.94e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (11249)\n",
+ " 1 2.2592658e+05 4.10e+04 6.94e+00 -1.0 2.26e+06 - 1.24e-06 1.27e-06f 1\n",
+ " 2 2.2592558e+05 4.10e+04 3.83e+02 -1.0 1.09e+07 - 2.51e-06 1.27e-08f 1\n",
+ " 3 2.2575143e+05 4.10e+04 9.02e+03 -1.0 2.27e+09 - 2.63e-07 1.12e-08f 1\n",
+ " 4 2.1959194e+05 4.10e+04 5.77e+03 -1.0 2.25e+09 - 2.72e-07 3.98e-07f 1\n",
+ " 5 1.8296150e+05 3.46e+05 1.20e+05 -1.0 1.14e+09 - 7.70e-07 4.70e-06f 1\n",
+ " 6 1.8296150e+05 3.45e+05 4.95e+07 -1.0 1.99e+04 6.0 1.10e-01 2.49e-03h 1\n",
+ " 7 1.8308684e+05 3.45e+05 1.07e+10 -1.0 1.59e+07 - 4.38e-11 2.97e-05h 1\n",
+ " 8 1.8308686e+05 3.45e+05 1.07e+10 -1.0 3.47e+04 5.5 2.57e-08 1.27e-06f 2\n",
+ " 9 1.8308346e+05 3.45e+05 1.07e+10 -1.0 2.33e+06 - 1.28e-06 1.28e-06f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10r 1.8308346e+05 3.45e+05 9.99e+02 5.5 0.00e+00 - 0.00e+00 6.41e-09R 2\n",
+ " 11r 1.8308366e+05 3.44e+05 6.06e+03 5.5 3.59e+08 - 9.52e-05 2.75e-06f 1\n",
+ " 12r 1.8308341e+05 3.96e+04 6.44e+03 3.4 3.13e+08 - 4.75e-04 1.01e-03f 1\n",
+ " 13 1.8245986e+05 3.96e+04 3.21e+03 -1.0 9.17e+06 - 1.24e-04 1.01e-05f 1\n",
+ " 14 1.8245424e+05 3.96e+04 4.69e+06 -1.0 8.13e+06 - 1.38e-04 1.01e-07f 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 15 1.8245406e+05 3.96e+04 8.01e+11 -1.0 5.70e+07 - 3.66e-04 1.06e-09f 2\n",
+ " 16 1.8163981e+05 3.96e+04 1.52e+12 -1.0 5.47e+08 - 2.78e-05 1.46e-05f 1\n",
+ " 17r 1.8163981e+05 3.96e+04 9.99e+02 4.6 0.00e+00 - 0.00e+00 1.32e-12R 2\n",
+ " 18r 1.8164024e+05 5.96e+04 6.63e+04 4.6 3.30e+07 - 1.77e-02 1.18e-04f 1\n",
+ " 19r 1.8164102e+05 4.78e+04 6.11e+04 3.2 1.72e+06 - 1.38e-01 1.86e-02f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20r 1.8164265e+05 4.73e+04 2.42e+04 3.2 2.06e+06 - 6.74e-01 1.03e-02f 1\n",
+ " 21r 1.8163776e+05 5.59e+04 1.44e+04 3.2 1.58e+03 - 4.29e-01 4.00e-01f 1\n",
+ " 22r 1.8168500e+05 4.59e+04 2.12e+03 3.2 6.14e+02 - 9.01e-01 8.37e-01f 1\n",
+ " 23r 1.8167353e+05 7.43e+04 2.27e+03 3.2 1.36e+02 - 3.19e-01 3.02e-01f 1\n",
+ " 24r 1.8153947e+05 5.07e+04 1.27e+04 3.2 6.53e+01 - 7.65e-01 1.00e+00f 1\n",
+ " 25r 1.8153947e+05 4.53e+04 1.69e+04 3.2 1.56e+01 4.0 1.07e-01 1.08e-01h 1\n",
+ " 26r 1.8153947e+05 2.41e+04 6.04e+04 3.2 1.81e+01 3.5 8.20e-01 1.00e+00f 1\n",
+ " 27 3.9962752e+04 2.41e+04 8.65e+01 -1.0 1.51e+07 - 1.07e-03 1.07e-03f 1\n",
+ " 28 1.7595823e+04 2.41e+04 1.10e+02 -1.0 2.01e+06 - 8.21e-03 1.19e-03f 1\n",
+ " 29 -1.6176446e+04 2.40e+04 4.65e+02 -1.0 1.41e+06 - 6.16e-03 4.06e-03f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 30 -1.6503845e+04 2.40e+04 4.67e+02 -1.0 1.60e+05 - 5.34e-02 4.11e-04f 1\n",
+ " 31 -1.6103557e+04 2.39e+04 1.51e+04 -1.0 5.35e+04 - 6.91e-02 1.53e-03h 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 32 -1.3109479e+04 2.37e+04 3.61e+04 -1.0 5.32e+04 - 1.16e-01 1.14e-02h 3\n",
+ " 33 -9.8778958e+03 2.34e+04 8.31e+04 -1.0 5.10e+04 - 2.78e-01 1.32e-02h 3\n",
+ " 34 -6.1943183e+03 2.30e+04 1.45e+05 -1.0 4.89e+04 - 5.07e-01 1.61e-02h 3\n",
+ " 35 -1.6595473e+03 2.25e+04 1.62e+05 -1.0 4.68e+04 - 3.19e-01 2.13e-02h 3\n",
+ " 36 5.4794139e+03 2.18e+04 1.85e+05 -1.0 4.46e+04 - 6.87e-01 3.60e-02h 3\n",
+ " 37 1.6365098e+04 2.05e+04 1.79e+05 -1.0 4.17e+04 - 3.54e-01 6.02e-02h 3\n",
+ " 38 2.7740530e+04 1.92e+04 1.68e+05 -1.0 3.80e+04 - 2.00e-01 7.01e-02h 3\n",
+ " 39 3.9763721e+04 1.78e+04 1.56e+05 -1.0 3.48e+04 - 2.45e-01 8.02e-02h 3\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 40 5.2469134e+04 1.64e+04 1.44e+05 -1.0 3.21e+04 - 3.86e-01 9.05e-02h 3\n",
+ " 41 6.5791945e+04 1.49e+04 1.34e+05 -1.0 2.96e+04 - 6.07e-01 1.01e-01h 3\n",
+ " 42 1.2096642e+05 1.17e+04 8.09e+04 -1.0 2.75e+04 - 8.69e-01 4.43e-01w 1\n",
+ " 43 1.3345225e+05 1.02e+04 9.69e+04 -1.0 2.10e+04 - 9.90e-01 1.33e-01w 1\n",
+ " 44 1.3364425e+05 1.02e+04 1.48e+05 -1.0 2.14e+04 - 1.00e+00 2.24e-03w 1\n",
+ " 45 7.9585562e+04 1.35e+04 1.27e+05 -1.0 2.14e+04 - 8.69e-01 1.11e-01h 2\n",
+ " 46 9.2643927e+04 1.22e+04 1.21e+05 -1.0 2.69e+04 - 9.90e-01 1.12e-01h 3\n",
+ " 47 1.1662879e+05 1.01e+04 1.01e+05 -1.0 2.65e+04 - 1.00e+00 2.21e-01h 2\n",
+ " 48 1.5635635e+05 6.66e+03 7.23e+04 -1.0 2.30e+04 - 1.00e+00 4.07e-01H 1\n",
+ " 49 1.5677484e+05 6.62e+03 9.35e+04 -1.0 1.77e+04 - 1.00e+00 6.00e-03h 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 50 1.5677903e+05 6.62e+03 9.06e+07 -1.0 1.77e+04 - 1.00e+00 6.03e-05h 1\n",
+ " 51r 1.5677903e+05 6.62e+03 1.00e+03 3.8 0.00e+00 - 0.00e+00 3.01e-07R 2\n",
+ " 52r 1.5677921e+05 2.60e+03 1.79e+03 3.8 6.62e+06 - 1.08e-02 9.90e-04f 1\n",
+ " 53 1.5639242e+05 2.60e+03 1.00e+02 -1.0 1.25e+05 - 5.02e-02 4.91e-04f 1\n",
+ " 54 1.5638540e+05 2.58e+03 7.78e+02 -1.0 1.53e+04 - 3.61e-01 7.65e-03h 1\n",
+ " 55 1.5639044e+05 2.58e+03 3.43e+06 -1.0 1.52e+04 - 7.08e-01 7.69e-05h 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 56r 1.5639044e+05 2.58e+03 1.00e+03 3.4 0.00e+00 - 0.00e+00 3.85e-07R 2\n",
+ " 57r 1.5639078e+05 7.01e+02 9.95e+02 3.4 2.58e+06 - 5.78e-03 9.91e-04f 1\n",
+ " 58 1.5614585e+05 7.00e+02 1.38e+02 -1.0 9.14e+04 - 6.54e-02 4.74e-04f 1\n",
+ " 59 1.5624013e+05 6.99e+02 4.69e+03 -1.0 1.57e+04 - 5.04e-01 2.61e-03h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 60 1.5624202e+05 6.99e+02 1.47e+08 -1.0 1.57e+04 - 8.22e-01 2.62e-05h 1\n",
+ " 61r 1.5624202e+05 6.99e+02 1.00e+03 2.8 0.00e+00 - 0.00e+00 1.31e-07R 2\n",
+ " 62r 1.5624284e+05 1.84e+02 9.98e+02 2.8 6.99e+05 - 2.70e-03 9.90e-04f 1\n",
+ " 63 1.5604488e+05 1.84e+02 1.65e+02 -1.0 7.47e+04 - 7.78e-02 4.95e-04f 1\n",
+ " 64 1.5606175e+05 1.84e+02 1.65e+05 -1.0 1.59e+04 - 5.42e-01 3.40e-04h 1\n",
+ " 65r 1.5606175e+05 1.84e+02 1.00e+03 2.3 0.00e+00 - 0.00e+00 4.26e-07R 4\n",
+ " 66r 1.5606221e+05 4.72e+01 4.65e+03 2.3 1.84e+05 - 3.00e-01 9.90e-04f 1\n",
+ " 67 1.5598771e+05 4.72e+01 4.39e+02 -1.0 6.50e+04 - 8.77e-02 2.22e-04f 1\n",
+ " 68r 1.5598771e+05 4.72e+01 9.99e+02 1.7 0.00e+00 - 0.00e+00 2.77e-07R 4\n",
+ " 69r 1.5598853e+05 1.22e+01 1.33e+03 1.7 4.72e+04 - 3.27e-01 9.90e-04f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 70 1.5594804e+05 1.22e+01 7.89e+02 -1.0 6.09e+04 - 9.21e-02 1.30e-04f 1\n",
+ " 71r 1.5594804e+05 1.22e+01 9.99e+02 1.1 0.00e+00 - 0.00e+00 3.24e-07R 3\n",
+ " 72r 1.5594931e+05 5.34e+01 9.49e+02 1.1 1.22e+04 - 1.28e-01 9.90e-04f 1\n",
+ " 73r 1.5602328e+05 8.38e+03 8.47e+02 1.1 1.82e+02 - 3.97e-01 1.18e-01f 1\n",
+ " 74r 1.5611223e+05 5.32e+03 5.09e+02 1.1 1.27e+02 - 4.87e-01 3.88e-01f 1\n",
+ " 75r 1.5611538e+05 4.46e+03 9.27e+02 1.1 4.35e+01 - 3.30e-01 2.08e-01f 1\n",
+ " 76r 1.5618738e+05 4.27e+03 3.31e+02 1.1 6.22e+01 - 8.72e-01 5.98e-01f 1\n",
+ " 77r 1.5626949e+05 2.10e+04 5.81e+03 1.1 2.66e+02 - 6.87e-01 1.00e+00f 1\n",
+ " 78r 1.5626950e+05 9.45e+02 1.67e+03 1.1 2.44e+00 0.0 9.93e-01 9.56e-01h 1\n",
+ " 79r 1.5633952e+05 1.55e+03 6.08e+02 1.1 7.00e+01 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 80r 1.5642050e+05 1.38e+02 4.09e+01 1.1 1.25e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 81r 1.5640166e+05 1.18e+00 1.13e+00 1.1 2.52e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 82 1.4211718e+05 4.18e+02 7.70e+02 -1.0 7.62e+05 - 5.86e-03 2.54e-03f 1\n",
+ " 83r 1.4211718e+05 4.18e+02 9.99e+02 2.6 0.00e+00 - 0.00e+00 4.73e-07R 15\n",
+ " 84r 1.4211760e+05 9.63e+01 7.10e+03 2.6 4.18e+05 - 2.71e-02 9.90e-04f 1\n",
+ " 85 1.4189541e+05 9.64e+01 3.92e+02 -1.0 3.81e+05 - 1.62e-02 7.48e-05f 1\n",
+ " 86 1.4037132e+05 2.61e+03 1.06e+03 -1.0 1.60e+04 - 3.64e-02 1.33e-02f 1\n",
+ " 87 1.4037496e+05 2.61e+03 1.03e+06 -1.0 2.99e+04 - 9.60e-02 1.34e-04h 1\n",
+ " 88r 1.4037496e+05 2.61e+03 1.00e+03 3.4 0.00e+00 - 0.00e+00 3.35e-07R 3\n",
+ " 89r 1.4037548e+05 1.23e+03 1.25e+04 3.4 2.61e+06 - 2.16e-02 9.90e-04f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 90 1.3159180e+05 1.24e+03 1.40e+01 -1.0 1.15e+06 - 1.26e-02 8.35e-04f 1\n",
+ " 91 1.3048033e+05 1.24e+03 5.90e+01 -1.0 5.18e+04 - 2.81e-02 2.55e-03f 1\n",
+ " 92 1.3047951e+05 1.24e+03 2.51e+05 -1.0 3.24e+04 - 1.03e-01 2.56e-05f 1\n",
+ " 93r 1.3047951e+05 1.24e+03 1.00e+03 3.1 0.00e+00 - 0.00e+00 1.28e-07R 2\n",
+ " 94r 1.3047961e+05 3.22e+02 7.99e+03 3.1 1.24e+06 - 1.28e-01 9.91e-04f 1\n",
+ " 95 1.2799595e+05 3.22e+02 3.48e+01 -1.0 2.84e+05 - 2.91e-02 8.14e-04f 1\n",
+ " 96 1.2798856e+05 3.21e+02 2.37e+03 -1.0 3.80e+04 - 8.68e-02 7.83e-04f 1\n",
+ " 97r 1.2798856e+05 3.21e+02 1.00e+03 2.5 0.00e+00 - 0.00e+00 4.90e-07R 5\n",
+ " 98r 1.2798821e+05 8.75e+01 6.36e+03 2.5 3.21e+05 - 3.92e-01 9.90e-04f 1\n",
+ " 99 1.2802319e+05 8.74e+01 1.07e+04 -1.0 4.00e+04 - 1.87e-01 4.16e-04h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 100r 1.2802319e+05 8.74e+01 1.00e+03 1.9 0.00e+00 - 0.00e+00 2.60e-07R 5\n",
+ " 101r 1.2802286e+05 2.25e+01 1.59e+03 1.9 8.74e+04 - 3.57e-01 9.90e-04f 1\n",
+ " 102 1.2803524e+05 2.24e+01 3.21e+05 -1.0 4.04e+04 - 3.46e-01 1.15e-04h 1\n",
+ " 103r 1.2803524e+05 2.24e+01 1.00e+03 1.4 0.00e+00 - 0.00e+00 2.87e-07R 3\n",
+ " 104r 1.2803522e+05 5.73e+00 9.93e+02 1.4 2.24e+04 - 3.75e-01 9.90e-04f 1\n",
+ " 105 1.2801361e+05 5.73e+00 1.41e+03 -1.0 5.87e+04 - 3.71e-02 2.95e-05f 1\n",
+ " 106r 1.2801361e+05 5.73e+00 1.00e+03 0.8 0.00e+00 - 0.00e+00 1.48e-07R 2\n",
+ " 107r 1.2801478e+05 2.68e+00 9.89e+02 0.8 5.73e+03 - 8.71e-02 9.90e-04f 1\n",
+ " 108 1.2800949e+05 2.68e+00 5.60e+03 -1.0 5.63e+04 - 3.78e-02 7.54e-06f 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 109r 1.2800949e+05 2.68e+00 1.00e+03 0.4 0.00e+00 - 0.00e+00 3.77e-08R 2\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 110r 1.2801166e+05 3.81e+00 9.93e+02 0.4 2.68e+03 - 3.82e-02 9.90e-04f 1\n",
+ " 111r 1.2802445e+05 6.14e+02 9.64e+02 0.4 3.09e+02 - 2.66e-02 2.94e-02f 1\n",
+ " 112r 1.2806075e+05 1.08e+03 8.98e+02 0.4 1.58e+02 - 2.79e-01 5.62e-02f 1\n",
+ " 113r 1.2831404e+05 1.07e+03 6.34e+02 0.4 1.43e+02 - 7.40e-01 3.03e-01f 1\n",
+ " 114r 1.2886030e+05 3.98e+03 2.01e+02 0.4 5.86e+01 - 9.64e-01 8.55e-01f 1\n",
+ " 115r 1.2885846e+05 5.59e+03 3.81e+03 0.4 1.76e+01 -2.0 7.49e-01 9.89e-01F 1\n",
+ " 116r 1.2885837e+05 5.02e+03 1.59e+03 0.4 3.19e+01 -1.6 1.26e-01 1.01e-01h 1\n",
+ " 117r 1.2875688e+05 7.27e+03 8.69e+03 0.4 1.70e+02 - 9.01e-01 6.08e-01H 1\n",
+ " 118r 1.2861391e+05 1.91e+03 2.32e+03 0.4 6.76e+01 - 3.09e-01 4.96e-01h 1\n",
+ " 119r 1.2861391e+05 1.18e+03 1.30e+03 0.4 7.62e-01 0.7 2.63e-01 3.79e-01f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 120r 1.2861391e+05 1.50e+01 1.60e+03 0.4 1.12e+00 0.2 1.00e+00 1.00e+00f 1\n",
+ " 121r 1.2855214e+05 1.41e+03 6.30e+02 0.4 2.14e+02 - 7.06e-01 6.45e-01F 1\n",
+ " 122r 1.2854036e+05 1.62e+02 2.13e+01 0.4 1.05e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 123r 1.2854284e+05 6.41e+01 1.88e+00 0.4 5.18e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 124r 1.2854112e+05 1.24e+00 5.76e-02 0.4 5.06e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 125 1.2853731e+05 8.25e+00 8.46e+01 -1.0 3.52e+04 - 2.13e-03 1.10e-04f 6\n",
+ " 126 1.2853574e+05 1.02e+01 1.68e+02 -1.0 3.46e+04 - 3.78e-03 5.51e-05f 7\n",
+ " 127 1.2853471e+05 1.22e+01 3.97e+02 -1.0 3.51e+04 - 5.15e-03 5.52e-05f 7\n",
+ " 128 1.2853431e+05 1.41e+01 9.42e+02 -1.0 3.57e+04 - 5.14e-03 5.54e-05f 7\n",
+ " 129r 1.2853431e+05 1.41e+01 9.99e+02 1.2 0.00e+00 - 0.00e+00 4.36e-07R 14\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 130r 1.2853521e+05 3.27e+00 3.14e+03 1.2 1.41e+04 - 6.27e-02 9.90e-04f 1\n",
+ " 131 1.2034467e+05 2.66e+02 3.47e+02 -1.0 1.47e+06 - 2.72e-03 6.73e-04f 1\n",
+ " 132 1.2022266e+05 4.31e+03 1.11e+03 -1.0 2.32e+04 - 6.56e-03 2.99e-03f 1\n",
+ " 133r 1.2022266e+05 4.31e+03 9.99e+02 3.6 0.00e+00 - 0.00e+00 4.67e-07R 7\n",
+ " 134r 1.2022335e+05 8.51e+03 7.19e+03 3.6 4.31e+06 - 1.68e-02 9.90e-04f 1\n",
+ " 135r 1.2022365e+05 8.36e+03 7.04e+03 2.2 5.51e+04 - 8.33e-01 1.76e-02f 1\n",
+ " 136r 1.2028738e+05 2.34e+05 4.43e+03 2.2 4.33e+02 - 5.63e-01 8.32e-01f 1\n",
+ " 137r 1.2028745e+05 8.35e+04 1.36e+03 2.2 1.19e+01 0.0 5.50e-01 7.32e-01f 1\n",
+ " 138r 1.2031198e+05 5.29e+04 7.87e+02 2.2 1.46e+02 - 6.30e-01 6.77e-01f 1\n",
+ " 139r 1.2030652e+05 2.46e+04 1.31e+03 2.2 5.31e+01 - 9.14e-01 8.25e-01f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 140r 1.2030840e+05 2.40e+04 1.29e+03 2.2 3.56e+01 - 1.86e-02 2.50e-02h 1\n",
+ " 141r 1.2030840e+05 2.36e+04 1.25e+03 2.2 9.18e+00 2.2 3.84e-02 1.35e-02h 1\n",
+ " 142r 1.2033359e+05 1.95e+04 8.08e+03 2.2 4.55e+01 - 5.22e-01 2.17e-01f 1\n",
+ " 143r 1.2038554e+05 3.79e+04 1.15e+03 2.2 5.04e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 144r 1.2036898e+05 1.43e+04 8.09e+02 2.2 2.28e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 145r 1.2047190e+05 5.00e+03 3.01e+02 2.2 5.23e+01 - 1.00e+00 7.53e-01h 1\n",
+ " 146r 1.2043452e+05 2.24e+03 2.42e+03 2.2 1.02e+01 - 1.00e+00 5.61e-01f 1\n",
+ " 147r 1.2041013e+05 4.32e+03 1.02e+03 2.2 1.51e+01 - 1.00e+00 5.72e-01f 1\n",
+ " 148r 1.2041937e+05 4.84e+02 1.91e+02 2.2 3.50e+00 - 1.00e+00 1.00e+00f 1\n",
+ " 149 1.1303874e+05 5.57e+03 4.76e+02 -1.0 2.96e+05 - 3.61e-03 2.13e-03f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 150 1.1050904e+05 5.53e+03 3.99e+02 -1.0 1.56e+05 - 8.49e-03 1.87e-03f 1\n",
+ " 151 1.1027960e+05 5.52e+03 4.08e+02 -1.0 7.06e+04 - 1.08e-02 3.88e-04f 1\n",
+ " 152 1.1027853e+05 5.52e+03 3.78e+05 -1.0 3.54e+04 - 1.88e-02 4.05e-06f 1\n",
+ " 153r 1.1027853e+05 5.52e+03 1.00e+03 3.7 0.00e+00 - 0.00e+00 2.03e-08R 2\n",
+ " 154r 1.1027886e+05 6.60e+02 2.29e+03 3.7 5.51e+06 - 3.42e-03 9.93e-04f 1\n",
+ " 155 1.0759473e+05 6.61e+02 2.40e+01 -1.0 1.36e+06 - 5.20e-03 2.07e-04f 1\n",
+ " 156 1.0758344e+05 6.61e+02 1.68e+05 -1.0 5.36e+05 - 1.38e-02 2.11e-06f 1\n",
+ " 157r 1.0758344e+05 6.61e+02 9.99e+02 2.8 0.00e+00 - 0.00e+00 1.06e-08R 2\n",
+ " 158r 1.0758424e+05 1.76e+02 9.97e+02 2.8 6.61e+05 - 1.95e-03 9.90e-04f 1\n",
+ " 159 1.0727225e+05 1.76e+02 2.26e+02 -1.0 1.28e+06 - 5.75e-03 2.52e-05f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 160 1.0727102e+05 1.76e+02 1.38e+07 -1.0 4.83e+05 - 1.54e-02 2.52e-07f 1\n",
+ " 161r 1.0727102e+05 1.76e+02 1.00e+03 2.2 0.00e+00 - 0.00e+00 2.10e-09R 2\n",
+ " 162r 1.0727100e+05 4.49e+01 3.89e+03 2.2 1.76e+05 - 3.33e-01 9.90e-04f 1\n",
+ " 163 1.0718953e+05 4.49e+01 8.71e+02 -1.0 1.28e+06 - 5.81e-03 6.62e-06f 1\n",
+ " 164 1.0718937e+05 4.49e+01 2.04e+08 -1.0 4.76e+05 - 1.56e-02 3.31e-08f 2\n",
+ " 165 1.0719074e+05 4.49e+01 2.41e+12 -1.0 1.39e+07 - 3.27e-04 2.74e-08H 1\n",
+ " 166r 1.0719074e+05 4.49e+01 1.00e+03 1.7 0.00e+00 - 0.00e+00 1.84e-11R 2\n",
+ " 167r 1.0719095e+05 1.12e+01 9.90e+02 1.7 4.49e+04 - 1.70e-01 9.90e-04f 1\n",
+ " 168 1.0717059e+05 1.12e+01 3.49e+03 -1.0 1.27e+06 - 5.83e-03 1.66e-06f 1\n",
+ " 169r 1.0717059e+05 1.12e+01 9.99e+02 1.0 0.00e+00 - 0.00e+00 8.30e-09R 2\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 170r 1.0717179e+05 3.98e+00 9.97e+02 1.0 1.12e+04 - 7.26e-02 9.90e-04f 1\n",
+ " 171 1.0716685e+05 3.98e+00 1.42e+04 -1.0 1.24e+06 - 5.88e-03 4.11e-07f 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 172r 1.0716685e+05 3.98e+00 9.99e+02 0.6 0.00e+00 - 0.00e+00 2.06e-09R 2\n",
+ " 173r 1.0716902e+05 1.22e+01 9.95e+02 0.6 3.98e+03 - 2.60e-02 9.90e-04f 1\n",
+ " 174r 1.0721151e+05 3.96e+03 9.71e+02 0.6 7.43e+02 - 5.48e-02 2.49e-02f 1\n",
+ " 175r 1.0733554e+05 8.77e+03 8.92e+02 0.6 7.42e+02 - 2.07e-01 7.93e-02f 1\n",
+ " 176r 1.0744861e+05 1.81e+04 3.21e+03 0.6 6.39e+02 - 2.76e-01 9.12e-02f 1\n",
+ " 177r 1.0760156e+05 1.26e+04 2.49e+03 0.6 4.84e+02 - 1.35e-01 1.57e-01f 1\n",
+ " 178r 1.0759534e+05 1.76e+04 3.00e+03 0.6 8.50e+01 - 2.93e-01 1.80e-01f 1\n",
+ " 179r 1.0769358e+05 1.54e+04 3.69e+03 0.6 5.91e+01 - 3.85e-01 2.13e-01f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 180r 1.0817736e+05 6.68e+03 3.86e+03 0.6 1.21e+02 - 9.01e-01 5.48e-01f 1\n",
+ " 181r 1.0810596e+05 6.25e+03 2.22e+03 0.6 6.69e+01 - 3.03e-01 3.61e-01f 1\n",
+ " 182r 1.0804719e+05 1.30e+03 4.59e+02 0.6 3.46e+01 - 9.90e-01 1.00e+00f 1\n",
+ " 183r 1.0811628e+05 1.96e+02 1.22e+01 0.6 2.24e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 184r 1.0810982e+05 6.43e+00 3.18e+00 0.6 9.06e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 185r 1.0822116e+05 9.78e+02 1.36e+02 -0.8 6.25e+01 - 7.37e-01 6.38e-01f 1\n",
+ " 186r 1.1108726e+05 1.47e+03 9.49e+01 -0.8 1.17e+03 - 7.44e-01 5.74e-01f 1\n",
+ " 187r 1.1267097e+05 5.05e+03 8.55e+01 -0.8 5.95e+02 - 1.00e+00 7.56e-01f 1\n",
+ " 188r 1.1279724e+05 1.61e+03 1.89e+01 -0.8 1.03e+02 - 6.41e-01 6.99e-01h 1\n",
+ " 189r 1.1300124e+05 7.91e+01 5.00e-01 -0.8 6.37e+01 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 190r 1.1300781e+05 1.88e+00 3.19e-02 -0.8 9.42e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 191r 1.1300781e+05 1.88e+00 9.99e+02 0.3 0.00e+00 - 0.00e+00 1.25e-09R 2\n",
+ " 192r 1.1300966e+05 4.83e-01 2.16e+04 0.3 1.88e+03 - 8.88e-02 9.90e-04f 1\n",
+ " 193r 1.1300966e+05 4.83e-01 9.99e+02 -0.3 0.00e+00 - 0.00e+00 1.49e-09R 2\n",
+ " 194r 1.1301306e+05 1.93e-01 1.24e+04 -0.3 8.04e+02 - 2.20e-01 9.90e-04f 1\n",
+ " 195r 1.1301306e+05 1.93e-01 9.99e+02 -0.7 0.00e+00 - 0.00e+00 1.56e-09R 2\n",
+ " 196r 1.1302132e+05 1.93e-01 2.17e+04 -0.7 1.31e+03 - 9.64e-01 1.54e-03f 1\n",
+ " 197r 1.1823161e+05 6.17e+02 4.80e+02 -0.7 1.34e+03 - 9.89e-01 9.61e-01f 1\n",
+ " 198r 1.1798536e+05 5.28e+02 6.49e+01 -0.7 5.91e+01 - 7.43e-01 1.00e+00h 1\n",
+ " 199r 1.1805718e+05 2.99e+02 3.87e+00 -0.7 1.29e+01 - 9.93e-01 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 200r 1.1805876e+05 8.10e+01 1.75e+00 -0.7 3.71e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 201r 1.1806057e+05 5.70e-01 1.05e-03 -0.7 4.13e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 202r 1.1811792e+05 3.68e+02 9.69e+00 -1.4 2.10e+01 - 9.31e-01 9.67e-01f 1\n",
+ " 203r 1.2050787e+05 7.67e+02 6.64e+01 -1.4 1.57e+03 - 6.63e-01 5.35e-01h 1\n",
+ " 204r 1.2249012e+05 4.59e+02 1.35e+02 -1.4 7.27e+02 - 6.94e-01 1.00e+00h 1\n",
+ " 205r 1.2248902e+05 6.11e+02 4.56e+01 -1.4 3.65e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 206r 1.2249445e+05 1.16e+02 6.38e+00 -1.4 7.80e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 207r 1.2249392e+05 1.06e+00 1.19e-01 -1.4 7.63e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 208r 1.2249396e+05 1.76e-01 3.39e-05 -1.4 6.38e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 209r 1.2253738e+05 1.27e+02 1.74e+01 -3.2 1.09e+01 - 9.28e-01 8.33e-01f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 210r 1.2342956e+05 2.40e+03 2.42e+02 -3.2 1.70e+04 - 4.06e-01 1.26e-01f 1\n",
+ " 211r 1.2343158e+05 2.40e+03 7.66e+02 -3.2 8.82e+03 - 2.08e-01 1.77e-04h 1\n",
+ " 212r 1.2680154e+05 2.07e+03 8.71e+02 -3.2 2.55e+03 - 3.91e-01 1.86e-01h 1\n",
+ " 213r 1.2680301e+05 2.06e+03 1.05e+03 -3.2 9.06e+01 - 7.96e-01 5.94e-03h 1\n",
+ " 214r 1.2694462e+05 1.25e+03 8.56e+02 -3.2 7.71e+01 - 1.00e+00 3.94e-01h 1\n",
+ " 215r 1.2716494e+05 2.37e+03 2.47e+02 -3.2 4.31e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 216r 1.2716480e+05 3.75e+02 2.05e+02 -3.2 1.32e+00 - 8.45e-01 9.35e-01h 1\n",
+ " 217r 1.2716432e+05 2.49e+01 7.82e+01 -3.2 2.34e-01 - 1.00e+00 9.40e-01h 1\n",
+ " 218r 1.2716443e+05 1.57e+00 2.02e+00 -3.2 1.03e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 219r 1.2716444e+05 1.72e-01 1.84e-02 -3.2 3.20e-02 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 220 1.2716441e+05 1.72e-01 5.84e+02 -1.0 3.35e+04 - 1.89e-04 1.11e-06f 3\n",
+ " 221 1.2716433e+05 1.72e-01 6.98e+03 -1.0 3.33e+04 - 5.76e-04 3.00e-06f 2\n",
+ " 222 1.2716001e+05 6.59e-01 6.09e+03 -1.0 3.26e+04 - 1.20e-04 1.53e-04f 1\n",
+ " 223 1.2715671e+05 9.98e-01 2.65e+04 -1.0 3.24e+04 - 8.81e-04 1.13e-04f 2\n",
+ " 224 1.2715642e+05 1.00e+00 3.99e+04 -1.0 3.21e+04 - 5.12e-04 1.02e-05f 8\n",
+ " 225 1.2715609e+05 1.00e+00 2.11e+05 -1.0 3.20e+04 - 6.44e-03 1.21e-05f 8\n",
+ " 226 1.2715594e+05 1.01e+00 2.22e+05 -1.0 3.12e+04 - 4.13e-04 7.29e-06f 9\n",
+ " 227 1.2715578e+05 1.01e+00 6.06e+05 -1.0 3.12e+04 - 1.45e-02 7.28e-06f 9\n",
+ " 228 1.2712455e+05 5.74e+01 5.61e+05 -1.0 2.98e+04 - 4.34e-04 2.11e-03f 1\n",
+ " 229 1.2712496e+05 5.76e+01 5.61e+05 -1.0 2.47e+04 - 1.73e-04 1.73e-04s 10\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 230 1.2713698e+05 1.14e+02 5.59e+05 -1.0 2.41e+04 - 2.70e-03 2.70e-03s 10\n",
+ " 231r 1.2713698e+05 1.14e+02 1.00e+03 2.1 0.00e+00 - 0.00e+00 0.00e+00R 1\n",
+ " 232r 1.2716197e+05 1.69e+03 3.15e+04 2.1 1.14e+05 - 1.07e-05 2.61e-04f 1\n",
+ " 233r 1.2714570e+05 2.14e+03 2.94e+04 2.1 8.31e+04 - 5.38e-04 1.00e-03f 1\n",
+ " 234r 1.2714342e+05 2.61e+03 2.90e+04 2.1 1.04e+04 - 2.06e-03 1.77e-03f 1\n",
+ " 235r 1.2713596e+05 3.50e+03 2.84e+04 2.1 1.57e+03 - 3.35e-03 4.25e-03f 1\n",
+ " 236r 1.2708154e+05 5.65e+03 2.84e+04 2.1 7.55e+02 - 2.00e-03 1.09e-02f 1\n",
+ " 237r 1.2708154e+05 5.08e+03 2.48e+04 2.1 8.00e+00 2.0 2.43e-02 1.02e-01f 1\n",
+ " 238r 1.2708154e+05 4.85e+03 2.33e+04 2.1 8.06e+00 1.5 3.31e-01 4.61e-02f 1\n",
+ " 239r 1.2708156e+05 1.14e+04 2.24e+04 2.1 2.91e+02 1.0 8.89e-03 1.92e-02f 2\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 240r 1.2708156e+05 3.64e+03 1.67e+03 2.1 3.56e-01 3.3 9.90e-01 9.24e-01f 1\n",
+ " 241r 1.2726934e+05 1.67e+04 1.27e+04 2.1 2.58e+02 - 4.63e-01 1.00e+00f 1\n",
+ " 242r 1.2736337e+05 1.24e+03 6.79e+01 2.1 2.54e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 243r 1.2744147e+05 1.56e+03 1.20e+02 2.1 8.73e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 244r 1.2739248e+05 1.69e+04 1.76e+02 2.1 4.12e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 245r 1.2738697e+05 6.55e+02 5.20e+00 2.1 6.39e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 246r 1.2749175e+05 1.38e+04 1.09e+03 1.4 1.60e+02 - 4.91e-01 7.12e-01f 1\n",
+ " 247r 1.2761275e+05 2.71e+03 4.74e+02 1.4 6.53e+01 - 6.43e-01 1.00e+00f 1\n",
+ " 248r 1.2750105e+05 1.80e+03 4.59e+01 1.4 3.96e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 249r 1.2754311e+05 6.91e+01 1.63e+01 1.4 1.22e+01 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 250r 1.2731384e+05 3.27e+03 7.52e+01 0.7 9.90e+01 - 9.32e-01 9.07e-01f 1\n",
+ " 251r 1.2733916e+05 3.31e+03 3.81e+02 0.7 2.94e+01 - 9.88e-01 1.00e+00f 1\n",
+ " 252r 1.2733916e+05 7.28e+00 2.53e+01 0.7 3.71e-02 2.8 1.00e+00 1.00e+00h 1\n",
+ " 253 1.2683674e+05 7.41e+03 1.23e+04 -1.0 3.89e+05 - 1.95e-04 3.22e-04f 1\n",
+ " 254 1.2676691e+05 7.46e+03 1.24e+04 -1.0 3.46e+05 - 8.15e-04 8.67e-05f 1\n",
+ " 255 1.2676634e+05 7.46e+03 1.25e+04 -1.0 3.35e+05 - 4.00e-06 1.86e-05f 1\n",
+ " 256r 1.2676634e+05 7.46e+03 9.99e+02 3.9 0.00e+00 - 0.00e+00 2.79e-07R 11\n",
+ " 257r 1.2676664e+05 6.95e+03 1.73e+03 3.9 7.46e+06 - 9.44e-06 6.75e-05f 1\n",
+ " 258r 1.2676749e+05 1.45e+04 4.19e+03 3.9 6.89e+06 - 5.87e-03 2.42e-04f 1\n",
+ " 259r 1.2677021e+05 2.06e+04 1.68e+05 3.9 7.68e+05 - 2.42e-01 6.81e-03f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 260r 1.2676657e+05 1.54e+04 1.99e+04 3.2 2.06e+03 - 7.98e-01 2.46e-01f 1\n",
+ " 261r 1.2679614e+05 1.25e+05 6.11e+04 3.2 4.23e+02 - 6.64e-01 9.18e-01f 1\n",
+ " 262r 1.2679614e+05 1.06e+05 5.24e+04 3.2 2.15e+01 2.0 2.47e-01 1.50e-01h 1\n",
+ " 263r 1.2679699e+05 9.96e+04 4.99e+04 3.2 3.45e+02 - 1.19e-01 5.68e-02f 1\n",
+ " 264r 1.2667363e+05 3.90e+04 1.72e+04 3.2 9.75e+01 - 1.00e+00 9.82e-01f 1\n",
+ " 265r 1.2671998e+05 8.46e+04 5.46e+03 3.2 4.82e+01 - 9.57e-01 1.00e+00f 1\n",
+ " 266r 1.2672645e+05 3.56e+04 8.81e+03 3.2 3.41e+01 - 7.54e-01 5.00e-01f 2\n",
+ " 267r 1.2673515e+05 2.88e+04 2.96e+03 3.2 3.52e+01 - 8.41e-01 5.00e-01h 2\n",
+ " 268r 1.2674045e+05 2.96e+04 5.20e+02 3.2 1.42e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 269r 1.2670264e+05 4.00e+04 1.89e+03 3.2 4.20e+01 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 270r 1.2671520e+05 2.66e+04 2.95e+03 3.2 3.23e+01 - 1.00e+00 5.00e-01h 2\n",
+ " 271r 1.2674449e+05 1.92e+04 6.30e+02 3.2 3.26e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 272r 1.2667937e+05 1.21e+04 1.31e+03 3.2 4.68e+01 - 8.60e-01 8.81e-01H 1\n",
+ " 273r 1.2675843e+05 1.14e+05 1.38e+03 2.5 2.14e+02 - 9.15e-01 9.58e-01f 1\n",
+ " 274r 1.2689727e+05 2.02e+04 6.57e+02 2.5 1.53e+02 - 8.86e-01 9.29e-01f 1\n",
+ " 275r 1.2682834e+05 4.79e+03 1.01e+03 2.5 8.87e+01 - 1.29e-01 1.00e+00f 1\n",
+ " 276r 1.2683302e+05 7.29e+03 2.75e+01 2.5 1.48e+01 - 1.00e+00 1.00e+00f 1\n",
+ " 277r 1.2683771e+05 1.69e+02 2.08e+00 2.5 2.17e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 278 9.8178178e+04 4.74e+03 3.17e+02 -1.0 1.14e+06 - 4.18e-03 3.73e-03f 1\n",
+ " 279 9.7892691e+04 4.74e+03 4.16e+02 -1.0 3.14e+05 - 1.05e-02 8.44e-05f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 280 9.7891957e+04 4.74e+03 6.56e+06 -1.0 9.57e+04 - 1.40e-02 8.51e-07f 1\n",
+ " 281 9.7890561e+04 4.74e+03 1.74e+11 -1.0 2.12e+07 - 2.28e-04 8.51e-09f 1\n",
+ " 282 8.8769650e+04 4.74e+03 7.10e+11 -1.0 7.63e+07 - 7.92e-05 1.93e-05f 1\n",
+ " 283r 8.8769650e+04 4.74e+03 1.00e+03 3.7 0.00e+00 - 0.00e+00 7.21e-12R 2\n",
+ " 284r 8.8769664e+04 3.34e+03 2.82e+04 3.7 4.74e+06 - 5.33e-02 2.94e-04f 1\n",
+ " 285 8.8693654e+04 3.34e+03 3.82e+02 -1.0 1.57e+05 - 1.43e-04 4.15e-05f 1\n",
+ " 286 8.8692951e+04 3.34e+03 2.28e+03 -1.0 1.43e+05 - 2.18e-04 4.17e-07f 1\n",
+ " 287r 8.8692951e+04 3.34e+03 9.99e+02 3.5 0.00e+00 - 0.00e+00 2.08e-09R 2\n",
+ " 288r 8.8692949e+04 3.30e+03 4.79e+03 3.5 3.34e+06 - 1.41e-03 1.30e-05f 1\n",
+ " 289r 8.8693153e+04 5.46e+02 4.17e+04 3.5 1.37e+06 - 1.36e-01 2.38e-03f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 290 8.7457681e+04 5.52e+02 9.15e+02 -1.0 3.59e+05 - 1.38e-02 3.41e-04f 1\n",
+ " 291 8.7456415e+04 5.52e+02 4.84e+06 -1.0 5.31e+04 - 1.82e-02 3.49e-06f 1\n",
+ " 292r 8.7456415e+04 5.52e+02 1.00e+03 2.7 0.00e+00 - 0.00e+00 1.76e-08R 2\n",
+ " 293r 8.7456389e+04 1.39e+02 2.42e+04 2.7 5.52e+05 - 4.97e-01 9.90e-04f 1\n",
+ " 294 8.7370462e+04 1.39e+02 5.88e+02 -1.0 3.62e+05 - 1.40e-02 2.36e-05f 1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 295r 8.7370462e+04 1.39e+02 9.99e+02 2.1 0.00e+00 - 0.00e+00 1.18e-07R 2\n",
+ " 296r 8.7370048e+04 3.52e+01 3.53e+03 2.1 1.39e+05 - 2.88e-01 9.90e-04f 1\n",
+ " 297 8.7365867e+04 3.52e+01 8.57e+03 -1.0 5.17e+04 - 1.49e-02 1.02e-05f 1\n",
+ " 298r 8.7365867e+04 3.52e+01 1.00e+03 1.5 0.00e+00 - 0.00e+00 5.08e-08R 2\n",
+ " 299r 8.7366392e+04 9.28e+00 9.94e+02 1.5 3.52e+04 - 2.03e-01 9.90e-04f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 300 8.7366287e+04 9.28e+00 8.33e+05 -1.0 7.00e+04 - 1.52e-02 7.75e-07f 2\n",
+ " 301r 8.7366287e+04 9.28e+00 1.00e+03 1.0 0.00e+00 - 0.00e+00 3.92e-07R 2\n",
+ " 302r 8.7367439e+04 1.24e+01 1.01e+03 1.0 9.28e+03 - 3.08e-02 9.90e-04f 1\n",
+ " 303r 8.7397075e+04 3.59e+03 9.77e+02 1.0 3.75e+02 - 1.00e-01 2.88e-02f 1\n",
+ " 304r 8.7438378e+04 3.48e+03 9.08e+02 1.0 3.31e+02 - 8.91e-02 4.71e-02f 1\n",
+ " 305r 8.7508053e+04 5.97e+03 1.50e+03 1.0 2.88e+02 - 4.19e-01 8.34e-02f 1\n",
+ " 306r 8.7712845e+04 2.48e+04 3.57e+03 1.0 2.81e+02 - 8.23e-01 3.25e-01f 1\n",
+ " 307r 8.7793008e+04 1.34e+04 2.30e+03 1.0 5.17e+01 - 4.78e-01 4.32e-01f 1\n",
+ " 308r 8.7846425e+04 7.72e+03 1.02e+03 1.0 2.62e+01 - 7.14e-01 6.69e-01f 1\n",
+ " 309r 8.7909231e+04 2.83e+03 4.55e+03 1.0 2.21e+01 - 9.91e-01 6.64e-01f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 310r 8.7935450e+04 1.38e+03 2.75e+03 1.0 1.16e+01 - 6.88e-01 5.11e-01f 1\n",
+ " 311r 8.7934743e+04 7.89e+01 4.04e+02 1.0 5.65e+00 - 1.00e+00 1.00e+00f 1\n",
+ " 312r 8.7774627e+04 2.97e+03 1.68e+02 0.3 4.16e+01 - 9.23e-01 9.88e-01f 1\n",
+ " 313r 8.8807837e+04 4.00e+03 1.24e+01 0.3 1.93e+02 - 1.00e+00 1.00e+00h 1\n",
+ " 314r 8.8874130e+04 2.92e+02 1.89e+00 0.3 9.71e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 315r 8.8879501e+04 1.07e+00 1.78e-02 0.3 1.06e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 316r 8.8879501e+04 1.07e+00 9.99e+02 0.0 0.00e+00 - 0.00e+00 2.69e-07R 2\n",
+ " 317r 8.8881473e+04 2.72e-01 1.76e+04 0.0 1.07e+03 - 9.21e-01 9.90e-04f 1\n",
+ " 318r 8.8881473e+04 2.72e-01 9.99e+02 -0.6 0.00e+00 - 0.00e+00 2.66e-07R 2\n",
+ " 319r 8.8884807e+04 2.82e-01 1.14e+03 -0.6 7.03e+02 - 2.34e-01 9.90e-04f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 320r 8.9636313e+04 9.61e+02 5.59e+03 -0.6 8.27e+02 - 8.63e-01 1.73e-01f 1\n",
+ " 321r 9.0993769e+04 1.08e+03 5.48e+03 -0.6 7.71e+02 - 5.54e-01 3.35e-01f 1\n",
+ " 322r 9.2474307e+04 2.15e+03 5.68e+03 -0.6 4.81e+02 - 8.60e-01 5.30e-01f 1\n",
+ " 323r 9.3478773e+04 1.06e+03 1.62e+03 -0.6 1.77e+02 - 9.90e-01 8.80e-01h 1\n",
+ " 324r 9.3554925e+04 1.01e+02 2.92e+01 -0.6 1.84e+01 - 9.96e-01 1.00e+00h 1\n",
+ " 325r 9.3556224e+04 1.65e-01 1.08e-02 -0.6 2.08e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 326r 9.3556224e+04 1.65e-01 9.99e+02 -0.8 0.00e+00 - 0.00e+00 2.98e-10R 2\n",
+ " 327r 9.3571208e+04 1.65e-01 1.76e+04 -0.8 9.65e+02 - 8.70e-01 2.51e-03f 1\n",
+ " 328r 9.8897161e+04 1.50e+03 3.13e+03 -0.8 1.01e+03 - 9.59e-01 8.71e-01f 1\n",
+ " 329r 9.8336345e+04 5.99e+01 1.09e+02 -0.8 7.97e+01 - 9.90e-01 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 330r 9.8338262e+04 4.49e-01 4.27e-01 -0.8 3.37e+00 - 9.95e-01 1.00e+00h 1\n",
+ " 331r 9.8363923e+04 2.98e+02 1.32e+02 -1.5 9.78e+00 - 1.00e+00 9.63e-01f 1\n",
+ " 332r 1.0078662e+05 2.43e+02 1.46e+02 -1.5 6.27e+02 - 1.00e+00 6.63e-01h 1\n",
+ " 333r 1.0169690e+05 9.17e+01 9.25e+01 -1.5 1.53e+02 - 1.00e+00 7.05e-01h 1\n",
+ " 334r 1.0207081e+05 2.83e+00 2.90e+00 -1.5 3.21e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 335r 1.0207272e+05 1.92e-01 6.60e-02 -1.5 8.17e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 336r 1.0210277e+05 2.14e+02 1.11e+02 -2.2 5.08e+00 - 1.00e+00 9.77e-01f 1\n",
+ " 337r 1.0356247e+05 1.01e+03 5.29e+02 -2.2 5.28e+02 - 4.61e-01 2.44e-01h 1\n",
+ " 338r 1.0508487e+05 2.49e+03 4.03e+03 -2.2 3.97e+02 - 1.00e+00 3.31e-01h 1\n",
+ " 339r 1.0815887e+05 1.05e+03 6.46e+02 -2.2 2.67e+02 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 340r 1.0790832e+05 9.75e+01 1.58e+01 -2.2 2.29e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 341r 1.0799170e+05 2.00e+01 1.12e+00 -2.2 7.74e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 342r 1.0799969e+05 1.96e-01 1.83e-02 -2.2 7.42e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 343r 1.0799977e+05 1.96e-01 1.39e-06 -2.2 6.97e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 344r 1.0810014e+05 1.22e+00 2.91e+02 -5.0 2.10e+01 - 8.95e-01 4.72e-01f 1\n",
+ " 345r 1.0810406e+05 4.81e+00 2.50e+02 -5.0 8.05e-01 -2.0 3.48e-01 4.35e-01h 1\n",
+ " 346r 1.0823331e+05 4.73e+00 3.13e+02 -5.0 6.45e+03 - 2.53e-01 1.89e-02f 1\n",
+ " 347r 1.0723140e+05 1.69e+02 4.34e+02 -5.0 1.58e+03 - 3.99e-03 4.40e-01h 1\n",
+ " 348r 1.0742343e+05 1.63e+02 3.79e+02 -5.0 1.51e+03 - 6.57e-01 6.72e-02h 1\n",
+ " 349r 1.0834320e+05 2.55e+02 5.98e+02 -5.0 1.45e+03 - 1.56e-01 3.47e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 350r 1.0905675e+05 4.18e+02 9.23e+02 -5.0 1.03e+03 - 2.62e-02 7.65e-01h 1\n",
+ " 351r 1.1388747e+05 2.64e+03 2.51e+03 -5.0 1.45e+03 - 2.53e-01 6.38e-01h 1\n",
+ " 352r 1.1388763e+05 1.74e+03 4.40e+03 -5.0 7.03e-01 -2.5 8.02e-01 3.41e-01h 1\n",
+ " 353r 1.1388766e+05 1.73e+03 6.62e+03 -5.0 5.05e-01 -3.0 9.72e-01 9.80e-03h 1\n",
+ " 354r 1.1417543e+05 1.41e+03 5.38e+03 -5.0 7.36e+02 - 4.04e-02 1.84e-01h 1\n",
+ " 355r 1.1417550e+05 1.40e+03 5.61e+03 -5.0 1.38e+00 -3.4 1.00e+00 3.66e-03h 1\n",
+ " 356r 1.1550772e+05 4.07e+02 1.18e+03 -5.0 7.26e+02 - 4.25e-02 8.35e-01h 1\n",
+ " 357r 1.1552641e+05 2.23e+02 7.45e+02 -5.0 4.56e+00 -3.9 6.30e-01 4.52e-01h 1\n",
+ " 358r 1.1558163e+05 1.25e+02 4.23e+02 -5.0 1.37e+01 -4.4 9.96e-02 4.40e-01h 1\n",
+ " 359r 1.1577336e+05 1.09e+02 5.76e+02 -5.0 4.44e+01 -4.9 7.36e-02 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 360r 1.1577561e+05 2.45e+03 5.78e+02 -5.0 7.08e+00 -2.6 1.51e-01 1.00e+00h 1\n",
+ " 361r 1.1577726e+05 1.89e+03 2.65e+02 -5.0 4.00e+00 -3.1 7.58e-01 2.50e-01h 3\n",
+ " 362r 1.1578214e+05 1.53e+03 1.98e+02 -5.0 5.80e+00 -3.6 3.32e-01 2.50e-01h 3\n",
+ " 363r 1.1578330e+05 1.50e+03 1.65e+02 -5.0 8.12e+00 -4.1 1.00e+00 2.01e-02h 6\n",
+ " 364r 1.1578639e+05 1.48e+03 1.42e+02 -5.0 1.72e+01 -4.5 4.68e-01 1.80e-02h 6\n",
+ " 365r 1.1592763e+05 1.40e+03 1.17e+02 -5.0 5.18e+01 -5.0 5.33e-01 2.75e-01h 2\n",
+ " 366r 1.1617094e+05 1.53e+03 9.71e+01 -5.0 1.50e+02 -5.5 1.75e-01 1.67e-01h 1\n",
+ " 367r 1.1703261e+05 1.26e+03 8.04e+01 -5.0 5.54e+02 -6.0 3.66e-01 1.80e-01h 1\n",
+ " 368r 1.2972938e+05 4.18e+03 1.66e+02 -5.0 2.79e+03 -6.4 2.07e-01 7.16e-01h 1\n",
+ " 369r 1.2972954e+05 4.18e+03 3.20e+02 -5.0 8.11e+02 -6.0 3.98e-01 3.44e-05h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 370r 1.2975480e+05 4.04e+03 5.38e+02 -5.0 1.31e+02 -3.8 1.19e-02 3.23e-02h 1\n",
+ " 371r 1.2964740e+05 3.38e+03 4.90e+02 -5.0 1.09e+02 -4.3 1.67e-03 1.64e-01h 1\n",
+ " 372r 1.2966158e+05 2.40e+03 3.46e+02 -5.0 7.46e+00 -3.8 2.68e-01 2.91e-01h 1\n",
+ " 373r 1.2973030e+05 1.27e+03 1.84e+02 -5.0 2.25e+01 -4.3 1.00e+00 4.68e-01h 1\n",
+ " 374r 1.3017019e+05 5.33e+01 4.05e+02 -5.0 6.82e+01 -4.8 3.63e-01 1.00e+00h 1\n",
+ " 375r 1.3028200e+05 5.05e+01 3.67e+02 -5.0 2.24e+02 -5.3 1.06e-01 7.97e-02h 1\n",
+ " 376r 1.3069758e+05 4.92e+01 3.93e+02 -5.0 8.09e+02 -5.7 4.51e-02 7.81e-02h 1\n",
+ " 377r 1.3069758e+05 4.92e+01 3.90e+02 -5.0 2.98e+03 - 1.65e-02 3.13e-05h 7\n",
+ " 378r 1.3069919e+05 4.92e+01 4.31e+02 -5.0 1.68e+03 - 1.08e-01 3.30e-04h 5\n",
+ " 379r 1.3126228e+05 4.78e+01 4.36e+02 -5.0 9.27e+02 - 1.70e-01 7.48e-02h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 380r 1.3306851e+05 3.73e+01 4.13e+02 -5.0 9.00e+02 - 4.51e-01 2.48e-01h 1\n",
+ " 381r 1.3831309e+05 1.63e+02 4.11e+02 -5.0 6.80e+02 - 1.96e-01 9.55e-01h 1\n",
+ " 382r 1.3831686e+05 1.59e+02 4.88e+02 -5.0 2.62e+01 - 1.36e-02 2.42e-02h 1\n",
+ " 383r 1.3854324e+05 2.37e+01 6.34e+02 -5.0 2.99e+01 - 3.17e-01 9.37e-01H 1\n",
+ " 384r 1.3854435e+05 2.30e+01 5.98e+02 -5.0 1.92e+01 - 3.14e-02 6.34e-02h 1\n",
+ " 385r 1.3855788e+05 1.90e+02 3.37e+02 -5.0 1.61e+01 - 6.68e-01 1.00e+00h 1\n",
+ " 386r 1.3855814e+05 3.75e+00 1.12e+01 -5.0 9.39e-02 - 9.55e-01 1.00e+00h 1\n",
+ " 387r 1.3855815e+05 4.13e+00 6.63e+02 -5.0 1.20e+00 - 3.35e-01 1.68e-01H 1\n",
+ " 388r 1.3855831e+05 1.34e+02 1.92e+01 -5.0 8.03e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 389r 1.3855837e+05 9.15e+00 1.46e+00 -5.0 1.61e-01 - 1.00e+00 1.00e+00h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 390r 1.3855836e+05 2.45e-01 1.28e+00 -5.0 2.43e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 391r 1.3855836e+05 2.45e-01 3.53e-02 -5.0 1.11e-03 - 1.00e+00 1.00e+00h 1\n",
+ " 392r 1.3855836e+05 2.45e-01 1.21e-06 -5.0 2.41e-05 - 1.00e+00 1.00e+00h 1\n",
+ " 393r 1.3855744e+05 2.08e+01 5.23e+02 -7.5 5.05e-01 - 8.64e-01 7.40e-01f 1\n",
+ " 394r 1.3855744e+05 1.51e+01 9.25e+02 -7.5 1.29e+00 - 2.87e-01 3.84e-01h 1\n",
+ " 395r 1.3855750e+05 8.64e+00 8.72e+02 -7.5 6.46e-01 - 4.26e-01 4.61e-01h 1\n",
+ " 396r 1.3855752e+05 4.84e+00 4.49e+02 -7.5 3.22e-01 - 6.28e-01 6.53e-01h 1\n",
+ " 397r 1.3855749e+05 3.20e+00 4.97e+02 -7.5 1.50e-01 - 2.97e-01 4.40e-01h 1\n",
+ " 398r 1.3855747e+05 1.96e+00 6.90e+02 -7.5 3.00e-02 -2.6 4.68e-02 3.88e-01h 1\n",
+ " 399r 1.3855745e+05 5.42e-01 5.37e+02 -7.5 2.62e-02 -3.1 3.97e-01 7.24e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 400r 1.3855744e+05 4.46e-01 3.86e+02 -7.5 2.77e-02 -2.7 2.69e-01 1.80e-01h 1\n",
+ " 401r 1.3855744e+05 4.34e-01 5.63e+02 -7.5 1.66e-01 -3.1 2.98e-01 2.76e-02h 1\n",
+ " 402r 1.3855738e+05 4.70e+00 6.16e+02 -7.5 6.32e-01 - 1.00e+00 2.87e-01h 1\n",
+ " 403r 1.3855735e+05 5.14e+00 3.38e+02 -7.5 3.82e-01 - 1.00e+00 2.07e-01h 1\n",
+ " 404r 1.3855722e+05 1.35e+01 1.78e+00 -7.5 2.46e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 405r 1.3855722e+05 2.45e-01 1.38e-02 -7.5 1.58e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 406r 1.3855722e+05 2.45e-01 2.29e-04 -7.5 3.59e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 406\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 1.3855721777671148e+05 1.3855721777671148e+05\n",
+ "Dual infeasibility......: 6.9379110321402369e+00 6.9379110321402369e+00\n",
+ "Constraint violation....: 2.4525985132130276e-01 2.4525985132130276e-01\n",
+ "Complementarity.........: 3.1231128787715433e-08 3.1231128787715433e-08\n",
+ "Overall NLP error.......: 6.9379110321402369e+00 6.9379110321402369e+00\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 723\n",
+ "Number of objective gradient evaluations = 182\n",
+ "Number of equality constraint evaluations = 723\n",
+ "Number of inequality constraint evaluations = 723\n",
+ "Number of equality constraint Jacobian evaluations = 446\n",
+ "Number of inequality constraint Jacobian evaluations = 446\n",
+ "Number of Lagrangian Hessian evaluations = 407\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.635\n",
+ "Total CPU secs in NLP function evaluations = 0.068\n",
+ "\n",
+ "EXIT: Converged to a point of local infeasibility. Problem may be infeasible.\n"
+ ]
+ }
+ ],
"source": [
"results = solver.solve(m, tee=True)"
]
@@ -1275,16 +4822,107 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization Results\n",
+ "### 8.1 Optimization Results\n",
"\n",
"Display the results and product specifications"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 62,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.074231Z",
+ "start_time": "2025-11-20T21:46:18.053675Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 138557.21777671148\n",
+ "\n",
+ "Product flow rate and purity in F102\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -0.0040595 : watt : False : (None, None)\n",
+ " Pressure Change : -2.4174e+05 : pascal : False : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate Liq mole / second 4.8078e-08 - - \n",
+ " Total Molar Flowrate Vap mole / second 1.0000e-08 - - \n",
+ " Total Mole Fraction ('Liq', 'benzene') dimensionless 0.91034 - - \n",
+ " Total Mole Fraction ('Liq', 'toluene') dimensionless 0.089660 - - \n",
+ " Total Mole Fraction ('Vap', 'benzene') dimensionless 0.95213 - - \n",
+ " Total Mole Fraction ('Vap', 'toluene') dimensionless 0.041932 - - \n",
+ " Total Mole Fraction ('Vap', 'hydrogen') dimensionless 0.0029849 - - \n",
+ " Total Mole Fraction ('Vap', 'methane') dimensionless 0.0029553 - - \n",
+ " Temperature kelvin 432.09 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 8.7385e-09 \n",
+ " flow_mol_phase Vap mole / second - 1.0000e-12 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.67175 0.67175 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.32825 0.32825 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.47214 0.47214 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.085798 0.085798 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.22083 0.22083 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.22124 0.22124 \n",
+ " temperature kelvin - 344.53 344.53 \n",
+ " pressure pascal - 1.0826e+05 1.0826e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8462216452944548\n",
+ "\n",
+ "Overhead loss in F101\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F101 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -36576. : watt : False : (None, None)\n",
+ " Pressure Change : 0.0000 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate Liq mole / second 0.17702 - - \n",
+ " Total Molar Flowrate Vap mole / second 0.068244 - - \n",
+ " Total Mole Fraction ('Liq', 'benzene') dimensionless 1.1730e-07 - - \n",
+ " Total Mole Fraction ('Liq', 'toluene') dimensionless 1.0000 - - \n",
+ " Total Mole Fraction ('Vap', 'benzene') dimensionless 2.4279e-07 - - \n",
+ " Total Mole Fraction ('Vap', 'toluene') dimensionless 1.0000 - - \n",
+ " Total Mole Fraction ('Vap', 'hydrogen') dimensionless 1.0000e-20 - - \n",
+ " Total Mole Fraction ('Vap', 'methane') dimensionless 1.0000e-20 - - \n",
+ " Temperature kelvin 800.00 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 4.8078e-08 \n",
+ " flow_mol_phase Vap mole / second - 1.0000e-12 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.91034 0.91034 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.089660 0.089660 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.95213 0.95213 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.041932 0.041932 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.0029849 0.0029849 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.0029553 0.0029553 \n",
+ " temperature kelvin - 432.09 432.09 \n",
+ " pressure pascal - 3.5000e+05 3.5000e+05 \n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))\n",
"\n",
@@ -1310,32 +4948,47 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "execution_count": 63,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.106001Z",
+ "start_time": "2025-11-20T21:46:18.101768Z"
+ }
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Optimal Values:\n",
+ "\n",
+ "H101 outlet temperature = 500.000 K\n",
+ "\n",
+ "R101 outlet temperature = 800.000 K\n",
+ "\n",
+ "F101 outlet temperature = 432.088 K\n",
+ "\n",
+ "F102 outlet temperature = 344.531 K\n",
+ "F102 outlet pressure = 108260.028 Pa\n",
+ "\n"
+ ]
+ }
+ ],
"source": [
- "print(\"Optimal Values\")\n",
- "print()\n",
+ "print(\n",
+ " f\"\"\"Optimal Values:\n",
"\n",
- "print(\"H101 outlet temperature = \", value(m.fs.H101.outlet.temperature[0]), \"K\")\n",
+ "H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"R101 outlet temperature = \", value(m.fs.R101.outlet.temperature[0]), \"K\")\n",
+ "R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F101 outlet temperature = \", value(m.fs.F101.vap_outlet.temperature[0]), \"K\")\n",
+ "F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F102 outlet temperature = \", value(m.fs.F102.vap_outlet.temperature[0]), \"K\")\n",
- "print(\"F102 outlet pressure = \", value(m.fs.F102.vap_outlet.pressure[0]), \"Pa\")"
+ "F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K\n",
+ "F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa\n",
+ "\"\"\"\n",
+ ")"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {
@@ -1355,7 +5008,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.12"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_exercise.ipynb b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_exercise.ipynb
index bcdc90bb..e8169a6a 100644
--- a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_exercise.ipynb
+++ b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_exercise.ipynb
@@ -2,18 +2,20 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"header",
"hide-cell"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:04.904828Z",
+ "start_time": "2025-11-20T21:46:04.900352Z"
+ }
},
- "outputs": [],
"source": [
"###############################################################################\n",
"# The Institute for the Design of Advanced Energy Systems Integrated Platform\n",
- "# Framework (IDAES IP) was produced under the DOE Institute for the\n",
+ "# Framework (idaes IP) was produced under the DOE Institute for the\n",
"# Design of Advanced Energy Systems (IDAES).\n",
"#\n",
"# Copyright (c) 2018-2023 by the software owners: The Regents of the\n",
@@ -23,7 +25,9 @@
"# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n",
"# for full copyright and license information.\n",
"###############################################################################"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 1
},
{
"cell_type": "markdown",
@@ -32,20 +36,34 @@
"\n",
"# HDA Flowsheet Simulation and Optimization\n",
"\n",
- "Author: Jaffer Ghouse \n",
- "Maintainer: Brandon Paul \n",
- "Updated: 2023-06-01 \n",
+ "Author: Jaffer Ghouse
\n",
+ "Maintainer: Tanner Polley
\n",
+ "Updated: 2025-11-19\n",
"\n",
"## Learning outcomes\n",
"\n",
"\n",
"- Construct a steady-state flowsheet using the IDAES unit model library\n",
- "- Connecting unit models in a flowsheet using Arcs\n",
+ "- Connecting unit models in a flowsheet using Arcs\n",
"- Using the SequentialDecomposition tool to initialize a flowsheet with recycle\n",
- "- Fomulate and solve an optimization problem\n",
+ "- Formulate and solve an optimization problem\n",
" - Defining an objective function\n",
" - Setting variable bounds\n",
- " - Adding additional constraints \n",
+ " - Adding additional constraints\n",
+ "\n",
+ "\n",
+ "The general workflow of setting up an IDAES flowsheet is the following:\n",
+ "\n",
+ " 1 Importing Modules
\n",
+ " 2 Building a Model
\n",
+ " 3 Scaling the Model
\n",
+ " 4 Specifying the Model
\n",
+ " 5 Initializing the Model
\n",
+ " 6 Solving the Model
\n",
+ " 7 Analyzing and Visualizing the Results
\n",
+ " 8 Optimizing the Model
\n",
+ "\n",
+ "We will complete each of these steps as well as demonstrate analyses on this model through some examples and exercises.\n",
"\n",
"\n",
"## Problem Statement\n",
@@ -81,10 +99,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required pyomo and idaes components\n",
+ "## 1 Importing Modules\n",
+ "### 1.1 Importing required Pyomo and IDAES components\n",
"\n",
"\n",
- "To construct a flowsheet, we will need several components from the pyomo and idaes package. Let us first import the following components from Pyomo:\n",
+ "To construct a flowsheet, we will need several components from the Pyomo and IDAES package. Let us first import the following components from Pyomo:\n",
"- Constraint (to write constraints)\n",
"- Var (to declare variables)\n",
"- ConcreteModel (to create the concrete model object)\n",
@@ -95,14 +114,17 @@
"- Arc (to connect two unit models)\n",
"- SequentialDecomposition (to initialize the flowsheet in a sequential mode)\n",
"\n",
- "For further details on these components, please refer to the pyomo documentation: https://pyomo.readthedocs.io/en/stable/\n"
+ "For further details on these components, please refer to the Pyomo documentation: https://Pyomo.readthedocs.io/en/stable/\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:05.294578Z",
+ "start_time": "2025-11-20T21:46:04.908296Z"
+ }
+ },
"source": [
"from pyomo.environ import (\n",
" Constraint,\n",
@@ -110,40 +132,51 @@
" ConcreteModel,\n",
" Expression,\n",
" Objective,\n",
- " SolverFactory,\n",
" TransformationFactory,\n",
" value,\n",
")\n",
"from pyomo.network import Arc, SequentialDecomposition"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "From idaes, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "From IDAES, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "- Feed\n",
"- Mixer\n",
"- Heater\n",
"- StoichiometricReactor\n",
"- **Flash**\n",
"- Separator (splitter) \n",
- "- PressureChanger"
+ "- PressureChanger\n",
+ "- Product"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:06.806301Z",
+ "start_time": "2025-11-20T21:46:05.297760Z"
+ }
+ },
"source": [
"from idaes.core import FlowsheetBlock"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 3
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.936732Z",
+ "start_time": "2025-11-20T21:46:09.883054Z"
+ }
+ },
"source": [
"from idaes.models.unit_models import (\n",
" PressureChanger,\n",
@@ -151,8 +184,14 @@
" Separator as Splitter,\n",
" Heater,\n",
" StoichiometricReactor,\n",
- ")"
- ]
+ " Feed,\n",
+ " Product,\n",
+ ")\n",
+ "from idaes.core.util.exceptions import InitializationError\n",
+ "import idaes.logger as idaeslog"
+ ],
+ "outputs": [],
+ "execution_count": 4
},
{
"cell_type": "markdown",
@@ -166,16 +205,20 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.952476Z",
+ "start_time": "2025-11-20T21:46:09.949367Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: import flash model from idaes.models.unit_models"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 5
},
{
"cell_type": "markdown",
@@ -186,24 +229,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.976914Z",
+ "start_time": "2025-11-20T21:46:09.971944Z"
+ }
+ },
"source": [
"from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n",
"from idaes.core.util.model_statistics import degrees_of_freedom\n",
"\n",
"# Import idaes logger to set output levels\n",
- "import idaes.logger as idaeslog\n",
- "from idaes.core.solvers import get_solver\n",
- "from idaes.core.util.exceptions import InitializationError"
- ]
+ "from idaes.core.solvers import get_solver"
+ ],
+ "outputs": [],
+ "execution_count": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required thermo and reaction package\n",
+ "### 1.2 Importing required thermo and reaction package\n",
"\n",
"The final set of imports are to import the thermo and reaction package for the HDA process. We have created a custom thermo package that assumes Ideal Gas with support for VLE. \n",
"\n",
@@ -218,33 +264,49 @@
]
},
{
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.017098Z",
+ "start_time": "2025-11-20T21:46:09.981997Z"
+ }
+ },
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
"source": [
- "from idaes_examples.mod.hda import hda_ideal_VLE as thermo_props\n",
- "from idaes_examples.mod.hda import hda_reaction as reaction_props"
- ]
+ "from idaes.models.properties.modular_properties.base.generic_property import (\n",
+ " GenericParameterBlock,\n",
+ ")\n",
+ "from idaes.models.properties.modular_properties.base.generic_reaction import (\n",
+ " GenericReactionParameterBlock,\n",
+ ")\n",
+ "from idaes_examples.mod.hda.hda_ideal_VLE_modular import thermo_config\n",
+ "from idaes_examples.mod.hda.hda_reaction_modular import reaction_config"
+ ],
+ "outputs": [],
+ "execution_count": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Constructing the Flowsheet\n",
+ "## 2 Constructing the Flowsheet\n",
"\n",
- "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block as we did in module 1. "
+ "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.031538Z",
+ "start_time": "2025-11-20T21:46:10.025904Z"
+ }
+ },
"source": [
"m = ConcreteModel()\n",
"m.fs = FlowsheetBlock(dynamic=False)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 9
},
{
"cell_type": "markdown",
@@ -255,34 +317,46 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.066746Z",
+ "start_time": "2025-11-20T21:46:10.035131Z"
+ }
+ },
"source": [
- "m.fs.thermo_params = thermo_props.HDAParameterBlock()\n",
- "m.fs.reaction_params = reaction_props.HDAReactionParameterBlock(\n",
- " property_package=m.fs.thermo_params\n",
+ "m.fs.thermo_params = GenericParameterBlock(**thermo_config)\n",
+ "m.fs.reaction_params = GenericReactionParameterBlock(\n",
+ " property_package=m.fs.thermo_params, **reaction_config\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding Unit Models\n",
+ "### 2.1 Adding Unit Models\n",
"\n",
- "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Mixer (assigned a name M101) and a Heater (assigned a name H101). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the Mixer unit model here is given a `list` consisting of names to the three inlets. "
+ "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Feed (assigned a name `I101` for Inlet), `Mixer` (assigned a name `M101`) and a `Heater` (assigned a name `H101`). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the `Mixer` unit model here must be specified the number of inlets that it will take in and the `Heater` can have specific settings enabled such as `has_pressure_change` or `has_phase_equilibrium`."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.114600Z",
+ "start_time": "2025-11-20T21:46:10.071845Z"
+ }
+ },
"source": [
+ "m.fs.I101 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.I102 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
"m.fs.M101 = Mixer(\n",
" property_package=m.fs.thermo_params,\n",
- " inlet_list=[\"toluene_feed\", \"hydrogen_feed\", \"vapor_recycle\"],\n",
+ " num_inlets=3,\n",
")\n",
"\n",
"m.fs.H101 = Heater(\n",
@@ -290,11 +364,17 @@
" has_pressure_change=False,\n",
" has_phase_equilibrium=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 11
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"
Inline Exercise:\n",
@@ -311,16 +391,20 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.121709Z",
+ "start_time": "2025-11-20T21:46:10.119134Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add reactor with the specifications above"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 12
},
{
"cell_type": "markdown",
@@ -336,29 +420,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.167357Z",
+ "start_time": "2025-11-20T21:46:10.149935Z"
+ }
+ },
"source": [
"m.fs.F101 = Flash(\n",
" property_package=m.fs.thermo_params,\n",
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us now add the Splitter(S101), PressureChanger(C101) and the second Flash(F102). "
+ "Let us now add the Splitter(S101) with specific names for its output (purge and recycle), PressureChanger(C101) and the second Flash(F102)."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.211911Z",
+ "start_time": "2025-11-20T21:46:10.173255Z"
+ }
+ },
"source": [
"m.fs.S101 = Splitter(\n",
" property_package=m.fs.thermo_params,\n",
@@ -378,52 +470,97 @@
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 15
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Connecting Unit Models using Arcs\n",
- "\n",
- "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the mixer(M101) to the inlet of the heater(H101). "
+ "Last, we will add the three Product blocks (P101, P102, P103). We use `Feed` blocks and `Product` blocks for convenience with reporting stream summaries and consistency"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.226989Z",
+ "start_time": "2025-11-20T21:46:10.216839Z"
+ }
+ },
+ "source": [
+ "m.fs.P101 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P102 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P103 = Product(property_package=m.fs.thermo_params)"
+ ],
"outputs": [],
+ "execution_count": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ "### 2.2 Connecting Unit Models using Arcs\n",
+ "\n",
+ "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a Pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the inlets (I101, I102) to the inlet of the mixer (M101) and outlet of the mixer to the inlet of the heater(H101)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- " \n",
- "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.235541Z",
+ "start_time": "2025-11-20T21:46:10.231058Z"
+ }
+ },
+ "source": [
+ "m.fs.s01 = Arc(source=m.fs.I101.outlet, destination=m.fs.M101.inlet_1)\n",
+ "m.fs.s02 = Arc(source=m.fs.I102.outlet, destination=m.fs.M101.inlet_2)\n",
+ "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
+ "source": [
"
\n",
"Inline Exercise:\n",
- "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide. \n",
- "
\n",
- "\n"
+ "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide.\n",
+ "
"
]
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.245319Z",
+ "start_time": "2025-11-20T21:46:10.239913Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Connect the H101 outlet to R101 inlet"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 18
},
{
"cell_type": "markdown",
@@ -434,17 +571,45 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.264461Z",
+ "start_time": "2025-11-20T21:46:10.258555Z"
+ }
+ },
"source": [
"m.fs.s05 = Arc(source=m.fs.R101.outlet, destination=m.fs.F101.inlet)\n",
"m.fs.s06 = Arc(source=m.fs.F101.vap_outlet, destination=m.fs.S101.inlet)\n",
+ "m.fs.s07 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)\n",
"m.fs.s08 = Arc(source=m.fs.S101.recycle, destination=m.fs.C101.inlet)\n",
- "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.vapor_recycle)\n",
- "m.fs.s10 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)"
+ "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.inlet_3)"
+ ],
+ "outputs": [],
+ "execution_count": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Last we will connect the outlet streams to the inlets of the Product blocks (P101, P102, P103)"
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.274505Z",
+ "start_time": "2025-11-20T21:46:10.268918Z"
+ }
+ },
+ "source": [
+ "m.fs.s10 = Arc(source=m.fs.F102.vap_outlet, destination=m.fs.P101.inlet)\n",
+ "m.fs.s11 = Arc(source=m.fs.F102.liq_outlet, destination=m.fs.P102.inlet)\n",
+ "m.fs.s12 = Arc(source=m.fs.S101.purge, destination=m.fs.P103.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 21
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -454,20 +619,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.303264Z",
+ "start_time": "2025-11-20T21:46:10.278714Z"
+ }
+ },
"source": [
"TransformationFactory(\"network.expand_arcs\").apply_to(m)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 22
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding expressions to compute purity and operating costs\n",
+ "### 2.3 Adding expressions to compute purity and operating costs\n",
"\n",
- "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/pyomo_modeling_components/Expressions.html\n",
+ "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/explanation/modeling/network.html.\n",
"\n",
"For this flowsheet, we are interested in computing the purity of the product Benzene stream (i.e. the mole fraction) and the operating cost which is a sum of the cooling and heating cost. "
]
@@ -481,18 +651,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.312336Z",
+ "start_time": "2025-11-20T21:46:10.309074Z"
+ }
+ },
"source": [
"m.fs.purity = Expression(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
" / (\n",
- " m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " + m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
+ " + m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 23
},
{
"cell_type": "markdown",
@@ -503,14 +682,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.323538Z",
+ "start_time": "2025-11-20T21:46:10.318119Z"
+ }
+ },
"source": [
"m.fs.cooling_cost = Expression(\n",
" expr=0.212e-7 * (-m.fs.F101.heat_duty[0]) + 0.212e-7 * (-m.fs.R101.heat_duty[0])\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 24
},
{
"cell_type": "markdown",
@@ -527,14 +711,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.336983Z",
+ "start_time": "2025-11-20T21:46:10.328380Z"
+ }
+ },
"source": [
"m.fs.heating_cost = Expression(\n",
" expr=2.2e-7 * m.fs.H101.heat_duty[0] + 1.9e-7 * m.fs.F102.heat_duty[0]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 25
},
{
"cell_type": "markdown",
@@ -545,64 +734,94 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.345607Z",
+ "start_time": "2025-11-20T21:46:10.341996Z"
+ }
+ },
"source": [
"m.fs.operating_cost = Expression(\n",
" expr=(3600 * 24 * 365 * (m.fs.heating_cost + m.fs.cooling_cost))\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 26
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing feed conditions\n",
+ "## 4 Specifying the Model\n",
+ "### 4.1 Fixing feed conditions\n",
"\n",
"Let us first check how many degrees of freedom exist for this flowsheet using the `degrees_of_freedom` tool we imported earlier. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.376586Z",
+ "start_time": "2025-11-20T21:46:10.349694Z"
+ }
+ },
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "29\n"
+ ]
+ }
+ ],
+ "execution_count": 27
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "We will now be fixing the toluene feed stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing. "
+ "We will now be fixing the toluene feed (`I101`) stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.418520Z",
+ "start_time": "2025-11-20T21:46:10.414167Z"
+ }
+ },
"source": [
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(0.30)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.temperature.fix(303.2)\n",
- "m.fs.M101.toluene_feed.pressure.fix(350000)"
- ]
+ "F_liq_toluene = 0.30\n",
+ "F_liq_non_zero = 1e-5\n",
+ "\n",
+ "F_vap_I101 = F_liq_non_zero * 4\n",
+ "F_liq_I101 = F_liq_toluene + F_liq_non_zero\n",
+ "\n",
+ "m.fs.I101.flow_mol_phase[0, \"Vap\"].fix(F_vap_I101)\n",
+ "m.fs.I101.flow_mol_phase[0, \"Liq\"].fix(F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_toluene / F_liq_I101)\n",
+ "m.fs.I101.temperature.fix(303.2)\n",
+ "m.fs.I101.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 29
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
- "Similarly, let us fix the hydrogen feed to the following conditions in the next cell:\n",
+ "Similarly, let us fix the hydrogen feed (`I102`) to the following conditions in the next cell:\n",
" \n",
" - FH2 = 0.30 mol/s
\n",
" - FCH4 = 0.02 mol/s
\n",
@@ -615,39 +834,59 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.429169Z",
+ "start_time": "2025-11-20T21:46:10.422052Z"
+ }
+ },
"source": [
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(0.30)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(0.02)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.temperature.fix(303.2)\n",
- "m.fs.M101.hydrogen_feed.pressure.fix(350000)"
- ]
+ "F_vap_hydrogen = 0.30\n",
+ "F_vap_methane = 0.020\n",
+ "\n",
+ "F_vap_non_zero = 1e-5\n",
+ "F_liq_non_zero = F_vap_non_zero\n",
+ "\n",
+ "F_vap_I102 = F_vap_hydrogen + F_vap_methane + 2 * F_vap_non_zero\n",
+ "F_liq_I102 = 2 * F_vap_non_zero\n",
+ "\n",
+ "m.fs.I102.flow_mol_phase[0, \"Vap\"].fix(F_vap_I102)\n",
+ "m.fs.I102.flow_mol_phase[0, \"Liq\"].fix(F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_vap_hydrogen / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_vap_methane / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "\n",
+ "m.fs.I102.temperature.fix(303.2)\n",
+ "m.fs.I102.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 30
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing unit model specifications\n",
+ "### 4.2 Fixing unit model specifications\n",
"\n",
"Now that we have fixed our inlet feed conditions, we will now be fixing the operating conditions for the unit models in the flowsheet. Let us set set the H101 outlet temperature to 600 K. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.441145Z",
+ "start_time": "2025-11-20T21:46:10.433569Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.fix(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 31
},
{
"cell_type": "markdown",
@@ -658,23 +897,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.453419Z",
+ "start_time": "2025-11-20T21:46:10.445363Z"
+ }
+ },
"source": [
"m.fs.R101.conversion = Var(initialize=0.75, bounds=(0, 1))\n",
"\n",
"m.fs.R101.conv_constraint = Constraint(\n",
- " expr=m.fs.R101.conversion * m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " expr=m.fs.R101.conversion\n",
+ " * (m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"])\n",
" == (\n",
- " m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
- " - m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"]\n",
+ " - m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")\n",
"\n",
"m.fs.R101.conversion.fix(0.75)\n",
"m.fs.R101.heat_duty.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 32
},
{
"cell_type": "markdown",
@@ -685,17 +932,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.463025Z",
+ "start_time": "2025-11-20T21:46:10.457476Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature.fix(325.0)\n",
"m.fs.F101.deltaP.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 33
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"
Inline Exercise:\n",
@@ -711,16 +967,20 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.472509Z",
+ "start_time": "2025-11-20T21:46:10.467229Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set conditions for Flash F102"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 34
},
{
"cell_type": "markdown",
@@ -731,17 +991,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.491620Z",
+ "start_time": "2025-11-20T21:46:10.485173Z"
+ }
+ },
"source": [
"m.fs.S101.split_fraction[0, \"purge\"].fix(0.2)\n",
"m.fs.C101.outlet.pressure.fix(350000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 36
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -753,41 +1022,58 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.503512Z",
+ "start_time": "2025-11-20T21:46:10.495838Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: print the degrees of freedom"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 37
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Initialization\n",
+ "## 5 Initializing the Model\n",
"\n",
"\n",
- "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet.\n",
"\n",
- " \n"
+ "When a flowsheet contains a recycle loop, the outlet of a downstream unit becomes the inlet of an upstream unit, creating a cyclic dependency that prevents straightforward calculation of all stream conditions. The tear‐stream method is necessary because it “breaks” this loop: you select one recycle stream as the tear, assign it an initial guess, and then solve the rest of the flowsheet as if it were acyclic. Once the downstream units compute their outputs, you compare the calculated value of the torn stream to your initial guess and iteratively adjust until they coincide. Without tearing, the solver cannot establish a proper topological sequence or drive the recycle to convergence, making initialization—and ultimately steady‐state convergence—impossible.\n",
+ "\n",
+ "It is important to determine the tear stream for a flowsheet which will be demonstrated below.\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "Currently, there are two methods of initializing a full flowsheet: using the sequential decomposition tool, or manually propagating through the flowsheet. Both methods will be shown.\n",
+ "\n",
+ "### 5.1 Sequential Decomposition\n",
+ "\n",
+ "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet. Sequential Decomposition is a tool from Pyomo where the documentation can be found here https://Pyomo.readthedocs.io/en/stable/explanation/modeling/network.html#sequential-decomposition\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us first create an object for the SequentialDecomposition and specify our options for this. "
+ "Let us first create an object for the SequentialDecomposition and specify our options for this. We can also create a graph for our flowsheet to determine the tear set and order."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.578789Z",
+ "start_time": "2025-11-20T21:46:10.574025Z"
+ }
+ },
"source": [
"seq = SequentialDecomposition()\n",
"seq.options.select_tear_method = \"heuristic\"\n",
@@ -798,7 +1084,9 @@
"G = seq.create_graph(m)\n",
"heuristic_tear_set = seq.tear_set_arcs(G, method=\"heuristic\")\n",
"order = seq.calculation_order(G)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 40
},
{
"cell_type": "markdown",
@@ -809,13 +1097,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.588985Z",
+ "start_time": "2025-11-20T21:46:10.581810Z"
+ }
+ },
+ "source": [
"for o in heuristic_tear_set:\n",
" print(o.name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.s03\n"
+ ]
+ }
+ ],
+ "execution_count": 41
},
{
"cell_type": "markdown",
@@ -826,15 +1127,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
- "scrolled": true
+ "scrolled": true,
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.602315Z",
+ "start_time": "2025-11-20T21:46:10.599259Z"
+ }
},
- "outputs": [],
"source": [
"for o in order:\n",
" print(o[0].name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.I101\n",
+ "fs.R101\n",
+ "fs.F101\n",
+ "fs.S101\n",
+ "fs.C101\n",
+ "fs.M101\n"
+ ]
+ }
+ ],
+ "execution_count": 42
},
{
"cell_type": "markdown",
@@ -845,25 +1163,30 @@
" \n",
"\n",
"\n",
- "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. We will need to provide a reasonable guess for this."
+ "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. You can see this shown in the picture of the flowsheet above as the outlet of the mixer as the two lines crossing it identifying it as the tear stream. We will need to provide a reasonable guess for this."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.620357Z",
+ "start_time": "2025-11-20T21:46:10.617116Z"
+ }
+ },
"source": [
"tear_guesses = {\n",
- " \"flow_mol_phase_comp\": {\n",
- " (0, \"Vap\", \"benzene\"): 1e-5,\n",
- " (0, \"Vap\", \"toluene\"): 1e-5,\n",
- " (0, \"Vap\", \"hydrogen\"): 0.30,\n",
- " (0, \"Vap\", \"methane\"): 0.02,\n",
- " (0, \"Liq\", \"benzene\"): 1e-5,\n",
- " (0, \"Liq\", \"toluene\"): 0.30,\n",
- " (0, \"Liq\", \"hydrogen\"): 1e-5,\n",
- " (0, \"Liq\", \"methane\"): 1e-5,\n",
+ " \"flow_mol_phase\": {\n",
+ " (0, \"Liq\"): F_liq_I101,\n",
+ " (0, \"Vap\"): F_vap_I102,\n",
+ " },\n",
+ " \"mole_frac_phase_comp\": {\n",
+ " (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ " (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ " (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ " (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
" },\n",
" \"temperature\": {0: 303},\n",
" \"pressure\": {0: 350000},\n",
@@ -871,7 +1194,9 @@
"\n",
"# Pass the tear_guess to the SD tool\n",
"seq.set_guesses_for(m.fs.H101.inlet, tear_guesses)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 43
},
{
"cell_type": "markdown",
@@ -882,9 +1207,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.638254Z",
+ "start_time": "2025-11-20T21:46:10.635136Z"
+ }
+ },
"source": [
"def function(unit):\n",
" try:\n",
@@ -893,7 +1221,9 @@
" except InitializationError:\n",
" solver = get_solver()\n",
" solver.solve(unit)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 44
},
{
"cell_type": "markdown",
@@ -904,99 +1234,1132 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.022425Z",
+ "start_time": "2025-11-20T21:46:10.648251Z"
+ }
+ },
+ "source": "seq.run(m, function)",
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal -
\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "WARNING: Wegstein failed to converge in 3 iterations\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n"
+ ]
+ }
+ ],
+ "execution_count": 45
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### 5.2 Manual Propagation Method\n",
+ "\n",
+ "This method uses a more direct approach to initialize the flowsheet, utilizing the updated initializer method and propagating manually through the flowsheet and solving for the tear stream directly.\n",
+ "Lets first import a helper function that will help us manually propagate and step through the flowsheet"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.069766Z",
+ "start_time": "2025-11-20T21:46:17.066725Z"
+ }
+ },
+ "source": [
+ "from idaes.core.util.initialization import propagate_state"
+ ],
+ "outputs": [],
+ "execution_count": 46
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can setup our initial guesses for the tear stream which we know is the outlet of the `Mixer` or the inlet of the `Heater`. We can use the same initial guesses used in the first method. We also want to ensure that the degrees of freedom are consistent while we manually initialize the model.\n",
+ "\n",
+ "We will first ensure that are current degrees of freedom is still zero"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.080343Z",
+ "start_time": "2025-11-20T21:46:17.077382Z"
+ }
+ },
+ "source": "# print(f\"The DOF is {degrees_of_freedom(m)} initially\")",
+ "outputs": [],
+ "execution_count": 47
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can manually deactivate the tear stream, creating a separation between the `Mixer` and `Heater`. This should reduce the degrees of freedom by 10 since the inlet of the `Heater` now contains no values to solve the unit model. To deactivate a stream, simply use `m.fs.s03_expanded.deactivate()`. This expanded stream is just a different version of the `Arc` stream that is able to be deactivated."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.093180Z",
+ "start_time": "2025-11-20T21:46:17.089671Z"
+ }
+ },
+ "source": [
+ "# m.fs.s03_expanded.deactivate()\n",
+ "#\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream\")"
+ ],
+ "outputs": [],
+ "execution_count": 48
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can provide the `Heater` inlet 10 guess values to bring the degrees of freedom back to 0 and start the manual initialization process. We can run this convenient loop to assign each of these guesses to the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.105510Z",
+ "start_time": "2025-11-20T21:46:17.099824Z"
+ }
+ },
+ "source": [
+ "# tear_guesses = {\n",
+ "# \"flow_mol_phase\": {\n",
+ "# (0, \"Liq\"): F_liq_I101,\n",
+ "# (0, \"Vap\"): F_vap_I102,\n",
+ "#\n",
+ "# },\n",
+ "# \"mole_frac_phase_comp\": {\n",
+ "# (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ "# (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ "# (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
+ "# },\n",
+ "# \"temperature\": {0: 303},\n",
+ "# \"pressure\": {0: 350000},\n",
+ "# }\n",
+ "#\n",
+ "# for k, v in tear_guesses.items():\n",
+ "# for k1, v1 in v.items():\n",
+ "# getattr(m.fs.s03.destination, k)[k1].fix(v1)\n",
+ "#\n",
+ "# DOF_initial = degrees_of_freedom(m)\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after providing the initial guesses\")"
+ ],
+ "outputs": [],
+ "execution_count": 49
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "The next step is to manually initialize each unit model starting from the `Heater` and then propagate the connection between it and the next unit model. This manual process ensures a strict order to the user's specification if that is desired. The current standard for initializing a unit model is to use an initializer object most compatible for that unit model. This can most often be done by utilizing the `default_initializer()` method attached to the unit model and then to call the `initialize()` method with the unit model as the argument."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.117110Z",
+ "start_time": "2025-11-20T21:46:17.113630Z"
+ }
+ },
+ "source": [
+ "# m.fs.H101.default_initializer().initialize(m.fs.H101) # Initialize Heater\n",
+ "# propagate_state(m.fs.s04) # Establish connection between Heater and Reactor\n",
+ "#\n",
+ "# m.fs.R101.default_initializer().initialize(m.fs.R101) # Initialize Reactor\n",
+ "# propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit\n",
+ "#\n",
+ "# m.fs.F101.default_initializer().initialize(m.fs.F101) # Initialize First Flash Unit\n",
+ "# propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter\n",
+ "# propagate_state(m.fs.s07) # Establish connection between First Flash Unit and Second Flash Unit\n",
+ "#\n",
+ "# m.fs.S101.default_initializer().initialize(m.fs.S101) # Initialize Splitter\n",
+ "# propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor\n",
+ "#\n",
+ "# m.fs.C101.default_initializer().initialize(m.fs.C101) # Initialize Compressor\n",
+ "# propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer\n",
+ "#\n",
+ "# m.fs.I101.default_initializer().initialize(m.fs.I101) # Initialize Toluene Inlet\n",
+ "# propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.I102.default_initializer().initialize(m.fs.I102) # Initialize Hydrogen Inlet\n",
+ "# propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.M101.default_initializer().initialize(m.fs.M101) # Initialize Mixer\n",
+ "# propagate_state(m.fs.s03) # Establish connection between Mixer and Heater\n",
+ "#\n",
+ "# m.fs.F102.default_initializer().initialize(m.fs.F102) # Initialize Second Flash Unit\n",
+ "# propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product\n",
+ "# propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product\n",
+ "# propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product"
+ ],
"outputs": [],
+ "execution_count": 50
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "seq.run(m, function)"
+ "Now we solve the system to allow the outlet of the mixer to reach a converged congruence with the inlet of the heater."
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.226222Z",
+ "start_time": "2025-11-20T21:46:17.129942Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 300,\n",
+ " \"tol\": 1e-8,\n",
+ "}\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
+ "results = solver.solve(m, tee=True)"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=300\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 3.35e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.07e+03 1.08e+01 -1.0 1.21e+03 - 8.49e-01 6.80e-01h 1\n",
+ " 2 0.0000000e+00 1.66e+02 4.55e+02 -1.0 7.65e+02 - 9.90e-01 8.44e-01h 1\n",
+ " 3 0.0000000e+00 5.53e+00 2.00e+02 -1.0 1.30e+02 - 9.90e-01 9.67e-01h 1\n",
+ " 4 0.0000000e+00 5.22e-02 8.91e+03 -1.0 4.05e+00 - 1.00e+00 9.91e-01h 1\n",
+ " 5 0.0000000e+00 1.46e-04 1.02e+04 -1.0 3.80e-02 - 1.00e+00 9.97e-01h 1\n",
+ " 6 0.0000000e+00 9.46e-11 6.27e-01 -1.0 1.06e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 6\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 7\n",
+ "Number of objective gradient evaluations = 7\n",
+ "Number of equality constraint evaluations = 7\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 7\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 6\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.009\n",
+ "Total CPU secs in NLP function evaluations = 0.001\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 51
+ },
{
"cell_type": "markdown",
"metadata": {},
+ "source": [
+ "Now that the flowsheet is initialized, we can unfix the guesses for the `Heater` and reactive the tear stream to complete the final solve."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.258332Z",
+ "start_time": "2025-11-20T21:46:17.233298Z"
+ }
+ },
+ "source": [
+ "for k, v in tear_guesses.items():\n",
+ " for k1, v1 in v.items():\n",
+ " getattr(m.fs.H101.inlet, k)[k1].unfix()\n",
+ "\n",
+ "m.fs.s03_expanded.activate()\n",
+ "print(\n",
+ " f\"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The DOF is 0 after unfixing the values and reactivating the tear stream\n"
+ ]
+ }
+ ],
+ "execution_count": 52
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6 Solving the Model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "We have now initialized the flowsheet. Lets set up some solving options before simulating the flowsheet. We want to specify the scaling method, number of iterations, and tolerance. More specific or advanced options can be found at the documentation for IPOPT https://coin-or.github.io/Ipopt/OPTIONS.html"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.268422Z",
+ "start_time": "2025-11-20T21:46:17.265316Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 1000,\n",
+ " \"tol\": 1e-8,\n",
+ "}"
+ ],
+ "outputs": [],
+ "execution_count": 53
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"Inline Exercise:\n",
- "We have now initialized the flowsheet. Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
- " \n",
+ "Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
+ "\n",
+ "solver = get_solver(solver_options=optarg)
\n",
"results = solver.solve(m, tee=True)\n",
"\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
+ "Use Shift+Enter to run the cell once you have typed in your code.\n",
+ "\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.285774Z",
+ "start_time": "2025-11-20T21:46:17.281657Z"
+ }
},
- "outputs": [],
"source": [
"# Create the solver object\n",
"\n",
- "\n",
"# Solve the model"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 54
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Analyze the results of the square problem\n",
+ "## 7 Analyze the results\n",
"\n",
- "\n",
- "What is the total operating cost? "
+ "\n"
]
},
{
- "cell_type": "code",
- "execution_count": null,
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "If the IDAES UI package was installed with the `idaes-pse` installation or installed separately, you can run the flowsheet visualizer to see a full diagram of the full process that is generated and displayed on a browser window.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "tags": [
+ "noauto"
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.403453Z",
+ "start_time": "2025-11-20T21:46:17.400372Z"
+ }
+ },
+ "source": [
+ "# m.fs.visualize(\"HDA-Flowsheet\")"
+ ],
"outputs": [],
+ "execution_count": 57
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ "Otherwise, we can run the `m.fs.report()` method to see a full summary of the solved flowsheet. It is recommended to adjust the width of the output as much as possible for the cleanest display."
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.448969Z",
+ "start_time": "2025-11-20T21:46:17.421434Z"
+ }
+ },
+ "source": [
+ "m.fs.report()"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Flowsheet : fs Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units s01 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 \n",
+ " Total Molar Flowrate mole / second 0.30005 0.32004 2.0320 2.0320 2.0320 1.7648 0.26712 1.4119 1.4119 0.17224 0.094878 0.35297\n",
+ " Total Mole Fraction benzene dimensionless 6.6656e-05 6.2492e-05 0.058732 0.058732 0.17408 0.084499 0.76595 0.084499 0.084499 0.82430 0.66001 0.084499\n",
+ " Total Mole Fraction toluene dimensionless 0.99987 6.2492e-05 0.15380 0.15380 0.038450 0.0088437 0.23405 0.0088437 0.0088437 0.17570 0.33999 0.0088437\n",
+ " Total Mole Fraction hydrogen dimensionless 3.3328e-05 0.93738 0.27683 0.27683 0.16148 0.18592 6.9600e-09 0.18592 0.18592 1.0794e-08 1.1376e-15 0.18592\n",
+ " Total Mole Fraction methane dimensionless 3.3328e-05 0.062492 0.51064 0.51064 0.62599 0.72074 2.6982e-08 0.72074 0.72074 4.1844e-08 4.4103e-15 0.72074\n",
+ " Temperature kelvin 303.20 303.20 324.54 600.00 822.07 325.00 325.00 325.00 325.00 375.00 375.00 325.00\n",
+ " Pressure pascal 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 1.5000e+05 1.5000e+05 3.5000e+05\n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 58
+ },
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? "
+ "What is the total operating cost?"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.475550Z",
+ "start_time": "2025-11-20T21:46:17.472001Z"
+ }
+ },
+ "source": [
+ "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 424513.9640158265\n"
+ ]
+ }
+ ],
+ "execution_count": 59
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
+ "source": [
+ "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? We can look at a specific unit models stream table with the same `report()` method."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.596910Z",
+ "start_time": "2025-11-20T21:46:17.580529Z"
+ }
+ },
"source": [
"m.fs.F102.report()\n",
"\n",
"print()\n",
"print(\"benzene purity = \", value(m.fs.purity))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 7346.0 : watt : False : (None, None)\n",
+ " Pressure Change : -2.0000e+05 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.26712 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.76595 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.23405 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 6.9600e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.6982e-08 - - \n",
+ " Temperature kelvin 325.00 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.094878 \n",
+ " flow_mol_phase Vap mole / second - 0.17224 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.66001 0.66001 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.33999 0.33999 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.82430 0.82430 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.17570 0.17570 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.0794e-08 1.0794e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.1844e-08 4.1844e-08 \n",
+ " temperature kelvin - 375.00 375.00 \n",
+ " pressure pascal - 1.5000e+05 1.5000e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8242963521555956\n"
+ ]
+ }
+ ],
+ "execution_count": 61
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101.\n",
- "\n",
- "
\n",
- "Inline Exercise:\n",
- "How much benzene are we losing in the F101 vapor outlet stream?\n",
- "
\n"
+ "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.648524Z",
+ "start_time": "2025-11-20T21:46:17.638446Z"
+ }
+ },
"source": [
"from idaes.core.util.tables import (\n",
" create_stream_table_dataframe,\n",
@@ -1005,25 +2368,30 @@
"\n",
"st = create_stream_table_dataframe({\"Reactor\": m.fs.s05, \"Light Gases\": m.fs.s06})\n",
"print(stream_table_dataframe_to_string(st))"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "
\n",
- "Inline Exercise:\n",
- "You can query additional variables here if you like. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Units Reactor Light Gases\n",
+ "Total Molar Flowrate mole / second 2.0320 1.7648 \n",
+ "Total Mole Fraction benzene dimensionless 0.17408 0.084499 \n",
+ "Total Mole Fraction toluene dimensionless 0.038450 0.0088437 \n",
+ "Total Mole Fraction hydrogen dimensionless 0.16148 0.18592 \n",
+ "Total Mole Fraction methane dimensionless 0.62599 0.72074 \n",
+ "Temperature kelvin 822.07 325.00 \n",
+ "Pressure pascal 3.5000e+05 3.5000e+05 \n"
+ ]
+ }
+ ],
+ "execution_count": 63
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization\n",
+ "## 8 Optimization\n",
"\n",
"\n",
"We saw from the results above that the total operating cost for the base case was $419,122 per year. We are producing 0.142 mol/s of benzene at a purity of 82\\%. However, we are losing around 42\\% of benzene in F101 vapor outlet stream. \n",
@@ -1050,12 +2418,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.675626Z",
+ "start_time": "2025-11-20T21:46:17.671136Z"
+ }
+ },
"source": [
"m.fs.objective = Objective(expr=m.fs.operating_cost)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 64
},
{
"cell_type": "markdown",
@@ -1066,19 +2439,28 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.691883Z",
+ "start_time": "2025-11-20T21:46:17.687385Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.unfix()\n",
"m.fs.R101.heat_duty.unfix()\n",
"m.fs.F101.vap_outlet.temperature.unfix()\n",
"m.fs.F102.vap_outlet.temperature.unfix()"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 65
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1091,16 +2473,20 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.707409Z",
+ "start_time": "2025-11-20T21:46:17.704141Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Unfix deltaP for F102"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 66
},
{
"cell_type": "markdown",
@@ -1119,17 +2505,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.779305Z",
+ "start_time": "2025-11-20T21:46:17.775669Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature[0].setlb(500)\n",
"m.fs.H101.outlet.temperature[0].setub(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 69
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1141,16 +2536,20 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.797044Z",
+ "start_time": "2025-11-20T21:46:17.794614Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 70
},
{
"cell_type": "markdown",
@@ -1161,9 +2560,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.827227Z",
+ "start_time": "2025-11-20T21:46:17.822681Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature[0].setlb(298.0)\n",
"m.fs.F101.vap_outlet.temperature[0].setub(450.0)\n",
@@ -1171,7 +2573,9 @@
"m.fs.F102.vap_outlet.temperature[0].setub(450.0)\n",
"m.fs.F102.vap_outlet.pressure[0].setlb(105000)\n",
"m.fs.F102.vap_outlet.pressure[0].setub(110000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 72
},
{
"cell_type": "markdown",
@@ -1182,19 +2586,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.848212Z",
+ "start_time": "2025-11-20T21:46:17.844101Z"
+ }
+ },
"source": [
"m.fs.overhead_loss = Constraint(\n",
- " expr=m.fs.F101.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " <= 0.20 * m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " <= 0.20\n",
+ " * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 73
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1206,16 +2622,20 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.862411Z",
+ "start_time": "2025-11-20T21:46:17.859385Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 74
},
{
"cell_type": "markdown",
@@ -1226,12 +2646,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.890250Z",
+ "start_time": "2025-11-20T21:46:17.887141Z"
+ }
+ },
"source": [
"m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 76
},
{
"cell_type": "markdown",
@@ -1245,27 +2670,141 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.024828Z",
+ "start_time": "2025-11-20T21:46:17.897344Z"
+ }
+ },
"source": [
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 938\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 9\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 504\n",
+ "\n",
+ "Reallocating memory for MA57: lfact (10594)\n",
+ "Total number of variables............................: 224\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 151\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 219\n",
+ "Total number of inequality constraints...............: 3\n",
+ " inequality constraints with only lower bounds: 2\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 1\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 4.2451396e+05 4.00e+04 6.94e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (11249)\n",
+ " 1 4.2182392e+05 4.00e+04 6.94e+00 -1.0 3.47e+07 - 3.71e-05 1.25e-05f 1\n",
+ " 2 4.2170773e+05 4.00e+04 8.41e+01 -1.0 1.49e+06 - 3.32e-04 1.53e-05f 1\n",
+ " 3 4.1795462e+05 4.00e+04 6.82e+01 -1.0 1.43e+06 - 4.98e-04 5.60e-04f 1\n",
+ " 4 3.0650178e+05 4.00e+04 3.09e+02 -1.0 1.26e+07 - 2.61e-05 1.17e-03f 1\n",
+ " 5 3.0553183e+05 3.99e+04 3.25e+04 -1.0 1.48e+05 - 1.28e-01 1.02e-03f 1\n",
+ " 6 3.0565526e+05 3.91e+04 5.25e+04 -1.0 3.99e+04 - 1.13e-01 2.09e-02h 2\n",
+ " 7 3.0601574e+05 3.59e+04 4.21e+04 -1.0 3.91e+04 - 5.17e-02 8.21e-02h 2\n",
+ " 8 3.0674242e+05 2.95e+04 8.41e+04 -1.0 3.59e+04 - 4.38e-01 1.79e-01h 1\n",
+ " 9 3.1153051e+05 1.11e+04 5.73e+04 -1.0 2.95e+04 - 8.56e-01 6.23e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10 3.1154545e+05 1.09e+04 5.69e+04 -1.0 1.19e+04 - 6.57e-02 2.37e-02h 1\n",
+ " 11 3.1159568e+05 1.08e+04 5.66e+04 -1.0 1.68e+04 - 2.23e-02 8.97e-03h 1\n",
+ " 12 3.1610911e+05 2.56e+03 2.13e+05 -1.0 1.68e+04 - 9.47e-01 7.94e-01h 1\n",
+ " 13 3.1708718e+05 1.16e+03 9.56e+04 -1.0 4.45e+03 - 9.90e-01 5.53e-01h 1\n",
+ " 14 3.1796760e+05 4.06e+02 1.14e+03 -1.0 1.27e+04 - 9.95e-01 9.87e-01h 1\n",
+ " 15 3.1802429e+05 5.35e+00 6.53e+02 -1.0 8.29e+01 - 1.00e+00 9.89e-01h 1\n",
+ " 16 3.1802524e+05 1.77e-04 5.89e+02 -1.0 5.10e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 17 3.1802492e+05 5.34e-06 1.83e+06 -2.5 1.32e+00 - 3.33e-01 1.00e+00f 1\n",
+ " 18 3.1802492e+05 1.70e-09 9.74e-03 -2.5 2.42e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 19 3.1802491e+05 4.41e-09 1.03e-01 -5.7 3.83e-02 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20 3.1802491e+05 2.39e-03 8.22e-09 -5.7 2.88e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 21 3.1802491e+05 8.00e-11 9.72e-09 -5.7 4.08e-04 - 1.00e+00 1.00e+00h 1\n",
+ " 22 3.1802491e+05 2.47e-03 1.19e-01 -8.6 2.93e+01 - 9.99e-01 1.00e+00h 1\n",
+ " 23 3.1802491e+05 2.41e+02 2.13e-09 -8.6 9.27e+03 - 1.00e+00 1.00e+00h 1\n",
+ " 24 3.1802491e+05 6.96e-03 3.66e-09 -8.6 1.88e+02 - 1.00e+00 1.00e+00h 1\n",
+ " 25 3.1802491e+05 3.61e-06 1.59e-09 -8.6 1.21e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 26 3.1802491e+05 2.29e-05 4.82e-09 -8.6 3.07e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 27 3.1802491e+05 9.42e-07 5.47e-09 -8.6 6.24e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 28 3.1802491e+05 1.16e-10 9.67e-09 -8.6 3.01e+00 - 1.00e+00 1.00e+00H 1\n",
+ "\n",
+ "Number of Iterations....: 28\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 3.1802490940142004e+05 3.1802490940142004e+05\n",
+ "Dual infeasibility......: 9.6706583658121551e-09 9.6706583658121551e-09\n",
+ "Constraint violation....: 1.1641532182693481e-10 1.1641532182693481e-10\n",
+ "Complementarity.........: 2.5059899579272651e-09 2.5059899579272651e-09\n",
+ "Overall NLP error.......: 2.2246107350021195e-10 9.6706583658121551e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 35\n",
+ "Number of objective gradient evaluations = 29\n",
+ "Number of equality constraint evaluations = 35\n",
+ "Number of inequality constraint evaluations = 35\n",
+ "Number of equality constraint Jacobian evaluations = 29\n",
+ "Number of inequality constraint Jacobian evaluations = 29\n",
+ "Number of Lagrangian Hessian evaluations = 28\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.036\n",
+ "Total CPU secs in NLP function evaluations = 0.006\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 77
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization Results\n",
+ "### 8.1 Optimization Results\n",
"\n",
"Display the results and product specifications"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.074231Z",
+ "start_time": "2025-11-20T21:46:18.053675Z"
+ }
+ },
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))\n",
"\n",
@@ -1280,7 +2819,89 @@
"print()\n",
"print(\"Overhead loss in F101\")\n",
"m.fs.F101.report()"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 318024.90940142004\n",
+ "\n",
+ "Product flow rate and purity in F102\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 8369.3 : watt : False : (None, None)\n",
+ " Pressure Change : -2.4500e+05 : pascal : False : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.28812 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.75463 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.24537 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 7.5018e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.5957e-08 - - \n",
+ " Temperature kelvin 301.88 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.10493 \n",
+ " flow_mol_phase Vap mole / second - 0.18319 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.64256 0.64256 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.35744 0.35744 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.81883 0.81883 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.18117 0.18117 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.1799e-08 1.1799e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.0825e-08 4.0825e-08 \n",
+ " temperature kelvin - 362.93 362.93 \n",
+ " pressure pascal - 1.0500e+05 1.0500e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8188295888411846\n",
+ "\n",
+ "Overhead loss in F101\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F101 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -66423. : watt : False : (None, None)\n",
+ " Pressure Change : 0.0000 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 1.9480 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.13952 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.039059 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 0.18417 - - \n",
+ " Total Mole Fraction methane dimensionless 0.63725 - - \n",
+ " Temperature kelvin 763.51 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.28812 \n",
+ " flow_mol_phase Vap mole / second - 1.6598 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.75463 0.75463 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.24537 0.24537 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.032748 0.032748 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.0032478 0.0032478 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.21614 0.21614 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.74786 0.74786 \n",
+ " temperature kelvin - 301.88 301.88 \n",
+ " pressure pascal - 3.5000e+05 3.5000e+05 \n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 79
},
{
"cell_type": "markdown",
@@ -1291,32 +2912,47 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.106001Z",
+ "start_time": "2025-11-20T21:46:18.101768Z"
+ }
+ },
"source": [
- "print(\"Optimal Values\")\n",
- "print()\n",
+ "print(\n",
+ " f\"\"\"Optimal Values:\n",
"\n",
- "print(\"H101 outlet temperature = \", value(m.fs.H101.outlet.temperature[0]), \"K\")\n",
+ "H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"R101 outlet temperature = \", value(m.fs.R101.outlet.temperature[0]), \"K\")\n",
+ "R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F101 outlet temperature = \", value(m.fs.F101.vap_outlet.temperature[0]), \"K\")\n",
+ "F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F102 outlet temperature = \", value(m.fs.F102.vap_outlet.temperature[0]), \"K\")\n",
- "print(\"F102 outlet pressure = \", value(m.fs.F102.vap_outlet.pressure[0]), \"Pa\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
+ "F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K\n",
+ "F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa\n",
+ "\"\"\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Optimal Values:\n",
+ "\n",
+ "H101 outlet temperature = 500.000 K\n",
+ "\n",
+ "R101 outlet temperature = 763.507 K\n",
+ "\n",
+ "F101 outlet temperature = 301.881 K\n",
+ "\n",
+ "F102 outlet temperature = 362.935 K\n",
+ "F102 outlet pressure = 105000.000 Pa\n",
+ "\n"
+ ]
+ }
+ ],
+ "execution_count": 81
}
],
"metadata": {
@@ -1336,7 +2972,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.12"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_solution.ipynb b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_solution.ipynb
index 6f8b47f4..5f2b6695 100644
--- a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_solution.ipynb
+++ b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_solution.ipynb
@@ -2,18 +2,20 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"header",
"hide-cell"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:04.904828Z",
+ "start_time": "2025-11-20T21:46:04.900352Z"
+ }
},
- "outputs": [],
"source": [
"###############################################################################\n",
"# The Institute for the Design of Advanced Energy Systems Integrated Platform\n",
- "# Framework (IDAES IP) was produced under the DOE Institute for the\n",
+ "# Framework (idaes IP) was produced under the DOE Institute for the\n",
"# Design of Advanced Energy Systems (IDAES).\n",
"#\n",
"# Copyright (c) 2018-2023 by the software owners: The Regents of the\n",
@@ -23,7 +25,9 @@
"# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n",
"# for full copyright and license information.\n",
"###############################################################################"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 1
},
{
"cell_type": "markdown",
@@ -32,20 +36,34 @@
"\n",
"# HDA Flowsheet Simulation and Optimization\n",
"\n",
- "Author: Jaffer Ghouse \n",
- "Maintainer: Brandon Paul \n",
- "Updated: 2023-06-01 \n",
+ "Author: Jaffer Ghouse
\n",
+ "Maintainer: Tanner Polley
\n",
+ "Updated: 2025-11-19\n",
"\n",
"## Learning outcomes\n",
"\n",
"\n",
"- Construct a steady-state flowsheet using the IDAES unit model library\n",
- "- Connecting unit models in a flowsheet using Arcs\n",
+ "- Connecting unit models in a flowsheet using Arcs\n",
"- Using the SequentialDecomposition tool to initialize a flowsheet with recycle\n",
- "- Fomulate and solve an optimization problem\n",
+ "- Formulate and solve an optimization problem\n",
" - Defining an objective function\n",
" - Setting variable bounds\n",
- " - Adding additional constraints \n",
+ " - Adding additional constraints\n",
+ "\n",
+ "\n",
+ "The general workflow of setting up an IDAES flowsheet is the following:\n",
+ "\n",
+ " 1 Importing Modules
\n",
+ " 2 Building a Model
\n",
+ " 3 Scaling the Model
\n",
+ " 4 Specifying the Model
\n",
+ " 5 Initializing the Model
\n",
+ " 6 Solving the Model
\n",
+ " 7 Analyzing and Visualizing the Results
\n",
+ " 8 Optimizing the Model
\n",
+ "\n",
+ "We will complete each of these steps as well as demonstrate analyses on this model through some examples and exercises.\n",
"\n",
"\n",
"## Problem Statement\n",
@@ -81,10 +99,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required pyomo and idaes components\n",
+ "## 1 Importing Modules\n",
+ "### 1.1 Importing required Pyomo and IDAES components\n",
"\n",
"\n",
- "To construct a flowsheet, we will need several components from the pyomo and idaes package. Let us first import the following components from Pyomo:\n",
+ "To construct a flowsheet, we will need several components from the Pyomo and IDAES package. Let us first import the following components from Pyomo:\n",
"- Constraint (to write constraints)\n",
"- Var (to declare variables)\n",
"- ConcreteModel (to create the concrete model object)\n",
@@ -95,14 +114,17 @@
"- Arc (to connect two unit models)\n",
"- SequentialDecomposition (to initialize the flowsheet in a sequential mode)\n",
"\n",
- "For further details on these components, please refer to the pyomo documentation: https://pyomo.readthedocs.io/en/stable/\n"
+ "For further details on these components, please refer to the Pyomo documentation: https://Pyomo.readthedocs.io/en/stable/\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:05.294578Z",
+ "start_time": "2025-11-20T21:46:04.908296Z"
+ }
+ },
"source": [
"from pyomo.environ import (\n",
" Constraint,\n",
@@ -110,40 +132,51 @@
" ConcreteModel,\n",
" Expression,\n",
" Objective,\n",
- " SolverFactory,\n",
" TransformationFactory,\n",
" value,\n",
")\n",
"from pyomo.network import Arc, SequentialDecomposition"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "From idaes, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "From IDAES, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "- Feed\n",
"- Mixer\n",
"- Heater\n",
"- StoichiometricReactor\n",
"-
**Flash**\n",
"- Separator (splitter) \n",
- "- PressureChanger"
+ "- PressureChanger\n",
+ "- Product"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:06.806301Z",
+ "start_time": "2025-11-20T21:46:05.297760Z"
+ }
+ },
"source": [
"from idaes.core import FlowsheetBlock"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 3
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.936732Z",
+ "start_time": "2025-11-20T21:46:09.883054Z"
+ }
+ },
"source": [
"from idaes.models.unit_models import (\n",
" PressureChanger,\n",
@@ -151,8 +184,14 @@
" Separator as Splitter,\n",
" Heater,\n",
" StoichiometricReactor,\n",
- ")"
- ]
+ " Feed,\n",
+ " Product,\n",
+ ")\n",
+ "from idaes.core.util.exceptions import InitializationError\n",
+ "import idaes.logger as idaeslog"
+ ],
+ "outputs": [],
+ "execution_count": 4
},
{
"cell_type": "markdown",
@@ -166,30 +205,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.952476Z",
+ "start_time": "2025-11-20T21:46:09.949367Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: import flash model from idaes.models.unit_models"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 5
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.963041Z",
+ "start_time": "2025-11-20T21:46:09.957319Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: import flash model from idaes.models.unit_models\n",
"from idaes.models.unit_models import Flash"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 6
},
{
"cell_type": "markdown",
@@ -200,24 +247,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.976914Z",
+ "start_time": "2025-11-20T21:46:09.971944Z"
+ }
+ },
"source": [
"from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n",
"from idaes.core.util.model_statistics import degrees_of_freedom\n",
"\n",
"# Import idaes logger to set output levels\n",
- "import idaes.logger as idaeslog\n",
- "from idaes.core.solvers import get_solver\n",
- "from idaes.core.util.exceptions import InitializationError"
- ]
+ "from idaes.core.solvers import get_solver"
+ ],
+ "outputs": [],
+ "execution_count": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required thermo and reaction package\n",
+ "### 1.2 Importing required thermo and reaction package\n",
"\n",
"The final set of imports are to import the thermo and reaction package for the HDA process. We have created a custom thermo package that assumes Ideal Gas with support for VLE. \n",
"\n",
@@ -232,33 +282,49 @@
]
},
{
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.017098Z",
+ "start_time": "2025-11-20T21:46:09.981997Z"
+ }
+ },
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
"source": [
- "from idaes_examples.mod.hda import hda_ideal_VLE as thermo_props\n",
- "from idaes_examples.mod.hda import hda_reaction as reaction_props"
- ]
+ "from idaes.models.properties.modular_properties.base.generic_property import (\n",
+ " GenericParameterBlock,\n",
+ ")\n",
+ "from idaes.models.properties.modular_properties.base.generic_reaction import (\n",
+ " GenericReactionParameterBlock,\n",
+ ")\n",
+ "from idaes_examples.mod.hda.hda_ideal_VLE_modular import thermo_config\n",
+ "from idaes_examples.mod.hda.hda_reaction_modular import reaction_config"
+ ],
+ "outputs": [],
+ "execution_count": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Constructing the Flowsheet\n",
+ "## 2 Constructing the Flowsheet\n",
"\n",
- "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block as we did in module 1. "
+ "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.031538Z",
+ "start_time": "2025-11-20T21:46:10.025904Z"
+ }
+ },
"source": [
"m = ConcreteModel()\n",
"m.fs = FlowsheetBlock(dynamic=False)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 9
},
{
"cell_type": "markdown",
@@ -269,34 +335,46 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.066746Z",
+ "start_time": "2025-11-20T21:46:10.035131Z"
+ }
+ },
"source": [
- "m.fs.thermo_params = thermo_props.HDAParameterBlock()\n",
- "m.fs.reaction_params = reaction_props.HDAReactionParameterBlock(\n",
- " property_package=m.fs.thermo_params\n",
+ "m.fs.thermo_params = GenericParameterBlock(**thermo_config)\n",
+ "m.fs.reaction_params = GenericReactionParameterBlock(\n",
+ " property_package=m.fs.thermo_params, **reaction_config\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding Unit Models\n",
+ "### 2.1 Adding Unit Models\n",
"\n",
- "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Mixer (assigned a name M101) and a Heater (assigned a name H101). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the Mixer unit model here is given a `list` consisting of names to the three inlets. "
+ "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Feed (assigned a name `I101` for Inlet), `Mixer` (assigned a name `M101`) and a `Heater` (assigned a name `H101`). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the `Mixer` unit model here must be specified the number of inlets that it will take in and the `Heater` can have specific settings enabled such as `has_pressure_change` or `has_phase_equilibrium`."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.114600Z",
+ "start_time": "2025-11-20T21:46:10.071845Z"
+ }
+ },
"source": [
+ "m.fs.I101 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.I102 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
"m.fs.M101 = Mixer(\n",
" property_package=m.fs.thermo_params,\n",
- " inlet_list=[\"toluene_feed\", \"hydrogen_feed\", \"vapor_recycle\"],\n",
+ " num_inlets=3,\n",
")\n",
"\n",
"m.fs.H101 = Heater(\n",
@@ -304,11 +382,17 @@
" has_pressure_change=False,\n",
" has_phase_equilibrium=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 11
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -325,26 +409,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.121709Z",
+ "start_time": "2025-11-20T21:46:10.119134Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add reactor with the specifications above"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 12
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.145853Z",
+ "start_time": "2025-11-20T21:46:10.127921Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add reactor with the specifications above\n",
"m.fs.R101 = StoichiometricReactor(\n",
@@ -354,7 +444,9 @@
" has_heat_transfer=True,\n",
" has_pressure_change=False,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 13
},
{
"cell_type": "markdown",
@@ -370,29 +462,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.167357Z",
+ "start_time": "2025-11-20T21:46:10.149935Z"
+ }
+ },
"source": [
"m.fs.F101 = Flash(\n",
" property_package=m.fs.thermo_params,\n",
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us now add the Splitter(S101), PressureChanger(C101) and the second Flash(F102). "
+ "Let us now add the Splitter(S101) with specific names for its output (purge and recycle), PressureChanger(C101) and the second Flash(F102)."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.211911Z",
+ "start_time": "2025-11-20T21:46:10.173255Z"
+ }
+ },
"source": [
"m.fs.S101 = Splitter(\n",
" property_package=m.fs.thermo_params,\n",
@@ -412,66 +512,115 @@
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 15
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Connecting Unit Models using Arcs\n",
- "\n",
- "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the mixer(M101) to the inlet of the heater(H101). "
+ "Last, we will add the three Product blocks (P101, P102, P103). We use `Feed` blocks and `Product` blocks for convenience with reporting stream summaries and consistency"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.226989Z",
+ "start_time": "2025-11-20T21:46:10.216839Z"
+ }
+ },
+ "source": [
+ "m.fs.P101 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P102 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P103 = Product(property_package=m.fs.thermo_params)"
+ ],
"outputs": [],
+ "execution_count": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ "### 2.2 Connecting Unit Models using Arcs\n",
+ "\n",
+ "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a Pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the inlets (I101, I102) to the inlet of the mixer (M101) and outlet of the mixer to the inlet of the heater(H101)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- " \n",
- "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.235541Z",
+ "start_time": "2025-11-20T21:46:10.231058Z"
+ }
+ },
+ "source": [
+ "m.fs.s01 = Arc(source=m.fs.I101.outlet, destination=m.fs.M101.inlet_1)\n",
+ "m.fs.s02 = Arc(source=m.fs.I102.outlet, destination=m.fs.M101.inlet_2)\n",
+ "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
+ "source": [
"
\n",
"Inline Exercise:\n",
- "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide. \n",
- "
\n",
- "\n"
+ "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide.\n",
+ "
"
]
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.245319Z",
+ "start_time": "2025-11-20T21:46:10.239913Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Connect the H101 outlet to R101 inlet"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 18
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.254153Z",
+ "start_time": "2025-11-20T21:46:10.248481Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Connect the H101 outlet to R101 inlet\n",
"m.fs.s04 = Arc(source=m.fs.H101.outlet, destination=m.fs.R101.inlet)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 19
},
{
"cell_type": "markdown",
@@ -482,17 +631,45 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.264461Z",
+ "start_time": "2025-11-20T21:46:10.258555Z"
+ }
+ },
"source": [
"m.fs.s05 = Arc(source=m.fs.R101.outlet, destination=m.fs.F101.inlet)\n",
"m.fs.s06 = Arc(source=m.fs.F101.vap_outlet, destination=m.fs.S101.inlet)\n",
+ "m.fs.s07 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)\n",
"m.fs.s08 = Arc(source=m.fs.S101.recycle, destination=m.fs.C101.inlet)\n",
- "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.vapor_recycle)\n",
- "m.fs.s10 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)"
+ "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.inlet_3)"
+ ],
+ "outputs": [],
+ "execution_count": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Last we will connect the outlet streams to the inlets of the Product blocks (P101, P102, P103)"
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.274505Z",
+ "start_time": "2025-11-20T21:46:10.268918Z"
+ }
+ },
+ "source": [
+ "m.fs.s10 = Arc(source=m.fs.F102.vap_outlet, destination=m.fs.P101.inlet)\n",
+ "m.fs.s11 = Arc(source=m.fs.F102.liq_outlet, destination=m.fs.P102.inlet)\n",
+ "m.fs.s12 = Arc(source=m.fs.S101.purge, destination=m.fs.P103.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 21
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -502,20 +679,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.303264Z",
+ "start_time": "2025-11-20T21:46:10.278714Z"
+ }
+ },
"source": [
"TransformationFactory(\"network.expand_arcs\").apply_to(m)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 22
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding expressions to compute purity and operating costs\n",
+ "### 2.3 Adding expressions to compute purity and operating costs\n",
"\n",
- "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/pyomo_modeling_components/Expressions.html\n",
+ "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/explanation/modeling/network.html.\n",
"\n",
"For this flowsheet, we are interested in computing the purity of the product Benzene stream (i.e. the mole fraction) and the operating cost which is a sum of the cooling and heating cost. "
]
@@ -529,18 +711,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.312336Z",
+ "start_time": "2025-11-20T21:46:10.309074Z"
+ }
+ },
"source": [
"m.fs.purity = Expression(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
" / (\n",
- " m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " + m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
+ " + m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 23
},
{
"cell_type": "markdown",
@@ -551,14 +742,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.323538Z",
+ "start_time": "2025-11-20T21:46:10.318119Z"
+ }
+ },
"source": [
"m.fs.cooling_cost = Expression(\n",
" expr=0.212e-7 * (-m.fs.F101.heat_duty[0]) + 0.212e-7 * (-m.fs.R101.heat_duty[0])\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 24
},
{
"cell_type": "markdown",
@@ -575,14 +771,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.336983Z",
+ "start_time": "2025-11-20T21:46:10.328380Z"
+ }
+ },
"source": [
"m.fs.heating_cost = Expression(\n",
" expr=2.2e-7 * m.fs.H101.heat_duty[0] + 1.9e-7 * m.fs.F102.heat_duty[0]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 25
},
{
"cell_type": "markdown",
@@ -593,64 +794,94 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.345607Z",
+ "start_time": "2025-11-20T21:46:10.341996Z"
+ }
+ },
"source": [
"m.fs.operating_cost = Expression(\n",
" expr=(3600 * 24 * 365 * (m.fs.heating_cost + m.fs.cooling_cost))\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 26
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing feed conditions\n",
+ "## 4 Specifying the Model\n",
+ "### 4.1 Fixing feed conditions\n",
"\n",
"Let us first check how many degrees of freedom exist for this flowsheet using the `degrees_of_freedom` tool we imported earlier. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.376586Z",
+ "start_time": "2025-11-20T21:46:10.349694Z"
+ }
+ },
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "29\n"
+ ]
+ }
+ ],
+ "execution_count": 27
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "We will now be fixing the toluene feed stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing. "
+ "We will now be fixing the toluene feed (`I101`) stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.418520Z",
+ "start_time": "2025-11-20T21:46:10.414167Z"
+ }
+ },
"source": [
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(0.30)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.temperature.fix(303.2)\n",
- "m.fs.M101.toluene_feed.pressure.fix(350000)"
- ]
+ "F_liq_toluene = 0.30\n",
+ "F_liq_non_zero = 1e-5\n",
+ "\n",
+ "F_vap_I101 = F_liq_non_zero * 4\n",
+ "F_liq_I101 = F_liq_toluene + F_liq_non_zero\n",
+ "\n",
+ "m.fs.I101.flow_mol_phase[0, \"Vap\"].fix(F_vap_I101)\n",
+ "m.fs.I101.flow_mol_phase[0, \"Liq\"].fix(F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_toluene / F_liq_I101)\n",
+ "m.fs.I101.temperature.fix(303.2)\n",
+ "m.fs.I101.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 29
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
- "Similarly, let us fix the hydrogen feed to the following conditions in the next cell:\n",
+ "Similarly, let us fix the hydrogen feed (`I102`) to the following conditions in the next cell:\n",
"
\n",
" - FH2 = 0.30 mol/s
\n",
" - FCH4 = 0.02 mol/s
\n",
@@ -663,39 +894,59 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.429169Z",
+ "start_time": "2025-11-20T21:46:10.422052Z"
+ }
+ },
"source": [
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(0.30)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(0.02)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.temperature.fix(303.2)\n",
- "m.fs.M101.hydrogen_feed.pressure.fix(350000)"
- ]
+ "F_vap_hydrogen = 0.30\n",
+ "F_vap_methane = 0.020\n",
+ "\n",
+ "F_vap_non_zero = 1e-5\n",
+ "F_liq_non_zero = F_vap_non_zero\n",
+ "\n",
+ "F_vap_I102 = F_vap_hydrogen + F_vap_methane + 2 * F_vap_non_zero\n",
+ "F_liq_I102 = 2 * F_vap_non_zero\n",
+ "\n",
+ "m.fs.I102.flow_mol_phase[0, \"Vap\"].fix(F_vap_I102)\n",
+ "m.fs.I102.flow_mol_phase[0, \"Liq\"].fix(F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_vap_hydrogen / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_vap_methane / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "\n",
+ "m.fs.I102.temperature.fix(303.2)\n",
+ "m.fs.I102.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 30
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing unit model specifications\n",
+ "### 4.2 Fixing unit model specifications\n",
"\n",
"Now that we have fixed our inlet feed conditions, we will now be fixing the operating conditions for the unit models in the flowsheet. Let us set set the H101 outlet temperature to 600 K. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.441145Z",
+ "start_time": "2025-11-20T21:46:10.433569Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.fix(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 31
},
{
"cell_type": "markdown",
@@ -706,23 +957,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.453419Z",
+ "start_time": "2025-11-20T21:46:10.445363Z"
+ }
+ },
"source": [
"m.fs.R101.conversion = Var(initialize=0.75, bounds=(0, 1))\n",
"\n",
"m.fs.R101.conv_constraint = Constraint(\n",
- " expr=m.fs.R101.conversion * m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " expr=m.fs.R101.conversion\n",
+ " * (m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"])\n",
" == (\n",
- " m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
- " - m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"]\n",
+ " - m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")\n",
"\n",
"m.fs.R101.conversion.fix(0.75)\n",
"m.fs.R101.heat_duty.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 32
},
{
"cell_type": "markdown",
@@ -733,17 +992,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.463025Z",
+ "start_time": "2025-11-20T21:46:10.457476Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature.fix(325.0)\n",
"m.fs.F101.deltaP.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 33
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"
Inline Exercise:\n",
@@ -759,30 +1027,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.472509Z",
+ "start_time": "2025-11-20T21:46:10.467229Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set conditions for Flash F102"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 34
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.482109Z",
+ "start_time": "2025-11-20T21:46:10.475567Z"
+ }
},
- "outputs": [],
"source": [
"m.fs.F102.vap_outlet.temperature.fix(375)\n",
"m.fs.F102.deltaP.fix(-200000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 35
},
{
"cell_type": "markdown",
@@ -793,17 +1069,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.491620Z",
+ "start_time": "2025-11-20T21:46:10.485173Z"
+ }
+ },
"source": [
"m.fs.S101.split_fraction[0, \"purge\"].fix(0.2)\n",
"m.fs.C101.outlet.pressure.fix(350000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 36
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -815,54 +1100,83 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.503512Z",
+ "start_time": "2025-11-20T21:46:10.495838Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: print the degrees of freedom"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 37
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.535421Z",
+ "start_time": "2025-11-20T21:46:10.507798Z"
+ }
},
- "outputs": [],
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "execution_count": 38
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Initialization\n",
+ "## 5 Initializing the Model\n",
+ "\n",
+ "\n",
+ "\n",
+ "When a flowsheet contains a recycle loop, the outlet of a downstream unit becomes the inlet of an upstream unit, creating a cyclic dependency that prevents straightforward calculation of all stream conditions. The tear‐stream method is necessary because it “breaks” this loop: you select one recycle stream as the tear, assign it an initial guess, and then solve the rest of the flowsheet as if it were acyclic. Once the downstream units compute their outputs, you compare the calculated value of the torn stream to your initial guess and iteratively adjust until they coincide. Without tearing, the solver cannot establish a proper topological sequence or drive the recycle to convergence, making initialization—and ultimately steady‐state convergence—impossible.\n",
"\n",
+ "It is important to determine the tear stream for a flowsheet which will be demonstrated below.\n",
"\n",
- "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet.\n",
"\n",
- " \n"
+ "\n",
+ "\n",
+ "Currently, there are two methods of initializing a full flowsheet: using the sequential decomposition tool, or manually propagating through the flowsheet. Both methods will be shown.\n",
+ "\n",
+ "### 5.1 Sequential Decomposition\n",
+ "\n",
+ "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet. Sequential Decomposition is a tool from Pyomo where the documentation can be found here https://Pyomo.readthedocs.io/en/stable/explanation/modeling/network.html#sequential-decomposition\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us first create an object for the SequentialDecomposition and specify our options for this. "
+ "Let us first create an object for the SequentialDecomposition and specify our options for this. We can also create a graph for our flowsheet to determine the tear set and order."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.578789Z",
+ "start_time": "2025-11-20T21:46:10.574025Z"
+ }
+ },
"source": [
"seq = SequentialDecomposition()\n",
"seq.options.select_tear_method = \"heuristic\"\n",
@@ -873,7 +1187,9 @@
"G = seq.create_graph(m)\n",
"heuristic_tear_set = seq.tear_set_arcs(G, method=\"heuristic\")\n",
"order = seq.calculation_order(G)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 40
},
{
"cell_type": "markdown",
@@ -884,13 +1200,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.588985Z",
+ "start_time": "2025-11-20T21:46:10.581810Z"
+ }
+ },
"source": [
"for o in heuristic_tear_set:\n",
" print(o.name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.s03\n"
+ ]
+ }
+ ],
+ "execution_count": 41
},
{
"cell_type": "markdown",
@@ -901,15 +1230,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
- "scrolled": true
+ "scrolled": true,
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.602315Z",
+ "start_time": "2025-11-20T21:46:10.599259Z"
+ }
},
- "outputs": [],
"source": [
"for o in order:\n",
" print(o[0].name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.I101\n",
+ "fs.R101\n",
+ "fs.F101\n",
+ "fs.S101\n",
+ "fs.C101\n",
+ "fs.M101\n"
+ ]
+ }
+ ],
+ "execution_count": 42
},
{
"cell_type": "markdown",
@@ -920,25 +1266,30 @@
" \n",
"\n",
"\n",
- "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. We will need to provide a reasonable guess for this."
+ "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. You can see this shown in the picture of the flowsheet above as the outlet of the mixer as the two lines crossing it identifying it as the tear stream. We will need to provide a reasonable guess for this."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.620357Z",
+ "start_time": "2025-11-20T21:46:10.617116Z"
+ }
+ },
"source": [
"tear_guesses = {\n",
- " \"flow_mol_phase_comp\": {\n",
- " (0, \"Vap\", \"benzene\"): 1e-5,\n",
- " (0, \"Vap\", \"toluene\"): 1e-5,\n",
- " (0, \"Vap\", \"hydrogen\"): 0.30,\n",
- " (0, \"Vap\", \"methane\"): 0.02,\n",
- " (0, \"Liq\", \"benzene\"): 1e-5,\n",
- " (0, \"Liq\", \"toluene\"): 0.30,\n",
- " (0, \"Liq\", \"hydrogen\"): 1e-5,\n",
- " (0, \"Liq\", \"methane\"): 1e-5,\n",
+ " \"flow_mol_phase\": {\n",
+ " (0, \"Liq\"): F_liq_I101,\n",
+ " (0, \"Vap\"): F_vap_I102,\n",
+ " },\n",
+ " \"mole_frac_phase_comp\": {\n",
+ " (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ " (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ " (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ " (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
" },\n",
" \"temperature\": {0: 303},\n",
" \"pressure\": {0: 350000},\n",
@@ -946,7 +1297,9 @@
"\n",
"# Pass the tear_guess to the SD tool\n",
"seq.set_guesses_for(m.fs.H101.inlet, tear_guesses)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 43
},
{
"cell_type": "markdown",
@@ -957,9 +1310,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.638254Z",
+ "start_time": "2025-11-20T21:46:10.635136Z"
+ }
+ },
"source": [
"def function(unit):\n",
" try:\n",
@@ -968,7 +1324,9 @@
" except InitializationError:\n",
" solver = get_solver()\n",
" solver.solve(unit)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 44
},
{
"cell_type": "markdown",
@@ -979,118 +1337,1232 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.022425Z",
+ "start_time": "2025-11-20T21:46:10.648251Z"
+ }
+ },
+ "source": "seq.run(m, function)",
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal -
\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "WARNING: Wegstein failed to converge in 3 iterations\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n"
+ ]
+ }
+ ],
+ "execution_count": 45
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### 5.2 Manual Propagation Method\n",
+ "\n",
+ "This method uses a more direct approach to initialize the flowsheet, utilizing the updated initializer method and propagating manually through the flowsheet and solving for the tear stream directly.\n",
+ "Lets first import a helper function that will help us manually propagate and step through the flowsheet"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.069766Z",
+ "start_time": "2025-11-20T21:46:17.066725Z"
+ }
+ },
+ "source": [
+ "from idaes.core.util.initialization import propagate_state"
+ ],
+ "outputs": [],
+ "execution_count": 46
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "Now we can setup our initial guesses for the tear stream which we know is the outlet of the `Mixer` or the inlet of the `Heater`. We can use the same initial guesses used in the first method. We also want to ensure that the degrees of freedom are consistent while we manually initialize the model.\n",
+ "\n",
+ "We will first ensure that are current degrees of freedom is still zero"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.080343Z",
+ "start_time": "2025-11-20T21:46:17.077382Z"
+ }
+ },
+ "source": "# print(f\"The DOF is {degrees_of_freedom(m)} initially\")",
"outputs": [],
+ "execution_count": 47
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "seq.run(m, function)"
+ "Now we can manually deactivate the tear stream, creating a separation between the `Mixer` and `Heater`. This should reduce the degrees of freedom by 10 since the inlet of the `Heater` now contains no values to solve the unit model. To deactivate a stream, simply use `m.fs.s03_expanded.deactivate()`. This expanded stream is just a different version of the `Arc` stream that is able to be deactivated."
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.093180Z",
+ "start_time": "2025-11-20T21:46:17.089671Z"
+ }
+ },
+ "source": [
+ "# m.fs.s03_expanded.deactivate()\n",
+ "#\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream\")"
+ ],
+ "outputs": [],
+ "execution_count": 48
+ },
{
"cell_type": "markdown",
"metadata": {},
+ "source": [
+ "Now we can provide the `Heater` inlet 10 guess values to bring the degrees of freedom back to 0 and start the manual initialization process. We can run this convenient loop to assign each of these guesses to the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.105510Z",
+ "start_time": "2025-11-20T21:46:17.099824Z"
+ }
+ },
+ "source": [
+ "# tear_guesses = {\n",
+ "# \"flow_mol_phase\": {\n",
+ "# (0, \"Liq\"): F_liq_I101,\n",
+ "# (0, \"Vap\"): F_vap_I102,\n",
+ "#\n",
+ "# },\n",
+ "# \"mole_frac_phase_comp\": {\n",
+ "# (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ "# (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ "# (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
+ "# },\n",
+ "# \"temperature\": {0: 303},\n",
+ "# \"pressure\": {0: 350000},\n",
+ "# }\n",
+ "#\n",
+ "# for k, v in tear_guesses.items():\n",
+ "# for k1, v1 in v.items():\n",
+ "# getattr(m.fs.s03.destination, k)[k1].fix(v1)\n",
+ "#\n",
+ "# DOF_initial = degrees_of_freedom(m)\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after providing the initial guesses\")"
+ ],
+ "outputs": [],
+ "execution_count": 49
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The next step is to manually initialize each unit model starting from the `Heater` and then propagate the connection between it and the next unit model. This manual process ensures a strict order to the user's specification if that is desired. The current standard for initializing a unit model is to use an initializer object most compatible for that unit model. This can most often be done by utilizing the `default_initializer()` method attached to the unit model and then to call the `initialize()` method with the unit model as the argument."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.117110Z",
+ "start_time": "2025-11-20T21:46:17.113630Z"
+ }
+ },
+ "source": [
+ "# m.fs.H101.default_initializer().initialize(m.fs.H101) # Initialize Heater\n",
+ "# propagate_state(m.fs.s04) # Establish connection between Heater and Reactor\n",
+ "#\n",
+ "# m.fs.R101.default_initializer().initialize(m.fs.R101) # Initialize Reactor\n",
+ "# propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit\n",
+ "#\n",
+ "# m.fs.F101.default_initializer().initialize(m.fs.F101) # Initialize First Flash Unit\n",
+ "# propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter\n",
+ "# propagate_state(m.fs.s07) # Establish connection between First Flash Unit and Second Flash Unit\n",
+ "#\n",
+ "# m.fs.S101.default_initializer().initialize(m.fs.S101) # Initialize Splitter\n",
+ "# propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor\n",
+ "#\n",
+ "# m.fs.C101.default_initializer().initialize(m.fs.C101) # Initialize Compressor\n",
+ "# propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer\n",
+ "#\n",
+ "# m.fs.I101.default_initializer().initialize(m.fs.I101) # Initialize Toluene Inlet\n",
+ "# propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.I102.default_initializer().initialize(m.fs.I102) # Initialize Hydrogen Inlet\n",
+ "# propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.M101.default_initializer().initialize(m.fs.M101) # Initialize Mixer\n",
+ "# propagate_state(m.fs.s03) # Establish connection between Mixer and Heater\n",
+ "#\n",
+ "# m.fs.F102.default_initializer().initialize(m.fs.F102) # Initialize Second Flash Unit\n",
+ "# propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product\n",
+ "# propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product\n",
+ "# propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product"
+ ],
+ "outputs": [],
+ "execution_count": 50
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we solve the system to allow the outlet of the mixer to reach a converged congruence with the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.226222Z",
+ "start_time": "2025-11-20T21:46:17.129942Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 300,\n",
+ " \"tol\": 1e-8,\n",
+ "}\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
+ "results = solver.solve(m, tee=True)"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=300\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 3.35e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.07e+03 1.08e+01 -1.0 1.21e+03 - 8.49e-01 6.80e-01h 1\n",
+ " 2 0.0000000e+00 1.66e+02 4.55e+02 -1.0 7.65e+02 - 9.90e-01 8.44e-01h 1\n",
+ " 3 0.0000000e+00 5.53e+00 2.00e+02 -1.0 1.30e+02 - 9.90e-01 9.67e-01h 1\n",
+ " 4 0.0000000e+00 5.22e-02 8.91e+03 -1.0 4.05e+00 - 1.00e+00 9.91e-01h 1\n",
+ " 5 0.0000000e+00 1.46e-04 1.02e+04 -1.0 3.80e-02 - 1.00e+00 9.97e-01h 1\n",
+ " 6 0.0000000e+00 9.46e-11 6.27e-01 -1.0 1.06e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 6\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 7\n",
+ "Number of objective gradient evaluations = 7\n",
+ "Number of equality constraint evaluations = 7\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 7\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 6\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.009\n",
+ "Total CPU secs in NLP function evaluations = 0.001\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 51
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now that the flowsheet is initialized, we can unfix the guesses for the `Heater` and reactive the tear stream to complete the final solve."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.258332Z",
+ "start_time": "2025-11-20T21:46:17.233298Z"
+ }
+ },
+ "source": [
+ "for k, v in tear_guesses.items():\n",
+ " for k1, v1 in v.items():\n",
+ " getattr(m.fs.H101.inlet, k)[k1].unfix()\n",
+ "\n",
+ "m.fs.s03_expanded.activate()\n",
+ "print(\n",
+ " f\"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The DOF is 0 after unfixing the values and reactivating the tear stream\n"
+ ]
+ }
+ ],
+ "execution_count": 52
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6 Solving the Model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "We have now initialized the flowsheet. Lets set up some solving options before simulating the flowsheet. We want to specify the scaling method, number of iterations, and tolerance. More specific or advanced options can be found at the documentation for IPOPT https://coin-or.github.io/Ipopt/OPTIONS.html"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.268422Z",
+ "start_time": "2025-11-20T21:46:17.265316Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 1000,\n",
+ " \"tol\": 1e-8,\n",
+ "}"
+ ],
+ "outputs": [],
+ "execution_count": 53
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"Inline Exercise:\n",
- "We have now initialized the flowsheet. Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
- " \n",
+ "Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
+ "\n",
+ "solver = get_solver(solver_options=optarg)
\n",
"results = solver.solve(m, tee=True)\n",
"\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
+ "Use Shift+Enter to run the cell once you have typed in your code.\n",
+ "\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.285774Z",
+ "start_time": "2025-11-20T21:46:17.281657Z"
+ }
},
- "outputs": [],
"source": [
"# Create the solver object\n",
"\n",
- "\n",
"# Solve the model"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 54
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.382669Z",
+ "start_time": "2025-11-20T21:46:17.293013Z"
+ }
},
- "outputs": [],
"source": [
"# Create the solver object\n",
- "from idaes.core.solvers import get_solver\n",
- "\n",
- "solver = get_solver()\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
"\n",
"# Solve the model\n",
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpi86o_z2t\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpi86o_z2t\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 1.64e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.84e+01 4.18e+00 -1.0 4.14e-01 - 9.90e-01 9.89e-01h 1\n",
+ " 2 0.0000000e+00 1.82e-01 3.87e+00 -1.0 3.76e-01 - 9.90e-01 9.90e-01h 1\n",
+ " 3 0.0000000e+00 6.96e-04 4.53e+02 -1.0 3.70e-02 - 9.92e-01 9.96e-01h 1\n",
+ " 4 0.0000000e+00 4.52e-09 8.75e-01 -1.0 3.82e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 4\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 4.5247361413203180e-09 4.5247361413203180e-09\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 4.5247361413203180e-09 4.5247361413203180e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 5\n",
+ "Number of objective gradient evaluations = 5\n",
+ "Number of equality constraint evaluations = 5\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 5\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 4\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.008\n",
+ "Total CPU secs in NLP function evaluations = 0.000\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 55
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Analyze the results of the square problem\n",
- "\n",
+ "## 7 Analyze the results\n",
"\n",
- "What is the total operating cost? "
+ "\n"
]
},
{
- "cell_type": "code",
- "execution_count": null,
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "If the IDAES UI package was installed with the `idaes-pse` installation or installed separately, you can run the flowsheet visualizer to see a full diagram of the full process that is generated and displayed on a browser window.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "tags": [
+ "noauto"
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.403453Z",
+ "start_time": "2025-11-20T21:46:17.400372Z"
+ }
+ },
+ "source": [
+ "# m.fs.visualize(\"HDA-Flowsheet\")"
+ ],
"outputs": [],
+ "execution_count": 57
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ "Otherwise, we can run the `m.fs.report()` method to see a full summary of the solved flowsheet. It is recommended to adjust the width of the output as much as possible for the cleanest display."
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.448969Z",
+ "start_time": "2025-11-20T21:46:17.421434Z"
+ }
+ },
+ "source": [
+ "m.fs.report()"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Flowsheet : fs Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units s01 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 \n",
+ " Total Molar Flowrate mole / second 0.30005 0.32004 2.0320 2.0320 2.0320 1.7648 0.26712 1.4119 1.4119 0.17224 0.094878 0.35297\n",
+ " Total Mole Fraction benzene dimensionless 6.6656e-05 6.2492e-05 0.058732 0.058732 0.17408 0.084499 0.76595 0.084499 0.084499 0.82430 0.66001 0.084499\n",
+ " Total Mole Fraction toluene dimensionless 0.99987 6.2492e-05 0.15380 0.15380 0.038450 0.0088437 0.23405 0.0088437 0.0088437 0.17570 0.33999 0.0088437\n",
+ " Total Mole Fraction hydrogen dimensionless 3.3328e-05 0.93738 0.27683 0.27683 0.16148 0.18592 6.9600e-09 0.18592 0.18592 1.0794e-08 1.1376e-15 0.18592\n",
+ " Total Mole Fraction methane dimensionless 3.3328e-05 0.062492 0.51064 0.51064 0.62599 0.72074 2.6982e-08 0.72074 0.72074 4.1844e-08 4.4103e-15 0.72074\n",
+ " Temperature kelvin 303.20 303.20 324.54 600.00 822.07 325.00 325.00 325.00 325.00 375.00 375.00 325.00\n",
+ " Pressure pascal 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 1.5000e+05 1.5000e+05 3.5000e+05\n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 58
+ },
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? "
+ "What is the total operating cost?"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.475550Z",
+ "start_time": "2025-11-20T21:46:17.472001Z"
+ }
+ },
+ "source": [
+ "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 424513.9640158265\n"
+ ]
+ }
+ ],
+ "execution_count": 59
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
+ "source": [
+ "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? We can look at a specific unit models stream table with the same `report()` method."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.596910Z",
+ "start_time": "2025-11-20T21:46:17.580529Z"
+ }
+ },
"source": [
"m.fs.F102.report()\n",
"\n",
"print()\n",
"print(\"benzene purity = \", value(m.fs.purity))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 7346.0 : watt : False : (None, None)\n",
+ " Pressure Change : -2.0000e+05 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.26712 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.76595 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.23405 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 6.9600e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.6982e-08 - - \n",
+ " Temperature kelvin 325.00 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.094878 \n",
+ " flow_mol_phase Vap mole / second - 0.17224 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.66001 0.66001 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.33999 0.33999 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.82430 0.82430 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.17570 0.17570 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.0794e-08 1.0794e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.1844e-08 4.1844e-08 \n",
+ " temperature kelvin - 375.00 375.00 \n",
+ " pressure pascal - 1.5000e+05 1.5000e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8242963521555956\n"
+ ]
+ }
+ ],
+ "execution_count": 61
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101.\n",
- "\n",
- "
\n",
- "Inline Exercise:\n",
- "How much benzene are we losing in the F101 vapor outlet stream?\n",
- "
\n"
+ "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.648524Z",
+ "start_time": "2025-11-20T21:46:17.638446Z"
+ }
+ },
"source": [
"from idaes.core.util.tables import (\n",
" create_stream_table_dataframe,\n",
@@ -1099,25 +2571,30 @@
"\n",
"st = create_stream_table_dataframe({\"Reactor\": m.fs.s05, \"Light Gases\": m.fs.s06})\n",
"print(stream_table_dataframe_to_string(st))"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "
\n",
- "Inline Exercise:\n",
- "You can query additional variables here if you like. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Units Reactor Light Gases\n",
+ "Total Molar Flowrate mole / second 2.0320 1.7648 \n",
+ "Total Mole Fraction benzene dimensionless 0.17408 0.084499 \n",
+ "Total Mole Fraction toluene dimensionless 0.038450 0.0088437 \n",
+ "Total Mole Fraction hydrogen dimensionless 0.16148 0.18592 \n",
+ "Total Mole Fraction methane dimensionless 0.62599 0.72074 \n",
+ "Temperature kelvin 822.07 325.00 \n",
+ "Pressure pascal 3.5000e+05 3.5000e+05 \n"
+ ]
+ }
+ ],
+ "execution_count": 63
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization\n",
+ "## 8 Optimization\n",
"\n",
"\n",
"We saw from the results above that the total operating cost for the base case was $419,122 per year. We are producing 0.142 mol/s of benzene at a purity of 82\\%. However, we are losing around 42\\% of benzene in F101 vapor outlet stream. \n",
@@ -1144,12 +2621,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.675626Z",
+ "start_time": "2025-11-20T21:46:17.671136Z"
+ }
+ },
"source": [
"m.fs.objective = Objective(expr=m.fs.operating_cost)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 64
},
{
"cell_type": "markdown",
@@ -1160,19 +2642,28 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.691883Z",
+ "start_time": "2025-11-20T21:46:17.687385Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.unfix()\n",
"m.fs.R101.heat_duty.unfix()\n",
"m.fs.F101.vap_outlet.temperature.unfix()\n",
"m.fs.F102.vap_outlet.temperature.unfix()"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 65
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1185,30 +2676,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.707409Z",
+ "start_time": "2025-11-20T21:46:17.704141Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Unfix deltaP for F102"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 66
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.720592Z",
+ "start_time": "2025-11-20T21:46:17.717532Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Unfix deltaP for F102\n",
"m.fs.F102.deltaP.unfix()"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 67
},
{
"cell_type": "markdown",
@@ -1227,17 +2726,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.779305Z",
+ "start_time": "2025-11-20T21:46:17.775669Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature[0].setlb(500)\n",
"m.fs.H101.outlet.temperature[0].setub(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 69
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1249,31 +2757,39 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.797044Z",
+ "start_time": "2025-11-20T21:46:17.794614Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 70
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.812504Z",
+ "start_time": "2025-11-20T21:46:17.807564Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature\n",
"m.fs.R101.outlet.temperature[0].setlb(600)\n",
"m.fs.R101.outlet.temperature[0].setub(800)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 71
},
{
"cell_type": "markdown",
@@ -1284,9 +2800,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.827227Z",
+ "start_time": "2025-11-20T21:46:17.822681Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature[0].setlb(298.0)\n",
"m.fs.F101.vap_outlet.temperature[0].setub(450.0)\n",
@@ -1294,7 +2813,9 @@
"m.fs.F102.vap_outlet.temperature[0].setub(450.0)\n",
"m.fs.F102.vap_outlet.pressure[0].setlb(105000)\n",
"m.fs.F102.vap_outlet.pressure[0].setub(110000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 72
},
{
"cell_type": "markdown",
@@ -1305,19 +2826,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.848212Z",
+ "start_time": "2025-11-20T21:46:17.844101Z"
+ }
+ },
"source": [
"m.fs.overhead_loss = Constraint(\n",
- " expr=m.fs.F101.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " <= 0.20 * m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " <= 0.20\n",
+ " * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 73
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1329,32 +2862,43 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.862411Z",
+ "start_time": "2025-11-20T21:46:17.859385Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 74
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.876414Z",
+ "start_time": "2025-11-20T21:46:17.872250Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint\n",
"m.fs.product_flow = Constraint(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"] >= 0.15\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " >= 0.15\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 75
},
{
"cell_type": "markdown",
@@ -1365,12 +2909,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.890250Z",
+ "start_time": "2025-11-20T21:46:17.887141Z"
+ }
+ },
"source": [
"m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 76
},
{
"cell_type": "markdown",
@@ -1384,27 +2933,141 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.024828Z",
+ "start_time": "2025-11-20T21:46:17.897344Z"
+ }
+ },
"source": [
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 938\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 9\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 504\n",
+ "\n",
+ "Reallocating memory for MA57: lfact (10594)\n",
+ "Total number of variables............................: 224\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 151\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 219\n",
+ "Total number of inequality constraints...............: 3\n",
+ " inequality constraints with only lower bounds: 2\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 1\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 4.2451396e+05 4.00e+04 6.94e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (11249)\n",
+ " 1 4.2182392e+05 4.00e+04 6.94e+00 -1.0 3.47e+07 - 3.71e-05 1.25e-05f 1\n",
+ " 2 4.2170773e+05 4.00e+04 8.41e+01 -1.0 1.49e+06 - 3.32e-04 1.53e-05f 1\n",
+ " 3 4.1795462e+05 4.00e+04 6.82e+01 -1.0 1.43e+06 - 4.98e-04 5.60e-04f 1\n",
+ " 4 3.0650178e+05 4.00e+04 3.09e+02 -1.0 1.26e+07 - 2.61e-05 1.17e-03f 1\n",
+ " 5 3.0553183e+05 3.99e+04 3.25e+04 -1.0 1.48e+05 - 1.28e-01 1.02e-03f 1\n",
+ " 6 3.0565526e+05 3.91e+04 5.25e+04 -1.0 3.99e+04 - 1.13e-01 2.09e-02h 2\n",
+ " 7 3.0601574e+05 3.59e+04 4.21e+04 -1.0 3.91e+04 - 5.17e-02 8.21e-02h 2\n",
+ " 8 3.0674242e+05 2.95e+04 8.41e+04 -1.0 3.59e+04 - 4.38e-01 1.79e-01h 1\n",
+ " 9 3.1153051e+05 1.11e+04 5.73e+04 -1.0 2.95e+04 - 8.56e-01 6.23e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10 3.1154545e+05 1.09e+04 5.69e+04 -1.0 1.19e+04 - 6.57e-02 2.37e-02h 1\n",
+ " 11 3.1159568e+05 1.08e+04 5.66e+04 -1.0 1.68e+04 - 2.23e-02 8.97e-03h 1\n",
+ " 12 3.1610911e+05 2.56e+03 2.13e+05 -1.0 1.68e+04 - 9.47e-01 7.94e-01h 1\n",
+ " 13 3.1708718e+05 1.16e+03 9.56e+04 -1.0 4.45e+03 - 9.90e-01 5.53e-01h 1\n",
+ " 14 3.1796760e+05 4.06e+02 1.14e+03 -1.0 1.27e+04 - 9.95e-01 9.87e-01h 1\n",
+ " 15 3.1802429e+05 5.35e+00 6.53e+02 -1.0 8.29e+01 - 1.00e+00 9.89e-01h 1\n",
+ " 16 3.1802524e+05 1.77e-04 5.89e+02 -1.0 5.10e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 17 3.1802492e+05 5.34e-06 1.83e+06 -2.5 1.32e+00 - 3.33e-01 1.00e+00f 1\n",
+ " 18 3.1802492e+05 1.70e-09 9.74e-03 -2.5 2.42e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 19 3.1802491e+05 4.41e-09 1.03e-01 -5.7 3.83e-02 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20 3.1802491e+05 2.39e-03 8.22e-09 -5.7 2.88e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 21 3.1802491e+05 8.00e-11 9.72e-09 -5.7 4.08e-04 - 1.00e+00 1.00e+00h 1\n",
+ " 22 3.1802491e+05 2.47e-03 1.19e-01 -8.6 2.93e+01 - 9.99e-01 1.00e+00h 1\n",
+ " 23 3.1802491e+05 2.41e+02 2.13e-09 -8.6 9.27e+03 - 1.00e+00 1.00e+00h 1\n",
+ " 24 3.1802491e+05 6.96e-03 3.66e-09 -8.6 1.88e+02 - 1.00e+00 1.00e+00h 1\n",
+ " 25 3.1802491e+05 3.61e-06 1.59e-09 -8.6 1.21e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 26 3.1802491e+05 2.29e-05 4.82e-09 -8.6 3.07e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 27 3.1802491e+05 9.42e-07 5.47e-09 -8.6 6.24e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 28 3.1802491e+05 1.16e-10 9.67e-09 -8.6 3.01e+00 - 1.00e+00 1.00e+00H 1\n",
+ "\n",
+ "Number of Iterations....: 28\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 3.1802490940142004e+05 3.1802490940142004e+05\n",
+ "Dual infeasibility......: 9.6706583658121551e-09 9.6706583658121551e-09\n",
+ "Constraint violation....: 1.1641532182693481e-10 1.1641532182693481e-10\n",
+ "Complementarity.........: 2.5059899579272651e-09 2.5059899579272651e-09\n",
+ "Overall NLP error.......: 2.2246107350021195e-10 9.6706583658121551e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 35\n",
+ "Number of objective gradient evaluations = 29\n",
+ "Number of equality constraint evaluations = 35\n",
+ "Number of inequality constraint evaluations = 35\n",
+ "Number of equality constraint Jacobian evaluations = 29\n",
+ "Number of inequality constraint Jacobian evaluations = 29\n",
+ "Number of Lagrangian Hessian evaluations = 28\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.036\n",
+ "Total CPU secs in NLP function evaluations = 0.006\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 77
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization Results\n",
+ "### 8.1 Optimization Results\n",
"\n",
"Display the results and product specifications"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.074231Z",
+ "start_time": "2025-11-20T21:46:18.053675Z"
+ }
+ },
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))\n",
"\n",
@@ -1419,7 +3082,89 @@
"print()\n",
"print(\"Overhead loss in F101\")\n",
"m.fs.F101.report()"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 318024.90940142004\n",
+ "\n",
+ "Product flow rate and purity in F102\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 8369.3 : watt : False : (None, None)\n",
+ " Pressure Change : -2.4500e+05 : pascal : False : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.28812 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.75463 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.24537 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 7.5018e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.5957e-08 - - \n",
+ " Temperature kelvin 301.88 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.10493 \n",
+ " flow_mol_phase Vap mole / second - 0.18319 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.64256 0.64256 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.35744 0.35744 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.81883 0.81883 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.18117 0.18117 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.1799e-08 1.1799e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.0825e-08 4.0825e-08 \n",
+ " temperature kelvin - 362.93 362.93 \n",
+ " pressure pascal - 1.0500e+05 1.0500e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8188295888411846\n",
+ "\n",
+ "Overhead loss in F101\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F101 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -66423. : watt : False : (None, None)\n",
+ " Pressure Change : 0.0000 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 1.9480 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.13952 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.039059 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 0.18417 - - \n",
+ " Total Mole Fraction methane dimensionless 0.63725 - - \n",
+ " Temperature kelvin 763.51 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.28812 \n",
+ " flow_mol_phase Vap mole / second - 1.6598 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.75463 0.75463 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.24537 0.24537 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.032748 0.032748 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.0032478 0.0032478 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.21614 0.21614 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.74786 0.74786 \n",
+ " temperature kelvin - 301.88 301.88 \n",
+ " pressure pascal - 3.5000e+05 3.5000e+05 \n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 79
},
{
"cell_type": "markdown",
@@ -1430,32 +3175,47 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.106001Z",
+ "start_time": "2025-11-20T21:46:18.101768Z"
+ }
+ },
"source": [
- "print(\"Optimal Values\")\n",
- "print()\n",
+ "print(\n",
+ " f\"\"\"Optimal Values:\n",
"\n",
- "print(\"H101 outlet temperature = \", value(m.fs.H101.outlet.temperature[0]), \"K\")\n",
+ "H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"R101 outlet temperature = \", value(m.fs.R101.outlet.temperature[0]), \"K\")\n",
+ "R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F101 outlet temperature = \", value(m.fs.F101.vap_outlet.temperature[0]), \"K\")\n",
+ "F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F102 outlet temperature = \", value(m.fs.F102.vap_outlet.temperature[0]), \"K\")\n",
- "print(\"F102 outlet pressure = \", value(m.fs.F102.vap_outlet.pressure[0]), \"Pa\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
+ "F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K\n",
+ "F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa\n",
+ "\"\"\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Optimal Values:\n",
+ "\n",
+ "H101 outlet temperature = 500.000 K\n",
+ "\n",
+ "R101 outlet temperature = 763.507 K\n",
+ "\n",
+ "F101 outlet temperature = 301.881 K\n",
+ "\n",
+ "F102 outlet temperature = 362.935 K\n",
+ "F102 outlet pressure = 105000.000 Pa\n",
+ "\n"
+ ]
+ }
+ ],
+ "execution_count": 81
}
],
"metadata": {
@@ -1475,7 +3235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.12"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_test.ipynb b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_test.ipynb
index 415cf48c..471da278 100644
--- a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_test.ipynb
+++ b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_test.ipynb
@@ -2,18 +2,20 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"header",
"hide-cell"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:04.904828Z",
+ "start_time": "2025-11-20T21:46:04.900352Z"
+ }
},
- "outputs": [],
"source": [
"###############################################################################\n",
"# The Institute for the Design of Advanced Energy Systems Integrated Platform\n",
- "# Framework (IDAES IP) was produced under the DOE Institute for the\n",
+ "# Framework (idaes IP) was produced under the DOE Institute for the\n",
"# Design of Advanced Energy Systems (IDAES).\n",
"#\n",
"# Copyright (c) 2018-2023 by the software owners: The Regents of the\n",
@@ -23,7 +25,9 @@
"# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n",
"# for full copyright and license information.\n",
"###############################################################################"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 1
},
{
"cell_type": "markdown",
@@ -32,20 +36,34 @@
"\n",
"# HDA Flowsheet Simulation and Optimization\n",
"\n",
- "Author: Jaffer Ghouse \n",
- "Maintainer: Brandon Paul \n",
- "Updated: 2023-06-01 \n",
+ "Author: Jaffer Ghouse
\n",
+ "Maintainer: Tanner Polley
\n",
+ "Updated: 2025-11-19\n",
"\n",
"## Learning outcomes\n",
"\n",
"\n",
"- Construct a steady-state flowsheet using the IDAES unit model library\n",
- "- Connecting unit models in a flowsheet using Arcs\n",
+ "- Connecting unit models in a flowsheet using Arcs\n",
"- Using the SequentialDecomposition tool to initialize a flowsheet with recycle\n",
- "- Fomulate and solve an optimization problem\n",
+ "- Formulate and solve an optimization problem\n",
" - Defining an objective function\n",
" - Setting variable bounds\n",
- " - Adding additional constraints \n",
+ " - Adding additional constraints\n",
+ "\n",
+ "\n",
+ "The general workflow of setting up an IDAES flowsheet is the following:\n",
+ "\n",
+ " 1 Importing Modules
\n",
+ " 2 Building a Model
\n",
+ " 3 Scaling the Model
\n",
+ " 4 Specifying the Model
\n",
+ " 5 Initializing the Model
\n",
+ " 6 Solving the Model
\n",
+ " 7 Analyzing and Visualizing the Results
\n",
+ " 8 Optimizing the Model
\n",
+ "\n",
+ "We will complete each of these steps as well as demonstrate analyses on this model through some examples and exercises.\n",
"\n",
"\n",
"## Problem Statement\n",
@@ -81,10 +99,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required pyomo and idaes components\n",
+ "## 1 Importing Modules\n",
+ "### 1.1 Importing required Pyomo and IDAES components\n",
"\n",
"\n",
- "To construct a flowsheet, we will need several components from the pyomo and idaes package. Let us first import the following components from Pyomo:\n",
+ "To construct a flowsheet, we will need several components from the Pyomo and IDAES package. Let us first import the following components from Pyomo:\n",
"- Constraint (to write constraints)\n",
"- Var (to declare variables)\n",
"- ConcreteModel (to create the concrete model object)\n",
@@ -95,14 +114,17 @@
"- Arc (to connect two unit models)\n",
"- SequentialDecomposition (to initialize the flowsheet in a sequential mode)\n",
"\n",
- "For further details on these components, please refer to the pyomo documentation: https://pyomo.readthedocs.io/en/stable/\n"
+ "For further details on these components, please refer to the Pyomo documentation: https://Pyomo.readthedocs.io/en/stable/\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:05.294578Z",
+ "start_time": "2025-11-20T21:46:04.908296Z"
+ }
+ },
"source": [
"from pyomo.environ import (\n",
" Constraint,\n",
@@ -110,40 +132,51 @@
" ConcreteModel,\n",
" Expression,\n",
" Objective,\n",
- " SolverFactory,\n",
" TransformationFactory,\n",
" value,\n",
")\n",
"from pyomo.network import Arc, SequentialDecomposition"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "From idaes, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "From IDAES, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "- Feed\n",
"- Mixer\n",
"- Heater\n",
"- StoichiometricReactor\n",
"-
**Flash**\n",
"- Separator (splitter) \n",
- "- PressureChanger"
+ "- PressureChanger\n",
+ "- Product"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:06.806301Z",
+ "start_time": "2025-11-20T21:46:05.297760Z"
+ }
+ },
"source": [
"from idaes.core import FlowsheetBlock"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 3
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.936732Z",
+ "start_time": "2025-11-20T21:46:09.883054Z"
+ }
+ },
"source": [
"from idaes.models.unit_models import (\n",
" PressureChanger,\n",
@@ -151,8 +184,14 @@
" Separator as Splitter,\n",
" Heater,\n",
" StoichiometricReactor,\n",
- ")"
- ]
+ " Feed,\n",
+ " Product,\n",
+ ")\n",
+ "from idaes.core.util.exceptions import InitializationError\n",
+ "import idaes.logger as idaeslog"
+ ],
+ "outputs": [],
+ "execution_count": 4
},
{
"cell_type": "markdown",
@@ -166,17 +205,21 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.963041Z",
+ "start_time": "2025-11-20T21:46:09.957319Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: import flash model from idaes.models.unit_models\n",
"from idaes.models.unit_models import Flash"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 6
},
{
"cell_type": "markdown",
@@ -187,24 +230,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.976914Z",
+ "start_time": "2025-11-20T21:46:09.971944Z"
+ }
+ },
"source": [
"from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n",
"from idaes.core.util.model_statistics import degrees_of_freedom\n",
"\n",
"# Import idaes logger to set output levels\n",
- "import idaes.logger as idaeslog\n",
- "from idaes.core.solvers import get_solver\n",
- "from idaes.core.util.exceptions import InitializationError"
- ]
+ "from idaes.core.solvers import get_solver"
+ ],
+ "outputs": [],
+ "execution_count": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required thermo and reaction package\n",
+ "### 1.2 Importing required thermo and reaction package\n",
"\n",
"The final set of imports are to import the thermo and reaction package for the HDA process. We have created a custom thermo package that assumes Ideal Gas with support for VLE. \n",
"\n",
@@ -219,33 +265,49 @@
]
},
{
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.017098Z",
+ "start_time": "2025-11-20T21:46:09.981997Z"
+ }
+ },
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
"source": [
- "from idaes_examples.mod.hda import hda_ideal_VLE as thermo_props\n",
- "from idaes_examples.mod.hda import hda_reaction as reaction_props"
- ]
+ "from idaes.models.properties.modular_properties.base.generic_property import (\n",
+ " GenericParameterBlock,\n",
+ ")\n",
+ "from idaes.models.properties.modular_properties.base.generic_reaction import (\n",
+ " GenericReactionParameterBlock,\n",
+ ")\n",
+ "from idaes_examples.mod.hda.hda_ideal_VLE_modular import thermo_config\n",
+ "from idaes_examples.mod.hda.hda_reaction_modular import reaction_config"
+ ],
+ "outputs": [],
+ "execution_count": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Constructing the Flowsheet\n",
+ "## 2 Constructing the Flowsheet\n",
"\n",
- "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block as we did in module 1. "
+ "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.031538Z",
+ "start_time": "2025-11-20T21:46:10.025904Z"
+ }
+ },
"source": [
"m = ConcreteModel()\n",
"m.fs = FlowsheetBlock(dynamic=False)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 9
},
{
"cell_type": "markdown",
@@ -256,34 +318,46 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.066746Z",
+ "start_time": "2025-11-20T21:46:10.035131Z"
+ }
+ },
"source": [
- "m.fs.thermo_params = thermo_props.HDAParameterBlock()\n",
- "m.fs.reaction_params = reaction_props.HDAReactionParameterBlock(\n",
- " property_package=m.fs.thermo_params\n",
+ "m.fs.thermo_params = GenericParameterBlock(**thermo_config)\n",
+ "m.fs.reaction_params = GenericReactionParameterBlock(\n",
+ " property_package=m.fs.thermo_params, **reaction_config\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding Unit Models\n",
+ "### 2.1 Adding Unit Models\n",
"\n",
- "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Mixer (assigned a name M101) and a Heater (assigned a name H101). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the Mixer unit model here is given a `list` consisting of names to the three inlets. "
+ "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Feed (assigned a name `I101` for Inlet), `Mixer` (assigned a name `M101`) and a `Heater` (assigned a name `H101`). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the `Mixer` unit model here must be specified the number of inlets that it will take in and the `Heater` can have specific settings enabled such as `has_pressure_change` or `has_phase_equilibrium`."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.114600Z",
+ "start_time": "2025-11-20T21:46:10.071845Z"
+ }
+ },
"source": [
+ "m.fs.I101 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.I102 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
"m.fs.M101 = Mixer(\n",
" property_package=m.fs.thermo_params,\n",
- " inlet_list=[\"toluene_feed\", \"hydrogen_feed\", \"vapor_recycle\"],\n",
+ " num_inlets=3,\n",
")\n",
"\n",
"m.fs.H101 = Heater(\n",
@@ -291,34 +365,21 @@
" has_pressure_change=False,\n",
" has_phase_equilibrium=True,\n",
")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "
\n",
- "
Inline Exercise:\n",
- "Let us now add the StoichiometricReactor(assign the name R101) and pass the following arguments:\n",
- "
\n",
- " - \"property_package\": m.fs.thermo_params
\n",
- " - \"reaction_package\": m.fs.reaction_params
\n",
- " - \"has_heat_of_reaction\": True
\n",
- " - \"has_heat_transfer\": True
\n",
- " - \"has_pressure_change\": False
\n",
- "
\n",
- "
"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 11
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.145853Z",
+ "start_time": "2025-11-20T21:46:10.127921Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add reactor with the specifications above\n",
"m.fs.R101 = StoichiometricReactor(\n",
@@ -328,7 +389,9 @@
" has_heat_transfer=True,\n",
" has_pressure_change=False,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 13
},
{
"cell_type": "markdown",
@@ -344,29 +407,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.167357Z",
+ "start_time": "2025-11-20T21:46:10.149935Z"
+ }
+ },
"source": [
"m.fs.F101 = Flash(\n",
" property_package=m.fs.thermo_params,\n",
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us now add the Splitter(S101), PressureChanger(C101) and the second Flash(F102). "
+ "Let us now add the Splitter(S101) with specific names for its output (purge and recycle), PressureChanger(C101) and the second Flash(F102)."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.211911Z",
+ "start_time": "2025-11-20T21:46:10.173255Z"
+ }
+ },
"source": [
"m.fs.S101 = Splitter(\n",
" property_package=m.fs.thermo_params,\n",
@@ -386,53 +457,84 @@
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 15
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Connecting Unit Models using Arcs\n",
- "\n",
- "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the mixer(M101) to the inlet of the heater(H101). "
+ "Last, we will add the three Product blocks (P101, P102, P103). We use `Feed` blocks and `Product` blocks for convenience with reporting stream summaries and consistency"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.226989Z",
+ "start_time": "2025-11-20T21:46:10.216839Z"
+ }
+ },
+ "source": [
+ "m.fs.P101 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P102 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P103 = Product(property_package=m.fs.thermo_params)"
+ ],
"outputs": [],
+ "execution_count": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ "### 2.2 Connecting Unit Models using Arcs\n",
+ "\n",
+ "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a Pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the inlets (I101, I102) to the inlet of the mixer (M101) and outlet of the mixer to the inlet of the heater(H101)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- " \n",
- "\n",
- "
\n",
- "Inline Exercise:\n",
- "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide. \n",
- "
\n",
- "\n"
+ ""
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.235541Z",
+ "start_time": "2025-11-20T21:46:10.231058Z"
+ }
+ },
+ "source": [
+ "m.fs.s01 = Arc(source=m.fs.I101.outlet, destination=m.fs.M101.inlet_1)\n",
+ "m.fs.s02 = Arc(source=m.fs.I102.outlet, destination=m.fs.M101.inlet_2)\n",
+ "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 17
+ },
+ {
+ "cell_type": "code",
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.254153Z",
+ "start_time": "2025-11-20T21:46:10.248481Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Connect the H101 outlet to R101 inlet\n",
"m.fs.s04 = Arc(source=m.fs.H101.outlet, destination=m.fs.R101.inlet)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 19
},
{
"cell_type": "markdown",
@@ -443,17 +545,45 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.264461Z",
+ "start_time": "2025-11-20T21:46:10.258555Z"
+ }
+ },
"source": [
"m.fs.s05 = Arc(source=m.fs.R101.outlet, destination=m.fs.F101.inlet)\n",
"m.fs.s06 = Arc(source=m.fs.F101.vap_outlet, destination=m.fs.S101.inlet)\n",
+ "m.fs.s07 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)\n",
"m.fs.s08 = Arc(source=m.fs.S101.recycle, destination=m.fs.C101.inlet)\n",
- "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.vapor_recycle)\n",
- "m.fs.s10 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)"
+ "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.inlet_3)"
+ ],
+ "outputs": [],
+ "execution_count": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Last we will connect the outlet streams to the inlets of the Product blocks (P101, P102, P103)"
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.274505Z",
+ "start_time": "2025-11-20T21:46:10.268918Z"
+ }
+ },
+ "source": [
+ "m.fs.s10 = Arc(source=m.fs.F102.vap_outlet, destination=m.fs.P101.inlet)\n",
+ "m.fs.s11 = Arc(source=m.fs.F102.liq_outlet, destination=m.fs.P102.inlet)\n",
+ "m.fs.s12 = Arc(source=m.fs.S101.purge, destination=m.fs.P103.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 21
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -463,20 +593,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.303264Z",
+ "start_time": "2025-11-20T21:46:10.278714Z"
+ }
+ },
"source": [
"TransformationFactory(\"network.expand_arcs\").apply_to(m)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 22
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding expressions to compute purity and operating costs\n",
+ "### 2.3 Adding expressions to compute purity and operating costs\n",
"\n",
- "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/pyomo_modeling_components/Expressions.html\n",
+ "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/explanation/modeling/network.html.\n",
"\n",
"For this flowsheet, we are interested in computing the purity of the product Benzene stream (i.e. the mole fraction) and the operating cost which is a sum of the cooling and heating cost. "
]
@@ -490,18 +625,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.312336Z",
+ "start_time": "2025-11-20T21:46:10.309074Z"
+ }
+ },
"source": [
"m.fs.purity = Expression(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
" / (\n",
- " m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " + m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
+ " + m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 23
},
{
"cell_type": "markdown",
@@ -512,14 +656,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.323538Z",
+ "start_time": "2025-11-20T21:46:10.318119Z"
+ }
+ },
"source": [
"m.fs.cooling_cost = Expression(\n",
" expr=0.212e-7 * (-m.fs.F101.heat_duty[0]) + 0.212e-7 * (-m.fs.R101.heat_duty[0])\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 24
},
{
"cell_type": "markdown",
@@ -536,14 +685,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.336983Z",
+ "start_time": "2025-11-20T21:46:10.328380Z"
+ }
+ },
"source": [
"m.fs.heating_cost = Expression(\n",
" expr=2.2e-7 * m.fs.H101.heat_duty[0] + 1.9e-7 * m.fs.F102.heat_duty[0]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 25
},
{
"cell_type": "markdown",
@@ -554,78 +708,112 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.345607Z",
+ "start_time": "2025-11-20T21:46:10.341996Z"
+ }
+ },
"source": [
"m.fs.operating_cost = Expression(\n",
" expr=(3600 * 24 * 365 * (m.fs.heating_cost + m.fs.cooling_cost))\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 26
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing feed conditions\n",
+ "## 4 Specifying the Model\n",
+ "### 4.1 Fixing feed conditions\n",
"\n",
"Let us first check how many degrees of freedom exist for this flowsheet using the `degrees_of_freedom` tool we imported earlier. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.376586Z",
+ "start_time": "2025-11-20T21:46:10.349694Z"
+ }
+ },
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "29\n"
+ ]
+ }
+ ],
+ "execution_count": 27
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.409008Z",
+ "start_time": "2025-11-20T21:46:10.382157Z"
+ }
},
- "outputs": [],
"source": [
"# Check the degrees of freedom\n",
"assert degrees_of_freedom(m) == 29"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 28
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "We will now be fixing the toluene feed stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing. "
+ "We will now be fixing the toluene feed (`I101`) stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.418520Z",
+ "start_time": "2025-11-20T21:46:10.414167Z"
+ }
+ },
"source": [
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(0.30)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.temperature.fix(303.2)\n",
- "m.fs.M101.toluene_feed.pressure.fix(350000)"
- ]
+ "F_liq_toluene = 0.30\n",
+ "F_liq_non_zero = 1e-5\n",
+ "\n",
+ "F_vap_I101 = F_liq_non_zero * 4\n",
+ "F_liq_I101 = F_liq_toluene + F_liq_non_zero\n",
+ "\n",
+ "m.fs.I101.flow_mol_phase[0, \"Vap\"].fix(F_vap_I101)\n",
+ "m.fs.I101.flow_mol_phase[0, \"Liq\"].fix(F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_toluene / F_liq_I101)\n",
+ "m.fs.I101.temperature.fix(303.2)\n",
+ "m.fs.I101.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 29
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
- "Similarly, let us fix the hydrogen feed to the following conditions in the next cell:\n",
+ "Similarly, let us fix the hydrogen feed (`I102`) to the following conditions in the next cell:\n",
"
\n",
" - FH2 = 0.30 mol/s
\n",
" - FCH4 = 0.02 mol/s
\n",
@@ -638,39 +826,59 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.429169Z",
+ "start_time": "2025-11-20T21:46:10.422052Z"
+ }
+ },
"source": [
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(0.30)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(0.02)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.temperature.fix(303.2)\n",
- "m.fs.M101.hydrogen_feed.pressure.fix(350000)"
- ]
+ "F_vap_hydrogen = 0.30\n",
+ "F_vap_methane = 0.020\n",
+ "\n",
+ "F_vap_non_zero = 1e-5\n",
+ "F_liq_non_zero = F_vap_non_zero\n",
+ "\n",
+ "F_vap_I102 = F_vap_hydrogen + F_vap_methane + 2 * F_vap_non_zero\n",
+ "F_liq_I102 = 2 * F_vap_non_zero\n",
+ "\n",
+ "m.fs.I102.flow_mol_phase[0, \"Vap\"].fix(F_vap_I102)\n",
+ "m.fs.I102.flow_mol_phase[0, \"Liq\"].fix(F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_vap_hydrogen / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_vap_methane / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "\n",
+ "m.fs.I102.temperature.fix(303.2)\n",
+ "m.fs.I102.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 30
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing unit model specifications\n",
+ "### 4.2 Fixing unit model specifications\n",
"\n",
"Now that we have fixed our inlet feed conditions, we will now be fixing the operating conditions for the unit models in the flowsheet. Let us set set the H101 outlet temperature to 600 K. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.441145Z",
+ "start_time": "2025-11-20T21:46:10.433569Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.fix(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 31
},
{
"cell_type": "markdown",
@@ -681,23 +889,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.453419Z",
+ "start_time": "2025-11-20T21:46:10.445363Z"
+ }
+ },
"source": [
"m.fs.R101.conversion = Var(initialize=0.75, bounds=(0, 1))\n",
"\n",
"m.fs.R101.conv_constraint = Constraint(\n",
- " expr=m.fs.R101.conversion * m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " expr=m.fs.R101.conversion\n",
+ " * (m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"])\n",
" == (\n",
- " m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
- " - m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"]\n",
+ " - m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")\n",
"\n",
"m.fs.R101.conversion.fix(0.75)\n",
"m.fs.R101.heat_duty.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 32
},
{
"cell_type": "markdown",
@@ -708,43 +924,36 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.463025Z",
+ "start_time": "2025-11-20T21:46:10.457476Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature.fix(325.0)\n",
"m.fs.F101.deltaP.fix(0)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "
Inline Exercise:\n",
- "Set the conditions for Flash F102 to the following conditions:\n",
- "
\n",
- " - T = 375 K
\n",
- " - deltaP = -200000
\n",
- "
\n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 33
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.482109Z",
+ "start_time": "2025-11-20T21:46:10.475567Z"
+ }
},
- "outputs": [],
"source": [
"m.fs.F102.vap_outlet.temperature.fix(375)\n",
"m.fs.F102.deltaP.fix(-200000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 35
},
{
"cell_type": "markdown",
@@ -755,77 +964,99 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.491620Z",
+ "start_time": "2025-11-20T21:46:10.485173Z"
+ }
+ },
"source": [
"m.fs.S101.split_fraction[0, \"purge\"].fix(0.2)\n",
"m.fs.C101.outlet.pressure.fix(350000)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "We have now defined all the feed conditions and the inputs required for the unit models. The system should now have 0 degrees of freedom i.e. should be a square problem. Please check that the degrees of freedom is 0. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 36
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.535421Z",
+ "start_time": "2025-11-20T21:46:10.507798Z"
+ }
},
- "outputs": [],
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "execution_count": 38
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.568992Z",
+ "start_time": "2025-11-20T21:46:10.542995Z"
+ }
},
- "outputs": [],
"source": [
"# Check the degrees of freedom\n",
"assert degrees_of_freedom(m) == 0"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 39
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Initialization\n",
+ "## 5 Initializing the Model\n",
+ "\n",
"\n",
"\n",
- "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet.\n",
+ "When a flowsheet contains a recycle loop, the outlet of a downstream unit becomes the inlet of an upstream unit, creating a cyclic dependency that prevents straightforward calculation of all stream conditions. The tear‐stream method is necessary because it “breaks” this loop: you select one recycle stream as the tear, assign it an initial guess, and then solve the rest of the flowsheet as if it were acyclic. Once the downstream units compute their outputs, you compare the calculated value of the torn stream to your initial guess and iteratively adjust until they coincide. Without tearing, the solver cannot establish a proper topological sequence or drive the recycle to convergence, making initialization—and ultimately steady‐state convergence—impossible.\n",
"\n",
- " \n"
+ "It is important to determine the tear stream for a flowsheet which will be demonstrated below.\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "Currently, there are two methods of initializing a full flowsheet: using the sequential decomposition tool, or manually propagating through the flowsheet. Both methods will be shown.\n",
+ "\n",
+ "### 5.1 Sequential Decomposition\n",
+ "\n",
+ "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet. Sequential Decomposition is a tool from Pyomo where the documentation can be found here https://Pyomo.readthedocs.io/en/stable/explanation/modeling/network.html#sequential-decomposition\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us first create an object for the SequentialDecomposition and specify our options for this. "
+ "Let us first create an object for the SequentialDecomposition and specify our options for this. We can also create a graph for our flowsheet to determine the tear set and order."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.578789Z",
+ "start_time": "2025-11-20T21:46:10.574025Z"
+ }
+ },
"source": [
"seq = SequentialDecomposition()\n",
"seq.options.select_tear_method = \"heuristic\"\n",
@@ -836,7 +1067,9 @@
"G = seq.create_graph(m)\n",
"heuristic_tear_set = seq.tear_set_arcs(G, method=\"heuristic\")\n",
"order = seq.calculation_order(G)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 40
},
{
"cell_type": "markdown",
@@ -847,13 +1080,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.588985Z",
+ "start_time": "2025-11-20T21:46:10.581810Z"
+ }
+ },
"source": [
"for o in heuristic_tear_set:\n",
" print(o.name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.s03\n"
+ ]
+ }
+ ],
+ "execution_count": 41
},
{
"cell_type": "markdown",
@@ -864,15 +1110,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
- "scrolled": true
+ "scrolled": true,
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.602315Z",
+ "start_time": "2025-11-20T21:46:10.599259Z"
+ }
},
- "outputs": [],
"source": [
"for o in order:\n",
" print(o[0].name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.I101\n",
+ "fs.R101\n",
+ "fs.F101\n",
+ "fs.S101\n",
+ "fs.C101\n",
+ "fs.M101\n"
+ ]
+ }
+ ],
+ "execution_count": 42
},
{
"cell_type": "markdown",
@@ -883,25 +1146,30 @@
" \n",
"\n",
"\n",
- "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. We will need to provide a reasonable guess for this."
+ "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. You can see this shown in the picture of the flowsheet above as the outlet of the mixer as the two lines crossing it identifying it as the tear stream. We will need to provide a reasonable guess for this."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.620357Z",
+ "start_time": "2025-11-20T21:46:10.617116Z"
+ }
+ },
"source": [
"tear_guesses = {\n",
- " \"flow_mol_phase_comp\": {\n",
- " (0, \"Vap\", \"benzene\"): 1e-5,\n",
- " (0, \"Vap\", \"toluene\"): 1e-5,\n",
- " (0, \"Vap\", \"hydrogen\"): 0.30,\n",
- " (0, \"Vap\", \"methane\"): 0.02,\n",
- " (0, \"Liq\", \"benzene\"): 1e-5,\n",
- " (0, \"Liq\", \"toluene\"): 0.30,\n",
- " (0, \"Liq\", \"hydrogen\"): 1e-5,\n",
- " (0, \"Liq\", \"methane\"): 1e-5,\n",
+ " \"flow_mol_phase\": {\n",
+ " (0, \"Liq\"): F_liq_I101,\n",
+ " (0, \"Vap\"): F_vap_I102,\n",
+ " },\n",
+ " \"mole_frac_phase_comp\": {\n",
+ " (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ " (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ " (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ " (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
" },\n",
" \"temperature\": {0: 303},\n",
" \"pressure\": {0: 350000},\n",
@@ -909,7 +1177,9 @@
"\n",
"# Pass the tear_guess to the SD tool\n",
"seq.set_guesses_for(m.fs.H101.inlet, tear_guesses)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 43
},
{
"cell_type": "markdown",
@@ -920,9 +1190,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.638254Z",
+ "start_time": "2025-11-20T21:46:10.635136Z"
+ }
+ },
"source": [
"def function(unit):\n",
" try:\n",
@@ -931,7 +1204,9 @@
" except InitializationError:\n",
" solver = get_solver()\n",
" solver.solve(unit)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 44
},
{
"cell_type": "markdown",
@@ -942,149 +1217,1235 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.022425Z",
+ "start_time": "2025-11-20T21:46:10.648251Z"
+ }
+ },
+ "source": "seq.run(m, function)",
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "WARNING: Wegstein failed to converge in 3 iterations\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n"
+ ]
+ }
+ ],
+ "execution_count": 45
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "### 5.2 Manual Propagation Method\n",
+ "\n",
+ "This method uses a more direct approach to initialize the flowsheet, utilizing the updated initializer method and propagating manually through the flowsheet and solving for the tear stream directly.\n",
+ "Lets first import a helper function that will help us manually propagate and step through the flowsheet"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.069766Z",
+ "start_time": "2025-11-20T21:46:17.066725Z"
+ }
+ },
+ "source": [
+ "from idaes.core.util.initialization import propagate_state"
+ ],
"outputs": [],
+ "execution_count": 46
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "seq.run(m, function)"
+ "Now we can setup our initial guesses for the tear stream which we know is the outlet of the `Mixer` or the inlet of the `Heater`. We can use the same initial guesses used in the first method. We also want to ensure that the degrees of freedom are consistent while we manually initialize the model.\n",
+ "\n",
+ "We will first ensure that are current degrees of freedom is still zero"
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.080343Z",
+ "start_time": "2025-11-20T21:46:17.077382Z"
+ }
+ },
+ "source": "# print(f\"The DOF is {degrees_of_freedom(m)} initially\")",
+ "outputs": [],
+ "execution_count": 47
+ },
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- "Inline Exercise:\n",
- "We have now initialized the flowsheet. Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
- " \n",
- "results = solver.solve(m, tee=True)\n",
+ "Now we can manually deactivate the tear stream, creating a separation between the `Mixer` and `Heater`. This should reduce the degrees of freedom by 10 since the inlet of the `Heater` now contains no values to solve the unit model. To deactivate a stream, simply use `m.fs.s03_expanded.deactivate()`. This expanded stream is just a different version of the `Arc` stream that is able to be deactivated."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.093180Z",
+ "start_time": "2025-11-20T21:46:17.089671Z"
+ }
+ },
+ "source": [
+ "# m.fs.s03_expanded.deactivate()\n",
+ "#\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream\")"
+ ],
+ "outputs": [],
+ "execution_count": 48
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can provide the `Heater` inlet 10 guess values to bring the degrees of freedom back to 0 and start the manual initialization process. We can run this convenient loop to assign each of these guesses to the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.105510Z",
+ "start_time": "2025-11-20T21:46:17.099824Z"
+ }
+ },
+ "source": [
+ "# tear_guesses = {\n",
+ "# \"flow_mol_phase\": {\n",
+ "# (0, \"Liq\"): F_liq_I101,\n",
+ "# (0, \"Vap\"): F_vap_I102,\n",
+ "#\n",
+ "# },\n",
+ "# \"mole_frac_phase_comp\": {\n",
+ "# (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ "# (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ "# (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
+ "# },\n",
+ "# \"temperature\": {0: 303},\n",
+ "# \"pressure\": {0: 350000},\n",
+ "# }\n",
+ "#\n",
+ "# for k, v in tear_guesses.items():\n",
+ "# for k1, v1 in v.items():\n",
+ "# getattr(m.fs.s03.destination, k)[k1].fix(v1)\n",
+ "#\n",
+ "# DOF_initial = degrees_of_freedom(m)\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after providing the initial guesses\")"
+ ],
+ "outputs": [],
+ "execution_count": 49
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The next step is to manually initialize each unit model starting from the `Heater` and then propagate the connection between it and the next unit model. This manual process ensures a strict order to the user's specification if that is desired. The current standard for initializing a unit model is to use an initializer object most compatible for that unit model. This can most often be done by utilizing the `default_initializer()` method attached to the unit model and then to call the `initialize()` method with the unit model as the argument."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.117110Z",
+ "start_time": "2025-11-20T21:46:17.113630Z"
+ }
+ },
+ "source": [
+ "# m.fs.H101.default_initializer().initialize(m.fs.H101) # Initialize Heater\n",
+ "# propagate_state(m.fs.s04) # Establish connection between Heater and Reactor\n",
+ "#\n",
+ "# m.fs.R101.default_initializer().initialize(m.fs.R101) # Initialize Reactor\n",
+ "# propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit\n",
+ "#\n",
+ "# m.fs.F101.default_initializer().initialize(m.fs.F101) # Initialize First Flash Unit\n",
+ "# propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter\n",
+ "# propagate_state(m.fs.s07) # Establish connection between First Flash Unit and Second Flash Unit\n",
+ "#\n",
+ "# m.fs.S101.default_initializer().initialize(m.fs.S101) # Initialize Splitter\n",
+ "# propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor\n",
+ "#\n",
+ "# m.fs.C101.default_initializer().initialize(m.fs.C101) # Initialize Compressor\n",
+ "# propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer\n",
+ "#\n",
+ "# m.fs.I101.default_initializer().initialize(m.fs.I101) # Initialize Toluene Inlet\n",
+ "# propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.I102.default_initializer().initialize(m.fs.I102) # Initialize Hydrogen Inlet\n",
+ "# propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.M101.default_initializer().initialize(m.fs.M101) # Initialize Mixer\n",
+ "# propagate_state(m.fs.s03) # Establish connection between Mixer and Heater\n",
+ "#\n",
+ "# m.fs.F102.default_initializer().initialize(m.fs.F102) # Initialize Second Flash Unit\n",
+ "# propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product\n",
+ "# propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product\n",
+ "# propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product"
+ ],
+ "outputs": [],
+ "execution_count": 50
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we solve the system to allow the outlet of the mixer to reach a converged congruence with the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.226222Z",
+ "start_time": "2025-11-20T21:46:17.129942Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 300,\n",
+ " \"tol\": 1e-8,\n",
+ "}\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
+ "results = solver.solve(m, tee=True)"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=300\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 3.35e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.07e+03 1.08e+01 -1.0 1.21e+03 - 8.49e-01 6.80e-01h 1\n",
+ " 2 0.0000000e+00 1.66e+02 4.55e+02 -1.0 7.65e+02 - 9.90e-01 8.44e-01h 1\n",
+ " 3 0.0000000e+00 5.53e+00 2.00e+02 -1.0 1.30e+02 - 9.90e-01 9.67e-01h 1\n",
+ " 4 0.0000000e+00 5.22e-02 8.91e+03 -1.0 4.05e+00 - 1.00e+00 9.91e-01h 1\n",
+ " 5 0.0000000e+00 1.46e-04 1.02e+04 -1.0 3.80e-02 - 1.00e+00 9.97e-01h 1\n",
+ " 6 0.0000000e+00 9.46e-11 6.27e-01 -1.0 1.06e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 6\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 7\n",
+ "Number of objective gradient evaluations = 7\n",
+ "Number of equality constraint evaluations = 7\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 7\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 6\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.009\n",
+ "Total CPU secs in NLP function evaluations = 0.001\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 51
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now that the flowsheet is initialized, we can unfix the guesses for the `Heater` and reactive the tear stream to complete the final solve."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.258332Z",
+ "start_time": "2025-11-20T21:46:17.233298Z"
+ }
+ },
+ "source": [
+ "for k, v in tear_guesses.items():\n",
+ " for k1, v1 in v.items():\n",
+ " getattr(m.fs.H101.inlet, k)[k1].unfix()\n",
"\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
+ "m.fs.s03_expanded.activate()\n",
+ "print(\n",
+ " f\"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The DOF is 0 after unfixing the values and reactivating the tear stream\n"
+ ]
+ }
+ ],
+ "execution_count": 52
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6 Solving the Model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "We have now initialized the flowsheet. Lets set up some solving options before simulating the flowsheet. We want to specify the scaling method, number of iterations, and tolerance. More specific or advanced options can be found at the documentation for IPOPT https://coin-or.github.io/Ipopt/OPTIONS.html"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.268422Z",
+ "start_time": "2025-11-20T21:46:17.265316Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 1000,\n",
+ " \"tol\": 1e-8,\n",
+ "}"
+ ],
+ "outputs": [],
+ "execution_count": 53
+ },
+ {
+ "cell_type": "code",
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.382669Z",
+ "start_time": "2025-11-20T21:46:17.293013Z"
+ }
},
- "outputs": [],
"source": [
"# Create the solver object\n",
- "from idaes.core.solvers import get_solver\n",
- "\n",
- "solver = get_solver()\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
"\n",
"# Solve the model\n",
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpi86o_z2t\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpi86o_z2t\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 1.64e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.84e+01 4.18e+00 -1.0 4.14e-01 - 9.90e-01 9.89e-01h 1\n",
+ " 2 0.0000000e+00 1.82e-01 3.87e+00 -1.0 3.76e-01 - 9.90e-01 9.90e-01h 1\n",
+ " 3 0.0000000e+00 6.96e-04 4.53e+02 -1.0 3.70e-02 - 9.92e-01 9.96e-01h 1\n",
+ " 4 0.0000000e+00 4.52e-09 8.75e-01 -1.0 3.82e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 4\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 4.5247361413203180e-09 4.5247361413203180e-09\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 4.5247361413203180e-09 4.5247361413203180e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 5\n",
+ "Number of objective gradient evaluations = 5\n",
+ "Number of equality constraint evaluations = 5\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 5\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 4\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.008\n",
+ "Total CPU secs in NLP function evaluations = 0.000\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 55
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.393870Z",
+ "start_time": "2025-11-20T21:46:17.390132Z"
+ }
},
- "outputs": [],
"source": [
"# Check solver solve status\n",
"from pyomo.environ import TerminationCondition\n",
"\n",
"assert results.solver.termination_condition == TerminationCondition.optimal"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 56
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Analyze the results of the square problem\n",
- "\n",
+ "## 7 Analyze the results\n",
"\n",
- "What is the total operating cost? "
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "If the IDAES UI package was installed with the `idaes-pse` installation or installed separately, you can run the flowsheet visualizer to see a full diagram of the full process that is generated and displayed on a browser window.\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Otherwise, we can run the `m.fs.report()` method to see a full summary of the solved flowsheet. It is recommended to adjust the width of the output as much as possible for the cleanest display."
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.448969Z",
+ "start_time": "2025-11-20T21:46:17.421434Z"
+ }
+ },
+ "source": [
+ "m.fs.report()"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Flowsheet : fs Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units s01 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 \n",
+ " Total Molar Flowrate mole / second 0.30005 0.32004 2.0320 2.0320 2.0320 1.7648 0.26712 1.4119 1.4119 0.17224 0.094878 0.35297\n",
+ " Total Mole Fraction benzene dimensionless 6.6656e-05 6.2492e-05 0.058732 0.058732 0.17408 0.084499 0.76595 0.084499 0.084499 0.82430 0.66001 0.084499\n",
+ " Total Mole Fraction toluene dimensionless 0.99987 6.2492e-05 0.15380 0.15380 0.038450 0.0088437 0.23405 0.0088437 0.0088437 0.17570 0.33999 0.0088437\n",
+ " Total Mole Fraction hydrogen dimensionless 3.3328e-05 0.93738 0.27683 0.27683 0.16148 0.18592 6.9600e-09 0.18592 0.18592 1.0794e-08 1.1376e-15 0.18592\n",
+ " Total Mole Fraction methane dimensionless 3.3328e-05 0.062492 0.51064 0.51064 0.62599 0.72074 2.6982e-08 0.72074 0.72074 4.1844e-08 4.4103e-15 0.72074\n",
+ " Temperature kelvin 303.20 303.20 324.54 600.00 822.07 325.00 325.00 325.00 325.00 375.00 375.00 325.00\n",
+ " Pressure pascal 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 1.5000e+05 1.5000e+05 3.5000e+05\n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 58
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
"source": [
- "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ "What is the total operating cost?"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.475550Z",
+ "start_time": "2025-11-20T21:46:17.472001Z"
+ }
+ },
+ "source": [
+ "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 424513.9640158265\n"
+ ]
+ }
+ ],
+ "execution_count": 59
+ },
+ {
+ "cell_type": "code",
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.571498Z",
+ "start_time": "2025-11-20T21:46:17.493194Z"
+ }
},
- "outputs": [],
"source": [
"import pytest\n",
"\n",
- "assert value(m.fs.operating_cost) == pytest.approx(419122.3387, abs=1e-3)"
- ]
+ "assert value(m.fs.operating_cost) == pytest.approx(424513.9645, abs=1e-3)"
+ ],
+ "outputs": [],
+ "execution_count": 60
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? "
+ "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? We can look at a specific unit models stream table with the same `report()` method."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.596910Z",
+ "start_time": "2025-11-20T21:46:17.580529Z"
+ }
+ },
"source": [
"m.fs.F102.report()\n",
"\n",
"print()\n",
"print(\"benzene purity = \", value(m.fs.purity))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 7346.0 : watt : False : (None, None)\n",
+ " Pressure Change : -2.0000e+05 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.26712 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.76595 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.23405 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 6.9600e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.6982e-08 - - \n",
+ " Temperature kelvin 325.00 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.094878 \n",
+ " flow_mol_phase Vap mole / second - 0.17224 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.66001 0.66001 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.33999 0.33999 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.82430 0.82430 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.17570 0.17570 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.0794e-08 1.0794e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.1844e-08 4.1844e-08 \n",
+ " temperature kelvin - 375.00 375.00 \n",
+ " pressure pascal - 1.5000e+05 1.5000e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8242963521555956\n"
+ ]
+ }
+ ],
+ "execution_count": 61
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.619054Z",
+ "start_time": "2025-11-20T21:46:17.613393Z"
+ }
},
- "outputs": [],
"source": [
"assert value(m.fs.purity) == pytest.approx(0.82429, abs=1e-3)\n",
- "\n",
- "assert value(m.fs.F102.heat_duty[0]) == pytest.approx(7352.4828, abs=1e-3)\n",
+ "assert value(m.fs.F102.heat_duty[0]) == pytest.approx(7346.03097, abs=1e-3)\n",
"assert value(m.fs.F102.vap_outlet.pressure[0]) == pytest.approx(1.5000e05, abs=1e-3)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 62
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101.\n",
- "\n",
- "\n",
- "Inline Exercise:\n",
- "How much benzene are we losing in the F101 vapor outlet stream?\n",
- "
\n"
+ "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.648524Z",
+ "start_time": "2025-11-20T21:46:17.638446Z"
+ }
+ },
"source": [
"from idaes.core.util.tables import (\n",
" create_stream_table_dataframe,\n",
@@ -1093,25 +2454,30 @@
"\n",
"st = create_stream_table_dataframe({\"Reactor\": m.fs.s05, \"Light Gases\": m.fs.s06})\n",
"print(stream_table_dataframe_to_string(st))"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "You can query additional variables here if you like. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Units Reactor Light Gases\n",
+ "Total Molar Flowrate mole / second 2.0320 1.7648 \n",
+ "Total Mole Fraction benzene dimensionless 0.17408 0.084499 \n",
+ "Total Mole Fraction toluene dimensionless 0.038450 0.0088437 \n",
+ "Total Mole Fraction hydrogen dimensionless 0.16148 0.18592 \n",
+ "Total Mole Fraction methane dimensionless 0.62599 0.72074 \n",
+ "Temperature kelvin 822.07 325.00 \n",
+ "Pressure pascal 3.5000e+05 3.5000e+05 \n"
+ ]
+ }
+ ],
+ "execution_count": 63
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization\n",
+ "## 8 Optimization\n",
"\n",
"\n",
"We saw from the results above that the total operating cost for the base case was $419,122 per year. We are producing 0.142 mol/s of benzene at a purity of 82\\%. However, we are losing around 42\\% of benzene in F101 vapor outlet stream. \n",
@@ -1138,12 +2504,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.675626Z",
+ "start_time": "2025-11-20T21:46:17.671136Z"
+ }
+ },
"source": [
"m.fs.objective = Objective(expr=m.fs.operating_cost)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 64
},
{
"cell_type": "markdown",
@@ -1154,55 +2525,55 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.691883Z",
+ "start_time": "2025-11-20T21:46:17.687385Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.unfix()\n",
"m.fs.R101.heat_duty.unfix()\n",
"m.fs.F101.vap_outlet.temperature.unfix()\n",
"m.fs.F102.vap_outlet.temperature.unfix()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "Let us now unfix the remaining variable which is F102 pressure drop (F102.deltaP) \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 65
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.720592Z",
+ "start_time": "2025-11-20T21:46:17.717532Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Unfix deltaP for F102\n",
"m.fs.F102.deltaP.unfix()"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 67
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.759351Z",
+ "start_time": "2025-11-20T21:46:17.728327Z"
+ }
},
- "outputs": [],
"source": [
"assert degrees_of_freedom(m) == 5"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 68
},
{
"cell_type": "markdown",
@@ -1221,40 +2592,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.779305Z",
+ "start_time": "2025-11-20T21:46:17.775669Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature[0].setlb(500)\n",
"m.fs.H101.outlet.temperature[0].setub(600)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "Now, set the variable bound for the R101 outlet temperature.\n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 69
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.812504Z",
+ "start_time": "2025-11-20T21:46:17.807564Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature\n",
"m.fs.R101.outlet.temperature[0].setlb(600)\n",
"m.fs.R101.outlet.temperature[0].setub(800)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 71
},
{
"cell_type": "markdown",
@@ -1265,9 +2633,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.827227Z",
+ "start_time": "2025-11-20T21:46:17.822681Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature[0].setlb(298.0)\n",
"m.fs.F101.vap_outlet.temperature[0].setub(450.0)\n",
@@ -1275,7 +2646,9 @@
"m.fs.F102.vap_outlet.temperature[0].setub(450.0)\n",
"m.fs.F102.vap_outlet.pressure[0].setlb(105000)\n",
"m.fs.F102.vap_outlet.pressure[0].setub(110000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 72
},
{
"cell_type": "markdown",
@@ -1286,43 +2659,46 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.848212Z",
+ "start_time": "2025-11-20T21:46:17.844101Z"
+ }
+ },
"source": [
"m.fs.overhead_loss = Constraint(\n",
- " expr=m.fs.F101.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " <= 0.20 * m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " <= 0.20\n",
+ " * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "\n",
- "Inline Exercise:\n",
- "Now, add the constraint such that we are producing at least 0.15 mol/s of benzene in the product stream which is the vapor outlet of F102. Let us name this constraint as m.fs.product_flow. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 73
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.876414Z",
+ "start_time": "2025-11-20T21:46:17.872250Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint\n",
"m.fs.product_flow = Constraint(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"] >= 0.15\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " >= 0.15\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 75
},
{
"cell_type": "markdown",
@@ -1333,12 +2709,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.890250Z",
+ "start_time": "2025-11-20T21:46:17.887141Z"
+ }
+ },
"source": [
"m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 76
},
{
"cell_type": "markdown",
@@ -1352,43 +2733,161 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.024828Z",
+ "start_time": "2025-11-20T21:46:17.897344Z"
+ }
+ },
"source": [
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 938\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 9\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 504\n",
+ "\n",
+ "Reallocating memory for MA57: lfact (10594)\n",
+ "Total number of variables............................: 224\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 151\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 219\n",
+ "Total number of inequality constraints...............: 3\n",
+ " inequality constraints with only lower bounds: 2\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 1\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 4.2451396e+05 4.00e+04 6.94e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (11249)\n",
+ " 1 4.2182392e+05 4.00e+04 6.94e+00 -1.0 3.47e+07 - 3.71e-05 1.25e-05f 1\n",
+ " 2 4.2170773e+05 4.00e+04 8.41e+01 -1.0 1.49e+06 - 3.32e-04 1.53e-05f 1\n",
+ " 3 4.1795462e+05 4.00e+04 6.82e+01 -1.0 1.43e+06 - 4.98e-04 5.60e-04f 1\n",
+ " 4 3.0650178e+05 4.00e+04 3.09e+02 -1.0 1.26e+07 - 2.61e-05 1.17e-03f 1\n",
+ " 5 3.0553183e+05 3.99e+04 3.25e+04 -1.0 1.48e+05 - 1.28e-01 1.02e-03f 1\n",
+ " 6 3.0565526e+05 3.91e+04 5.25e+04 -1.0 3.99e+04 - 1.13e-01 2.09e-02h 2\n",
+ " 7 3.0601574e+05 3.59e+04 4.21e+04 -1.0 3.91e+04 - 5.17e-02 8.21e-02h 2\n",
+ " 8 3.0674242e+05 2.95e+04 8.41e+04 -1.0 3.59e+04 - 4.38e-01 1.79e-01h 1\n",
+ " 9 3.1153051e+05 1.11e+04 5.73e+04 -1.0 2.95e+04 - 8.56e-01 6.23e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10 3.1154545e+05 1.09e+04 5.69e+04 -1.0 1.19e+04 - 6.57e-02 2.37e-02h 1\n",
+ " 11 3.1159568e+05 1.08e+04 5.66e+04 -1.0 1.68e+04 - 2.23e-02 8.97e-03h 1\n",
+ " 12 3.1610911e+05 2.56e+03 2.13e+05 -1.0 1.68e+04 - 9.47e-01 7.94e-01h 1\n",
+ " 13 3.1708718e+05 1.16e+03 9.56e+04 -1.0 4.45e+03 - 9.90e-01 5.53e-01h 1\n",
+ " 14 3.1796760e+05 4.06e+02 1.14e+03 -1.0 1.27e+04 - 9.95e-01 9.87e-01h 1\n",
+ " 15 3.1802429e+05 5.35e+00 6.53e+02 -1.0 8.29e+01 - 1.00e+00 9.89e-01h 1\n",
+ " 16 3.1802524e+05 1.77e-04 5.89e+02 -1.0 5.10e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 17 3.1802492e+05 5.34e-06 1.83e+06 -2.5 1.32e+00 - 3.33e-01 1.00e+00f 1\n",
+ " 18 3.1802492e+05 1.70e-09 9.74e-03 -2.5 2.42e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 19 3.1802491e+05 4.41e-09 1.03e-01 -5.7 3.83e-02 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20 3.1802491e+05 2.39e-03 8.22e-09 -5.7 2.88e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 21 3.1802491e+05 8.00e-11 9.72e-09 -5.7 4.08e-04 - 1.00e+00 1.00e+00h 1\n",
+ " 22 3.1802491e+05 2.47e-03 1.19e-01 -8.6 2.93e+01 - 9.99e-01 1.00e+00h 1\n",
+ " 23 3.1802491e+05 2.41e+02 2.13e-09 -8.6 9.27e+03 - 1.00e+00 1.00e+00h 1\n",
+ " 24 3.1802491e+05 6.96e-03 3.66e-09 -8.6 1.88e+02 - 1.00e+00 1.00e+00h 1\n",
+ " 25 3.1802491e+05 3.61e-06 1.59e-09 -8.6 1.21e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 26 3.1802491e+05 2.29e-05 4.82e-09 -8.6 3.07e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 27 3.1802491e+05 9.42e-07 5.47e-09 -8.6 6.24e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 28 3.1802491e+05 1.16e-10 9.67e-09 -8.6 3.01e+00 - 1.00e+00 1.00e+00H 1\n",
+ "\n",
+ "Number of Iterations....: 28\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 3.1802490940142004e+05 3.1802490940142004e+05\n",
+ "Dual infeasibility......: 9.6706583658121551e-09 9.6706583658121551e-09\n",
+ "Constraint violation....: 1.1641532182693481e-10 1.1641532182693481e-10\n",
+ "Complementarity.........: 2.5059899579272651e-09 2.5059899579272651e-09\n",
+ "Overall NLP error.......: 2.2246107350021195e-10 9.6706583658121551e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 35\n",
+ "Number of objective gradient evaluations = 29\n",
+ "Number of equality constraint evaluations = 35\n",
+ "Number of inequality constraint evaluations = 35\n",
+ "Number of equality constraint Jacobian evaluations = 29\n",
+ "Number of inequality constraint Jacobian evaluations = 29\n",
+ "Number of Lagrangian Hessian evaluations = 28\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.036\n",
+ "Total CPU secs in NLP function evaluations = 0.006\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 77
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.045752Z",
+ "start_time": "2025-11-20T21:46:18.041549Z"
+ }
},
- "outputs": [],
"source": [
"# Check for solver solve status\n",
"from pyomo.environ import TerminationCondition\n",
"\n",
"assert results.solver.termination_condition == TerminationCondition.optimal"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 78
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization Results\n",
+ "### 8.1 Optimization Results\n",
"\n",
"Display the results and product specifications"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.074231Z",
+ "start_time": "2025-11-20T21:46:18.053675Z"
+ }
+ },
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))\n",
"\n",
@@ -1403,21 +2902,107 @@
"print()\n",
"print(\"Overhead loss in F101\")\n",
"m.fs.F101.report()"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 318024.90940142004\n",
+ "\n",
+ "Product flow rate and purity in F102\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 8369.3 : watt : False : (None, None)\n",
+ " Pressure Change : -2.4500e+05 : pascal : False : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.28812 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.75463 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.24537 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 7.5018e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.5957e-08 - - \n",
+ " Temperature kelvin 301.88 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.10493 \n",
+ " flow_mol_phase Vap mole / second - 0.18319 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.64256 0.64256 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.35744 0.35744 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.81883 0.81883 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.18117 0.18117 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.1799e-08 1.1799e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.0825e-08 4.0825e-08 \n",
+ " temperature kelvin - 362.93 362.93 \n",
+ " pressure pascal - 1.0500e+05 1.0500e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8188295888411846\n",
+ "\n",
+ "Overhead loss in F101\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F101 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -66423. : watt : False : (None, None)\n",
+ " Pressure Change : 0.0000 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 1.9480 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.13952 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.039059 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 0.18417 - - \n",
+ " Total Mole Fraction methane dimensionless 0.63725 - - \n",
+ " Temperature kelvin 763.51 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.28812 \n",
+ " flow_mol_phase Vap mole / second - 1.6598 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.75463 0.75463 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.24537 0.24537 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.032748 0.032748 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.0032478 0.0032478 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.21614 0.21614 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.74786 0.74786 \n",
+ " temperature kelvin - 301.88 301.88 \n",
+ " pressure pascal - 3.5000e+05 3.5000e+05 \n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 79
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.093619Z",
+ "start_time": "2025-11-20T21:46:18.090039Z"
+ }
},
- "outputs": [],
"source": [
- "assert value(m.fs.operating_cost) == pytest.approx(312786.338, abs=1e-3)\n",
+ "assert value(m.fs.operating_cost) == pytest.approx(318024.909, abs=1e-3)\n",
"assert value(m.fs.purity) == pytest.approx(0.818827, abs=1e-3)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 80
},
{
"cell_type": "markdown",
@@ -1428,49 +3013,88 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.106001Z",
+ "start_time": "2025-11-20T21:46:18.101768Z"
+ }
+ },
"source": [
- "print(\"Optimal Values\")\n",
- "print()\n",
+ "print(\n",
+ " f\"\"\"Optimal Values:\n",
"\n",
- "print(\"H101 outlet temperature = \", value(m.fs.H101.outlet.temperature[0]), \"K\")\n",
+ "H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"R101 outlet temperature = \", value(m.fs.R101.outlet.temperature[0]), \"K\")\n",
+ "R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F101 outlet temperature = \", value(m.fs.F101.vap_outlet.temperature[0]), \"K\")\n",
+ "F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F102 outlet temperature = \", value(m.fs.F102.vap_outlet.temperature[0]), \"K\")\n",
- "print(\"F102 outlet pressure = \", value(m.fs.F102.vap_outlet.pressure[0]), \"Pa\")"
- ]
+ "F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K\n",
+ "F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa\n",
+ "\"\"\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Optimal Values:\n",
+ "\n",
+ "H101 outlet temperature = 500.000 K\n",
+ "\n",
+ "R101 outlet temperature = 763.507 K\n",
+ "\n",
+ "F101 outlet temperature = 301.881 K\n",
+ "\n",
+ "F102 outlet temperature = 362.935 K\n",
+ "F102 outlet pressure = 105000.000 Pa\n",
+ "\n"
+ ]
+ }
+ ],
+ "execution_count": 81
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"testing"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:19.262061Z",
+ "start_time": "2025-11-20T21:46:18.121920Z"
+ }
},
- "outputs": [],
"source": [
"assert value(m.fs.H101.outlet.temperature[0]) == pytest.approx(500, abs=1e-3)\n",
- "assert value(m.fs.R101.outlet.temperature[0]) == pytest.approx(696.112, abs=1e-3)\n",
- "assert value(m.fs.F101.vap_outlet.temperature[0]) == pytest.approx(301.878, abs=1e-3)\n",
+ "print(value(m.fs.R101.outlet.temperature[0]))\n",
+ "assert value(m.fs.R101.outlet.temperature[0]) == pytest.approx(763.484, abs=1e-3)\n",
+ "assert value(m.fs.F101.vap_outlet.temperature[0]) == pytest.approx(301.881, abs=1e-3)\n",
"assert value(m.fs.F102.vap_outlet.temperature[0]) == pytest.approx(362.935, abs=1e-3)\n",
"assert value(m.fs.F102.vap_outlet.pressure[0]) == pytest.approx(105000, abs=1e-2)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "763.5072359720118\n"
+ ]
+ },
+ {
+ "ename": "AssertionError",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
+ "\u001b[31mAssertionError\u001b[39m Traceback (most recent call last)",
+ "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[82]\u001b[39m\u001b[32m, line 3\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.H101.outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m500\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n\u001b[32m 2\u001b[39m \u001b[38;5;28mprint\u001b[39m(value(m.fs.R101.outlet.temperature[\u001b[32m0\u001b[39m]))\n\u001b[32m----> \u001b[39m\u001b[32m3\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.R101.outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m763.484\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n\u001b[32m 4\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.F101.vap_outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m301.881\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n\u001b[32m 5\u001b[39m \u001b[38;5;28;01massert\u001b[39;00m value(m.fs.F102.vap_outlet.temperature[\u001b[32m0\u001b[39m]) == pytest.approx(\u001b[32m362.935\u001b[39m, \u001b[38;5;28mabs\u001b[39m=\u001b[32m1e-3\u001b[39m)\n",
+ "\u001b[31mAssertionError\u001b[39m: "
+ ]
+ }
+ ],
+ "execution_count": 82
}
],
"metadata": {
@@ -1490,7 +3114,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.12"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_usr.ipynb b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_usr.ipynb
index 6f8b47f4..5f2b6695 100644
--- a/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_usr.ipynb
+++ b/idaes_examples/notebooks/docs/tut/core/hda_flowsheet_usr.ipynb
@@ -2,18 +2,20 @@
"cells": [
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"header",
"hide-cell"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:04.904828Z",
+ "start_time": "2025-11-20T21:46:04.900352Z"
+ }
},
- "outputs": [],
"source": [
"###############################################################################\n",
"# The Institute for the Design of Advanced Energy Systems Integrated Platform\n",
- "# Framework (IDAES IP) was produced under the DOE Institute for the\n",
+ "# Framework (idaes IP) was produced under the DOE Institute for the\n",
"# Design of Advanced Energy Systems (IDAES).\n",
"#\n",
"# Copyright (c) 2018-2023 by the software owners: The Regents of the\n",
@@ -23,7 +25,9 @@
"# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n",
"# for full copyright and license information.\n",
"###############################################################################"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 1
},
{
"cell_type": "markdown",
@@ -32,20 +36,34 @@
"\n",
"# HDA Flowsheet Simulation and Optimization\n",
"\n",
- "Author: Jaffer Ghouse \n",
- "Maintainer: Brandon Paul \n",
- "Updated: 2023-06-01 \n",
+ "Author: Jaffer Ghouse
\n",
+ "Maintainer: Tanner Polley
\n",
+ "Updated: 2025-11-19\n",
"\n",
"## Learning outcomes\n",
"\n",
"\n",
"- Construct a steady-state flowsheet using the IDAES unit model library\n",
- "- Connecting unit models in a flowsheet using Arcs\n",
+ "- Connecting unit models in a flowsheet using Arcs\n",
"- Using the SequentialDecomposition tool to initialize a flowsheet with recycle\n",
- "- Fomulate and solve an optimization problem\n",
+ "- Formulate and solve an optimization problem\n",
" - Defining an objective function\n",
" - Setting variable bounds\n",
- " - Adding additional constraints \n",
+ " - Adding additional constraints\n",
+ "\n",
+ "\n",
+ "The general workflow of setting up an IDAES flowsheet is the following:\n",
+ "\n",
+ " 1 Importing Modules
\n",
+ " 2 Building a Model
\n",
+ " 3 Scaling the Model
\n",
+ " 4 Specifying the Model
\n",
+ " 5 Initializing the Model
\n",
+ " 6 Solving the Model
\n",
+ " 7 Analyzing and Visualizing the Results
\n",
+ " 8 Optimizing the Model
\n",
+ "\n",
+ "We will complete each of these steps as well as demonstrate analyses on this model through some examples and exercises.\n",
"\n",
"\n",
"## Problem Statement\n",
@@ -81,10 +99,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required pyomo and idaes components\n",
+ "## 1 Importing Modules\n",
+ "### 1.1 Importing required Pyomo and IDAES components\n",
"\n",
"\n",
- "To construct a flowsheet, we will need several components from the pyomo and idaes package. Let us first import the following components from Pyomo:\n",
+ "To construct a flowsheet, we will need several components from the Pyomo and IDAES package. Let us first import the following components from Pyomo:\n",
"- Constraint (to write constraints)\n",
"- Var (to declare variables)\n",
"- ConcreteModel (to create the concrete model object)\n",
@@ -95,14 +114,17 @@
"- Arc (to connect two unit models)\n",
"- SequentialDecomposition (to initialize the flowsheet in a sequential mode)\n",
"\n",
- "For further details on these components, please refer to the pyomo documentation: https://pyomo.readthedocs.io/en/stable/\n"
+ "For further details on these components, please refer to the Pyomo documentation: https://Pyomo.readthedocs.io/en/stable/\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:05.294578Z",
+ "start_time": "2025-11-20T21:46:04.908296Z"
+ }
+ },
"source": [
"from pyomo.environ import (\n",
" Constraint,\n",
@@ -110,40 +132,51 @@
" ConcreteModel,\n",
" Expression,\n",
" Objective,\n",
- " SolverFactory,\n",
" TransformationFactory,\n",
" value,\n",
")\n",
"from pyomo.network import Arc, SequentialDecomposition"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "From idaes, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "From IDAES, we will be needing the FlowsheetBlock and the following unit models:\n",
+ "- Feed\n",
"- Mixer\n",
"- Heater\n",
"- StoichiometricReactor\n",
"- **Flash**\n",
"- Separator (splitter) \n",
- "- PressureChanger"
+ "- PressureChanger\n",
+ "- Product"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:06.806301Z",
+ "start_time": "2025-11-20T21:46:05.297760Z"
+ }
+ },
"source": [
"from idaes.core import FlowsheetBlock"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 3
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.936732Z",
+ "start_time": "2025-11-20T21:46:09.883054Z"
+ }
+ },
"source": [
"from idaes.models.unit_models import (\n",
" PressureChanger,\n",
@@ -151,8 +184,14 @@
" Separator as Splitter,\n",
" Heater,\n",
" StoichiometricReactor,\n",
- ")"
- ]
+ " Feed,\n",
+ " Product,\n",
+ ")\n",
+ "from idaes.core.util.exceptions import InitializationError\n",
+ "import idaes.logger as idaeslog"
+ ],
+ "outputs": [],
+ "execution_count": 4
},
{
"cell_type": "markdown",
@@ -166,30 +205,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.952476Z",
+ "start_time": "2025-11-20T21:46:09.949367Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: import flash model from idaes.models.unit_models"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 5
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.963041Z",
+ "start_time": "2025-11-20T21:46:09.957319Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: import flash model from idaes.models.unit_models\n",
"from idaes.models.unit_models import Flash"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 6
},
{
"cell_type": "markdown",
@@ -200,24 +247,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:09.976914Z",
+ "start_time": "2025-11-20T21:46:09.971944Z"
+ }
+ },
"source": [
"from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n",
"from idaes.core.util.model_statistics import degrees_of_freedom\n",
"\n",
"# Import idaes logger to set output levels\n",
- "import idaes.logger as idaeslog\n",
- "from idaes.core.solvers import get_solver\n",
- "from idaes.core.util.exceptions import InitializationError"
- ]
+ "from idaes.core.solvers import get_solver"
+ ],
+ "outputs": [],
+ "execution_count": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Importing required thermo and reaction package\n",
+ "### 1.2 Importing required thermo and reaction package\n",
"\n",
"The final set of imports are to import the thermo and reaction package for the HDA process. We have created a custom thermo package that assumes Ideal Gas with support for VLE. \n",
"\n",
@@ -232,33 +282,49 @@
]
},
{
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.017098Z",
+ "start_time": "2025-11-20T21:46:09.981997Z"
+ }
+ },
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
"source": [
- "from idaes_examples.mod.hda import hda_ideal_VLE as thermo_props\n",
- "from idaes_examples.mod.hda import hda_reaction as reaction_props"
- ]
+ "from idaes.models.properties.modular_properties.base.generic_property import (\n",
+ " GenericParameterBlock,\n",
+ ")\n",
+ "from idaes.models.properties.modular_properties.base.generic_reaction import (\n",
+ " GenericReactionParameterBlock,\n",
+ ")\n",
+ "from idaes_examples.mod.hda.hda_ideal_VLE_modular import thermo_config\n",
+ "from idaes_examples.mod.hda.hda_reaction_modular import reaction_config"
+ ],
+ "outputs": [],
+ "execution_count": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Constructing the Flowsheet\n",
+ "## 2 Constructing the Flowsheet\n",
"\n",
- "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block as we did in module 1. "
+ "We have now imported all the components, unit models, and property modules we need to construct a flowsheet. Let us create a ConcreteModel and add the flowsheet block."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.031538Z",
+ "start_time": "2025-11-20T21:46:10.025904Z"
+ }
+ },
"source": [
"m = ConcreteModel()\n",
"m.fs = FlowsheetBlock(dynamic=False)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 9
},
{
"cell_type": "markdown",
@@ -269,34 +335,46 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.066746Z",
+ "start_time": "2025-11-20T21:46:10.035131Z"
+ }
+ },
"source": [
- "m.fs.thermo_params = thermo_props.HDAParameterBlock()\n",
- "m.fs.reaction_params = reaction_props.HDAReactionParameterBlock(\n",
- " property_package=m.fs.thermo_params\n",
+ "m.fs.thermo_params = GenericParameterBlock(**thermo_config)\n",
+ "m.fs.reaction_params = GenericReactionParameterBlock(\n",
+ " property_package=m.fs.thermo_params, **reaction_config\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding Unit Models\n",
+ "### 2.1 Adding Unit Models\n",
"\n",
- "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Mixer (assigned a name M101) and a Heater (assigned a name H101). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the Mixer unit model here is given a `list` consisting of names to the three inlets. "
+ "Let us start adding the unit models we have imported to the flowsheet. Here, we are adding the Feed (assigned a name `I101` for Inlet), `Mixer` (assigned a name `M101`) and a `Heater` (assigned a name `H101`). Note that, all unit models need to be given a property package argument. In addition to that, there are several arguments depending on the unit model, please refer to the documentation for more details (https://idaes-pse.readthedocs.io/en/stable/reference_guides/model_libraries/generic/unit_models/index.html). For example, the `Mixer` unit model here must be specified the number of inlets that it will take in and the `Heater` can have specific settings enabled such as `has_pressure_change` or `has_phase_equilibrium`."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.114600Z",
+ "start_time": "2025-11-20T21:46:10.071845Z"
+ }
+ },
"source": [
+ "m.fs.I101 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.I102 = Feed(property_package=m.fs.thermo_params)\n",
+ "\n",
"m.fs.M101 = Mixer(\n",
" property_package=m.fs.thermo_params,\n",
- " inlet_list=[\"toluene_feed\", \"hydrogen_feed\", \"vapor_recycle\"],\n",
+ " num_inlets=3,\n",
")\n",
"\n",
"m.fs.H101 = Heater(\n",
@@ -304,11 +382,17 @@
" has_pressure_change=False,\n",
" has_phase_equilibrium=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 11
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"
Inline Exercise:\n",
@@ -325,26 +409,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.121709Z",
+ "start_time": "2025-11-20T21:46:10.119134Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add reactor with the specifications above"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 12
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.145853Z",
+ "start_time": "2025-11-20T21:46:10.127921Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add reactor with the specifications above\n",
"m.fs.R101 = StoichiometricReactor(\n",
@@ -354,7 +444,9 @@
" has_heat_transfer=True,\n",
" has_pressure_change=False,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 13
},
{
"cell_type": "markdown",
@@ -370,29 +462,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.167357Z",
+ "start_time": "2025-11-20T21:46:10.149935Z"
+ }
+ },
"source": [
"m.fs.F101 = Flash(\n",
" property_package=m.fs.thermo_params,\n",
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us now add the Splitter(S101), PressureChanger(C101) and the second Flash(F102). "
+ "Let us now add the Splitter(S101) with specific names for its output (purge and recycle), PressureChanger(C101) and the second Flash(F102)."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.211911Z",
+ "start_time": "2025-11-20T21:46:10.173255Z"
+ }
+ },
"source": [
"m.fs.S101 = Splitter(\n",
" property_package=m.fs.thermo_params,\n",
@@ -412,66 +512,115 @@
" has_heat_transfer=True,\n",
" has_pressure_change=True,\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 15
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Connecting Unit Models using Arcs\n",
- "\n",
- "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the mixer(M101) to the inlet of the heater(H101). "
+ "Last, we will add the three Product blocks (P101, P102, P103). We use `Feed` blocks and `Product` blocks for convenience with reporting stream summaries and consistency"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.226989Z",
+ "start_time": "2025-11-20T21:46:10.216839Z"
+ }
+ },
+ "source": [
+ "m.fs.P101 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P102 = Product(property_package=m.fs.thermo_params)\n",
+ "\n",
+ "m.fs.P103 = Product(property_package=m.fs.thermo_params)"
+ ],
"outputs": [],
+ "execution_count": 16
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ "### 2.2 Connecting Unit Models using Arcs\n",
+ "\n",
+ "We have now added all the unit models we need to the flowsheet. However, we have not yet specified how the units are to be connected. To do this, we will be using the `Arc` which is a Pyomo component that takes in two arguments: `source` and `destination`. Let us connect the outlet of the inlets (I101, I102) to the inlet of the mixer (M101) and outlet of the mixer to the inlet of the heater(H101)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- " \n",
- "\n",
+ ""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.235541Z",
+ "start_time": "2025-11-20T21:46:10.231058Z"
+ }
+ },
+ "source": [
+ "m.fs.s01 = Arc(source=m.fs.I101.outlet, destination=m.fs.M101.inlet_1)\n",
+ "m.fs.s02 = Arc(source=m.fs.I102.outlet, destination=m.fs.M101.inlet_2)\n",
+ "m.fs.s03 = Arc(source=m.fs.M101.outlet, destination=m.fs.H101.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 17
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
+ "source": [
"
\n",
"Inline Exercise:\n",
- "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide. \n",
- "
\n",
- "\n"
+ "Now, connect the H101 outlet to the R101 inlet using the cell above as a guide.\n",
+ "
"
]
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.245319Z",
+ "start_time": "2025-11-20T21:46:10.239913Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Connect the H101 outlet to R101 inlet"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 18
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.254153Z",
+ "start_time": "2025-11-20T21:46:10.248481Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Connect the H101 outlet to R101 inlet\n",
"m.fs.s04 = Arc(source=m.fs.H101.outlet, destination=m.fs.R101.inlet)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 19
},
{
"cell_type": "markdown",
@@ -482,17 +631,45 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.264461Z",
+ "start_time": "2025-11-20T21:46:10.258555Z"
+ }
+ },
"source": [
"m.fs.s05 = Arc(source=m.fs.R101.outlet, destination=m.fs.F101.inlet)\n",
"m.fs.s06 = Arc(source=m.fs.F101.vap_outlet, destination=m.fs.S101.inlet)\n",
+ "m.fs.s07 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)\n",
"m.fs.s08 = Arc(source=m.fs.S101.recycle, destination=m.fs.C101.inlet)\n",
- "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.vapor_recycle)\n",
- "m.fs.s10 = Arc(source=m.fs.F101.liq_outlet, destination=m.fs.F102.inlet)"
+ "m.fs.s09 = Arc(source=m.fs.C101.outlet, destination=m.fs.M101.inlet_3)"
+ ],
+ "outputs": [],
+ "execution_count": 20
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Last we will connect the outlet streams to the inlets of the Product blocks (P101, P102, P103)"
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.274505Z",
+ "start_time": "2025-11-20T21:46:10.268918Z"
+ }
+ },
+ "source": [
+ "m.fs.s10 = Arc(source=m.fs.F102.vap_outlet, destination=m.fs.P101.inlet)\n",
+ "m.fs.s11 = Arc(source=m.fs.F102.liq_outlet, destination=m.fs.P102.inlet)\n",
+ "m.fs.s12 = Arc(source=m.fs.S101.purge, destination=m.fs.P103.inlet)"
+ ],
+ "outputs": [],
+ "execution_count": 21
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -502,20 +679,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.303264Z",
+ "start_time": "2025-11-20T21:46:10.278714Z"
+ }
+ },
"source": [
"TransformationFactory(\"network.expand_arcs\").apply_to(m)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 22
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Adding expressions to compute purity and operating costs\n",
+ "### 2.3 Adding expressions to compute purity and operating costs\n",
"\n",
- "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/pyomo_modeling_components/Expressions.html\n",
+ "In this section, we will add a few Expressions that allows us to evaluate the performance. Expressions provide a convenient way of calculating certain values that are a function of the variables defined in the model. For more details on Expressions, please refer to: https://pyomo.readthedocs.io/en/stable/explanation/modeling/network.html.\n",
"\n",
"For this flowsheet, we are interested in computing the purity of the product Benzene stream (i.e. the mole fraction) and the operating cost which is a sum of the cooling and heating cost. "
]
@@ -529,18 +711,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.312336Z",
+ "start_time": "2025-11-20T21:46:10.309074Z"
+ }
+ },
"source": [
"m.fs.purity = Expression(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
" / (\n",
- " m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " + m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
+ " + m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 23
},
{
"cell_type": "markdown",
@@ -551,14 +742,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.323538Z",
+ "start_time": "2025-11-20T21:46:10.318119Z"
+ }
+ },
"source": [
"m.fs.cooling_cost = Expression(\n",
" expr=0.212e-7 * (-m.fs.F101.heat_duty[0]) + 0.212e-7 * (-m.fs.R101.heat_duty[0])\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 24
},
{
"cell_type": "markdown",
@@ -575,14 +771,19 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.336983Z",
+ "start_time": "2025-11-20T21:46:10.328380Z"
+ }
+ },
"source": [
"m.fs.heating_cost = Expression(\n",
" expr=2.2e-7 * m.fs.H101.heat_duty[0] + 1.9e-7 * m.fs.F102.heat_duty[0]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 25
},
{
"cell_type": "markdown",
@@ -593,64 +794,94 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.345607Z",
+ "start_time": "2025-11-20T21:46:10.341996Z"
+ }
+ },
"source": [
"m.fs.operating_cost = Expression(\n",
" expr=(3600 * 24 * 365 * (m.fs.heating_cost + m.fs.cooling_cost))\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 26
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing feed conditions\n",
+ "## 4 Specifying the Model\n",
+ "### 4.1 Fixing feed conditions\n",
"\n",
"Let us first check how many degrees of freedom exist for this flowsheet using the `degrees_of_freedom` tool we imported earlier. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.376586Z",
+ "start_time": "2025-11-20T21:46:10.349694Z"
+ }
+ },
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "29\n"
+ ]
+ }
+ ],
+ "execution_count": 27
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "We will now be fixing the toluene feed stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing. "
+ "We will now be fixing the toluene feed (`I101`) stream to the conditions shown in the flowsheet above. Please note that though this is a pure toluene feed, the remaining components are still assigned a very small non-zero value to help with convergence and initializing."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.418520Z",
+ "start_time": "2025-11-20T21:46:10.414167Z"
+ }
+ },
"source": [
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(0.30)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.toluene_feed.temperature.fix(303.2)\n",
- "m.fs.M101.toluene_feed.pressure.fix(350000)"
- ]
+ "F_liq_toluene = 0.30\n",
+ "F_liq_non_zero = 1e-5\n",
+ "\n",
+ "F_vap_I101 = F_liq_non_zero * 4\n",
+ "F_liq_I101 = F_liq_toluene + F_liq_non_zero\n",
+ "\n",
+ "m.fs.I101.flow_mol_phase[0, \"Vap\"].fix(F_vap_I101)\n",
+ "m.fs.I101.flow_mol_phase[0, \"Liq\"].fix(F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_liq_non_zero / F_vap_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I101)\n",
+ "m.fs.I101.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_toluene / F_liq_I101)\n",
+ "m.fs.I101.temperature.fix(303.2)\n",
+ "m.fs.I101.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 29
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
- "Similarly, let us fix the hydrogen feed to the following conditions in the next cell:\n",
+ "Similarly, let us fix the hydrogen feed (`I102`) to the following conditions in the next cell:\n",
" \n",
" - FH2 = 0.30 mol/s
\n",
" - FCH4 = 0.02 mol/s
\n",
@@ -663,39 +894,59 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.429169Z",
+ "start_time": "2025-11-20T21:46:10.422052Z"
+ }
+ },
"source": [
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"hydrogen\"].fix(0.30)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Vap\", \"methane\"].fix(0.02)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"benzene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"toluene\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"hydrogen\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.flow_mol_phase_comp[0, \"Liq\", \"methane\"].fix(1e-5)\n",
- "m.fs.M101.hydrogen_feed.temperature.fix(303.2)\n",
- "m.fs.M101.hydrogen_feed.pressure.fix(350000)"
- ]
+ "F_vap_hydrogen = 0.30\n",
+ "F_vap_methane = 0.020\n",
+ "\n",
+ "F_vap_non_zero = 1e-5\n",
+ "F_liq_non_zero = F_vap_non_zero\n",
+ "\n",
+ "F_vap_I102 = F_vap_hydrogen + F_vap_methane + 2 * F_vap_non_zero\n",
+ "F_liq_I102 = 2 * F_vap_non_zero\n",
+ "\n",
+ "m.fs.I102.flow_mol_phase[0, \"Vap\"].fix(F_vap_I102)\n",
+ "m.fs.I102.flow_mol_phase[0, \"Liq\"].fix(F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"benzene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"toluene\"].fix(F_vap_non_zero / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"hydrogen\"].fix(F_vap_hydrogen / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Vap\", \"methane\"].fix(F_vap_methane / F_vap_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"benzene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "m.fs.I102.mole_frac_phase_comp[0, \"Liq\", \"toluene\"].fix(F_liq_non_zero / F_liq_I102)\n",
+ "\n",
+ "m.fs.I102.temperature.fix(303.2)\n",
+ "m.fs.I102.pressure.fix(350000)"
+ ],
+ "outputs": [],
+ "execution_count": 30
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Fixing unit model specifications\n",
+ "### 4.2 Fixing unit model specifications\n",
"\n",
"Now that we have fixed our inlet feed conditions, we will now be fixing the operating conditions for the unit models in the flowsheet. Let us set set the H101 outlet temperature to 600 K. "
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.441145Z",
+ "start_time": "2025-11-20T21:46:10.433569Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.fix(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 31
},
{
"cell_type": "markdown",
@@ -706,23 +957,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.453419Z",
+ "start_time": "2025-11-20T21:46:10.445363Z"
+ }
+ },
"source": [
"m.fs.R101.conversion = Var(initialize=0.75, bounds=(0, 1))\n",
"\n",
"m.fs.R101.conv_constraint = Constraint(\n",
- " expr=m.fs.R101.conversion * m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " expr=m.fs.R101.conversion\n",
+ " * (m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"])\n",
" == (\n",
- " m.fs.R101.inlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
- " - m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"toluene\"]\n",
+ " m.fs.R101.control_volume.properties_in[0].flow_mol_phase_comp[\"Vap\", \"toluene\"]\n",
+ " - m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"toluene\"\n",
+ " ]\n",
" )\n",
")\n",
"\n",
"m.fs.R101.conversion.fix(0.75)\n",
"m.fs.R101.heat_duty.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 32
},
{
"cell_type": "markdown",
@@ -733,17 +992,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.463025Z",
+ "start_time": "2025-11-20T21:46:10.457476Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature.fix(325.0)\n",
"m.fs.F101.deltaP.fix(0)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 33
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"
Inline Exercise:\n",
@@ -759,30 +1027,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.472509Z",
+ "start_time": "2025-11-20T21:46:10.467229Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set conditions for Flash F102"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 34
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.482109Z",
+ "start_time": "2025-11-20T21:46:10.475567Z"
+ }
},
- "outputs": [],
"source": [
"m.fs.F102.vap_outlet.temperature.fix(375)\n",
"m.fs.F102.deltaP.fix(-200000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 35
},
{
"cell_type": "markdown",
@@ -793,17 +1069,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.491620Z",
+ "start_time": "2025-11-20T21:46:10.485173Z"
+ }
+ },
"source": [
"m.fs.S101.split_fraction[0, \"purge\"].fix(0.2)\n",
"m.fs.C101.outlet.pressure.fix(350000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 36
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -815,54 +1100,83 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.503512Z",
+ "start_time": "2025-11-20T21:46:10.495838Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: print the degrees of freedom"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 37
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.535421Z",
+ "start_time": "2025-11-20T21:46:10.507798Z"
+ }
},
- "outputs": [],
"source": [
"print(degrees_of_freedom(m))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0\n"
+ ]
+ }
+ ],
+ "execution_count": 38
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Initialization\n",
+ "## 5 Initializing the Model\n",
+ "\n",
+ "\n",
+ "\n",
+ "When a flowsheet contains a recycle loop, the outlet of a downstream unit becomes the inlet of an upstream unit, creating a cyclic dependency that prevents straightforward calculation of all stream conditions. The tear‐stream method is necessary because it “breaks” this loop: you select one recycle stream as the tear, assign it an initial guess, and then solve the rest of the flowsheet as if it were acyclic. Once the downstream units compute their outputs, you compare the calculated value of the torn stream to your initial guess and iteratively adjust until they coincide. Without tearing, the solver cannot establish a proper topological sequence or drive the recycle to convergence, making initialization—and ultimately steady‐state convergence—impossible.\n",
"\n",
+ "It is important to determine the tear stream for a flowsheet which will be demonstrated below.\n",
"\n",
- "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet.\n",
"\n",
- " \n"
+ "\n",
+ "\n",
+ "Currently, there are two methods of initializing a full flowsheet: using the sequential decomposition tool, or manually propagating through the flowsheet. Both methods will be shown.\n",
+ "\n",
+ "### 5.1 Sequential Decomposition\n",
+ "\n",
+ "This section will demonstrate how to use the built-in sequential decomposition tool to initialize our flowsheet. Sequential Decomposition is a tool from Pyomo where the documentation can be found here https://Pyomo.readthedocs.io/en/stable/explanation/modeling/network.html#sequential-decomposition\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Let us first create an object for the SequentialDecomposition and specify our options for this. "
+ "Let us first create an object for the SequentialDecomposition and specify our options for this. We can also create a graph for our flowsheet to determine the tear set and order."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.578789Z",
+ "start_time": "2025-11-20T21:46:10.574025Z"
+ }
+ },
"source": [
"seq = SequentialDecomposition()\n",
"seq.options.select_tear_method = \"heuristic\"\n",
@@ -873,7 +1187,9 @@
"G = seq.create_graph(m)\n",
"heuristic_tear_set = seq.tear_set_arcs(G, method=\"heuristic\")\n",
"order = seq.calculation_order(G)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 40
},
{
"cell_type": "markdown",
@@ -884,13 +1200,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.588985Z",
+ "start_time": "2025-11-20T21:46:10.581810Z"
+ }
+ },
"source": [
"for o in heuristic_tear_set:\n",
" print(o.name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.s03\n"
+ ]
+ }
+ ],
+ "execution_count": 41
},
{
"cell_type": "markdown",
@@ -901,15 +1230,32 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
- "scrolled": true
+ "scrolled": true,
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.602315Z",
+ "start_time": "2025-11-20T21:46:10.599259Z"
+ }
},
- "outputs": [],
"source": [
"for o in order:\n",
" print(o[0].name)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fs.I101\n",
+ "fs.R101\n",
+ "fs.F101\n",
+ "fs.S101\n",
+ "fs.C101\n",
+ "fs.M101\n"
+ ]
+ }
+ ],
+ "execution_count": 42
},
{
"cell_type": "markdown",
@@ -920,25 +1266,30 @@
" \n",
"\n",
"\n",
- "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. We will need to provide a reasonable guess for this."
+ "The SequentialDecomposition tool has determined that the tear stream is the mixer outlet. You can see this shown in the picture of the flowsheet above as the outlet of the mixer as the two lines crossing it identifying it as the tear stream. We will need to provide a reasonable guess for this."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.620357Z",
+ "start_time": "2025-11-20T21:46:10.617116Z"
+ }
+ },
"source": [
"tear_guesses = {\n",
- " \"flow_mol_phase_comp\": {\n",
- " (0, \"Vap\", \"benzene\"): 1e-5,\n",
- " (0, \"Vap\", \"toluene\"): 1e-5,\n",
- " (0, \"Vap\", \"hydrogen\"): 0.30,\n",
- " (0, \"Vap\", \"methane\"): 0.02,\n",
- " (0, \"Liq\", \"benzene\"): 1e-5,\n",
- " (0, \"Liq\", \"toluene\"): 0.30,\n",
- " (0, \"Liq\", \"hydrogen\"): 1e-5,\n",
- " (0, \"Liq\", \"methane\"): 1e-5,\n",
+ " \"flow_mol_phase\": {\n",
+ " (0, \"Liq\"): F_liq_I101,\n",
+ " (0, \"Vap\"): F_vap_I102,\n",
+ " },\n",
+ " \"mole_frac_phase_comp\": {\n",
+ " (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ " (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ " (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ " (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ " (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
" },\n",
" \"temperature\": {0: 303},\n",
" \"pressure\": {0: 350000},\n",
@@ -946,7 +1297,9 @@
"\n",
"# Pass the tear_guess to the SD tool\n",
"seq.set_guesses_for(m.fs.H101.inlet, tear_guesses)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 43
},
{
"cell_type": "markdown",
@@ -957,9 +1310,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:10.638254Z",
+ "start_time": "2025-11-20T21:46:10.635136Z"
+ }
+ },
"source": [
"def function(unit):\n",
" try:\n",
@@ -968,7 +1324,9 @@
" except InitializationError:\n",
" solver = get_solver()\n",
" solver.solve(unit)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 44
},
{
"cell_type": "markdown",
@@ -979,118 +1337,1232 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.022425Z",
+ "start_time": "2025-11-20T21:46:10.648251Z"
+ }
+ },
+ "source": "seq.run(m, function)",
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:10 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal -
\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:11 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.I102.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:12 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:13 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:14 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:15 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.purge_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101.recycle_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.S101: Initialization Step 2 Complete: optimal - \n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_1_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_2_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.inlet_3_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101.mixed_state: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - \n",
+ "WARNING: Wegstein failed to converge in 3 iterations\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P103.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_in: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.F102.control_volume.properties_out: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P101.properties: Property initialization routine finished.\n",
+ "2025-11-20 14:46:16 [INFO] idaes.init.fs.P102.properties: Starting initialization routine\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Bubble, dew, and critical point initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Equilibrium temperature initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: State variable initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Phase equilibrium initialization completed.\n",
+ "2025-11-20 14:46:17 [INFO] idaes.init.fs.P102.properties: Property initialization routine finished.\n"
+ ]
+ }
+ ],
+ "execution_count": 45
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### 5.2 Manual Propagation Method\n",
+ "\n",
+ "This method uses a more direct approach to initialize the flowsheet, utilizing the updated initializer method and propagating manually through the flowsheet and solving for the tear stream directly.\n",
+ "Lets first import a helper function that will help us manually propagate and step through the flowsheet"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.069766Z",
+ "start_time": "2025-11-20T21:46:17.066725Z"
+ }
+ },
+ "source": [
+ "from idaes.core.util.initialization import propagate_state"
+ ],
+ "outputs": [],
+ "execution_count": 46
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "Now we can setup our initial guesses for the tear stream which we know is the outlet of the `Mixer` or the inlet of the `Heater`. We can use the same initial guesses used in the first method. We also want to ensure that the degrees of freedom are consistent while we manually initialize the model.\n",
+ "\n",
+ "We will first ensure that are current degrees of freedom is still zero"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.080343Z",
+ "start_time": "2025-11-20T21:46:17.077382Z"
+ }
+ },
+ "source": "# print(f\"The DOF is {degrees_of_freedom(m)} initially\")",
"outputs": [],
+ "execution_count": 47
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "seq.run(m, function)"
+ "Now we can manually deactivate the tear stream, creating a separation between the `Mixer` and `Heater`. This should reduce the degrees of freedom by 10 since the inlet of the `Heater` now contains no values to solve the unit model. To deactivate a stream, simply use `m.fs.s03_expanded.deactivate()`. This expanded stream is just a different version of the `Arc` stream that is able to be deactivated."
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.093180Z",
+ "start_time": "2025-11-20T21:46:17.089671Z"
+ }
+ },
+ "source": [
+ "# m.fs.s03_expanded.deactivate()\n",
+ "#\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream\")"
+ ],
+ "outputs": [],
+ "execution_count": 48
+ },
{
"cell_type": "markdown",
"metadata": {},
+ "source": [
+ "Now we can provide the `Heater` inlet 10 guess values to bring the degrees of freedom back to 0 and start the manual initialization process. We can run this convenient loop to assign each of these guesses to the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.105510Z",
+ "start_time": "2025-11-20T21:46:17.099824Z"
+ }
+ },
+ "source": [
+ "# tear_guesses = {\n",
+ "# \"flow_mol_phase\": {\n",
+ "# (0, \"Liq\"): F_liq_I101,\n",
+ "# (0, \"Vap\"): F_vap_I102,\n",
+ "#\n",
+ "# },\n",
+ "# \"mole_frac_phase_comp\": {\n",
+ "# (0, \"Liq\", \"benzene\"): 1e-5 / F_liq_I101,\n",
+ "# (0, \"Liq\", \"toluene\"): 0.30 / F_liq_I101,\n",
+ "# (0, \"Vap\", \"benzene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"toluene\"): 1e-5 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"methane\"): 0.02 / F_vap_I102,\n",
+ "# (0, \"Vap\", \"hydrogen\"): 0.30 / F_vap_I102,\n",
+ "# },\n",
+ "# \"temperature\": {0: 303},\n",
+ "# \"pressure\": {0: 350000},\n",
+ "# }\n",
+ "#\n",
+ "# for k, v in tear_guesses.items():\n",
+ "# for k1, v1 in v.items():\n",
+ "# getattr(m.fs.s03.destination, k)[k1].fix(v1)\n",
+ "#\n",
+ "# DOF_initial = degrees_of_freedom(m)\n",
+ "# print(f\"The DOF is {degrees_of_freedom(m)} after providing the initial guesses\")"
+ ],
+ "outputs": [],
+ "execution_count": 49
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The next step is to manually initialize each unit model starting from the `Heater` and then propagate the connection between it and the next unit model. This manual process ensures a strict order to the user's specification if that is desired. The current standard for initializing a unit model is to use an initializer object most compatible for that unit model. This can most often be done by utilizing the `default_initializer()` method attached to the unit model and then to call the `initialize()` method with the unit model as the argument."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.117110Z",
+ "start_time": "2025-11-20T21:46:17.113630Z"
+ }
+ },
+ "source": [
+ "# m.fs.H101.default_initializer().initialize(m.fs.H101) # Initialize Heater\n",
+ "# propagate_state(m.fs.s04) # Establish connection between Heater and Reactor\n",
+ "#\n",
+ "# m.fs.R101.default_initializer().initialize(m.fs.R101) # Initialize Reactor\n",
+ "# propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit\n",
+ "#\n",
+ "# m.fs.F101.default_initializer().initialize(m.fs.F101) # Initialize First Flash Unit\n",
+ "# propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter\n",
+ "# propagate_state(m.fs.s07) # Establish connection between First Flash Unit and Second Flash Unit\n",
+ "#\n",
+ "# m.fs.S101.default_initializer().initialize(m.fs.S101) # Initialize Splitter\n",
+ "# propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor\n",
+ "#\n",
+ "# m.fs.C101.default_initializer().initialize(m.fs.C101) # Initialize Compressor\n",
+ "# propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer\n",
+ "#\n",
+ "# m.fs.I101.default_initializer().initialize(m.fs.I101) # Initialize Toluene Inlet\n",
+ "# propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.I102.default_initializer().initialize(m.fs.I102) # Initialize Hydrogen Inlet\n",
+ "# propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer\n",
+ "#\n",
+ "# m.fs.M101.default_initializer().initialize(m.fs.M101) # Initialize Mixer\n",
+ "# propagate_state(m.fs.s03) # Establish connection between Mixer and Heater\n",
+ "#\n",
+ "# m.fs.F102.default_initializer().initialize(m.fs.F102) # Initialize Second Flash Unit\n",
+ "# propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product\n",
+ "# propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product\n",
+ "# propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product"
+ ],
+ "outputs": [],
+ "execution_count": 50
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we solve the system to allow the outlet of the mixer to reach a converged congruence with the inlet of the heater."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.226222Z",
+ "start_time": "2025-11-20T21:46:17.129942Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 300,\n",
+ " \"tol\": 1e-8,\n",
+ "}\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
+ "results = solver.solve(m, tee=True)"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=300\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpvgsmpj67\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 3.35e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.07e+03 1.08e+01 -1.0 1.21e+03 - 8.49e-01 6.80e-01h 1\n",
+ " 2 0.0000000e+00 1.66e+02 4.55e+02 -1.0 7.65e+02 - 9.90e-01 8.44e-01h 1\n",
+ " 3 0.0000000e+00 5.53e+00 2.00e+02 -1.0 1.30e+02 - 9.90e-01 9.67e-01h 1\n",
+ " 4 0.0000000e+00 5.22e-02 8.91e+03 -1.0 4.05e+00 - 1.00e+00 9.91e-01h 1\n",
+ " 5 0.0000000e+00 1.46e-04 1.02e+04 -1.0 3.80e-02 - 1.00e+00 9.97e-01h 1\n",
+ " 6 0.0000000e+00 9.46e-11 6.27e-01 -1.0 1.06e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 6\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 9.4587448984384537e-11 9.4587448984384537e-11\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 7\n",
+ "Number of objective gradient evaluations = 7\n",
+ "Number of equality constraint evaluations = 7\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 7\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 6\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.009\n",
+ "Total CPU secs in NLP function evaluations = 0.001\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 51
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now that the flowsheet is initialized, we can unfix the guesses for the `Heater` and reactive the tear stream to complete the final solve."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.258332Z",
+ "start_time": "2025-11-20T21:46:17.233298Z"
+ }
+ },
+ "source": [
+ "for k, v in tear_guesses.items():\n",
+ " for k1, v1 in v.items():\n",
+ " getattr(m.fs.H101.inlet, k)[k1].unfix()\n",
+ "\n",
+ "m.fs.s03_expanded.activate()\n",
+ "print(\n",
+ " f\"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The DOF is 0 after unfixing the values and reactivating the tear stream\n"
+ ]
+ }
+ ],
+ "execution_count": 52
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## 6 Solving the Model"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "We have now initialized the flowsheet. Lets set up some solving options before simulating the flowsheet. We want to specify the scaling method, number of iterations, and tolerance. More specific or advanced options can be found at the documentation for IPOPT https://coin-or.github.io/Ipopt/OPTIONS.html"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.268422Z",
+ "start_time": "2025-11-20T21:46:17.265316Z"
+ }
+ },
+ "source": [
+ "optarg = {\n",
+ " \"nlp_scaling_method\": \"user-scaling\",\n",
+ " \"OF_ma57_automatic_scaling\": \"yes\",\n",
+ " \"max_iter\": 1000,\n",
+ " \"tol\": 1e-8,\n",
+ "}"
+ ],
+ "outputs": [],
+ "execution_count": 53
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"\n",
"Inline Exercise:\n",
- "We have now initialized the flowsheet. Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
- " \n",
+ "Let us run the flowsheet in a simulation mode to look at the results. To do this, complete the last line of code where we pass the model to the solver. You will need to type the following:\n",
+ "\n",
+ "solver = get_solver(solver_options=optarg)
\n",
"results = solver.solve(m, tee=True)\n",
"\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n",
- "\n"
+ "Use Shift+Enter to run the cell once you have typed in your code.\n",
+ "\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.285774Z",
+ "start_time": "2025-11-20T21:46:17.281657Z"
+ }
},
- "outputs": [],
"source": [
"# Create the solver object\n",
"\n",
- "\n",
"# Solve the model"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 54
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.382669Z",
+ "start_time": "2025-11-20T21:46:17.293013Z"
+ }
},
- "outputs": [],
"source": [
"# Create the solver object\n",
- "from idaes.core.solvers import get_solver\n",
- "\n",
- "solver = get_solver()\n",
+ "solver = get_solver(\"ipopt_v2\", options=optarg)\n",
"\n",
"# Solve the model\n",
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpi86o_z2t\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpi86o_z2t\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 920\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 0\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 456\n",
+ "\n",
+ "Total number of variables............................: 218\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 147\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 218\n",
+ "Total number of inequality constraints...............: 0\n",
+ " inequality constraints with only lower bounds: 0\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 0\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 0.0000000e+00 1.64e+03 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (10193)\n",
+ " 1 0.0000000e+00 1.84e+01 4.18e+00 -1.0 4.14e-01 - 9.90e-01 9.89e-01h 1\n",
+ " 2 0.0000000e+00 1.82e-01 3.87e+00 -1.0 3.76e-01 - 9.90e-01 9.90e-01h 1\n",
+ " 3 0.0000000e+00 6.96e-04 4.53e+02 -1.0 3.70e-02 - 9.92e-01 9.96e-01h 1\n",
+ " 4 0.0000000e+00 4.52e-09 8.75e-01 -1.0 3.82e-04 - 1.00e+00 1.00e+00h 1\n",
+ "\n",
+ "Number of Iterations....: 4\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Constraint violation....: 4.5247361413203180e-09 4.5247361413203180e-09\n",
+ "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n",
+ "Overall NLP error.......: 4.5247361413203180e-09 4.5247361413203180e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 5\n",
+ "Number of objective gradient evaluations = 5\n",
+ "Number of equality constraint evaluations = 5\n",
+ "Number of inequality constraint evaluations = 0\n",
+ "Number of equality constraint Jacobian evaluations = 5\n",
+ "Number of inequality constraint Jacobian evaluations = 0\n",
+ "Number of Lagrangian Hessian evaluations = 4\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.008\n",
+ "Total CPU secs in NLP function evaluations = 0.000\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 55
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Analyze the results of the square problem\n",
- "\n",
+ "## 7 Analyze the results\n",
"\n",
- "What is the total operating cost? "
+ "\n"
]
},
{
- "cell_type": "code",
- "execution_count": null,
+ "cell_type": "markdown",
"metadata": {},
+ "source": [
+ "If the IDAES UI package was installed with the `idaes-pse` installation or installed separately, you can run the flowsheet visualizer to see a full diagram of the full process that is generated and displayed on a browser window.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "tags": [
+ "noauto"
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.403453Z",
+ "start_time": "2025-11-20T21:46:17.400372Z"
+ }
+ },
+ "source": [
+ "# m.fs.visualize(\"HDA-Flowsheet\")"
+ ],
"outputs": [],
+ "execution_count": 57
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
- "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ "Otherwise, we can run the `m.fs.report()` method to see a full summary of the solved flowsheet. It is recommended to adjust the width of the output as much as possible for the cleanest display."
]
},
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.448969Z",
+ "start_time": "2025-11-20T21:46:17.421434Z"
+ }
+ },
+ "source": [
+ "m.fs.report()"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Flowsheet : fs Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units s01 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 \n",
+ " Total Molar Flowrate mole / second 0.30005 0.32004 2.0320 2.0320 2.0320 1.7648 0.26712 1.4119 1.4119 0.17224 0.094878 0.35297\n",
+ " Total Mole Fraction benzene dimensionless 6.6656e-05 6.2492e-05 0.058732 0.058732 0.17408 0.084499 0.76595 0.084499 0.084499 0.82430 0.66001 0.084499\n",
+ " Total Mole Fraction toluene dimensionless 0.99987 6.2492e-05 0.15380 0.15380 0.038450 0.0088437 0.23405 0.0088437 0.0088437 0.17570 0.33999 0.0088437\n",
+ " Total Mole Fraction hydrogen dimensionless 3.3328e-05 0.93738 0.27683 0.27683 0.16148 0.18592 6.9600e-09 0.18592 0.18592 1.0794e-08 1.1376e-15 0.18592\n",
+ " Total Mole Fraction methane dimensionless 3.3328e-05 0.062492 0.51064 0.51064 0.62599 0.72074 2.6982e-08 0.72074 0.72074 4.1844e-08 4.4103e-15 0.72074\n",
+ " Temperature kelvin 303.20 303.20 324.54 600.00 822.07 325.00 325.00 325.00 325.00 375.00 375.00 325.00\n",
+ " Pressure pascal 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 3.5000e+05 1.5000e+05 1.5000e+05 3.5000e+05\n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 58
+ },
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? "
+ "What is the total operating cost?"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.475550Z",
+ "start_time": "2025-11-20T21:46:17.472001Z"
+ }
+ },
+ "source": [
+ "print(\"operating cost = $\", value(m.fs.operating_cost))"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 424513.9640158265\n"
+ ]
+ }
+ ],
+ "execution_count": 59
+ },
+ {
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
+ "source": [
+ "For this operating cost, what is the amount of benzene we are able to produce and what purity we are able to achieve? We can look at a specific unit models stream table with the same `report()` method."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.596910Z",
+ "start_time": "2025-11-20T21:46:17.580529Z"
+ }
+ },
"source": [
"m.fs.F102.report()\n",
"\n",
"print()\n",
"print(\"benzene purity = \", value(m.fs.purity))"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 7346.0 : watt : False : (None, None)\n",
+ " Pressure Change : -2.0000e+05 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.26712 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.76595 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.23405 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 6.9600e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.6982e-08 - - \n",
+ " Temperature kelvin 325.00 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.094878 \n",
+ " flow_mol_phase Vap mole / second - 0.17224 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.66001 0.66001 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.33999 0.33999 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.82430 0.82430 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.17570 0.17570 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.0794e-08 1.0794e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.1844e-08 4.1844e-08 \n",
+ " temperature kelvin - 375.00 375.00 \n",
+ " pressure pascal - 1.5000e+05 1.5000e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8242963521555956\n"
+ ]
+ }
+ ],
+ "execution_count": 61
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101.\n",
- "\n",
- "
\n",
- "Inline Exercise:\n",
- "How much benzene are we losing in the F101 vapor outlet stream?\n",
- "
\n"
+ "Next, let's look at how much benzene we are losing with the light gases out of F101. IDAES has tools for creating stream tables based on the `Arcs` and/or `Ports` in a flowsheet. Let us create and print a simple stream table showing the stream leaving the reactor and the vapor stream from F101."
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.648524Z",
+ "start_time": "2025-11-20T21:46:17.638446Z"
+ }
+ },
"source": [
"from idaes.core.util.tables import (\n",
" create_stream_table_dataframe,\n",
@@ -1099,25 +2571,30 @@
"\n",
"st = create_stream_table_dataframe({\"Reactor\": m.fs.s05, \"Light Gases\": m.fs.s06})\n",
"print(stream_table_dataframe_to_string(st))"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "
\n",
- "Inline Exercise:\n",
- "You can query additional variables here if you like. \n",
- "\n",
- "Use Shift+Enter to run the cell once you have typed in your code. \n",
- "
\n"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " Units Reactor Light Gases\n",
+ "Total Molar Flowrate mole / second 2.0320 1.7648 \n",
+ "Total Mole Fraction benzene dimensionless 0.17408 0.084499 \n",
+ "Total Mole Fraction toluene dimensionless 0.038450 0.0088437 \n",
+ "Total Mole Fraction hydrogen dimensionless 0.16148 0.18592 \n",
+ "Total Mole Fraction methane dimensionless 0.62599 0.72074 \n",
+ "Temperature kelvin 822.07 325.00 \n",
+ "Pressure pascal 3.5000e+05 3.5000e+05 \n"
+ ]
+ }
+ ],
+ "execution_count": 63
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization\n",
+ "## 8 Optimization\n",
"\n",
"\n",
"We saw from the results above that the total operating cost for the base case was $419,122 per year. We are producing 0.142 mol/s of benzene at a purity of 82\\%. However, we are losing around 42\\% of benzene in F101 vapor outlet stream. \n",
@@ -1144,12 +2621,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.675626Z",
+ "start_time": "2025-11-20T21:46:17.671136Z"
+ }
+ },
"source": [
"m.fs.objective = Objective(expr=m.fs.operating_cost)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 64
},
{
"cell_type": "markdown",
@@ -1160,19 +2642,28 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.691883Z",
+ "start_time": "2025-11-20T21:46:17.687385Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature.unfix()\n",
"m.fs.R101.heat_duty.unfix()\n",
"m.fs.F101.vap_outlet.temperature.unfix()\n",
"m.fs.F102.vap_outlet.temperature.unfix()"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 65
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1185,30 +2676,38 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.707409Z",
+ "start_time": "2025-11-20T21:46:17.704141Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Unfix deltaP for F102"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 66
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.720592Z",
+ "start_time": "2025-11-20T21:46:17.717532Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Unfix deltaP for F102\n",
"m.fs.F102.deltaP.unfix()"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 67
},
{
"cell_type": "markdown",
@@ -1227,17 +2726,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.779305Z",
+ "start_time": "2025-11-20T21:46:17.775669Z"
+ }
+ },
"source": [
"m.fs.H101.outlet.temperature[0].setlb(500)\n",
"m.fs.H101.outlet.temperature[0].setub(600)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 69
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"
Inline Exercise:\n",
@@ -1249,31 +2757,39 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.797044Z",
+ "start_time": "2025-11-20T21:46:17.794614Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 70
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.812504Z",
+ "start_time": "2025-11-20T21:46:17.807564Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Set the bounds for reactor outlet temperature\n",
"m.fs.R101.outlet.temperature[0].setlb(600)\n",
"m.fs.R101.outlet.temperature[0].setub(800)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 71
},
{
"cell_type": "markdown",
@@ -1284,9 +2800,12 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.827227Z",
+ "start_time": "2025-11-20T21:46:17.822681Z"
+ }
+ },
"source": [
"m.fs.F101.vap_outlet.temperature[0].setlb(298.0)\n",
"m.fs.F101.vap_outlet.temperature[0].setub(450.0)\n",
@@ -1294,7 +2813,9 @@
"m.fs.F102.vap_outlet.temperature[0].setub(450.0)\n",
"m.fs.F102.vap_outlet.pressure[0].setlb(105000)\n",
"m.fs.F102.vap_outlet.pressure[0].setub(110000)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 72
},
{
"cell_type": "markdown",
@@ -1305,19 +2826,31 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.848212Z",
+ "start_time": "2025-11-20T21:46:17.844101Z"
+ }
+ },
"source": [
"m.fs.overhead_loss = Constraint(\n",
- " expr=m.fs.F101.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
- " <= 0.20 * m.fs.R101.outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"]\n",
+ " expr=m.fs.F101.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " <= 0.20\n",
+ " * m.fs.R101.control_volume.properties_out[0].flow_mol_phase_comp[\"Vap\", \"benzene\"]\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 73
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "tags": [
+ "exercise"
+ ]
+ },
"source": [
"
\n",
"Inline Exercise:\n",
@@ -1329,32 +2862,43 @@
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"exercise"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.862411Z",
+ "start_time": "2025-11-20T21:46:17.859385Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 74
},
{
"cell_type": "code",
- "execution_count": null,
"metadata": {
"tags": [
"solution"
- ]
+ ],
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.876414Z",
+ "start_time": "2025-11-20T21:46:17.872250Z"
+ }
},
- "outputs": [],
"source": [
"# Todo: Add minimum product flow constraint\n",
"m.fs.product_flow = Constraint(\n",
- " expr=m.fs.F102.vap_outlet.flow_mol_phase_comp[0, \"Vap\", \"benzene\"] >= 0.15\n",
+ " expr=m.fs.F102.control_volume.properties_out[0].flow_mol_phase_comp[\n",
+ " \"Vap\", \"benzene\"\n",
+ " ]\n",
+ " >= 0.15\n",
")"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 75
},
{
"cell_type": "markdown",
@@ -1365,12 +2909,17 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:17.890250Z",
+ "start_time": "2025-11-20T21:46:17.887141Z"
+ }
+ },
"source": [
"m.fs.product_purity = Constraint(expr=m.fs.purity >= 0.80)"
- ]
+ ],
+ "outputs": [],
+ "execution_count": 76
},
{
"cell_type": "markdown",
@@ -1384,27 +2933,141 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.024828Z",
+ "start_time": "2025-11-20T21:46:17.897344Z"
+ }
+ },
"source": [
"results = solver.solve(m, tee=True)"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ipopt 3.13.2: linear_solver=\"ma57\"\n",
+ "max_iter=1000\n",
+ "nlp_scaling_method=\"user-scaling\"\n",
+ "tol=1e-08\n",
+ "option_file_name=\"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\"\n",
+ "\n",
+ "Using option file \"C:\\Users\\Tanner\\AppData\\Local\\Temp\\tmpqgb86kxz\\unknown.36084.37884.opt\".\n",
+ "\n",
+ "\n",
+ "******************************************************************************\n",
+ "This program contains Ipopt, a library for large-scale nonlinear optimization.\n",
+ " Ipopt is released as open source code under the Eclipse Public License (EPL).\n",
+ " For more information visit http://projects.coin-or.org/Ipopt\n",
+ "\n",
+ "This version of Ipopt was compiled from source code available at\n",
+ " https://github.com/IDAES/Ipopt as part of the Institute for the Design of\n",
+ " Advanced Energy Systems Process Systems Engineering Framework (IDAES PSE\n",
+ " Framework) Copyright (c) 2018-2019. See https://github.com/IDAES/idaes-pse.\n",
+ "\n",
+ "This version of Ipopt was compiled using HSL, a collection of Fortran codes\n",
+ " for large-scale scientific computation. All technical papers, sales and\n",
+ " publicity material resulting from use of the HSL codes within IPOPT must\n",
+ " contain the following acknowledgement:\n",
+ " HSL, a collection of Fortran codes for large-scale scientific\n",
+ " computation. See http://www.hsl.rl.ac.uk.\n",
+ "******************************************************************************\n",
+ "\n",
+ "This is Ipopt version 3.13.2, running with linear solver ma57.\n",
+ "\n",
+ "Number of nonzeros in equality constraint Jacobian...: 938\n",
+ "Number of nonzeros in inequality constraint Jacobian.: 9\n",
+ "Number of nonzeros in Lagrangian Hessian.............: 504\n",
+ "\n",
+ "Reallocating memory for MA57: lfact (10594)\n",
+ "Total number of variables............................: 224\n",
+ " variables with only lower bounds: 56\n",
+ " variables with lower and upper bounds: 151\n",
+ " variables with only upper bounds: 0\n",
+ "Total number of equality constraints.................: 219\n",
+ "Total number of inequality constraints...............: 3\n",
+ " inequality constraints with only lower bounds: 2\n",
+ " inequality constraints with lower and upper bounds: 0\n",
+ " inequality constraints with only upper bounds: 1\n",
+ "\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 0 4.2451396e+05 4.00e+04 6.94e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n",
+ "Reallocating memory for MA57: lfact (11249)\n",
+ " 1 4.2182392e+05 4.00e+04 6.94e+00 -1.0 3.47e+07 - 3.71e-05 1.25e-05f 1\n",
+ " 2 4.2170773e+05 4.00e+04 8.41e+01 -1.0 1.49e+06 - 3.32e-04 1.53e-05f 1\n",
+ " 3 4.1795462e+05 4.00e+04 6.82e+01 -1.0 1.43e+06 - 4.98e-04 5.60e-04f 1\n",
+ " 4 3.0650178e+05 4.00e+04 3.09e+02 -1.0 1.26e+07 - 2.61e-05 1.17e-03f 1\n",
+ " 5 3.0553183e+05 3.99e+04 3.25e+04 -1.0 1.48e+05 - 1.28e-01 1.02e-03f 1\n",
+ " 6 3.0565526e+05 3.91e+04 5.25e+04 -1.0 3.99e+04 - 1.13e-01 2.09e-02h 2\n",
+ " 7 3.0601574e+05 3.59e+04 4.21e+04 -1.0 3.91e+04 - 5.17e-02 8.21e-02h 2\n",
+ " 8 3.0674242e+05 2.95e+04 8.41e+04 -1.0 3.59e+04 - 4.38e-01 1.79e-01h 1\n",
+ " 9 3.1153051e+05 1.11e+04 5.73e+04 -1.0 2.95e+04 - 8.56e-01 6.23e-01h 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 10 3.1154545e+05 1.09e+04 5.69e+04 -1.0 1.19e+04 - 6.57e-02 2.37e-02h 1\n",
+ " 11 3.1159568e+05 1.08e+04 5.66e+04 -1.0 1.68e+04 - 2.23e-02 8.97e-03h 1\n",
+ " 12 3.1610911e+05 2.56e+03 2.13e+05 -1.0 1.68e+04 - 9.47e-01 7.94e-01h 1\n",
+ " 13 3.1708718e+05 1.16e+03 9.56e+04 -1.0 4.45e+03 - 9.90e-01 5.53e-01h 1\n",
+ " 14 3.1796760e+05 4.06e+02 1.14e+03 -1.0 1.27e+04 - 9.95e-01 9.87e-01h 1\n",
+ " 15 3.1802429e+05 5.35e+00 6.53e+02 -1.0 8.29e+01 - 1.00e+00 9.89e-01h 1\n",
+ " 16 3.1802524e+05 1.77e-04 5.89e+02 -1.0 5.10e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 17 3.1802492e+05 5.34e-06 1.83e+06 -2.5 1.32e+00 - 3.33e-01 1.00e+00f 1\n",
+ " 18 3.1802492e+05 1.70e-09 9.74e-03 -2.5 2.42e-02 - 1.00e+00 1.00e+00h 1\n",
+ " 19 3.1802491e+05 4.41e-09 1.03e-01 -5.7 3.83e-02 - 1.00e+00 1.00e+00f 1\n",
+ "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n",
+ " 20 3.1802491e+05 2.39e-03 8.22e-09 -5.7 2.88e+01 - 1.00e+00 1.00e+00h 1\n",
+ " 21 3.1802491e+05 8.00e-11 9.72e-09 -5.7 4.08e-04 - 1.00e+00 1.00e+00h 1\n",
+ " 22 3.1802491e+05 2.47e-03 1.19e-01 -8.6 2.93e+01 - 9.99e-01 1.00e+00h 1\n",
+ " 23 3.1802491e+05 2.41e+02 2.13e-09 -8.6 9.27e+03 - 1.00e+00 1.00e+00h 1\n",
+ " 24 3.1802491e+05 6.96e-03 3.66e-09 -8.6 1.88e+02 - 1.00e+00 1.00e+00h 1\n",
+ " 25 3.1802491e+05 3.61e-06 1.59e-09 -8.6 1.21e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 26 3.1802491e+05 2.29e-05 4.82e-09 -8.6 3.07e+00 - 1.00e+00 1.00e+00h 1\n",
+ " 27 3.1802491e+05 9.42e-07 5.47e-09 -8.6 6.24e-01 - 1.00e+00 1.00e+00h 1\n",
+ " 28 3.1802491e+05 1.16e-10 9.67e-09 -8.6 3.01e+00 - 1.00e+00 1.00e+00H 1\n",
+ "\n",
+ "Number of Iterations....: 28\n",
+ "\n",
+ " (scaled) (unscaled)\n",
+ "Objective...............: 3.1802490940142004e+05 3.1802490940142004e+05\n",
+ "Dual infeasibility......: 9.6706583658121551e-09 9.6706583658121551e-09\n",
+ "Constraint violation....: 1.1641532182693481e-10 1.1641532182693481e-10\n",
+ "Complementarity.........: 2.5059899579272651e-09 2.5059899579272651e-09\n",
+ "Overall NLP error.......: 2.2246107350021195e-10 9.6706583658121551e-09\n",
+ "\n",
+ "\n",
+ "Number of objective function evaluations = 35\n",
+ "Number of objective gradient evaluations = 29\n",
+ "Number of equality constraint evaluations = 35\n",
+ "Number of inequality constraint evaluations = 35\n",
+ "Number of equality constraint Jacobian evaluations = 29\n",
+ "Number of inequality constraint Jacobian evaluations = 29\n",
+ "Number of Lagrangian Hessian evaluations = 28\n",
+ "Total CPU secs in IPOPT (w/o function evaluations) = 0.036\n",
+ "Total CPU secs in NLP function evaluations = 0.006\n",
+ "\n",
+ "EXIT: Optimal Solution Found.\n"
+ ]
+ }
+ ],
+ "execution_count": 77
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "## Optimization Results\n",
+ "### 8.1 Optimization Results\n",
"\n",
"Display the results and product specifications"
]
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.074231Z",
+ "start_time": "2025-11-20T21:46:18.053675Z"
+ }
+ },
"source": [
"print(\"operating cost = $\", value(m.fs.operating_cost))\n",
"\n",
@@ -1419,7 +3082,89 @@
"print()\n",
"print(\"Overhead loss in F101\")\n",
"m.fs.F101.report()"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "operating cost = $ 318024.90940142004\n",
+ "\n",
+ "Product flow rate and purity in F102\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F102 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : 8369.3 : watt : False : (None, None)\n",
+ " Pressure Change : -2.4500e+05 : pascal : False : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 0.28812 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.75463 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.24537 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 7.5018e-09 - - \n",
+ " Total Mole Fraction methane dimensionless 2.5957e-08 - - \n",
+ " Temperature kelvin 301.88 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.10493 \n",
+ " flow_mol_phase Vap mole / second - 0.18319 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.64256 0.64256 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.35744 0.35744 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.81883 0.81883 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.18117 0.18117 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 1.1799e-08 1.1799e-08 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 4.0825e-08 4.0825e-08 \n",
+ " temperature kelvin - 362.93 362.93 \n",
+ " pressure pascal - 1.0500e+05 1.0500e+05 \n",
+ "====================================================================================\n",
+ "\n",
+ "benzene purity = 0.8188295888411846\n",
+ "\n",
+ "Overhead loss in F101\n",
+ "\n",
+ "====================================================================================\n",
+ "Unit : fs.F101 Time: 0.0\n",
+ "------------------------------------------------------------------------------------\n",
+ " Unit Performance\n",
+ "\n",
+ " Variables: \n",
+ "\n",
+ " Key : Value : Units : Fixed : Bounds\n",
+ " Heat Duty : -66423. : watt : False : (None, None)\n",
+ " Pressure Change : 0.0000 : pascal : True : (None, None)\n",
+ "\n",
+ "------------------------------------------------------------------------------------\n",
+ " Stream Table\n",
+ " Units Inlet Vapor Outlet Liquid Outlet\n",
+ " Total Molar Flowrate mole / second 1.9480 - - \n",
+ " Total Mole Fraction benzene dimensionless 0.13952 - - \n",
+ " Total Mole Fraction toluene dimensionless 0.039059 - - \n",
+ " Total Mole Fraction hydrogen dimensionless 0.18417 - - \n",
+ " Total Mole Fraction methane dimensionless 0.63725 - - \n",
+ " Temperature kelvin 763.51 - - \n",
+ " Pressure pascal 3.5000e+05 - - \n",
+ " flow_mol_phase Liq mole / second - 1.0000e-08 0.28812 \n",
+ " flow_mol_phase Vap mole / second - 1.6598 1.0000e-08 \n",
+ " mole_frac_phase_comp ('Liq', 'benzene') dimensionless - 0.75463 0.75463 \n",
+ " mole_frac_phase_comp ('Liq', 'toluene') dimensionless - 0.24537 0.24537 \n",
+ " mole_frac_phase_comp ('Vap', 'benzene') dimensionless - 0.032748 0.032748 \n",
+ " mole_frac_phase_comp ('Vap', 'toluene') dimensionless - 0.0032478 0.0032478 \n",
+ " mole_frac_phase_comp ('Vap', 'hydrogen') dimensionless - 0.21614 0.21614 \n",
+ " mole_frac_phase_comp ('Vap', 'methane') dimensionless - 0.74786 0.74786 \n",
+ " temperature kelvin - 301.88 301.88 \n",
+ " pressure pascal - 3.5000e+05 3.5000e+05 \n",
+ "====================================================================================\n"
+ ]
+ }
+ ],
+ "execution_count": 79
},
{
"cell_type": "markdown",
@@ -1430,32 +3175,47 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2025-11-20T21:46:18.106001Z",
+ "start_time": "2025-11-20T21:46:18.101768Z"
+ }
+ },
"source": [
- "print(\"Optimal Values\")\n",
- "print()\n",
+ "print(\n",
+ " f\"\"\"Optimal Values:\n",
"\n",
- "print(\"H101 outlet temperature = \", value(m.fs.H101.outlet.temperature[0]), \"K\")\n",
+ "H101 outlet temperature = {value(m.fs.H101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"R101 outlet temperature = \", value(m.fs.R101.outlet.temperature[0]), \"K\")\n",
+ "R101 outlet temperature = {value(m.fs.R101.outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F101 outlet temperature = \", value(m.fs.F101.vap_outlet.temperature[0]), \"K\")\n",
+ "F101 outlet temperature = {value(m.fs.F101.vap_outlet.temperature[0]):.3f} K\n",
"\n",
- "print()\n",
- "print(\"F102 outlet temperature = \", value(m.fs.F102.vap_outlet.temperature[0]), \"K\")\n",
- "print(\"F102 outlet pressure = \", value(m.fs.F102.vap_outlet.pressure[0]), \"Pa\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
+ "F102 outlet temperature = {value(m.fs.F102.vap_outlet.temperature[0]):.3f} K\n",
+ "F102 outlet pressure = {value(m.fs.F102.vap_outlet.pressure[0]):.3f} Pa\n",
+ "\"\"\"\n",
+ ")"
+ ],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Optimal Values:\n",
+ "\n",
+ "H101 outlet temperature = 500.000 K\n",
+ "\n",
+ "R101 outlet temperature = 763.507 K\n",
+ "\n",
+ "F101 outlet temperature = 301.881 K\n",
+ "\n",
+ "F102 outlet temperature = 362.935 K\n",
+ "F102 outlet pressure = 105000.000 Pa\n",
+ "\n"
+ ]
+ }
+ ],
+ "execution_count": 81
}
],
"metadata": {
@@ -1475,7 +3235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.12"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/idaes_examples/notebooks/docs/tut/core/initializing_testing.py b/idaes_examples/notebooks/docs/tut/core/initializing_testing.py
new file mode 100644
index 00000000..673ccac9
--- /dev/null
+++ b/idaes_examples/notebooks/docs/tut/core/initializing_testing.py
@@ -0,0 +1,107 @@
+# Import required packages
+from idaes.models_extra.power_generation.properties.natural_gas_PR import get_prop
+from pyomo.environ import (
+ ConcreteModel,
+ SolverFactory,
+ value,
+ units,
+ TransformationFactory,
+ Expression,
+)
+from idaes.core import FlowsheetBlock
+from idaes.core.util.initialization import propagate_state
+import idaes.logger as idaeslog
+from idaes.models.properties import iapws95
+from idaes.models.unit_models import Feed
+from idaes.models.unit_models.heater import Heater
+from idaes.models.unit_models.heat_exchanger import (
+ HeatExchanger,
+ delta_temperature_amtd_callback,
+)
+from pyomo.network import Arc, SequentialDecomposition
+from idaes.core.util.model_statistics import degrees_of_freedom
+
+# Create the ConcreteModel and the FlowsheetBlock, and attach the flowsheet block to it.
+m = ConcreteModel()
+
+m.fs = FlowsheetBlock(dynamic=False)
+
+m.fs.properties = iapws95.Iapws95ParameterBlock()
+
+m.fs.feed = Feed(property_package=m.fs.properties)
+m.fs.heater = Heater(property_package=m.fs.properties)
+m.fs.heat_exchanger = HeatExchanger(
+ delta_temperature_callback=delta_temperature_amtd_callback,
+ hot_side_name="shell",
+ cold_side_name="tube",
+ shell={"property_package": m.fs.properties},
+ tube={"property_package": m.fs.properties},
+)
+
+m.fs.s01 = Arc(source=m.fs.feed.outlet, destination=m.fs.heat_exchanger.cold_side_inlet)
+m.fs.s02 = Arc(
+ source=m.fs.heat_exchanger.cold_side_outlet, destination=m.fs.heater.inlet
+)
+m.fs.s03 = Arc(
+ source=m.fs.heater.outlet, destination=m.fs.heat_exchanger.hot_side_inlet
+)
+
+TransformationFactory("network.expand_arcs").apply_to(m)
+DOF_initial = degrees_of_freedom(m)
+print("The initial DOF is {0}".format(DOF_initial))
+
+# Fix the stream inlet conditions
+m.fs.feed.flow_mol[0].fix(100) # mol/s
+m.fs.feed.pressure[0].fix(101325) # Pa
+m.fs.feed.enth_mol[0].fix(value(iapws95.htpx(T=293 * units.K, P=101325 * units.Pa)))
+
+
+m.fs.heat_exchanger.overall_heat_transfer_coefficient[0].fix(500) # W/m2/K
+m.fs.heat_exchanger.area.fix(50)
+
+
+m.fs.heater.outlet.enth_mol.fix(
+ value(iapws95.htpx(T=1073 * units.K, P=101325 * units.Pa))
+)
+
+DOF_initial = degrees_of_freedom(m)
+print("The DOF is {0}".format(DOF_initial))
+
+# Provide initial guess for the shell inlet and create tear stream
+m.fs.heat_exchanger.shell_inlet.flow_mol.fix(100) # mol/s
+m.fs.heat_exchanger.shell_inlet.enth_mol[0].fix(
+ value(iapws95.htpx(T=1073 * units.K, P=101325 * 1.5 * units.Pa))
+)
+m.fs.heat_exchanger.shell_inlet.pressure[0].fix(101325) # Pa
+m.fs.s03_expanded.deactivate()
+
+DOF_initial = degrees_of_freedom(m)
+print("The DOF is {0} after creating tear stream".format(DOF_initial))
+
+m.fs.report()
+
+m.fs.feed.initialize(outlvl=idaeslog.INFO)
+propagate_state(m.fs.s01)
+m.fs.report()
+m.fs.heat_exchanger.initialize(outlvl=idaeslog.INFO)
+propagate_state(m.fs.s02)
+m.fs.report()
+m.fs.heater.initialize(outlvl=idaeslog.INFO)
+
+m.fs.report()
+
+# Solve the model
+from idaes.core.solvers import get_solver
+
+solver = get_solver()
+results = solver.solve(m, tee=False)
+
+# Reactivate tear stream, and unfix shell side initial conditions
+m.fs.heat_exchanger.shell_inlet.flow_mol.unfix()
+m.fs.heat_exchanger.shell_inlet.enth_mol[0].unfix()
+m.fs.heat_exchanger.shell_inlet.pressure[0].unfix()
+m.fs.s03_expanded.activate()
+
+results = solver.solve(m, tee=False)
+
+m.fs.report()