diff --git a/idaes_examples/notebooks/docs/flowsheets/methanol_flowsheet_w_recycle.py b/idaes_examples/notebooks/docs/flowsheets/methanol_flowsheet_w_recycle.py index 8d5cfd7c..fab2cca3 100644 --- a/idaes_examples/notebooks/docs/flowsheets/methanol_flowsheet_w_recycle.py +++ b/idaes_examples/notebooks/docs/flowsheets/methanol_flowsheet_w_recycle.py @@ -916,8 +916,26 @@ def main(m): print() print("Solving optimization problem...") + + # Pass 1: smoothed VLE transition + eps_nominal = value(m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq) + m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value( + eps_nominal * 2.5 + ) + m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value( + eps_nominal * 2.5 + ) + opt_res = solver.solve(m, tee=True) assert opt_res.solver.termination_condition == TerminationCondition.optimal + + # Pass 2: restore default smoothness + m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal) + m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal) + + opt_res = solver.solve(m, tee=True) + assert opt_res.solver.termination_condition == TerminationCondition.optimal + print("Optimal solution process results:") report(m) diff --git a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis.ipynb b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis.ipynb index 44462419..58af66d0 100644 --- a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis.ipynb +++ b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis.ipynb @@ -2,14 +2,16 @@ "cells": [ { "cell_type": "code", - "execution_count": null, "metadata": { "tags": [ "header", "hide-cell" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:04.629603300Z", + "start_time": "2026-02-20T21:01:04.619279Z" + } }, - "outputs": [], "source": [ "###############################################################################\n", "# The Institute for the Design of Advanced Energy Systems Integrated Platform\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", @@ -89,14 +93,31 @@ }, { "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:04.649464300Z", + "start_time": "2026-02-20T21:01:04.632133500Z" + } + }, "source": [ "from IPython.display import Image\n", "\n", "Image(\"methanol_flowsheet.png\")" - ] + ], + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA48AAACpCAYAAACLdAi5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAC0vSURBVHhe7d2/duI6tMDhnfsYt4YpsuYJ4AlImqnSTgdlaKZLmS4NKcNat5g2VZqBJwhPkJXiwLvkassSCMfGBvwX/76zfAaMbWRLVryRLF99GQIAAAAAwAH/4/4FAAAAACAVwSMAAAAAIBPBIwAAAAAgE8EjAAAAACATwSMAAAAA5LV5luHVlVxtp6E8b9xnR1vKJNzW8FlO3lQFCB4BAAAAdJoGbscZyGz9JfrgivVMZNo/JYDUwPFG5uOF3Y7d1t2rPC3dxw1E8AgAAACg844PICO9+wcZy0pe/5nocTmRq+FEJkNtRYz+HbqocvM83GtZ3Dw/ytysuXgZuTm6rXfRt3bZbYvkxISZRtDi6be5nPhlzDRxUWfCckUheAQAAACAk/XleiCy+lxHb1dzkYcv+Xp/kT93A1lNn2zwt/5cyeDuVnrRUva9DK7N2vtBoMaAGkRGrZELE17O5c3M2/x7lZVrpXy/N1sxgerN3ASffrn5jV3323IFIngEAAAA0FkasPluo/r6eGuJ4kANA9VA/MuoVVKDv6W8zQdyd7sL5vpRxGnWFhm9mO9fz8yajrZg2mDyxqwt8vHfRnq3dzIwAaIPMDf/fZhP5nKTsVyRCB4BAAAA4ERR99P9wHBnJL/GJsS70eDup/wIFrFBnpn7mNC1dPlmQkHbeqgtj07vXt5NgLuemb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AADor3vqor4tqddw8P4oJ92TxMopm9O7l3b9OM3oRv8j6cyUyuJa+eb3592pCwLH88quPfpl3Ih//ZTUp9uV6kGe5bASPAAAAAFC5lUz7rguqtk66uSZMlOdhNP9mPpDZ33vRJ0SGgWQkCgpX2ybFtO1FdsudjuARAAAAACpnAsO164K6npl3Xk/u3323VbEBoXZN7UeRouxCwLVE8aQPJ9O2VxyCRwAAAACd5ruu6lRUl1VlB6uRuTyGA9tk3qS40/vx073yr+fy5ldfvpl3A7m71XbJbLsg83QEjwAAAABQBr3H0Q1sE3Un/ZSHjHse7aM1XCB7dWPCw9k6ugdy9GIH0Jnf7D4bL97lPjN2jFoof/7IF2QecmUi6+JCawAAAABooaJbHRtDWzv7r3K3zhNoHkbLIwAAAIDOu9Q2NTtK6+BOcvZuPYiWRwAAAABAJloeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAABlE/h+1/fUys0mHlQAAAABJRU5ErkJggg==", + "text/plain": [ + "" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 2 }, { "cell_type": "markdown", @@ -115,9 +136,12 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:07.389407500Z", + "start_time": "2026-02-20T21:01:04.652988700Z" + } + }, "source": [ "import pytest\n", "import os\n", @@ -181,7 +205,9 @@ " add_costing,\n", " report,\n", ")" - ] + ], + "outputs": [], + "execution_count": 3 }, { "cell_type": "markdown", @@ -193,15 +219,20 @@ }, { "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:07.399593900Z", + "start_time": "2026-02-20T21:01:07.390910200Z" + } + }, "source": [ "# Set solver options\n", "solver = get_solver() # IPOPT\n", "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", "solver.options = optarg" - ] + ], + "outputs": [], + "execution_count": 4 }, { "cell_type": "markdown", @@ -218,11 +249,13 @@ }, { "cell_type": "code", - "execution_count": 4, "metadata": { - "scrolled": false + "scrolled": false, + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.234663Z", + "start_time": "2026-02-20T21:01:07.401096600Z" + } }, - "outputs": [], "source": [ "# Build and solve flowsheet\n", "m = ConcreteModel()\n", @@ -236,21 +269,327 @@ "print(\"Solving initial problem...\")\n", "\n", "results = solver.solve(m, tee=True) # initial square problem solve" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unit degrees of freedom\n", + "M101 0\n", + "C101 1\n", + "H101 1\n", + "R101 2\n", + "T101 2\n", + "H102 1\n", + "F101 2\n", + "Total DOF: 23\n", + "DOF after streams specified: 9\n", + "DOF after units specified: 0\n", + "\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.H2.properties: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.H2.properties: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.H2.properties: Property package initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.H2: Initialization Complete.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.CO.properties: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.CO.properties: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.CO.properties: Property package initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.CO: Initialization Complete.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.M101.H2_WGS_state: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.M101.H2_WGS_state: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:07 [INFO] idaes.init.fs.M101.CO_WGS_state: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.M101.CO_WGS_state: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.M101.mixed_state: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.M101.mixed_state: Property package initialization: optimal - Optimal Solution Found.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.C101.control_volume: Initialization Complete\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.C101: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H101.control_volume: Initialization Complete\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H101: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101.control_volume.reactions: Initialization Complete.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101.control_volume: Initialization Complete\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.R101: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.control_volume.properties_in: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.control_volume.properties_out: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property package initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.properties_isentropic: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.properties_isentropic: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101.properties_isentropic: Property package initialization: optimal - Optimal Solution Found.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.T101: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H102.control_volume.properties_in: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H102.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H102.control_volume.properties_out: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H102.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H102.control_volume: Initialization Complete\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.H102: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization: optimal - Optimal Solution Found.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization: optimal - Optimal Solution Found.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101.control_volume: Initialization Complete\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.F101: Initialization Complete: optimal - Optimal Solution Found\n", + "2026-02-20 14:01:08 [INFO] idaes.init.fs.EXHAUST.properties: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.EXHAUST.properties: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.EXHAUST.properties: Property package initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.EXHAUST: Initialization Complete.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH.properties: Starting initialization\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH.properties: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH.properties: Equilibrium temperature initialization completed.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH.properties: Phase equilibrium initialization: optimal - Optimal Solution Found.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH.properties: Property initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH.properties: Property package initialization: optimal - Optimal Solution Found.\n", + "2026-02-20 14:01:09 [INFO] idaes.init.fs.CH3OH: Initialization Complete.\n", + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 955\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 607\n", + "\n", + "Total number of variables............................: 310\n", + " variables with only lower bounds: 35\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 310\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 2.77e+00 -1.0 1.00e-02 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 1.21e+00 -1.0 1.00e-04 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 6.98e-10 1.00e+03 -1.0 9.90e-07 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Constraint violation....: 1.1368683772161603e-13 6.9849193096160889e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 1.1368683772161603e-13 6.9849193096160889e-10\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.005\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "execution_count": 5 }, { "cell_type": "code", - "execution_count": 5, "metadata": { "tags": [ "testing" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.241076500Z", + "start_time": "2026-02-20T21:01:09.235965Z" + } }, - "outputs": [], "source": [ "# check optimal termination\n", "assert results.solver.termination_condition == TerminationCondition.optimal" - ] + ], + "outputs": [], + "execution_count": 6 }, { "cell_type": "markdown", @@ -262,11 +601,13 @@ }, { "cell_type": "code", - "execution_count": 6, "metadata": { - "scrolled": false + "scrolled": false, + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.373826200Z", + "start_time": "2026-02-20T21:01:09.242152800Z" + } }, - "outputs": [], "source": [ "add_costing(m) # re-solve with costing equations\n", "print()\n", @@ -275,21 +616,193 @@ "\n", "print(\"Initial solution process results:\")\n", "report(m) # display initial solution results" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving with costing...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 971\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 611\n", + "\n", + "Total number of variables............................: 319\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 319\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 -2.8492051e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9068962e+07 5.76e+04 6.45e+01 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9074767e+07 5.71e+02 9.98e+00 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9074825e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9074825e+07 1.05e-09 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4948186430824137e+01 -2.9074824816033222e+07\n", + "Dual infeasibility......: 3.6708958239217049e-07 2.3745263485255724e-01\n", + "Constraint violation....: 4.5474735088646412e-12 1.0477378964424133e-09\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 2.3745263485255724e-01\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.005\n", + "Total CPU secs in NLP function evaluations = 0.001\n", + "\n", + "EXIT: Optimal Solution Found.\n", + "Initial solution process results:\n", + "\n", + "\n", + "Extent of reaction: 237.6004779\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.21917830318435\n", + "Duty from Reaction (MW)): 21.536107316856\n", + "Turbine work (MW): -0.9593346445867499\n", + "Mixer outlet temperature (C)): 20.051714213753257\n", + "Compressor outlet temperature (C)): 20.051714213753257\n", + "Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.8781524424324\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Methanol recovery(%): 60.004430129216836\n", + "annualized capital cost ($/year) = 219790.5044704343\n", + "operating cost ($/year) = 380701687.4964806\n", + "sales ($/year) = 64685201172.198135\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29074824.816033214\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.23\n", + " Total Mole Fraction CH4 dimensionless 2.8373e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.57\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" + ] + } + ], + "execution_count": 7 }, { "cell_type": "code", - "execution_count": 7, "metadata": { "tags": [ "testing" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.381154800Z", + "start_time": "2026-02-20T21:01:09.375269800Z" + } }, - "outputs": [], "source": [ "# check optimal termination\n", "assert results2.solver.termination_condition == TerminationCondition.optimal" - ] + ], + "outputs": [], + "execution_count": 8 }, { "cell_type": "markdown", @@ -300,11 +813,13 @@ }, { "cell_type": "code", - "execution_count": 8, "metadata": { - "scrolled": false + "scrolled": false, + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.500156800Z", + "start_time": "2026-02-20T21:01:09.382424800Z" + } }, - "outputs": [], "source": [ "# Set up Optimization Problem (Maximize Revenue)\n", "# keep process pre-reaction fixed and unfix some post-process specs\n", @@ -351,7 +866,205 @@ "\n", "print(\"Optimal solution process results:\")\n", "report(m)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 975\n", + "Number of nonzeros in inequality constraint Jacobian.: 8\n", + "Number of nonzeros in Lagrangian Hessian.............: 613\n", + "\n", + "Total number of variables............................: 322\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 259\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 318\n", + "Total number of inequality constraints...............: 8\n", + " inequality constraints with only lower bounds: 4\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 4\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8492012e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8402807e+07 2.72e+04 9.71e+01 -1.0 8.82e+06 - 4.99e-02 2.59e-02h 1\n", + " 2 -2.8406592e+07 2.70e+04 9.55e+01 -1.0 8.56e+06 - 7.51e-02 8.58e-03h 1\n", + " 3 -2.8493711e+07 2.29e+04 3.69e+02 -1.0 8.41e+06 - 1.67e-01 1.52e-01h 1\n", + " 4 -2.8493256e+07 2.28e+04 1.20e+04 -1.0 4.60e+06 - 1.00e-01 2.61e-03h 1\n", + " 5 -2.8504483e+07 2.24e+04 1.20e+04 -1.0 4.52e+06 - 2.44e-02 2.38e-02h 1\n", + " 6 -2.8536508e+07 2.16e+04 2.28e+04 -1.0 4.39e+06 - 5.48e-02 6.86e-02h 1\n", + " 7 -2.8537589e+07 2.16e+04 1.35e+05 -1.0 3.94e+06 - 2.56e-01 2.49e-03h 1\n", + " 8 -2.8537637e+07 2.15e+04 6.77e+06 -1.0 1.30e+06 - 4.68e-01 1.17e-04h 1\n", + " 9 -2.8910081e+07 8.51e+04 2.07e+06 -1.0 1.31e+06 - 4.38e-01 9.05e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -2.8916017e+07 7.81e+04 1.11e+08 -1.0 9.39e+04 -4.0 3.56e-03 8.26e-02h 1\n", + " 11 -2.8916050e+07 7.80e+04 1.11e+08 -1.0 8.73e+04 -4.5 9.12e-02 9.05e-04h 1\n", + " 12 -2.8951501e+07 1.29e+04 3.00e+07 -1.0 8.73e+04 - 1.37e-02 9.90e-01h 1\n", + " 13 -2.8964697e+07 3.52e+03 9.82e+06 -1.0 2.95e+04 - 8.80e-01 9.92e-01h 1\n", + " 14 -2.9150638e+07 4.25e+00 6.53e+07 -1.0 1.59e+04 - 9.88e-01 1.00e+00h 1\n", + " 15 -3.2694771e+07 3.47e+03 1.38e+08 -1.0 3.00e+05 - 3.58e-01 1.00e+00f 1\n", + " 16 -3.9657884e+07 3.74e+02 4.98e+06 -1.0 6.48e+05 - 9.11e-01 1.00e+00F 1\n", + " 17 -5.8700677e+07 2.03e+04 1.12e+06 -1.0 2.00e+06 - 2.65e-01 1.00e+00F 1\n", + " 18 -7.8085174e+07 1.40e+05 4.14e+05 -1.0 4.34e+06 - 7.55e-01 7.57e-01f 1\n", + " 19 -7.9333792e+07 1.60e+05 2.63e+05 -1.0 3.52e+06 - 9.63e-01 3.03e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -7.7164009e+07 3.20e+03 7.59e+03 -1.0 4.56e+05 - 9.91e-01 1.00e+00h 1\n", + " 21 -7.7545831e+07 3.83e+03 5.53e+01 -1.0 2.78e+05 - 1.00e+00 1.00e+00h 1\n", + " 22 -7.7683360e+07 9.76e+02 2.23e+06 -2.5 6.32e+04 - 1.00e+00 7.70e-01h 1\n", + " 23 -7.7696221e+07 8.35e+00 1.48e+02 -2.5 6.87e+04 - 1.00e+00 1.00e+00h 1\n", + " 24 -7.7696183e+07 8.31e-03 4.61e-03 -2.5 2.13e+03 - 1.00e+00 1.00e+00h 1\n", + " 25 -7.7699949e+07 5.36e+00 1.27e+04 -5.7 7.60e+04 - 9.49e-01 9.94e-01f 1\n", + " 26 -7.7700458e+07 8.84e+01 1.03e+03 -5.7 3.66e+05 - 9.25e-01 9.72e-01h 1\n", + " 27 -7.7700530e+07 1.74e+01 1.01e+01 -5.7 6.59e+04 - 1.00e+00 8.03e-01h 1\n", + " 28 -7.7700531e+07 2.07e-04 4.22e-06 -5.7 1.25e+03 - 1.00e+00 1.00e+00h 1\n", + " 29 -7.7700536e+07 9.48e-04 1.29e-01 -8.6 1.69e+03 - 1.00e+00 9.99e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 30 -7.7700536e+07 6.52e-09 5.32e-11 -8.6 1.52e+00 - 1.00e+00 1.00e+00f 1\n", + " 31 -7.7700536e+07 8.38e-09 6.97e-11 -10.9 2.16e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 31\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.2012103932708916e+02 -7.7700535938862860e+07\n", + "Dual infeasibility......: 6.9713197782916848e-11 4.5094122229452131e-05\n", + "Constraint violation....: 9.4587448984384537e-11 8.3819031715393066e-09\n", + "Complementarity.........: 1.4074777632989367e-11 9.1042982264387185e-06\n", + "Overall NLP error.......: 9.4587448984384537e-11 4.5094122229452131e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 34\n", + "Number of objective gradient evaluations = 32\n", + "Number of equality constraint evaluations = 34\n", + "Number of inequality constraint evaluations = 34\n", + "Number of equality constraint Jacobian evaluations = 32\n", + "Number of inequality constraint Jacobian evaluations = 32\n", + "Number of Lagrangian Hessian evaluations = 31\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.026\n", + "Total CPU secs in NLP function evaluations = 0.003\n", + "\n", + "EXIT: Optimal Solution Found.\n", + "Optimal solution process results:\n", + "\n", + "\n", + "Extent of reaction: 269.2805447879921\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.8500000099999546\n", + "Reactor duty (MW): -51.363573577545786\n", + "Duty from Reaction (MW)): 24.407588579583603\n", + "Turbine work (MW): -1.9904899177794815\n", + "Mixer outlet temperature (C)): 20.0517142137536\n", + "Compressor outlet temperature (C)): 20.0517142137536\n", + "Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 231.85000468716584\n", + "Turbine outlet temperature (C)): 139.85888172675686\n", + "Turbine outlet pressure (Pa)): 1427653.3547820917\n", + "Cooler outlet temperature (C)): 52.56999709299214\n", + "Flash outlet temperature (C)): 134.0\n", + "Methanol recovery(%): 92.8035547465754\n", + "annualized capital cost ($/year) = 235547.18924473316\n", + "operating cost ($/year) = 451663512.6847629\n", + "sales ($/year) = 113381889876.90082\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 77700535.93886285\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 165.54\n", + " Total Mole Fraction CH4 dimensionless 5.7630e-06\n", + " Total Mole Fraction CO dimensionless 0.28706\n", + " Total Mole Fraction H2 dimensionless 0.59587\n", + " Total Mole Fraction CH3OH dimensionless 0.11706\n", + " Molar Enthalpy joule / mole -52313.\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 249.90\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3792e+05\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n" + ] + } + ], + "execution_count": 9 }, { "cell_type": "markdown", @@ -362,13 +1075,15 @@ }, { "cell_type": "code", - "execution_count": 9, "metadata": { "tags": [ "testing" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.508319Z", + "start_time": "2026-02-20T21:01:09.501157500Z" + } }, - "outputs": [], "source": [ "# testing model results\n", "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", @@ -380,7 +1095,9 @@ "assert value(m.fs.T101.work_isentropic[0]) / 1e6 == pytest.approx(-1.9905, rel=1e-5)\n", "assert value(m.fs.F101.recovery * 100) == pytest.approx(92.8036, rel=1e-5)\n", "assert value(m.fs.objective) / 1e6 == pytest.approx(77.7005, rel=1e-5)" - ] + ], + "outputs": [], + "execution_count": 10 }, { "cell_type": "markdown", @@ -411,14 +1128,31 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.517374100Z", + "start_time": "2026-02-20T21:01:09.509320Z" + } + }, "source": [ "from IPython.display import Image\n", "\n", "Image(\"methanol_flowsheet_recycle.png\")" - ] + ], + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAABCsAAAEKCAYAAAA7A99lAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAETCSURBVHhe7d09cuJM2+jxy+8uzslOFUzgmhWIFYCTiZxOBqFJJpvQmRMIoeoNJnXkxLACswKXgxv2wumr1Q0NlkACSQjx/z2P7jFCHy21JKRL/XG3NgQAAAAAAKAm/sf9CwAAAAAAUAsEKwAAAAAAQK0QrAAAAAAAALVCsAIAAAAAANQKwQoAAAAAAFArBCsAAAAAAECtEKwAAAAAAOAGzAd3cnfXkfHKjagxghUAAAAAAOQUP/jvDp3OQOZ1DQSsxvI8Nf9Gj/LQikdZq7kMOnH6B3M3bmMl40Fnu41Ht89M75a1M+wsONsyCVYAAAAAAJDLSv77dH8GFoup9Nr1LLmwen+Vhfk3enwQH6tYjTty1+7JVL/4RgMPbRmGX9rtG8i3mEZm2ZdJsAIAAAAAgBP1Z2tZr82wnEk/0jELeX2vX7Ri+WVDFfK4KVaxkvdXk/7RTEZ9Nyo0f5GhjSn0ZbbUbVzKyG7fVN6ORivMPLpP/DDpxqNzLJNgBQAAAAAARXAFBn7+0IDAXAa2qkNYamB/nKs20Rlvq0b4KhPzgXR8VYnNEJTaWM3NvLvVKdJLdMzlTauAyE+xSbNa8vTxIZOnrvxwY0IrV3QkGv2Rrp2nJQ+PNrIgn/8dC8ZMpReky1fzyLNMghUAAAAAAJxo2nMP5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sAIAAAAAANQKwQoAAAAAAFArBCsAAAAAAECtEKwAAAAAAAA1IvL/AccPhEZ19gnJAAAAAElFTkSuQmCC", + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "execution_count": 11 }, { "cell_type": "markdown", @@ -431,9 +1165,12 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:09.534388600Z", + "start_time": "2026-02-20T21:01:09.517374100Z" + } + }, "source": [ "import pytest\n", "import os\n", @@ -500,7 +1237,9 @@ " add_costing,\n", " report,\n", ")" - ] + ], + "outputs": [], + "execution_count": 12 }, { "cell_type": "markdown", @@ -512,11 +1251,13 @@ }, { "cell_type": "code", - "execution_count": 12, "metadata": { - "scrolled": false + "scrolled": false, + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.393968500Z", + "start_time": "2026-02-20T21:01:09.535877100Z" + } }, - "outputs": [], "source": [ "# Build and solve flowsheet\n", "solver = get_solver() # IPOPT\n", @@ -535,21 +1276,380 @@ "print()\n", "print(\"Solving initial problem...\")\n", "results = solver.solve(m, tee=True)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unit degrees of freedom\n", + "M101 0\n", + "C101 1\n", + "H101 1\n", + "R101 2\n", + "T101 2\n", + "H102 1\n", + "F101 2\n", + "M102 0\n", + "S101 1\n", + "Total DOF: 24\n", + "DOF after streams specified: 10\n", + "DOF after units specified: 0\n", + "\n", + "Tear Stream:\n", + "fs.s02 : fs.M102.outlet to fs.C101.inlet\n", + "\n", + "Calculation order:\n", + "fs.H2\n", + "fs.M101\n", + "fs.R101\n", + "fs.T101\n", + "fs.H102\n", + "fs.F101\n", + "fs.S101\n", + "fs.EXHAUST\n", + "\n", + "Initial DOF = 0\n", + "Solving fs.H2\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.CO\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.C101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.M101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.H101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.R101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.T101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.H102\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.F101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.S101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.CH3OH\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.EXHAUST\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.M102\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.H2\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.CO\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.M101\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.EXHAUST\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Solving fs.CH3OH\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "DOF = 0\n", + "Final DOF = 0\n", + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1211\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 768\n", + "\n", + "Total number of variables............................: 397\n", + " variables with only lower bounds: 41\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 397\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 4.22e+03 -1.0 1.96e+03 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 3.86e+03 -1.0 2.03e+01 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 7.44e-06 1.01e+03 -1.0 2.01e-01 - 9.90e-01 1.00e+00h 1\n", + "Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 1.0099088928127792e+05 1.0099088928127792e+05\n", + "Constraint violation....: 2.4014227693119351e-10 7.4444105848670006e-06\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 2.4014227693119351e-10 1.0099088928127792e+05\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.004\n", + "Total CPU secs in NLP function evaluations = 0.002\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "execution_count": 13 }, { "cell_type": "code", - "execution_count": 13, "metadata": { "tags": [ "testing" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.403359500Z", + "start_time": "2026-02-20T21:01:12.393968500Z" + } }, - "outputs": [], "source": [ "# check optimal termination\n", "assert results.solver.termination_condition == TerminationCondition.optimal" - ] + ], + "outputs": [], + "execution_count": 14 }, { "cell_type": "markdown", @@ -561,11 +1661,13 @@ }, { "cell_type": "code", - "execution_count": 14, "metadata": { - "scrolled": false + "scrolled": false, + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.612557100Z", + "start_time": "2026-02-20T21:01:12.405029Z" + } }, - "outputs": [], "source": [ "add_costing(m) # re-solve with costing equations\n", "print()\n", @@ -573,21 +1675,195 @@ "\n", "print(\"Initial solution process results:\")\n", "report(m) # display initial solution results" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1227\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 772\n", + "\n", + "Total number of variables............................: 406\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 406\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 -2.8497869e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9074832e+07 5.76e+04 4.22e+03 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9080637e+07 5.71e+02 3.82e+03 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9080695e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9080695e+07 9.31e-10 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4953175283791907e+01 -2.9080695361147854e+07\n", + "Dual infeasibility......: 2.4946824403693549e-06 1.6138370562967401e+00\n", + "Constraint violation....: 4.5474735088646412e-12 9.3132257461547852e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 1.6138370562967401e+00\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.005\n", + "Total CPU secs in NLP function evaluations = 0.002\n", + "\n", + "EXIT: Optimal Solution Found.\n", + "Initial solution process results:\n", + "\n", + "\n", + "Extent of reaction: 237.6064180604515\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.22029794711382\n", + "Duty from Reaction (MW)): 21.536645732999325\n", + "Compressor work (MW): -2.5668711294294714e-15\n", + "Turbine work (MW): -0.959378502391431\n", + "Feed Mixer outlet temperature (C)): 20.051714213753144\n", + "Recycle Mixer outlet temperature (C)): 20.056485612776214\n", + "Feed Compressor outlet temperature (C)): 20.0564856127761\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.87840947667888\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 99.99 %\n", + "Methanol recovery(%): 60.005984934911716\n", + "annualized capital cost ($/year) = 219794.2325658716\n", + "operating cost ($/year) = 380711692.18369955\n", + "sales ($/year) = 64691081725.72807\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29080695.36114784\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.21\n", + " Total Mole Fraction CH4 dimensionless 2.8375e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.58\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" + ] + } + ], + "execution_count": 15 }, { "cell_type": "code", - "execution_count": 15, "metadata": { "tags": [ "testing" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.622485200Z", + "start_time": "2026-02-20T21:01:12.613467100Z" + } }, - "outputs": [], "source": [ "# check optimal termination\n", "assert results2.solver.termination_condition == TerminationCondition.optimal" - ] + ], + "outputs": [], + "execution_count": 16 }, { "cell_type": "markdown", @@ -598,11 +1874,13 @@ }, { "cell_type": "code", - "execution_count": 16, "metadata": { - "scrolled": false + "scrolled": false, + "ExecuteTime": { + "end_time": "2026-02-20T21:01:13.760944100Z", + "start_time": "2026-02-20T21:01:12.626378Z" + } }, - "outputs": [], "source": [ "# Set up Optimization Problem (Maximize Revenue)\n", "# keep process pre-reaction fixed and unfix some post-process specs\n", @@ -653,11 +1931,378 @@ "\n", "print()\n", "print(\"Solving optimization problem...\")\n", + "\n", + "# Pass 1: smoothed VLE transition\n", + "eps_nominal = value(m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq)\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "\n", "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "# Pass 2: restore default smoothness\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "\n", + "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", "\n", "print(\"Optimal solution process results:\")\n", "report(m)" - ] + ], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8497829e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8431127e+07 2.74e+04 9.77e+01 -1.0 8.82e+06 - 4.99e-02 1.94e-02h 1\n", + " 2 -2.8430719e+07 2.74e+04 7.81e+02 -1.0 8.52e+06 - 3.76e-02 1.99e-04h 1\n", + " 3 -2.8524903e+07 2.48e+04 1.61e+05 -1.0 6.46e+06 - 2.49e-04 9.25e-02f 1\n", + " 4 -2.8526723e+07 2.48e+04 1.61e+05 -1.0 5.76e+06 - 5.84e-02 9.84e-04h 1\n", + " 5 -2.8554206e+07 2.48e+04 1.60e+05 -1.0 1.49e+07 - 3.32e-03 8.96e-04h 1\n", + " 6 -2.9123967e+07 2.43e+04 1.52e+05 -1.0 1.49e+07 - 1.23e-01 1.84e-02f 1\n", + " 7 -2.9208690e+07 2.43e+04 1.51e+05 -1.0 9.71e+06 - 2.32e-02 2.78e-03h 1\n", + " 8 -3.0003175e+07 2.36e+04 1.08e+06 -1.0 9.31e+06 - 1.92e-01 2.61e-02h 1\n", + " 9 -3.1468200e+07 2.25e+04 1.09e+06 -1.0 8.71e+06 - 6.69e-02 4.91e-02f 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -3.1583903e+07 2.24e+04 1.14e+07 -1.0 5.51e+06 - 3.91e-01 3.89e-03h 1\n", + " 11 -4.3112078e+07 3.08e+04 5.71e+06 -1.0 5.49e+06 - 1.57e-01 3.86e-01f 1\n", + " 12 -4.3711661e+07 4.53e+04 5.09e+06 -1.0 3.67e+06 - 8.46e-02 2.88e-02h 1\n", + " 13 -4.3718221e+07 4.53e+04 1.94e+06 -1.0 3.57e+06 - 5.81e-01 3.23e-04h 1\n", + " 14 -4.3760623e+07 4.51e+04 4.16e+07 -1.0 3.56e+06 - 4.25e-01 5.93e-03h 1\n", + " 15 -4.4646398e+07 7.99e+04 5.37e+07 -1.0 3.54e+06 - 6.75e-01 1.23e-01h 4\n", + " 16 -6.6613749e+07 4.71e+04 6.18e+06 -1.0 3.14e+06 - 7.83e-01 9.90e-01H 1\n", + " 17 -6.5999969e+07 4.71e+04 3.10e+06 -1.0 2.01e+07 - 3.61e-03 3.25e-03h 5\n", + " 18 -6.5249518e+07 4.72e+04 3.12e+07 -1.0 1.74e+07 - 4.59e-05 4.34e-03h 5\n", + " 19 -6.4064695e+07 2.26e+03 9.68e+06 -1.0 8.00e+04 - 3.33e-04 9.87e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -6.4051103e+07 1.77e+03 8.53e+03 -1.0 2.66e+03 - 9.89e-01 1.00e+00h 1\n", + " 21 -6.5080976e+07 1.26e+03 4.14e+05 -1.0 1.04e+05 - 9.50e-01 9.92e-01f 1\n", + " 22 -7.5335243e+07 1.38e+05 3.86e+06 -1.0 1.20e+06 - 2.39e-01 1.00e+00f 1\n", + " 23 -7.4658996e+07 9.99e+04 2.12e+06 -1.0 1.07e+05 -4.0 9.90e-01 2.78e-01h 1\n", + " 24 -7.4649764e+07 9.94e+04 2.08e+06 -1.0 7.73e+04 -4.5 5.39e-01 5.23e-03h 1\n", + " 25 -7.4613845e+07 9.73e+04 2.01e+06 -1.0 7.23e+04 -5.0 1.00e+00 2.08e-02h 1\n", + " 26 -7.4421363e+07 8.62e+04 1.78e+06 -1.0 7.09e+04 -5.4 5.88e-01 1.14e-01h 1\n", + " 27 -7.4390154e+07 8.46e+04 1.75e+06 -1.0 7.84e+04 -5.9 1.21e-02 1.83e-02h 1\n", + " 28 -7.2740081e+07 3.01e+02 1.73e+06 -1.0 1.09e+05 -6.4 1.05e-04 1.00e+00h 1\n", + " 29 -7.2726278e+07 1.44e-01 6.68e+02 -1.0 5.95e+02 -6.9 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", + " 30 -7.2726419e+07 7.97e-05 2.12e+01 -1.7 1.63e+02 -7.3 1.00e+00 1.00e+00f 1\n", + " 31 -8.6665745e+07 8.89e+03 9.70e+05 -2.5 5.14e+06 - 2.89e-02 5.94e-01f 1\n", + " 32 -8.6649468e+07 8.59e+03 6.03e+05 -2.5 1.66e+04 -7.8 9.58e-01 3.35e-02h 1\n", + " 33 -8.6148813e+07 1.45e+01 6.46e+04 -2.5 2.26e+04 -8.3 8.44e-02 1.00e+00h 1\n", + " 34 -8.6163785e+07 4.53e-03 1.68e+00 -2.5 3.37e+03 -8.8 1.00e+00 1.00e+00h 1\n", + " 35 -8.6204319e+07 4.58e-02 7.40e-02 -2.5 1.03e+04 -9.2 1.00e+00 1.00e+00f 1\n", + " 36 -8.6333114e+07 3.92e-01 1.69e+02 -3.8 3.04e+04 -9.7 1.00e+00 1.00e+00f 1\n", + " 37 -8.6713987e+07 3.42e+00 4.46e-01 -3.8 9.15e+04 -10.2 1.00e+00 1.00e+00f 1\n", + " 38 -8.7245785e+07 7.78e+00 1.64e+00 -3.8 2.74e+05 -10.7 1.00e+00 4.68e-01f 1\n", + " 39 -9.0563354e+07 2.18e+02 6.58e+00 -3.8 8.00e+05 -11.2 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", + " 40 -9.9476688e+07 6.32e+02 4.50e+01 -3.8 2.39e+06 -11.6 1.00e+00 9.22e-01f 1\n", + " 41 -9.9478624e+07 6.32e+02 4.50e+01 -3.8 5.59e+06 -12.1 1.12e-01 8.94e-05h 1\n", + " 42 -1.0299591e+08 3.80e+04 1.01e+02 -3.8 7.08e+06 -12.6 4.04e-01 1.44e-01f 1\n", + " 43 -1.0299655e+08 3.80e+04 1.08e+02 -3.8 1.39e+06 - 6.91e-01 2.06e-04h 1\n", + " 44 -1.0436244e+08 3.39e+05 1.55e+01 -3.8 2.01e+06 - 1.00e+00 1.00e+00h 1\n", + " 45 -1.0441522e+08 3.19e+05 1.27e+02 -3.8 4.87e+06 - 9.54e-01 8.06e-02h 1\n", + " 46 -1.0438806e+08 2.70e+05 9.30e+01 -3.8 1.25e+07 - 2.30e-01 1.54e-01h 1\n", + " 47 -1.0435495e+08 2.01e+05 1.05e+01 -3.8 9.64e+05 - 8.19e-01 2.54e-01h 1\n", + " 48 -1.0426618e+08 2.01e+03 2.19e+01 -3.8 1.81e+06 - 1.20e-01 1.00e+00h 1\n", + " 49 -1.0426992e+08 2.91e+02 3.40e-01 -3.8 6.45e+04 -13.1 1.00e+00 9.64e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 50 -1.0427006e+08 2.52e+02 4.03e+02 -3.8 6.80e+06 - 5.54e-03 2.57e-01h 1\n", + " 51 -1.0427055e+08 2.92e+02 3.97e+02 -3.8 3.24e+06 - 1.33e-01 1.97e-02h 1\n", + " 52 -1.0427008e+08 1.05e+02 1.15e+05 -3.8 2.71e+04 - 7.76e-04 1.00e+00f 1\n", + " 53 -1.0427044e+08 9.41e+01 7.74e+04 -3.8 4.75e+04 -12.6 1.00e+00 3.26e-01h 2\n", + " 54 -1.0427081e+08 9.98e+01 6.24e+04 -3.8 8.03e+04 -13.1 1.00e+00 1.91e-01h 2\n", + " 55 -1.0427080e+08 8.21e-01 1.24e+00 -3.8 7.52e+04 - 1.00e+00 1.00e+00h 1\n", + " 56 -1.0427114e+08 2.09e+01 2.34e+02 -3.8 3.16e+04 -12.7 1.00e+00 4.65e-01h 2\n", + " 57 -1.0427107e+08 4.98e-01 5.37e+00 -3.8 1.61e+04 - 1.00e+00 1.00e+00h 1\n", + " 58 -1.0427121e+08 3.58e+00 1.04e+03 -3.8 1.22e+04 -12.3 1.00e+00 4.79e-01h 2\n", + " 59 -1.0427120e+08 8.56e-03 3.90e+00 -3.8 1.47e+03 - 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", + " 60 -1.0427265e+08 3.69e+02 2.06e+03 -3.8 6.13e+04 -12.7 1.00e+00 1.00e+00f 1\n", + " 61 -1.0427267e+08 8.82e-03 8.41e-01 -3.8 2.14e+04 - 1.00e+00 1.00e+00h 1\n", + " 62 -1.0427488e+08 8.81e+02 4.71e+03 -3.8 9.30e+04 -13.2 9.57e-01 1.00e+00h 1\n", + " 63 -1.0427489e+08 1.12e-02 8.43e+03 -3.8 2.41e+04 - 4.26e-01 1.00e+00h 1\n", + " 64 -1.0427588e+08 1.77e+02 2.25e+02 -3.8 4.16e+04 -12.8 1.00e+00 1.00e+00h 1\n", + " 65 -1.0427569e+08 7.17e+00 2.18e+02 -3.8 9.45e+03 - 8.56e-01 1.00e+00h 1\n", + " 66 -1.0427569e+08 3.81e-04 1.34e+03 -3.8 7.69e+02 - 3.56e-01 1.00e+00h 1\n", + " 67 -1.0427568e+08 5.99e-04 1.01e+02 -3.8 7.28e+01 - 6.32e-01 1.00e+00h 1\n", + " 68 -1.0427568e+08 5.44e-04 1.32e+02 -3.8 6.86e+01 - 5.69e-01 1.00e+00h 1\n", + " 69 -1.0427569e+08 3.30e-03 2.05e+01 -3.8 2.50e+02 - 6.00e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 70 -1.0427569e+08 1.33e-05 2.19e+01 -3.8 2.05e+02 - 5.83e-01 1.00e+00h 1\n", + " 71 -1.0427569e+08 1.09e-03 3.63e+00 -3.8 5.68e+02 - 5.94e-01 1.00e+00f 1\n", + " 72 -1.0427569e+08 6.75e-04 3.84e+00 -3.8 1.21e+03 - 5.81e-01 1.00e+00h 1\n", + " 73 -1.0427569e+08 6.52e-03 6.49e-01 -3.8 3.03e+03 - 5.80e-01 1.00e+00h 1\n", + " 74 -1.0427570e+08 3.77e-02 6.80e-01 -3.8 7.51e+03 - 5.69e-01 1.00e+00h 1\n", + " 75 -1.0427573e+08 2.57e-01 1.17e-01 -3.8 1.96e+04 - 5.45e-01 1.00e+00h 1\n", + " 76 -1.0427580e+08 2.17e+00 1.46e-01 -3.8 5.66e+04 - 4.91e-01 1.00e+00h 1\n", + " 77 -1.0427608e+08 3.10e+01 6.00e-02 -3.8 2.13e+05 - 3.77e-01 1.00e+00h 1\n", + " 78 -1.0427817e+08 1.76e+03 5.49e-01 -3.8 1.56e+06 - 1.85e-01 1.00e+00h 1\n", + " 79 -1.0427835e+08 1.67e+03 6.12e-01 -3.8 1.75e+06 - 9.50e-01 6.05e-02h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 80 -1.0427838e+08 3.76e-01 2.22e-04 -3.8 9.99e+04 - 1.00e+00 1.00e+00h 1\n", + " 81 -1.0427881e+08 2.24e+00 1.80e+02 -5.7 8.49e+04 - 9.88e-01 1.00e+00h 1\n", + " 82 -1.0427883e+08 9.31e-02 1.16e-03 -5.7 1.69e+04 - 1.00e+00 9.65e-01h 1\n", + " 83 -1.0427883e+08 1.60e-05 1.37e-08 -5.7 9.08e+02 - 1.00e+00 1.00e+00f 1\n", + " 84 -1.0427884e+08 5.70e-04 5.09e-06 -8.6 1.48e+03 - 1.00e+00 1.00e+00h 1\n", + " 85 -1.0427884e+08 5.59e-09 2.35e-13 -8.6 7.18e-01 - 1.00e+00 1.00e+00h 1\n", + " 86 -1.0427884e+08 2.79e-09 9.30e-12 -10.9 1.99e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 86\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.6119507851267775e+02 -1.0427883997848792e+08\n", + "Dual infeasibility......: 9.2995983076271742e-12 6.0160107413515216e-06\n", + "Constraint violation....: 1.0913936421275139e-10 2.7939677238464355e-09\n", + "Complementarity.........: 1.4067955341342552e-11 9.1007124870068398e-06\n", + "Overall NLP error.......: 1.0913936421275139e-10 9.1007124870068398e-06\n", + "\n", + "\n", + "Number of objective function evaluations = 118\n", + "Number of objective gradient evaluations = 87\n", + "Number of equality constraint evaluations = 118\n", + "Number of inequality constraint evaluations = 118\n", + "Number of equality constraint Jacobian evaluations = 87\n", + "Number of inequality constraint Jacobian evaluations = 87\n", + "Number of Lagrangian Hessian evaluations = 86\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.121\n", + "Total CPU secs in NLP function evaluations = 0.009\n", + "\n", + "EXIT: Optimal Solution Found.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n", + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -1.0301714e+08 2.98e+05 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -1.0365412e+08 1.32e+05 4.21e+01 -1.0 8.57e+04 - 8.59e-01 5.52e-01h 1\n", + " 2 -1.0410108e+08 5.26e+04 7.56e+03 -1.0 5.09e+04 - 9.61e-01 5.97e-01h 1\n", + " 3 -1.0413437e+08 2.06e+04 2.27e+02 -1.0 2.41e+04 - 9.37e-01 6.07e-01h 1\n", + " 4 -1.0424131e+08 1.93e+02 5.00e+03 -1.0 1.94e+05 - 9.87e-01 9.90e-01h 1\n", + " 5 -1.0420077e+08 9.43e+00 3.43e+03 -1.0 1.40e+05 - 9.11e-01 9.91e-01h 1\n", + " 6 -1.0416592e+08 2.19e+01 9.98e+05 -1.0 7.17e+05 - 7.26e-01 1.56e-02f 7\n", + " 7 -1.0366377e+08 9.17e+01 5.74e+05 -1.0 4.94e+05 - 5.51e-01 1.00e+00H 1\n", + " 8 -1.0363147e+08 9.84e+01 7.49e+06 -1.0 9.50e+05 - 9.90e-01 1.56e-02f 7\n", + " 9 -1.0252180e+08 7.86e+02 3.75e+04 -1.0 1.53e+06 - 7.68e-01 1.00e+00F 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -1.0190033e+08 6.00e+00 1.87e+03 -1.0 2.37e+05 - 1.00e+00 1.00e+00H 1\n", + " 11 -1.0201665e+08 1.13e+01 8.51e+01 -1.0 1.34e+05 - 1.00e+00 1.00e+00H 1\n", + " 12 -1.0416792e+08 1.89e+04 2.50e+06 -2.5 1.28e+06 - 3.10e-01 5.67e-01f 1\n", + " 13 -1.0432990e+08 7.37e+04 1.94e+05 -2.5 1.61e+06 - 8.21e-01 6.69e-01h 1\n", + " 14 -1.0425973e+08 1.27e+02 1.47e+03 -2.5 4.32e+04 - 1.00e+00 1.00e+00h 1\n", + " 15 -1.0426575e+08 1.07e+01 1.87e-01 -2.5 5.16e+04 - 1.00e+00 1.00e+00h 1\n", + " 16 -1.0427763e+08 2.48e+01 2.62e+01 -3.8 6.19e+04 - 1.00e+00 1.00e+00h 1\n", + " 17 -1.0427797e+08 9.99e+01 2.44e-03 -3.8 3.85e+05 - 1.00e+00 1.00e+00h 1\n", + " 18 -1.0427790e+08 1.94e+00 1.79e-05 -3.8 5.18e+04 - 1.00e+00 1.00e+00h 1\n", + " 19 -1.0427873e+08 8.25e+00 5.26e+02 -5.7 1.32e+05 - 9.65e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -1.0427883e+08 1.02e+00 6.20e-03 -5.7 6.34e+04 - 1.00e+00 9.13e-01h 1\n", + " 21 -1.0427883e+08 2.22e-03 7.11e-08 -5.7 2.00e+03 - 1.00e+00 1.00e+00f 1\n", + " 22 -1.0427884e+08 2.66e-03 1.10e-05 -8.6 3.26e+03 - 1.00e+00 1.00e+00h 1\n", + " 23 -1.0427884e+08 1.16e-08 1.82e-13 -8.6 4.36e+00 - 1.00e+00 1.00e+00h 1\n", + " 24 -1.0427884e+08 3.14e-09 2.03e-11 -11.2 4.33e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 24\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -7.4466968713582915e+01 -1.0427883997850099e+08\n", + "Dual infeasibility......: 2.0257749320973842e-11 2.8367672758258825e-05\n", + "Constraint violation....: 1.3824319466948509e-10 3.1432136893272400e-09\n", + "Complementarity.........: 6.5249453183277711e-12 9.1371213367821990e-06\n", + "Overall NLP error.......: 1.3824319466948509e-10 2.8367672758258825e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 52\n", + "Number of objective gradient evaluations = 25\n", + "Number of equality constraint evaluations = 52\n", + "Number of inequality constraint evaluations = 52\n", + "Number of equality constraint Jacobian evaluations = 25\n", + "Number of inequality constraint Jacobian evaluations = 25\n", + "Number of Lagrangian Hessian evaluations = 24\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.028\n", + "Total CPU secs in NLP function evaluations = 0.003\n", + "\n", + "EXIT: Optimal Solution Found.\n", + "Optimal solution process results:\n", + "\n", + "\n", + "Extent of reaction: 311.30698549500477\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.8500000099996615\n", + "Reactor duty (MW): -59.340221072991014\n", + "Duty from Reaction (MW)): 28.216865165267233\n", + "Compressor work (MW): 1.2861669211016399e-24\n", + "Turbine work (MW): -2.4913012083840025\n", + "Feed Mixer outlet temperature (C)): 20.05171421375354\n", + "Recycle Mixer outlet temperature (C)): 41.54321437801775\n", + "Feed Compressor outlet temperature (C)): 41.54321437801792\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 231.85000478422364\n", + "Turbine outlet temperature (C)): 141.50037862882152\n", + "Turbine outlet pressure (Pa)): 1487177.2483574792\n", + "Cooler outlet temperature (C)): 52.56999699077659\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 9.999999000026644 %\n", + "Methanol recovery(%): 92.05882105498138\n", + "annualized capital cost ($/year) = 259559.90821288762\n", + "operating cost ($/year) = 525130020.7095608\n", + "sales ($/year) = 140033684437.2827\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 104278839.97850098\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 22.743\n", + " Total Mole Fraction CH4 dimensionless 4.1946e-05\n", + " Total Mole Fraction CO dimensionless 0.24155\n", + " Total Mole Fraction H2 dimensionless 0.64134\n", + " Total Mole Fraction CH3OH dimensionless 0.11706\n", + " Molar Enthalpy joule / mole -47286.\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 308.65\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3792e+05\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n" + ] + } + ], + "execution_count": 17 }, { "cell_type": "markdown", @@ -668,17 +2313,17 @@ }, { "cell_type": "code", - "execution_count": 17, "metadata": { "tags": [ "testing" - ] + ], + "ExecuteTime": { + "end_time": "2026-02-20T21:01:13.770912800Z", + "start_time": "2026-02-20T21:01:13.761945900Z" + } }, - "outputs": [], "source": [ "# testing model results\n", - "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", - "\n", "assert value(m.fs.R101.rate_reaction_extent[0, \"R1\"]) == pytest.approx(\n", " 311.3070, rel=1e-5\n", ")\n", @@ -690,7 +2335,9 @@ " 10.0000, rel=1e-5\n", ")\n", "assert value(m.fs.objective) / 1e6 == pytest.approx(104.2789, rel=1e-5)" - ] + ], + "outputs": [], + "execution_count": 18 }, { "cell_type": "markdown", @@ -702,10 +2349,15 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:13.775587500Z", + "start_time": "2026-02-20T21:01:13.771970400Z" + } + }, + "source": [], "outputs": [], - "source": [] + "execution_count": 18 } ], "metadata": { diff --git a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_doc.ipynb b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_doc.ipynb index 6e83e8ed..26f653c2 100644 --- a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_doc.ipynb +++ b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_doc.ipynb @@ -4,6 +4,16 @@ "cell_type": "code", "execution_count": 1, "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:08.793234700Z", + "start_time": "2026-02-20T21:01:08.784498Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:12.243314Z", + "iopub.status.busy": "2026-02-20T21:02:12.242299Z", + "iopub.status.idle": "2026-02-20T21:02:12.246325Z", + "shell.execute_reply": "2026-02-20T21:02:12.246325Z" + }, "tags": [ "header", "hide-cell" @@ -90,7 +100,18 @@ { "cell_type": "code", "execution_count": 2, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:08.820779700Z", + "start_time": "2026-02-20T21:01:08.801334300Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:12.247834Z", + "iopub.status.busy": "2026-02-20T21:02:12.247834Z", + "iopub.status.idle": "2026-02-20T21:02:12.253383Z", + "shell.execute_reply": "2026-02-20T21:02:12.253383Z" + } + }, "outputs": [ { "data": { @@ -100,11 +121,7 @@ ] }, "execution_count": 2, - "metadata": { - "filenames": { - "image/png": "C:\\Users\\dkgun\\src\\dangunter\\examples\\idaes_examples\\notebooks\\_build\\jupyter_execute\\docs\\flowsheets\\methanol_synthesis_doc_4_0.png" - } - }, + "metadata": {}, "output_type": "execute_result" } ], @@ -132,7 +149,18 @@ { "cell_type": "code", "execution_count": 3, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:11.424944700Z", + "start_time": "2026-02-20T21:01:08.826325100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:12.283314Z", + "iopub.status.busy": "2026-02-20T21:02:12.282304Z", + "iopub.status.idle": "2026-02-20T21:02:14.904598Z", + "shell.execute_reply": "2026-02-20T21:02:14.904598Z" + } + }, "outputs": [], "source": [ "import pytest\n", @@ -210,7 +238,18 @@ { "cell_type": "code", "execution_count": 4, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:11.432823800Z", + "start_time": "2026-02-20T21:01:11.426117300Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:14.907115Z", + "iopub.status.busy": "2026-02-20T21:02:14.905612Z", + "iopub.status.idle": "2026-02-20T21:02:14.909354Z", + "shell.execute_reply": "2026-02-20T21:02:14.909354Z" + } + }, "outputs": [], "source": [ "# Set solver options\n", @@ -236,6 +275,16 @@ "cell_type": "code", "execution_count": 5, "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.052603900Z", + "start_time": "2026-02-20T21:01:11.433413300Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:14.910861Z", + "iopub.status.busy": "2026-02-20T21:02:14.910861Z", + "iopub.status.idle": "2026-02-20T21:02:16.329145Z", + "shell.execute_reply": "2026-02-20T21:02:16.329145Z" + }, "scrolled": false }, "outputs": [ @@ -255,558 +304,596 @@ "DOF after streams specified: 9\n", "DOF after units specified: 0\n", "\n", - "2023-11-02 10:29:50 [INFO] idaes.init.fs.H2.properties: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H2.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.H2.properties: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.H2.properties: Property package initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H2.properties: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.H2: Initialization Complete.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H2.properties: Property package initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.CO.properties: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H2: Initialization Complete.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.CO.properties: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.CO.properties: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.CO.properties: Property package initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.CO: Initialization Complete.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.CO.properties: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.H2_WGS_state: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.CO.properties: Property package initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.H2_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.CO: Initialization Complete.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.CO_WGS_state: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.H2_WGS_state: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.CO_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.mixed_state: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.H2_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101.mixed_state: Property package initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.CO_WGS_state: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - Optimal Solution Found\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.CO_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:50 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.C101.control_volume: Initialization Complete\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.C101: Initialization Complete: optimal - Optimal Solution Found\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.mixed_state: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101.mixed_state: Property package initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H101.control_volume: Initialization Complete\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H101: Initialization Complete: optimal - Optimal Solution Found\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101.control_volume.reactions: Initialization Complete.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101.control_volume: Initialization Complete\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.R101: Initialization Complete: optimal - Optimal Solution Found\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.C101.control_volume: Initialization Complete\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.control_volume.properties_in: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.control_volume.properties_out: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.C101: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property package initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.properties_isentropic: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.properties_isentropic: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101.properties_isentropic: Property package initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.T101: Initialization Complete: optimal - Optimal Solution Found\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H102.control_volume.properties_in: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H102.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H102.control_volume.properties_out: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H101.control_volume: Initialization Complete\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H102.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H102.control_volume: Initialization Complete\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.H102: Initialization Complete: optimal - Optimal Solution Found\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H101: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_in: Dew and bubble point initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_out: Dew and bubble point initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101.control_volume.reactions: Initialization Complete.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101.control_volume: Initialization Complete\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101.control_volume: Initialization Complete\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.F101: Initialization Complete: optimal - Optimal Solution Found\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:51 [INFO] idaes.init.fs.EXHAUST.properties: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.R101: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.EXHAUST.properties: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.control_volume.properties_in: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.EXHAUST.properties: Property package initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.EXHAUST: Initialization Complete.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH.properties: Starting initialization\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH.properties: Dew and bubble point initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.control_volume.properties_out: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH.properties: Equilibrium temperature initialization completed.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH.properties: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH.properties: Property initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH.properties: Property package initialization: optimal - Optimal Solution Found.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property package initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2023-11-02 10:29:52 [INFO] idaes.init.fs.CH3OH: Initialization Complete.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.properties_isentropic: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF before solve: 0\n", - "\n", - "Solving initial problem...\n", - "WARNING: model contains export suffix\n", - "'fs.CH3OH.properties[0.0].scaling_factor' that contains 7 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.EXHAUST.properties[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.split.scaling_factor' that\n", - "contains 24 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.properties_isentropic: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_out[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101.properties_isentropic: Property package initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_in[0.0].scaling_factor' that contains 13\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -814,17 +901,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -832,35 +917,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.properties_isentropic[0.0].scaling_factor' that contains 8 component\n", - "keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.T101: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H102.control_volume.properties_in: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_in[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -868,35 +947,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.T101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.reactions[0.0].scaling_factor' that contains 1\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H102.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H102.control_volume.properties_out: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -904,35 +977,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H102.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_out[0.0].scaling_factor' that contains 8\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H102.control_volume: Initialization Complete\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -940,262 +1007,142 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.CO_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.H102: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.H2_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.CO.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.H2.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH3OH.scaling_factor' that contains 11 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.H2.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CO.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH4.scaling_factor' that contains 8 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH3OH.scaling_factor' that contains 23 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.H2.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.CO.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH4.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Ipopt 3.13.2: tol=1e-06\n", - "max_iter=100\n" + "2026-02-20 14:02:15 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "\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 ma27.\n", - "\n", - "Number of nonzeros in equality constraint Jacobian...: 955\n", - "Number of nonzeros in inequality constraint Jacobian.: 0\n", - "Number of nonzeros in Lagrangian Hessian.............: 607\n", - "\n", - "Total number of variables............................: 310\n", - " variables with only lower bounds: 35\n", - " variables with lower and upper bounds: 255\n", - " variables with only upper bounds: 1\n", - "Total number of equality constraints.................: 310\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", - " 1 0.0000000e+00 2.79e+02 2.77e+00 -1.0 1.00e-02 - 9.90e-01 9.90e-01h 1\n", - " 2 0.0000000e+00 2.77e+00 1.21e+00 -1.0 1.00e-04 - 9.90e-01 9.90e-01h 1\n", - " 3 0.0000000e+00 3.68e-08 1.00e+03 -1.0 1.76e-06 - 9.90e-01 1.00e+00h 1\n", - "\n", - "Number of Iterations....: 3\n", - "\n", - " (scaled) (unscaled)\n", - "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Constraint violation....: 1.2293436154280945e-12 3.6787241697311401e-08\n", - "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Overall NLP error.......: 1.2293436154280945e-12 3.6787241697311401e-08\n", - "\n", - "\n", - "Number of objective function evaluations = 4\n", - "Number of objective gradient evaluations = 4\n", - "Number of equality constraint evaluations = 4\n", - "Number of inequality constraint evaluations = 0\n", - "Number of equality constraint Jacobian evaluations = 4\n", - "Number of inequality constraint Jacobian evaluations = 0\n", - "Number of Lagrangian Hessian evaluations = 3\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 0.003\n", - "Total CPU secs in NLP function evaluations = 0.000\n", - "\n", - "EXIT: Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] - } - ], - "source": [ - "# Build and solve flowsheet\n", - "m = ConcreteModel()\n", - "build_model(m) # build flowsheet by adding unit models and property packages\n", - "set_inputs(m) # unit and stream specifications\n", - "scale_flowsheet(m) # flowsheet and unit model level scaling\n", - "initialize_flowsheet(m) # rigorous initialization scheme\n", - "\n", - "print(\"DOF before solve: \", degrees_of_freedom(m))\n", - "print()\n", - "print(\"Solving initial problem...\")\n", - "\n", - "results = solver.solve(m, tee=True) # initial square problem solve" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.3 Flowsheet Costing and Optimization\n", - "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs. Additional, we calculate reactor operating costs as a function of conversion and assume constant rates for electricity, heating and cooling costs. Capital costs are annualized over 15 years, and revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, including a check on the reaction stoichiometry, relevant duty and state variable values, economic results, and stream tables for feed and product streams:" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "scrolled": false - }, - "outputs": [ + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "Solving with costing...\n", - "WARNING: model contains export suffix\n", - "'fs.CH3OH.properties[0.0].scaling_factor' that contains 7 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.EXHAUST.properties[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.split.scaling_factor' that\n", - "contains 24 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_out[0.0].scaling_factor' that contains 13\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -1203,26 +1150,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_in[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -1230,35 +1173,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.properties_isentropic[0.0].scaling_factor' that contains 8 component\n", - "keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.F101.control_volume: Initialization Complete\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_in[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -1266,35 +1203,29 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.T101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.reactions[0.0].scaling_factor' that contains 1\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.F101: Initialization Complete: optimal - Optimal Solution Found\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.EXHAUST.properties: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -1302,35 +1233,43 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.EXHAUST.properties: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_out[0.0].scaling_factor' that contains 8\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.EXHAUST.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:16 [INFO] idaes.init.fs.EXHAUST: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH.properties: Starting initialization\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -1338,117 +1277,101 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.CO_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH.properties: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.H2_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH.properties: Equilibrium temperature initialization completed.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.CO.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.H2.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH3OH.scaling_factor' that contains 11 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH.properties: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.H2.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CO.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH4.scaling_factor' that contains 8 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH.properties: Property initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH3OH.scaling_factor' that contains 23 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH.properties: Property package initialization: optimal - Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.H2.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "2026-02-20 14:02:16 [INFO] idaes.init.fs.CH3OH: Initialization Complete.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.CO.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH4.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { @@ -1456,7 +1379,13 @@ "output_type": "stream", "text": [ "Ipopt 3.13.2: tol=1e-06\n", - "max_iter=100\n", + "max_iter=100\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "\n", "\n", "******************************************************************************\n", @@ -1479,45 +1408,187 @@ "\n", "This is Ipopt version 3.13.2, running with linear solver ma27.\n", "\n", - "Number of nonzeros in equality constraint Jacobian...: 971\n", + "Number of nonzeros in equality constraint Jacobian...: 955\n", "Number of nonzeros in inequality constraint Jacobian.: 0\n", - "Number of nonzeros in Lagrangian Hessian.............: 611\n", + "Number of nonzeros in Lagrangian Hessian.............: 607\n", "\n", - "Total number of variables............................: 319\n", - " variables with only lower bounds: 43\n", - " variables with lower and upper bounds: 255\n", + "Total number of variables............................: 310\n", + " variables with only lower bounds: 35\n", + " variables with lower and upper bounds: 258\n", " variables with only upper bounds: 1\n", - "Total number of equality constraints.................: 319\n", + "Total number of equality constraints.................: 310\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 -2.8492051e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", - " 1 -2.9068962e+07 5.76e+04 6.45e+01 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", - " 2 -2.9074767e+07 5.71e+02 9.98e+00 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", - " 3 -2.9074825e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", - " 4 -2.9074825e+07 1.86e-09 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + " 0 0.0000000e+00 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 2.77e+00 -1.0 1.00e-02 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 1.21e+00 -1.0 1.00e-04 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 6.98e-10 1.00e+03 -1.0 9.90e-07 - 9.90e-01 1.00e+00h 1\n", "\n", - "Number of Iterations....: 4\n", + "Number of Iterations....: 3\n", "\n", " (scaled) (unscaled)\n", - "Objective...............: -4.4948186430824144e+01 -2.9074824816033211e+07\n", - "Dual infeasibility......: 8.3561161967102299e-07 5.4051705720246346e-01\n", - "Constraint violation....: 4.5474735088646412e-12 1.8626451492309570e-09\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Constraint violation....: 1.1368683772161603e-13 6.9849193096160889e-10\n", "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Overall NLP error.......: 4.5474735088646412e-12 5.4051705720246346e-01\n", + "Overall NLP error.......: 1.1368683772161603e-13 6.9849193096160889e-10\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 objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", "Number of inequality constraint evaluations = 0\n", - "Number of equality constraint Jacobian evaluations = 5\n", + "Number of equality constraint Jacobian evaluations = 4\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.004\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.003\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "source": [ + "# Build and solve flowsheet\n", + "m = ConcreteModel()\n", + "build_model(m) # build flowsheet by adding unit models and property packages\n", + "set_inputs(m) # unit and stream specifications\n", + "scale_flowsheet(m) # flowsheet and unit model level scaling\n", + "initialize_flowsheet(m) # rigorous initialization scheme\n", + "\n", + "print(\"DOF before solve: \", degrees_of_freedom(m))\n", + "print()\n", + "print(\"Solving initial problem...\")\n", + "\n", + "results = solver.solve(m, tee=True) # initial square problem solve" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3.3 Flowsheet Costing and Optimization\n", + "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs. Additional, we calculate reactor operating costs as a function of conversion and assume constant rates for electricity, heating and cooling costs. Capital costs are annualized over 15 years, and revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, including a check on the reaction stoichiometry, relevant duty and state variable values, economic results, and stream tables for feed and product streams:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.190744700Z", + "start_time": "2026-02-20T21:01:14.053656100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:16.331152Z", + "iopub.status.busy": "2026-02-20T21:02:16.331152Z", + "iopub.status.idle": "2026-02-20T21:02:16.452173Z", + "shell.execute_reply": "2026-02-20T21:02:16.452173Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Solving with costing...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 971\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 611\n", + "\n", + "Total number of variables............................: 319\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 319\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 -2.8492051e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9068962e+07 5.76e+04 6.45e+01 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9074767e+07 5.71e+02 9.98e+00 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9074825e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9074825e+07 1.05e-09 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4948186430824137e+01 -2.9074824816033222e+07\n", + "Dual infeasibility......: 3.6708958239217049e-07 2.3745263485255724e-01\n", + "Constraint violation....: 4.5474735088646412e-12 1.0477378964424133e-09\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 2.3745263485255724e-01\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.006\n", "Total CPU secs in NLP function evaluations = 0.000\n", "\n", "EXIT: Optimal Solution Found.\n" @@ -1530,7 +1601,7 @@ "Initial solution process results:\n", "\n", "\n", - "Extent of reaction: 237.60047790000002\n", + "Extent of reaction: 237.6004779\n", "Stoichiometry of each component normalized by the extent:\n", "CH4 : 0.0\n", "H2 : -2.0\n", @@ -1541,22 +1612,22 @@ "Reaction conversion: 0.75\n", "Reactor duty (MW): -45.21917830318435\n", "Duty from Reaction (MW)): 21.536107316856\n", - "Turbine work (MW): -0.9593346445867593\n", + "Turbine work (MW): -0.9593346445867499\n", "Mixer outlet temperature (C)): 20.051714213753257\n", - "Compressor outlet temperature (C)): 20.051714213753314\n", + "Compressor outlet temperature (C)): 20.051714213753257\n", "Compressor outlet pressure (Pa)): 5100000.0\n", "Heater outlet temperature (C)): 215.0\n", "Reactor outlet temperature (C)): 234.0\n", - "Turbine outlet temperature (C)): 192.87815244243234\n", + "Turbine outlet temperature (C)): 192.8781524424324\n", "Turbine outlet pressure (Pa)): 3100000.0\n", "Cooler outlet temperature (C)): 134.0\n", "Flash outlet temperature (C)): 134.0\n", - "Methanol recovery(%): 60.004430129216814\n", - "annualized capital cost ($/year) = 219790.50447043404\n", - "operating cost ($/year) = 380701687.4964808\n", - "sales ($/year) = 64685201172.19813\n", + "Methanol recovery(%): 60.004430129216836\n", + "annualized capital cost ($/year) = 219790.5044704343\n", + "operating cost ($/year) = 380701687.4964806\n", + "sales ($/year) = 64685201172.198135\n", "raw materials cost ($/year) = 35229454878.16397\n", - "revenue (1000$/year)= 29074824.816033203\n", + "revenue (1000$/year)= 29074824.816033214\n", "\n", "\n", "====================================================================================\n", @@ -1638,6 +1709,16 @@ "cell_type": "code", "execution_count": 7, "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.325574400Z", + "start_time": "2026-02-20T21:01:14.190744700Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:16.454455Z", + "iopub.status.busy": "2026-02-20T21:02:16.453435Z", + "iopub.status.idle": "2026-02-20T21:02:16.561300Z", + "shell.execute_reply": "2026-02-20T21:02:16.561300Z" + }, "scrolled": false }, "outputs": [ @@ -1647,89 +1728,7 @@ "text": [ "\n", "Solving optimization problem...\n", - "WARNING: model contains export suffix\n", - "'fs.CH3OH.properties[0.0].scaling_factor' that contains 7 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.EXHAUST.properties[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix 'fs.F101.split.scaling_factor' that\n", - "contains 24 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_out[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_in[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.properties_isentropic[0.0].scaling_factor' that contains 8 component\n", - "keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_in[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -1737,180 +1736,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.reactions[0.0].scaling_factor' that contains 1\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_out[0.0].scaling_factor' that contains 8\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.CO_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.H2_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix 'fs.CO.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix 'fs.H2.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH3OH.scaling_factor' that contains 11 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.H2.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CO.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH4.scaling_factor' that contains 8 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH3OH.scaling_factor' that contains 23 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.H2.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.CO.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH4.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { @@ -1947,7 +1774,7 @@ "\n", "Total number of variables............................: 322\n", " variables with only lower bounds: 43\n", - " variables with lower and upper bounds: 256\n", + " variables with lower and upper bounds: 259\n", " variables with only upper bounds: 1\n", "Total number of equality constraints.................: 318\n", "Total number of inequality constraints...............: 8\n", @@ -1957,63 +1784,60 @@ "\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", " 0 -2.8492012e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", - " 1 -2.8402805e+07 2.72e+04 9.71e+01 -1.0 8.82e+06 - 4.99e-02 2.59e-02h 1\n", - " 2 -2.8406590e+07 2.70e+04 9.56e+01 -1.0 8.57e+06 - 7.51e-02 8.58e-03h 1\n", - " 3 -2.8493710e+07 2.29e+04 3.69e+02 -1.0 8.41e+06 - 1.67e-01 1.52e-01h 1\n", + " 1 -2.8402807e+07 2.72e+04 9.71e+01 -1.0 8.82e+06 - 4.99e-02 2.59e-02h 1\n", + " 2 -2.8406592e+07 2.70e+04 9.55e+01 -1.0 8.56e+06 - 7.51e-02 8.58e-03h 1\n", + " 3 -2.8493711e+07 2.29e+04 3.69e+02 -1.0 8.41e+06 - 1.67e-01 1.52e-01h 1\n", " 4 -2.8493256e+07 2.28e+04 1.20e+04 -1.0 4.60e+06 - 1.00e-01 2.61e-03h 1\n", - " 5 -2.8504482e+07 2.24e+04 1.20e+04 -1.0 4.52e+06 - 2.44e-02 2.38e-02h 1\n", - " 6 -2.8536507e+07 2.16e+04 2.28e+04 -1.0 4.39e+06 - 5.48e-02 6.86e-02h 1\n", - " 7 -2.8537588e+07 2.16e+04 1.35e+05 -1.0 3.94e+06 - 2.56e-01 2.49e-03h 1\n", - " 8 -2.8537637e+07 2.15e+04 6.77e+06 -1.0 1.30e+06 - 4.69e-01 1.17e-04h 1\n", + " 5 -2.8504483e+07 2.24e+04 1.20e+04 -1.0 4.52e+06 - 2.44e-02 2.38e-02h 1\n", + " 6 -2.8536508e+07 2.16e+04 2.28e+04 -1.0 4.39e+06 - 5.48e-02 6.86e-02h 1\n", + " 7 -2.8537589e+07 2.16e+04 1.35e+05 -1.0 3.94e+06 - 2.56e-01 2.49e-03h 1\n", + " 8 -2.8537637e+07 2.15e+04 6.77e+06 -1.0 1.30e+06 - 4.68e-01 1.17e-04h 1\n", " 9 -2.8910081e+07 8.51e+04 2.07e+06 -1.0 1.31e+06 - 4.38e-01 9.05e-01h 1\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 10 -2.8914184e+07 7.59e+04 7.45e+06 -1.0 9.51e+04 - 9.00e-01 1.08e-01h 1\n", - " 11 -2.8947637e+07 1.17e+03 1.82e+05 -1.0 8.76e+04 - 9.09e-01 9.90e-01h 1\n", - " 12 -2.8897906e+07 2.27e+01 4.44e+06 -1.0 6.65e+03 - 9.89e-01 9.92e-01h 1\n", - " 13 -3.9607639e+07 3.82e+04 7.42e+07 -1.0 5.09e+06 - 8.24e-02 1.77e-01f 3\n", - " 14 -5.3973065e+07 7.32e+04 5.80e+07 -1.0 1.89e+06 - 6.48e-01 1.00e+00F 1\n", - " 15 -5.8002084e+07 1.39e+05 2.82e+06 -1.0 1.54e+06 - 6.75e-01 1.00e+00f 1\n", - " 16 -5.8861909e+07 1.30e+05 2.75e+06 -1.0 3.00e+06 - 2.44e-02 7.50e-02f 1\n", - " 17 -6.8252381e+07 1.25e+05 2.72e+06 -1.0 6.30e+07 - 8.98e-03 4.63e-02f 2\n", - " 18 -6.7691432e+07 5.47e+02 2.17e+06 -1.0 1.32e+04 -4.0 2.04e-01 1.00e+00h 1\n", - " 19 -6.7689998e+07 4.76e-01 2.15e+04 -1.0 1.89e+02 -4.5 9.90e-01 1.00e+00h 1\n", + " 10 -2.8916017e+07 7.81e+04 1.11e+08 -1.0 9.39e+04 -4.0 3.56e-03 8.26e-02h 1\n", + " 11 -2.8916050e+07 7.80e+04 1.11e+08 -1.0 8.73e+04 -4.5 9.12e-02 9.05e-04h 1\n", + " 12 -2.8951501e+07 1.29e+04 3.00e+07 -1.0 8.73e+04 - 1.37e-02 9.90e-01h 1\n", + " 13 -2.8964697e+07 3.52e+03 9.82e+06 -1.0 2.95e+04 - 8.80e-01 9.92e-01h 1\n", + " 14 -2.9150638e+07 4.25e+00 6.53e+07 -1.0 1.59e+04 - 9.88e-01 1.00e+00h 1\n", + " 15 -3.2694771e+07 3.47e+03 1.38e+08 -1.0 3.00e+05 - 3.58e-01 1.00e+00f 1\n", + " 16 -3.9657884e+07 3.74e+02 4.98e+06 -1.0 6.48e+05 - 9.11e-01 1.00e+00F 1\n", + " 17 -5.8700677e+07 2.03e+04 1.12e+06 -1.0 2.00e+06 - 2.65e-01 1.00e+00F 1\n", + " 18 -7.8085174e+07 1.40e+05 4.14e+05 -1.0 4.34e+06 - 7.55e-01 7.57e-01f 1\n", + " 19 -7.9333792e+07 1.60e+05 2.63e+05 -1.0 3.52e+06 - 9.63e-01 3.03e-01h 1\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 20 -6.7690000e+07 1.68e-08 2.33e+01 -1.0 2.45e-01 -5.0 9.99e-01 1.00e+00h 1\n", - " 21 -7.7035618e+07 3.05e+04 5.41e+04 -3.8 4.62e+08 - 6.81e-03 6.33e-03f 1\n", - " 22 -7.7132115e+07 3.01e+04 6.44e+06 -3.8 3.55e+06 - 6.66e-01 1.74e-02h 1\n", - " 23 -7.7647090e+07 3.09e+04 8.42e+06 -3.8 3.42e+06 - 8.94e-01 1.00e-01h 1\n", - " 24 -7.7699683e+07 8.17e+01 3.90e+03 -3.8 2.07e+04 - 9.89e-01 1.00e+00h 1\n", - " 25 -7.7699749e+07 7.87e+01 3.80e+03 -3.8 5.54e+07 - 2.54e-02 8.20e-04h 2\n", - " 26 -7.7699755e+07 3.08e+00 3.03e-01 -3.8 2.79e+05 - 1.00e+00 1.00e+00H 1\n", - " 27 -7.7700174e+07 1.09e+02 5.94e-03 -3.8 3.03e+05 - 1.00e+00 1.00e+00h 1\n", - " 28 -7.7700167e+07 3.00e-02 4.25e-06 -3.8 1.14e+04 - 1.00e+00 1.00e+00h 1\n", - " 29 -7.7700500e+07 3.89e+00 3.43e+02 -5.7 9.59e+04 - 9.77e-01 1.00e+00h 1\n", + " 20 -7.7164009e+07 3.20e+03 7.59e+03 -1.0 4.56e+05 - 9.91e-01 1.00e+00h 1\n", + " 21 -7.7545831e+07 3.83e+03 5.53e+01 -1.0 2.78e+05 - 1.00e+00 1.00e+00h 1\n", + " 22 -7.7683360e+07 9.76e+02 2.23e+06 -2.5 6.32e+04 - 1.00e+00 7.70e-01h 1\n", + " 23 -7.7696221e+07 8.35e+00 1.48e+02 -2.5 6.87e+04 - 1.00e+00 1.00e+00h 1\n", + " 24 -7.7696183e+07 8.31e-03 4.61e-03 -2.5 2.13e+03 - 1.00e+00 1.00e+00h 1\n", + " 25 -7.7699949e+07 5.36e+00 1.27e+04 -5.7 7.60e+04 - 9.49e-01 9.94e-01f 1\n", + " 26 -7.7700458e+07 8.84e+01 1.03e+03 -5.7 3.66e+05 - 9.25e-01 9.72e-01h 1\n", + " 27 -7.7700530e+07 1.74e+01 1.01e+01 -5.7 6.59e+04 - 1.00e+00 8.03e-01h 1\n", + " 28 -7.7700531e+07 2.07e-04 4.22e-06 -5.7 1.25e+03 - 1.00e+00 1.00e+00h 1\n", + " 29 -7.7700536e+07 9.48e-04 1.29e-01 -8.6 1.69e+03 - 1.00e+00 9.99e-01h 1\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 30 -7.7700531e+07 4.15e-01 1.39e-03 -5.7 2.29e+04 - 1.00e+00 9.07e-01h 1\n", - " 31 -7.7700531e+07 4.98e-04 3.89e-08 -5.7 9.80e+02 - 1.00e+00 1.00e+00f 1\n", - " 32 -7.7700536e+07 9.48e-04 2.13e-01 -8.6 1.62e+03 - 1.00e+00 9.99e-01h 1\n", - " 33 -7.7700536e+07 5.01e-09 1.08e-10 -8.6 1.88e+00 - 1.00e+00 1.00e+00f 1\n", - " 34 -7.7700536e+07 8.38e-09 6.97e-11 -10.9 2.16e+00 - 1.00e+00 1.00e+00h 1\n", + " 30 -7.7700536e+07 6.52e-09 5.32e-11 -8.6 1.52e+00 - 1.00e+00 1.00e+00f 1\n", + " 31 -7.7700536e+07 8.38e-09 6.97e-11 -10.9 2.16e+00 - 1.00e+00 1.00e+00h 1\n", "\n", - "Number of Iterations....: 34\n", + "Number of Iterations....: 31\n", "\n", " (scaled) (unscaled)\n", - "Objective...............: -1.2012103932708919e+02 -7.7700535938862875e+07\n", - "Dual infeasibility......: 6.9703904435575171e-11 4.5088110809028537e-05\n", - "Constraint violation....: 8.7311491370201111e-11 8.3819031715393066e-09\n", - "Complementarity.........: 1.4074777602064815e-11 9.1042982064351105e-06\n", - "Overall NLP error.......: 8.7311491370201111e-11 4.5088110809028537e-05\n", - "\n", - "\n", - "Number of objective function evaluations = 47\n", - "Number of objective gradient evaluations = 35\n", - "Number of equality constraint evaluations = 47\n", - "Number of inequality constraint evaluations = 47\n", - "Number of equality constraint Jacobian evaluations = 35\n", - "Number of inequality constraint Jacobian evaluations = 35\n", - "Number of Lagrangian Hessian evaluations = 34\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 0.022\n", - "Total CPU secs in NLP function evaluations = 0.000\n", + "Objective...............: -1.2012103932708916e+02 -7.7700535938862860e+07\n", + "Dual infeasibility......: 6.9713197782916848e-11 4.5094122229452131e-05\n", + "Constraint violation....: 9.4587448984384537e-11 8.3819031715393066e-09\n", + "Complementarity.........: 1.4074777632989367e-11 9.1042982264387185e-06\n", + "Overall NLP error.......: 9.4587448984384537e-11 4.5094122229452131e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 34\n", + "Number of objective gradient evaluations = 32\n", + "Number of equality constraint evaluations = 34\n", + "Number of inequality constraint evaluations = 34\n", + "Number of equality constraint Jacobian evaluations = 32\n", + "Number of inequality constraint Jacobian evaluations = 32\n", + "Number of Lagrangian Hessian evaluations = 31\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.021\n", + "Total CPU secs in NLP function evaluations = 0.006\n", "\n", "EXIT: Optimal Solution Found.\n" ] @@ -2022,12 +1846,19 @@ "name": "stdout", "output_type": "stream", "text": [ - "Optimal solution process results:\n", + "Optimal solution process results:" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", "\n", "\n", - "Extent of reaction: 269.280544787992\n", + "Extent of reaction: 269.2805447879921\n", "Stoichiometry of each component normalized by the extent:\n", - "CH4 : -0.0\n", + "CH4 : 0.0\n", "H2 : -2.0\n", "CH3OH : 1.0\n", "CO : -1.0\n", @@ -2035,23 +1866,23 @@ "\n", "Reaction conversion: 0.8500000099999546\n", "Reactor duty (MW): -51.363573577545786\n", - "Duty from Reaction (MW)): 24.407588579583596\n", - "Turbine work (MW): -1.9904899177794766\n", + "Duty from Reaction (MW)): 24.407588579583603\n", + "Turbine work (MW): -1.9904899177794815\n", "Mixer outlet temperature (C)): 20.0517142137536\n", - "Compressor outlet temperature (C)): 20.051714213753428\n", + "Compressor outlet temperature (C)): 20.0517142137536\n", "Compressor outlet pressure (Pa)): 5100000.0\n", "Heater outlet temperature (C)): 215.0\n", "Reactor outlet temperature (C)): 231.85000468716584\n", - "Turbine outlet temperature (C)): 139.85888172675635\n", - "Turbine outlet pressure (Pa)): 1427653.3547820912\n", + "Turbine outlet temperature (C)): 139.85888172675686\n", + "Turbine outlet pressure (Pa)): 1427653.3547820917\n", "Cooler outlet temperature (C)): 52.56999709299214\n", "Flash outlet temperature (C)): 134.0\n", - "Methanol recovery(%): 92.80355474657543\n", - "annualized capital cost ($/year) = 235547.18924473223\n", - "operating cost ($/year) = 451663512.6847628\n", - "sales ($/year) = 113381889876.90083\n", + "Methanol recovery(%): 92.8035547465754\n", + "annualized capital cost ($/year) = 235547.18924473316\n", + "operating cost ($/year) = 451663512.6847629\n", + "sales ($/year) = 113381889876.90082\n", "raw materials cost ($/year) = 35229454878.16397\n", - "revenue (1000$/year)= 77700535.93886286\n", + "revenue (1000$/year)= 77700535.93886285\n", "\n", "\n", "====================================================================================\n", @@ -2066,7 +1897,13 @@ " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", " Molar Enthalpy joule / mole -142.40\n", " Pressure pascal 3.0000e+06\n", - "====================================================================================\n", + "====================================================================================\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "\n", "====================================================================================\n", "Unit : fs.CO Time: 0.0\n", @@ -2197,7 +2034,18 @@ { "cell_type": "code", "execution_count": 8, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.336449800Z", + "start_time": "2026-02-20T21:01:14.325574400Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:16.563343Z", + "iopub.status.busy": "2026-02-20T21:02:16.562311Z", + "iopub.status.idle": "2026-02-20T21:02:16.566882Z", + "shell.execute_reply": "2026-02-20T21:02:16.566882Z" + } + }, "outputs": [ { "data": { @@ -2207,11 +2055,7 @@ ] }, "execution_count": 8, - "metadata": { - "filenames": { - "image/png": "C:\\Users\\dkgun\\src\\dangunter\\examples\\idaes_examples\\notebooks\\_build\\jupyter_execute\\docs\\flowsheets\\methanol_synthesis_doc_18_0.png" - } - }, + "metadata": {}, "output_type": "execute_result" } ], @@ -2233,7 +2077,18 @@ { "cell_type": "code", "execution_count": 9, - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.352741300Z", + "start_time": "2026-02-20T21:01:14.336982200Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:16.567927Z", + "iopub.status.busy": "2026-02-20T21:02:16.567927Z", + "iopub.status.idle": "2026-02-20T21:02:16.574038Z", + "shell.execute_reply": "2026-02-20T21:02:16.574038Z" + } + }, "outputs": [], "source": [ "import pytest\n", @@ -2315,6 +2170,16 @@ "cell_type": "code", "execution_count": 10, "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:17.493149400Z", + "start_time": "2026-02-20T21:01:14.352741300Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:16.575088Z", + "iopub.status.busy": "2026-02-20T21:02:16.575088Z", + "iopub.status.idle": "2026-02-20T21:02:19.340983Z", + "shell.execute_reply": "2026-02-20T21:02:19.340473Z" + }, "scrolled": false }, "outputs": [ @@ -2331,16 +2196,16 @@ "H102 1\n", "F101 2\n", "M102 0\n", - "S101 1\n" + "S101 1\n", + "Total DOF: 24\n", + "DOF after streams specified: 10\n", + "DOF after units specified: 0\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Total DOF: 24\n", - "DOF after streams specified: 10\n", - "DOF after units specified: 0\n", "\n", "Tear Stream:\n", "fs.s02 : fs.M102.outlet to fs.C101.inlet\n", @@ -2356,9 +2221,53 @@ "fs.EXHAUST\n", "\n", "Initial DOF = 0\n", - "Solving fs.H2\n", + "Solving fs.H2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "DOF = 0\n", - "Solving fs.CO\n", + "Solving fs.CO\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "DOF = 0\n", "Solving fs.C101\n" ] @@ -2367,72 +2276,127 @@ "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.M101\n", - "DOF = 0\n", - "Solving fs.H101\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.M101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.R101\n", - "DOF = 0\n", - "Solving fs.T101\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.H102\n", - "DOF = 0\n", - "Solving fs.F101\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.S101\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.CH3OH\n", - "DOF = 0\n", - "Solving fs.EXHAUST\n", - "DOF = 0\n", - "Solving fs.M102\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.H2\n", - "DOF = 0\n", - "Solving fs.CO\n", - "DOF = 0\n", - "Solving fs.M101\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "DOF = 0\n", - "Solving fs.EXHAUST\n", - "DOF = 0\n", - "Solving fs.CH3OH\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { @@ -2440,75 +2404,70 @@ "output_type": "stream", "text": [ "DOF = 0\n", - "Final DOF = 0\n", - "DOF before solve: 0\n", - "\n", - "Solving initial problem...\n", - "WARNING: model contains export suffix\n", - "'fs.CH3OH.properties[0.0].scaling_factor' that contains 7 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "Solving fs.H101\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.EXHAUST.properties[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.recycle_state[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.purge_state[0.0].scaling_factor' that contains 4 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.mixed_state[0.0].scaling_factor' that contains 4 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.split.scaling_factor' that\n", - "contains 24 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_out[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.R101\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_in[0.0].scaling_factor' that contains 13\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2516,17 +2475,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2534,8 +2491,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2543,26 +2507,30 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.properties_isentropic[0.0].scaling_factor' that contains 8 component\n", - "keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.T101\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_in[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2570,17 +2538,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.T101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.reactions[0.0].scaling_factor' that contains 1\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2588,17 +2554,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2606,17 +2570,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2624,17 +2586,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_out[0.0].scaling_factor' that contains 8\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2642,321 +2602,196 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M102.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M102.recycle_state[0.0].scaling_factor' that contains 6 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "DOF = " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.M102.feed_state[0.0].scaling_factor'\n", - "that contains 6 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + " " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "0\n", + "Solving fs.H102\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.CO_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.H2_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.CO.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.H2.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH3OH.scaling_factor' that contains 11 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.H2.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CO.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "DOF = " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH4.scaling_factor' that contains 8 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + " 0\n", + "Solving fs.F101\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH3OH.scaling_factor' that contains 23 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.H2.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.CO.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH4.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Ipopt 3.13.2: tol=1e-06\n", - "max_iter=100\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 ma27.\n", - "\n", - "Number of nonzeros in equality constraint Jacobian...: 1211\n", - "Number of nonzeros in inequality constraint Jacobian.: 0\n", - "Number of nonzeros in Lagrangian Hessian.............: 768\n", - "\n", - "Total number of variables............................: 397\n", - " variables with only lower bounds: 41\n", - " variables with lower and upper bounds: 333\n", - " variables with only upper bounds: 1\n", - "Total number of equality constraints.................: 397\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", - " 1 0.0000000e+00 2.79e+02 4.22e+03 -1.0 1.96e+03 - 9.90e-01 9.90e-01h 1\n", - " 2 0.0000000e+00 2.77e+00 3.86e+03 -1.0 2.03e+01 - 9.90e-01 9.90e-01h 1\n", - " 3 0.0000000e+00 7.44e-06 1.01e+03 -1.0 2.01e-01 - 9.90e-01 1.00e+00h 1\n", - "Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator\n", - "\n", - "Number of Iterations....: 3\n", - "\n", - " (scaled) (unscaled)\n", - "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Dual infeasibility......: 1.0099088928127794e+05 1.0099088928127794e+05\n", - "Constraint violation....: 2.4013852159823137e-10 7.4442941695451736e-06\n", - "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Overall NLP error.......: 2.4013852159823137e-10 1.0099088928127794e+05\n", - "\n", - "\n", - "Number of objective function evaluations = 4\n", - "Number of objective gradient evaluations = 4\n", - "Number of equality constraint evaluations = 4\n", - "Number of inequality constraint evaluations = 0\n", - "Number of equality constraint Jacobian evaluations = 4\n", - "Number of inequality constraint Jacobian evaluations = 0\n", - "Number of Lagrangian Hessian evaluations = 3\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 0.003\n", - "Total CPU secs in NLP function evaluations = 0.002\n", - "\n", - "EXIT: Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] - } - ], - "source": [ - "# Build and solve flowsheet\n", - "solver = get_solver() # IPOPT\n", - "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", - "solver.options = optarg\n", - "\n", - "m = ConcreteModel() # create a new model so we may reference 'm' below\n", - "build_model(m) # build flowsheet\n", - "set_inputs(m) # unit and stream specifications\n", - "scale_flowsheet(m) # flowsheet and unit model level scaling\n", - "\n", - "# let the solver determine the tear stream\n", - "initialize_flowsheet(m) # rigorous initialization scheme\n", - "\n", - "print(\"DOF before solve: \", degrees_of_freedom(m))\n", - "print()\n", - "print(\"Solving initial problem...\")\n", - "results = solver.solve(m, tee=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 5.3 Flowsheet Costing and Optimization\n", - "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs, reactor operating costs and utility costs for heating, cooling and electricity. As before, revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, which are updated for new results with the presence of a recycle stream:" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "scrolled": false - }, - "outputs": [ + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.CH3OH.properties[0.0].scaling_factor' that contains 7 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.EXHAUST.properties[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.recycle_state[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.purge_state[0.0].scaling_factor' that contains 4 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.mixed_state[0.0].scaling_factor' that contains 4 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.split.scaling_factor' that\n", - "contains 24 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_out[0.0].scaling_factor' that contains 13\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -2964,35 +2799,30 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_in[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "DOF = " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + " 0\n", + "Solving fs.S101\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3000,17 +2830,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.properties_isentropic[0.0].scaling_factor' that contains 8 component\n", - "keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3018,8 +2846,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_in[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3027,17 +2862,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.T101.control_volume.scaling_factor'\n", - "that contains 1 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.reactions[0.0].scaling_factor' that contains 1\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3045,26 +2878,23 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "DOF = 0\n", + "Solving fs.CH3OH\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3072,17 +2902,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_out[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3090,416 +2918,211 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M102.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M102.recycle_state[0.0].scaling_factor' that contains 6 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.M102.feed_state[0.0].scaling_factor'\n", - "that contains 6 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "DOF = " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + " 0\n", + "Solving fs.EXHAUST\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.CO_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.H2_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.CO.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "DOF = 0\n", + "Solving fs.M102\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.H2.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH3OH.scaling_factor' that contains 11 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.H2.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CO.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH4.scaling_factor' that contains 8 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH3OH.scaling_factor' that contains 23 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.H2.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.CO.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH4.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "DOF = 0\n", + "Solving fs.H2\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Ipopt 3.13.2: tol=1e-06\n", - "max_iter=100\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "\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 ma27.\n", - "\n", - "Number of nonzeros in equality constraint Jacobian...: 1227\n", - "Number of nonzeros in inequality constraint Jacobian.: 0\n", - "Number of nonzeros in Lagrangian Hessian.............: 772\n", - "\n", - "Total number of variables............................: 406\n", - " variables with only lower bounds: 49\n", - " variables with lower and upper bounds: 333\n", - " variables with only upper bounds: 1\n", - "Total number of equality constraints.................: 406\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 -2.8497869e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", - " 1 -2.9074832e+07 5.76e+04 4.22e+03 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", - " 2 -2.9080637e+07 5.71e+02 3.82e+03 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", - " 3 -2.9080695e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", - " 4 -2.9080695e+07 6.98e-10 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", - "Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator\n", - "\n", - "Number of Iterations....: 4\n", - "\n", - " (scaled) (unscaled)\n", - "Objective...............: -4.4953175283791907e+01 -2.9080695361147862e+07\n", - "Dual infeasibility......: 9.9999999999985807e+06 6.4691081725719443e+12\n", - "Constraint violation....: 4.5474735088646412e-12 6.9849193096160889e-10\n", - "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", - "Overall NLP error.......: 4.5474735088646412e-12 6.4691081725719443e+12\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.005\n", - "Total CPU secs in NLP function evaluations = 0.000\n", - "\n", - "EXIT: Optimal Solution Found.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Initial solution process results:\n", - "\n", - "\n", - "Extent of reaction: 237.60641806045152\n", - "Stoichiometry of each component normalized by the extent:\n", - "CH4 : 0.0\n", - "H2 : -2.0\n", - "CH3OH : 1.0\n", - "CO : -1.0\n", - "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", - "\n", - "Reaction conversion: 0.75\n", - "Reactor duty (MW): -45.22029794711383\n", - "Duty from Reaction (MW)): 21.536645732999325\n", - "Compressor work (MW): 4.9022090500807066e-15\n", - "Turbine work (MW): -0.95937850239144\n", - "Feed Mixer outlet temperature (C)): 20.051714213753144\n", - "Recycle Mixer outlet temperature (C)): 20.056485612776044\n", - "Feed Compressor outlet temperature (C)): 20.056485612776157\n", - "Feed Compressor outlet pressure (Pa)): 5100000.0\n", - "Heater outlet temperature (C)): 215.0\n", - "Reactor outlet temperature (C)): 234.0\n", - "Turbine outlet temperature (C)): 192.87840947667905\n", - "Turbine outlet pressure (Pa)): 3100000.0\n", - "Cooler outlet temperature (C)): 134.0\n", - "Flash outlet temperature (C)): 134.0\n", - "Purge percentage (amount of vapor vented to exhaust): 99.99 %\n", - "Methanol recovery(%): 60.00598493491174\n", - "annualized capital cost ($/year) = 219794.2325658716\n", - "operating cost ($/year) = 380711692.18370014\n", - "sales ($/year) = 64691081725.72809\n", - "raw materials cost ($/year) = 35229454878.16397\n", - "revenue (1000$/year)= 29080695.36114785\n", - "\n", - "\n", - "====================================================================================\n", - "Unit : fs.H2 Time: 0.0\n", - "------------------------------------------------------------------------------------\n", - " Stream Table\n", - " Units Outlet \n", - " Total Molar Flowrate mole / second 637.20\n", - " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", - " Total Mole Fraction CO dimensionless 1.0000e-06\n", - " Total Mole Fraction H2 dimensionless 1.0000\n", - " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", - " Molar Enthalpy joule / mole -142.40\n", - " Pressure pascal 3.0000e+06\n", - "====================================================================================\n", - "\n", - "====================================================================================\n", - "Unit : fs.CO Time: 0.0\n", - "------------------------------------------------------------------------------------\n", - " Stream Table\n", - " Units Outlet \n", - " Total Molar Flowrate mole / second 316.80\n", - " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", - " Total Mole Fraction CO dimensionless 1.0000\n", - " Total Mole Fraction H2 dimensionless 1.0000e-06\n", - " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", - " Molar Enthalpy joule / mole -1.1068e+05\n", - " Pressure pascal 3.0000e+06\n", - "====================================================================================\n", - "\n", - "====================================================================================\n", - "Unit : fs.EXHAUST Time: 0.0\n", - "------------------------------------------------------------------------------------\n", - " Stream Table\n", - " Units Inlet \n", - " Total Molar Flowrate mole / second 336.21\n", - " Total Mole Fraction CH4 dimensionless 2.8375e-06\n", - " Total Mole Fraction CO dimensionless 0.23555\n", - " Total Mole Fraction H2 dimensionless 0.48181\n", - " Total Mole Fraction CH3OH dimensionless 0.28263\n", - " Molar Enthalpy joule / mole -80218.\n", - " Pressure pascal 3.1000e+06\n", - "====================================================================================\n", - "\n", - "====================================================================================\n", - "Unit : fs.CH3OH Time: 0.0\n", - "------------------------------------------------------------------------------------\n", - " Stream Table\n", - " Units Inlet \n", - " Total Molar Flowrate mole / second 142.58\n", - " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", - " Total Mole Fraction CO dimensionless 1.0000e-08\n", - " Total Mole Fraction H2 dimensionless 1.0000e-08\n", - " Total Mole Fraction CH3OH dimensionless 1.0000\n", - " Molar Enthalpy joule / mole -2.3813e+05\n", - " Pressure pascal 3.1000e+06\n", - "====================================================================================\n" + "DOF = " ] - } - ], - "source": [ - "add_costing(m) # re-solve with costing equations\n", - "print()\n", - "results2 = solver.solve(m, tee=True)\n", - "\n", - "print(\"Initial solution process results:\")\n", - "report(m) # display initial solution results" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions, including a purge between 10-50% of flash vapor. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "scrolled": false - }, - "outputs": [ + }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "Solving optimization problem...\n", - "WARNING: model contains export suffix\n", - "'fs.CH3OH.properties[0.0].scaling_factor' that contains 7 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + " " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.EXHAUST.properties[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "0\n", + "Solving fs.CO\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.recycle_state[0.0].scaling_factor' that contains 4 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.purge_state[0.0].scaling_factor' that contains 4 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.S101.mixed_state[0.0].scaling_factor' that contains 4 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "DOF = " ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.F101.split.scaling_factor' that\n", - "contains 24 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + " 0\n", + "Solving fs.M101\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_out[0.0].scaling_factor' that contains 13\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3507,17 +3130,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.F101.control_volume.properties_in[0.0].scaling_factor' that contains 13\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3525,8 +3146,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H102.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3534,17 +3162,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.properties_isentropic[0.0].scaling_factor' that contains 8 component\n", - "keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3552,26 +3178,23 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.T101.control_volume.properties_in[0.0].scaling_factor' that contains 8\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.reactions[0.0].scaling_factor' that contains 1\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "DOF = 0\n", + "Solving fs.EXHAUST\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3579,26 +3202,30 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.R101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_out[0.0].scaling_factor' that contains 7\n", - "component keys that are not exported as part of the NL file. Skipping.\n" + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.CH3OH\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.H101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3606,8 +3233,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_out[0.0].scaling_factor' that contains 8\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3615,8 +3249,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.C101.control_volume.properties_in[0.0].scaling_factor' that contains 7\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", "component keys that are not exported as part of the NL file. Skipping.\n" ] }, @@ -3624,158 +3265,607 @@ "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M102.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Final DOF = 0\n", + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M102.recycle_state[0.0].scaling_factor' that contains 6 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.M102.feed_state[0.0].scaling_factor'\n", - "that contains 6 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.mixed_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1211\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 768\n", + "\n", + "Total number of variables............................: 397\n", + " variables with only lower bounds: 41\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 397\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 4.22e+03 -1.0 1.96e+03 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 3.86e+03 -1.0 2.03e+01 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 7.44e-06 1.01e+03 -1.0 2.01e-01 - 9.90e-01 1.00e+00h 1\n", + "Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 1.0099088928127792e+05 1.0099088928127792e+05\n", + "Constraint violation....: 2.4014227693119351e-10 7.4444105848670006e-06\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 2.4014227693119351e-10 1.0099088928127792e+05\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.005\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" ] + } + ], + "source": [ + "# Build and solve flowsheet\n", + "solver = get_solver() # IPOPT\n", + "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", + "solver.options = optarg\n", + "\n", + "m = ConcreteModel() # create a new model so we may reference 'm' below\n", + "build_model(m) # build flowsheet\n", + "set_inputs(m) # unit and stream specifications\n", + "scale_flowsheet(m) # flowsheet and unit model level scaling\n", + "\n", + "# let the solver determine the tear stream\n", + "initialize_flowsheet(m) # rigorous initialization scheme\n", + "\n", + "print(\"DOF before solve: \", degrees_of_freedom(m))\n", + "print()\n", + "print(\"Solving initial problem...\")\n", + "results = solver.solve(m, tee=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5.3 Flowsheet Costing and Optimization\n", + "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs, reactor operating costs and utility costs for heating, cooling and electricity. As before, revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, which are updated for new results with the presence of a recycle stream:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:17.672850500Z", + "start_time": "2026-02-20T21:01:17.493149400Z" }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.CO_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" - ] + "execution": { + "iopub.execute_input": "2026-02-20T21:02:19.342021Z", + "iopub.status.busy": "2026-02-20T21:02:19.342021Z", + "iopub.status.idle": "2026-02-20T21:02:19.476954Z", + "shell.execute_reply": "2026-02-20T21:02:19.476954Z" }, + "scrolled": false + }, + "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.M101.H2_WGS_state[0.0].scaling_factor' that contains 6 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.CO.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.H2.properties[0.0].scaling_factor'\n", - "that contains 15 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1227\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 772\n", + "\n", + "Total number of variables............................: 406\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 406\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 -2.8497869e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9074832e+07 5.76e+04 4.22e+03 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9080637e+07 5.71e+02 3.82e+03 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9080695e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9080695e+07 9.31e-10 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4953175283791907e+01 -2.9080695361147854e+07\n", + "Dual infeasibility......: 2.4946824403693549e-06 1.6138370562967401e+00\n", + "Constraint violation....: 4.5474735088646412e-12 9.3132257461547852e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 1.6138370562967401e+00\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.006\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH3OH.scaling_factor' that contains 11 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "Initial solution process results:\n", + "\n", + "\n", + "Extent of reaction: 237.6064180604515\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.22029794711382\n", + "Duty from Reaction (MW)): 21.536645732999325\n", + "Compressor work (MW): -2.5668711294294714e-15\n", + "Turbine work (MW): -0.959378502391431\n", + "Feed Mixer outlet temperature (C)): 20.051714213753144\n", + "Recycle Mixer outlet temperature (C)): 20.056485612776214\n", + "Feed Compressor outlet temperature (C)): 20.0564856127761\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.87840947667888\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 99.99 %\n", + "Methanol recovery(%): 60.005984934911716\n", + "annualized capital cost ($/year) = 219794.2325658716\n", + "operating cost ($/year) = 380711692.18369955\n", + "sales ($/year) = 64691081725.72807\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29080695.36114784\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.21\n", + " Total Mole Fraction CH4 dimensionless 2.8375e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.58\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" ] + } + ], + "source": [ + "add_costing(m) # re-solve with costing equations\n", + "print()\n", + "results2 = solver.solve(m, tee=True)\n", + "\n", + "print(\"Initial solution process results:\")\n", + "report(m) # display initial solution results" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions, including a purge between 10-50% of flash vapor. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:18.109467400Z", + "start_time": "2026-02-20T21:01:17.672850500Z" }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:19.478988Z", + "iopub.status.busy": "2026-02-20T21:02:19.478988Z", + "iopub.status.idle": "2026-02-20T21:02:19.773886Z", + "shell.execute_reply": "2026-02-20T21:02:19.773886Z" + }, + "scrolled": false + }, + "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.H2.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CO.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_vapor.CH4.scaling_factor' that contains 8 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH3OH.scaling_factor' that contains 23 component keys\n", - "that are not exported as part of the NL file. Skipping.\n" + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8497829e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8431127e+07 2.74e+04 9.77e+01 -1.0 8.82e+06 - 4.99e-02 1.94e-02h 1\n", + " 2 -2.8430719e+07 2.74e+04 7.81e+02 -1.0 8.52e+06 - 3.76e-02 1.99e-04h 1\n", + " 3 -2.8524903e+07 2.48e+04 1.61e+05 -1.0 6.46e+06 - 2.49e-04 9.25e-02f 1\n", + " 4 -2.8526723e+07 2.48e+04 1.61e+05 -1.0 5.76e+06 - 5.84e-02 9.84e-04h 1\n", + " 5 -2.8554206e+07 2.48e+04 1.60e+05 -1.0 1.49e+07 - 3.32e-03 8.96e-04h 1\n", + " 6 -2.9123967e+07 2.43e+04 1.52e+05 -1.0 1.49e+07 - 1.23e-01 1.84e-02f 1\n", + " 7 -2.9208690e+07 2.43e+04 1.51e+05 -1.0 9.71e+06 - 2.32e-02 2.78e-03h 1\n", + " 8 -3.0003175e+07 2.36e+04 1.08e+06 -1.0 9.31e+06 - 1.92e-01 2.61e-02h 1\n", + " 9 -3.1468200e+07 2.25e+04 1.09e+06 -1.0 8.71e+06 - 6.69e-02 4.91e-02f 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -3.1583903e+07 2.24e+04 1.14e+07 -1.0 5.51e+06 - 3.91e-01 3.89e-03h 1\n", + " 11 -4.3112078e+07 3.08e+04 5.71e+06 -1.0 5.49e+06 - 1.57e-01 3.86e-01f 1\n", + " 12 -4.3711661e+07 4.53e+04 5.09e+06 -1.0 3.67e+06 - 8.46e-02 2.88e-02h 1\n", + " 13 -4.3718221e+07 4.53e+04 1.94e+06 -1.0 3.57e+06 - 5.81e-01 3.23e-04h 1\n", + " 14 -4.3760623e+07 4.51e+04 4.16e+07 -1.0 3.56e+06 - 4.25e-01 5.93e-03h 1\n", + " 15 -4.4646398e+07 7.99e+04 5.37e+07 -1.0 3.54e+06 - 6.75e-01 1.23e-01h 4\n", + " 16 -6.6613749e+07 4.71e+04 6.18e+06 -1.0 3.14e+06 - 7.83e-01 9.90e-01H 1\n", + " 17 -6.5999969e+07 4.71e+04 3.10e+06 -1.0 2.01e+07 - 3.61e-03 3.25e-03h 5\n", + " 18 -6.5249518e+07 4.72e+04 3.12e+07 -1.0 1.74e+07 - 4.59e-05 4.34e-03h 5\n", + " 19 -6.4064695e+07 2.26e+03 9.68e+06 -1.0 8.00e+04 - 3.33e-04 9.87e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -6.4051103e+07 1.77e+03 8.53e+03 -1.0 2.66e+03 - 9.89e-01 1.00e+00h 1\n", + " 21 -6.5080976e+07 1.26e+03 4.14e+05 -1.0 1.04e+05 - 9.50e-01 9.92e-01f 1\n", + " 22 -7.5335243e+07 1.38e+05 3.86e+06 -1.0 1.20e+06 - 2.39e-01 1.00e+00f 1\n", + " 23 -7.4658996e+07 9.99e+04 2.12e+06 -1.0 1.07e+05 -4.0 9.90e-01 2.78e-01h 1\n", + " 24 -7.4649764e+07 9.94e+04 2.08e+06 -1.0 7.73e+04 -4.5 5.39e-01 5.23e-03h 1\n", + " 25 -7.4613845e+07 9.73e+04 2.01e+06 -1.0 7.23e+04 -5.0 1.00e+00 2.08e-02h 1\n", + " 26 -7.4421363e+07 8.62e+04 1.78e+06 -1.0 7.09e+04 -5.4 5.88e-01 1.14e-01h 1\n", + " 27 -7.4390154e+07 8.46e+04 1.75e+06 -1.0 7.84e+04 -5.9 1.21e-02 1.83e-02h 1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.H2.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + " 28 -7.2740081e+07 3.01e+02 1.73e+06 -1.0 1.09e+05 -6.4 1.05e-04 1.00e+00h 1\n", + " 29 -7.2726278e+07 1.44e-01 6.68e+02 -1.0 5.95e+02 -6.9 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", + " 30 -7.2726419e+07 7.97e-05 2.12e+01 -1.7 1.63e+02 -7.3 1.00e+00 1.00e+00f 1\n", + " 31 -8.6665745e+07 8.89e+03 9.70e+05 -2.5 5.14e+06 - 2.89e-02 5.94e-01f 1\n", + " 32 -8.6649468e+07 8.59e+03 6.03e+05 -2.5 1.66e+04 -7.8 9.58e-01 3.35e-02h 1\n", + " 33 -8.6148813e+07 1.45e+01 6.46e+04 -2.5 2.26e+04 -8.3 8.44e-02 1.00e+00h 1\n", + " 34 -8.6163785e+07 4.53e-03 1.68e+00 -2.5 3.37e+03 -8.8 1.00e+00 1.00e+00h 1\n", + " 35 -8.6204319e+07 4.58e-02 7.40e-02 -2.5 1.03e+04 -9.2 1.00e+00 1.00e+00f 1\n", + " 36 -8.6333114e+07 3.92e-01 1.69e+02 -3.8 3.04e+04 -9.7 1.00e+00 1.00e+00f 1\n", + " 37 -8.6713987e+07 3.42e+00 4.46e-01 -3.8 9.15e+04 -10.2 1.00e+00 1.00e+00f 1\n", + " 38 -8.7245785e+07 7.78e+00 1.64e+00 -3.8 2.74e+05 -10.7 1.00e+00 4.68e-01f 1\n", + " 39 -9.0563354e+07 2.18e+02 6.58e+00 -3.8 8.00e+05 -11.2 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", + " 40 -9.9476688e+07 6.32e+02 4.50e+01 -3.8 2.39e+06 -11.6 1.00e+00 9.22e-01f 1\n", + " 41 -9.9478624e+07 6.32e+02 4.50e+01 -3.8 5.59e+06 -12.1 1.12e-01 8.94e-05h 1\n", + " 42 -1.0299591e+08 3.80e+04 1.01e+02 -3.8 7.08e+06 -12.6 4.04e-01 1.44e-01f 1\n", + " 43 -1.0299655e+08 3.80e+04 1.08e+02 -3.8 1.39e+06 - 6.91e-01 2.06e-04h 1\n", + " 44 -1.0436244e+08 3.39e+05 1.55e+01 -3.8 2.01e+06 - 1.00e+00 1.00e+00h 1\n", + " 45 -1.0441522e+08 3.19e+05 1.27e+02 -3.8 4.87e+06 - 9.54e-01 8.06e-02h 1\n", + " 46 -1.0438806e+08 2.70e+05 9.30e+01 -3.8 1.25e+07 - 2.30e-01 1.54e-01h 1\n", + " 47 -1.0435495e+08 2.01e+05 1.05e+01 -3.8 9.64e+05 - 8.19e-01 2.54e-01h 1\n", + " 48 -1.0426618e+08 2.01e+03 2.19e+01 -3.8 1.81e+06 - 1.20e-01 1.00e+00h 1\n", + " 49 -1.0426992e+08 2.91e+02 3.40e-01 -3.8 6.45e+04 -13.1 1.00e+00 9.64e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 50 -1.0427006e+08 2.52e+02 4.03e+02 -3.8 6.80e+06 - 5.54e-03 2.57e-01h 1\n", + " 51 -1.0427055e+08 2.92e+02 3.97e+02 -3.8 3.24e+06 - 1.33e-01 1.97e-02h 1\n", + " 52 -1.0427008e+08 1.05e+02 1.15e+05 -3.8 2.71e+04 - 7.76e-04 1.00e+00f 1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix 'fs.thermo_params_VLE.CO.scaling_factor'\n", - "that contains 8 component keys that are not exported as part of the NL file.\n", - "Skipping.\n" + " 53 -1.0427044e+08 9.41e+01 7.74e+04 -3.8 4.75e+04 -12.6 1.00e+00 3.26e-01h 2\n", + " 54 -1.0427081e+08 9.98e+01 6.24e+04 -3.8 8.03e+04 -13.1 1.00e+00 1.91e-01h 2\n", + " 55 -1.0427080e+08 8.21e-01 1.24e+00 -3.8 7.52e+04 - 1.00e+00 1.00e+00h 1\n", + " 56 -1.0427114e+08 2.09e+01 2.34e+02 -3.8 3.16e+04 -12.7 1.00e+00 4.65e-01h 2\n", + " 57 -1.0427107e+08 4.98e-01 5.37e+00 -3.8 1.61e+04 - 1.00e+00 1.00e+00h 1\n", + " 58 -1.0427121e+08 3.58e+00 1.04e+03 -3.8 1.22e+04 -12.3 1.00e+00 4.79e-01h 2\n", + " 59 -1.0427120e+08 8.56e-03 3.90e+00 -3.8 1.47e+03 - 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", + " 60 -1.0427265e+08 3.69e+02 2.06e+03 -3.8 6.13e+04 -12.7 1.00e+00 1.00e+00f 1\n", + " 61 -1.0427267e+08 8.82e-03 8.41e-01 -3.8 2.14e+04 - 1.00e+00 1.00e+00h 1\n", + " 62 -1.0427488e+08 8.81e+02 4.71e+03 -3.8 9.30e+04 -13.2 9.57e-01 1.00e+00h 1\n", + " 63 -1.0427489e+08 1.12e-02 8.43e+03 -3.8 2.41e+04 - 4.26e-01 1.00e+00h 1\n", + " 64 -1.0427588e+08 1.77e+02 2.25e+02 -3.8 4.16e+04 -12.8 1.00e+00 1.00e+00h 1\n", + " 65 -1.0427569e+08 7.17e+00 2.18e+02 -3.8 9.45e+03 - 8.56e-01 1.00e+00h 1\n", + " 66 -1.0427569e+08 3.81e-04 1.34e+03 -3.8 7.69e+02 - 3.56e-01 1.00e+00h 1\n", + " 67 -1.0427568e+08 5.99e-04 1.01e+02 -3.8 7.28e+01 - 6.32e-01 1.00e+00h 1\n", + " 68 -1.0427568e+08 5.44e-04 1.32e+02 -3.8 6.86e+01 - 5.69e-01 1.00e+00h 1\n", + " 69 -1.0427569e+08 3.30e-03 2.05e+01 -3.8 2.50e+02 - 6.00e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 70 -1.0427569e+08 1.33e-05 2.19e+01 -3.8 2.05e+02 - 5.83e-01 1.00e+00h 1\n", + " 71 -1.0427569e+08 1.09e-03 3.63e+00 -3.8 5.68e+02 - 5.94e-01 1.00e+00f 1\n", + " 72 -1.0427569e+08 6.75e-04 3.84e+00 -3.8 1.21e+03 - 5.81e-01 1.00e+00h 1\n", + " 73 -1.0427569e+08 6.52e-03 6.49e-01 -3.8 3.03e+03 - 5.80e-01 1.00e+00h 1\n", + " 74 -1.0427570e+08 3.77e-02 6.80e-01 -3.8 7.51e+03 - 5.69e-01 1.00e+00h 1\n", + " 75 -1.0427573e+08 2.57e-01 1.17e-01 -3.8 1.96e+04 - 5.45e-01 1.00e+00h 1\n", + " 76 -1.0427580e+08 2.17e+00 1.46e-01 -3.8 5.66e+04 - 4.91e-01 1.00e+00h 1\n", + " 77 -1.0427608e+08 3.10e+01 6.00e-02 -3.8 2.13e+05 - 3.77e-01 1.00e+00h 1\n", + " 78 -1.0427817e+08 1.76e+03 5.49e-01 -3.8 1.56e+06 - 1.85e-01 1.00e+00h 1\n", + " 79 -1.0427835e+08 1.67e+03 6.12e-01 -3.8 1.75e+06 - 9.50e-01 6.05e-02h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 80 -1.0427838e+08 3.76e-01 2.22e-04 -3.8 9.99e+04 - 1.00e+00 1.00e+00h 1\n", + " 81 -1.0427881e+08 2.24e+00 1.80e+02 -5.7 8.49e+04 - 9.88e-01 1.00e+00h 1\n", + " 82 -1.0427883e+08 9.31e-02 1.16e-03 -5.7 1.69e+04 - 1.00e+00 9.65e-01h 1\n", + " 83 -1.0427883e+08 1.60e-05 1.37e-08 -5.7 9.08e+02 - 1.00e+00 1.00e+00f 1\n", + " 84 -1.0427884e+08 5.70e-04 5.09e-06 -8.6 1.48e+03 - 1.00e+00 1.00e+00h 1\n", + " 85 -1.0427884e+08 5.59e-09 2.35e-13 -8.6 7.18e-01 - 1.00e+00 1.00e+00h 1\n", + " 86 -1.0427884e+08 2.79e-09 9.30e-12 -10.9 1.99e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 86\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.6119507851267775e+02 -1.0427883997848792e+08\n", + "Dual infeasibility......: 9.2995983076271742e-12 6.0160107413515216e-06\n", + "Constraint violation....: 1.0913936421275139e-10 2.7939677238464355e-09\n", + "Complementarity.........: 1.4067955341342552e-11 9.1007124870068398e-06\n", + "Overall NLP error.......: 1.0913936421275139e-10 9.1007124870068398e-06\n", + "\n", + "\n", + "Number of objective function evaluations = 118\n", + "Number of objective gradient evaluations = 87\n", + "Number of equality constraint evaluations = 118\n", + "Number of inequality constraint evaluations = 118\n", + "Number of equality constraint Jacobian evaluations = 87\n", + "Number of inequality constraint Jacobian evaluations = 87\n", + "Number of Lagrangian Hessian evaluations = 86\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.091\n", + "Total CPU secs in NLP function evaluations = 0.014\n", + "\n", + "EXIT: Optimal Solution Found.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "WARNING: model contains export suffix\n", - "'fs.thermo_params_VLE.CH4.scaling_factor' that contains 8 component keys that\n", - "are not exported as part of the NL file. Skipping.\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "Ipopt 3.13.2: tol=1e-06\n", - "max_iter=100\n" + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\n", "\n", "\n", "******************************************************************************\n", @@ -3804,7 +3894,7 @@ "\n", "Total number of variables............................: 410\n", " variables with only lower bounds: 49\n", - " variables with lower and upper bounds: 334\n", + " variables with lower and upper bounds: 337\n", " variables with only upper bounds: 1\n", "Total number of equality constraints.................: 405\n", "Total number of inequality constraints...............: 10\n", @@ -3813,114 +3903,59 @@ " inequality constraints with only upper bounds: 5\n", "\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 0 -2.8497829e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", - " 1 -2.8431118e+07 2.74e+04 9.77e+01 -1.0 8.82e+06 - 4.99e-02 1.94e-02h 1\n", - " 2 -2.8430711e+07 2.74e+04 7.81e+02 -1.0 8.52e+06 - 3.76e-02 1.99e-04h 1\n", - " 3 -2.8524881e+07 2.48e+04 1.61e+05 -1.0 6.46e+06 - 2.49e-04 9.25e-02f 1\n", - " 4 -2.8526701e+07 2.48e+04 1.61e+05 -1.0 5.76e+06 - 5.84e-02 9.84e-04h 1\n", - " 5 -2.8554187e+07 2.48e+04 1.60e+05 -1.0 1.49e+07 - 3.31e-03 8.96e-04h 1\n", - " 6 -2.9123963e+07 2.43e+04 1.52e+05 -1.0 1.49e+07 - 1.23e-01 1.84e-02f 1\n", - " 7 -2.9208669e+07 2.43e+04 1.51e+05 -1.0 9.71e+06 - 2.32e-02 2.78e-03h 1\n", - " 8 -3.0003106e+07 2.36e+04 1.08e+06 -1.0 9.31e+06 - 1.92e-01 2.61e-02h 1\n", - " 9 -3.1468193e+07 2.25e+04 1.09e+06 -1.0 8.71e+06 - 6.69e-02 4.91e-02f 1\n", - "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 10 -3.1583879e+07 2.24e+04 1.14e+07 -1.0 5.51e+06 - 3.91e-01 3.89e-03h 1\n", - " 11 -4.3112060e+07 3.08e+04 5.71e+06 -1.0 5.49e+06 - 1.57e-01 3.86e-01f 1\n", - " 12 -4.3711568e+07 4.53e+04 5.09e+06 -1.0 3.67e+06 - 8.46e-02 2.88e-02h 1\n", - " 13 -4.3718128e+07 4.53e+04 1.94e+06 -1.0 3.57e+06 - 5.80e-01 3.23e-04h 1\n", - " 14 -4.3760522e+07 4.51e+04 4.15e+07 -1.0 3.56e+06 - 4.25e-01 5.93e-03h 1\n", - " 15 -4.4646098e+07 7.99e+04 5.37e+07 -1.0 3.54e+06 - 6.75e-01 1.23e-01h 4\n", - " 16 -6.6609948e+07 4.70e+04 6.17e+06 -1.0 3.14e+06 - 7.83e-01 9.90e-01H 1\n", - " 17 -6.5995574e+07 4.70e+04 3.11e+06 -1.0 2.01e+07 - 3.61e-03 3.25e-03h 5\n", - " 18 -6.5244336e+07 4.71e+04 3.13e+07 -1.0 1.74e+07 - 4.59e-05 4.34e-03h 5\n", - " 19 -6.4062606e+07 2.26e+03 9.67e+06 -1.0 7.97e+04 - 3.33e-04 9.87e-01h 1\n", - "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 20 -6.4049002e+07 1.77e+03 8.54e+03 -1.0 2.65e+03 - 9.89e-01 1.00e+00h 1\n", - " 21 -6.5078492e+07 1.26e+03 4.14e+05 -1.0 1.04e+05 - 9.50e-01 9.92e-01f 1\n", - " 22 -7.5331202e+07 1.38e+05 3.86e+06 -1.0 1.20e+06 - 2.40e-01 1.00e+00f 1\n", - " 23 -7.4656453e+07 9.99e+04 2.12e+06 -1.0 1.07e+05 -4.0 9.90e-01 2.77e-01h 1\n", - " 24 -7.4647249e+07 9.94e+04 2.08e+06 -1.0 7.74e+04 -4.5 5.39e-01 5.21e-03h 1\n", - " 25 -7.4611354e+07 9.73e+04 2.02e+06 -1.0 7.24e+04 -5.0 1.00e+00 2.07e-02h 1\n", - " 26 -7.4417188e+07 8.61e+04 1.78e+06 -1.0 7.10e+04 -5.4 5.90e-01 1.15e-01h 1\n", - " 27 -7.4386526e+07 8.46e+04 1.75e+06 -1.0 7.83e+04 -5.9 1.23e-02 1.80e-02h 1\n", - " 28 -7.2736872e+07 3.01e+02 1.72e+06 -1.0 1.09e+05 -6.4 1.06e-04 1.00e+00h 1\n", - " 29 -7.2723082e+07 1.43e-01 6.52e+02 -1.0 5.95e+02 -6.9 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", - " 30 -7.2723222e+07 7.89e-05 2.09e+01 -1.7 1.63e+02 -7.3 1.00e+00 1.00e+00f 1\n", - " 31 -8.6816123e+07 8.68e+03 9.78e+05 -2.5 5.17e+06 - 2.86e-02 5.98e-01f 1\n", - " 32 -8.6799976e+07 8.39e+03 5.89e+05 -2.5 1.65e+04 -7.8 9.53e-01 3.34e-02h 1\n", - " 33 -8.6300379e+07 1.51e+01 7.15e+04 -2.5 2.25e+04 -8.3 8.28e-02 1.00e+00h 1\n", - " 34 -8.6315273e+07 4.51e-03 1.67e+00 -2.5 3.37e+03 -8.8 1.00e+00 1.00e+00h 1\n", - " 35 -8.6355832e+07 4.54e-02 7.17e-02 -2.5 1.03e+04 -9.2 1.00e+00 1.00e+00f 1\n" + " 0 -1.0301714e+08 2.98e+05 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -1.0365412e+08 1.32e+05 4.21e+01 -1.0 8.57e+04 - 8.59e-01 5.52e-01h 1\n", + " 2 -1.0410108e+08 5.26e+04 7.56e+03 -1.0 5.09e+04 - 9.61e-01 5.97e-01h 1\n", + " 3 -1.0413437e+08 2.06e+04 2.27e+02 -1.0 2.41e+04 - 9.37e-01 6.07e-01h 1\n", + " 4 -1.0424131e+08 1.93e+02 5.00e+03 -1.0 1.94e+05 - 9.87e-01 9.90e-01h 1\n", + " 5 -1.0420077e+08 9.43e+00 3.43e+03 -1.0 1.40e+05 - 9.11e-01 9.91e-01h 1\n", + " 6 -1.0416592e+08 2.19e+01 9.98e+05 -1.0 7.17e+05 - 7.26e-01 1.56e-02f 7\n", + " 7 -1.0366377e+08 9.17e+01 5.74e+05 -1.0 4.94e+05 - 5.51e-01 1.00e+00H 1\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - " 36 -8.6484786e+07 3.89e-01 3.04e+03 -5.7 3.04e+04 -9.7 9.89e-01 1.00e+00f 1\n", - " 37 -8.6863607e+07 3.35e+00 6.38e-01 -5.7 9.16e+04 -10.2 1.00e+00 9.94e-01f 1\n", - " 38 -8.7407007e+07 7.89e+00 3.54e-01 -5.7 2.74e+05 -10.7 1.00e+00 4.78e-01f 1\n", - " 39 -9.0728057e+07 2.04e+02 2.21e+00 -5.7 8.01e+05 -11.2 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", - " 40 -9.9495392e+07 6.13e+02 3.85e+00 -5.7 2.39e+06 -11.6 1.00e+00 9.06e-01f 1\n", - " 41 -9.9495416e+07 6.13e+02 3.85e+00 -5.7 5.53e+06 -12.1 1.07e-01 1.10e-06h 1\n", - " 42 -1.0301582e+08 3.81e+04 2.43e+01 -5.7 7.11e+06 -12.6 3.99e-01 1.44e-01f 1\n", - " 43 -1.0301583e+08 3.81e+04 3.36e+01 -5.7 1.39e+06 - 6.86e-01 1.25e-06h 2\n", - " 44 -1.0436645e+08 3.42e+05 1.56e+01 -5.7 2.02e+06 - 1.00e+00 1.00e+00h 1\n", - " 45 -1.0441853e+08 3.22e+05 1.44e+01 -5.7 4.91e+06 - 9.43e-01 7.95e-02h 1\n", - " 46 -1.0439096e+08 2.72e+05 1.22e+01 -5.7 1.25e+07 - 2.29e-01 1.53e-01h 1\n", - " 47 -1.0436186e+08 2.08e+05 9.28e+00 -5.7 6.35e+05 - 1.00e+00 2.38e-01h 1\n", - " 48 -1.0427962e+08 1.89e+04 8.38e-01 -5.7 2.21e+05 - 1.00e+00 9.09e-01h 1\n", - " 49 -1.0427372e+08 1.22e+01 8.52e-02 -5.7 2.01e+04 - 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", - " 50 -1.0427510e+08 3.31e+02 1.55e+00 -5.7 5.86e+04 -13.1 1.00e+00 9.55e-01h 1\n", - " 51 -1.0427510e+08 2.94e+02 5.87e+01 -5.7 2.24e+04 - 7.65e-02 1.13e-01f 1\n", - " 52 -1.0427509e+08 1.51e-03 1.08e-01 -5.7 8.91e+03 - 1.00e+00 1.00e+00f 1\n", - " 53 -1.0427919e+08 3.06e+03 5.51e+01 -5.7 1.66e+05 -13.5 1.00e+00 1.00e+00f 1\n", - " 54 -1.0427839e+08 2.40e+03 4.05e+01 -5.7 1.34e+05 - 4.18e-01 2.55e-01h 1\n", - " 55 -1.0427605e+08 1.01e+03 2.12e+01 -5.7 9.49e+04 - 4.92e-01 1.00e+00h 1\n", - " 56 -1.0427605e+08 6.84e-03 5.30e+01 -5.7 1.43e+03 - 2.80e-01 1.00e+00h 1\n", - " 57 -1.0427605e+08 6.92e-04 5.08e-03 -5.7 1.97e+02 - 1.00e+00 1.00e+00h 1\n", - " 58 -1.0427606e+08 1.10e-02 4.86e+00 -5.7 3.32e+02 -10.4 4.14e-01 1.00e+00h 1\n", - " 59 -1.0427605e+08 2.11e-03 5.96e-01 -5.7 2.09e+02 - 2.89e-01 1.00e+00h 1\n", + " 8 -1.0363147e+08 9.84e+01 7.49e+06 -1.0 9.50e+05 - 9.90e-01 1.56e-02f 7\n", + " 9 -1.0252180e+08 7.86e+02 3.75e+04 -1.0 1.53e+06 - 7.68e-01 1.00e+00F 1\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 60 -1.0427605e+08 7.75e-05 1.67e-01 -5.7 3.44e+02 - 5.92e-01 1.00e+00h 1\n", - " 61 -1.0427606e+08 1.07e-03 3.54e-02 -5.7 1.20e+03 - 4.52e-01 1.00e+00h 1\n", - " 62 -1.0427606e+08 1.84e-02 6.27e-02 -5.7 5.23e+03 - 3.18e-01 1.00e+00h 1\n", - " 63 -1.0427613e+08 2.01e+00 9.36e-03 -5.7 5.45e+04 - 1.26e-01 1.00e+00h 1\n", - " 64 -1.0427676e+08 1.61e+02 1.39e-02 -5.7 6.85e+06 - 8.98e-03 7.04e-02h 3\n", - " 65 -1.0427678e+08 1.30e-01 1.17e-04 -5.7 7.26e+02 -10.9 1.00e+00 1.00e+00h 1\n", - " 66 -1.0427727e+08 9.59e+01 5.94e-03 -5.7 5.11e+06 - 1.07e-01 6.92e-02h 3\n", - " 67 -1.0427802e+08 3.15e+02 6.28e-02 -5.7 5.67e+06 - 4.89e-01 9.21e-02h 2\n", - " 68 -1.0427841e+08 3.63e+02 7.79e-02 -5.7 6.06e+06 - 2.53e-01 4.21e-02h 2\n", - " 69 -1.0427881e+08 4.10e+02 1.51e-01 -5.7 5.10e+06 - 1.00e+00 4.94e-02h 1\n", + " 10 -1.0190033e+08 6.00e+00 1.87e+03 -1.0 2.37e+05 - 1.00e+00 1.00e+00H 1\n", + " 11 -1.0201665e+08 1.13e+01 8.51e+01 -1.0 1.34e+05 - 1.00e+00 1.00e+00H 1\n", + " 12 -1.0416792e+08 1.89e+04 2.50e+06 -2.5 1.28e+06 - 3.10e-01 5.67e-01f 1\n", + " 13 -1.0432990e+08 7.37e+04 1.94e+05 -2.5 1.61e+06 - 8.21e-01 6.69e-01h 1\n", + " 14 -1.0425973e+08 1.27e+02 1.47e+03 -2.5 4.32e+04 - 1.00e+00 1.00e+00h 1\n", + " 15 -1.0426575e+08 1.07e+01 1.87e-01 -2.5 5.16e+04 - 1.00e+00 1.00e+00h 1\n", + " 16 -1.0427763e+08 2.48e+01 2.62e+01 -3.8 6.19e+04 - 1.00e+00 1.00e+00h 1\n", + " 17 -1.0427797e+08 9.99e+01 2.44e-03 -3.8 3.85e+05 - 1.00e+00 1.00e+00h 1\n", + " 18 -1.0427790e+08 1.94e+00 1.79e-05 -3.8 5.18e+04 - 1.00e+00 1.00e+00h 1\n", + " 19 -1.0427873e+08 8.25e+00 5.26e+02 -5.7 1.32e+05 - 9.65e-01 1.00e+00h 1\n", "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", - " 70 -1.0427883e+08 1.43e-01 9.49e-05 -5.7 1.47e+04 - 1.00e+00 1.00e+00h 1\n", - " 71 -1.0427883e+08 7.08e-03 1.45e-08 -5.7 2.57e+03 - 1.00e+00 1.00e+00h 1\n", - " 72 -1.0427884e+08 5.67e-04 5.09e-06 -8.6 1.47e+03 - 1.00e+00 1.00e+00h 1\n", - " 73 -1.0427884e+08 1.86e-09 3.49e-13 -8.6 6.91e-01 - 1.00e+00 1.00e+00h 1\n", - " 74 -1.0427884e+08 9.31e-10 9.31e-12 -10.9 1.99e+00 - 1.00e+00 1.00e+00h 1\n", + " 20 -1.0427883e+08 1.02e+00 6.20e-03 -5.7 6.34e+04 - 1.00e+00 9.13e-01h 1\n", + " 21 -1.0427883e+08 2.22e-03 7.11e-08 -5.7 2.00e+03 - 1.00e+00 1.00e+00f 1\n", + " 22 -1.0427884e+08 2.66e-03 1.10e-05 -8.6 3.26e+03 - 1.00e+00 1.00e+00h 1\n", + " 23 -1.0427884e+08 1.16e-08 1.82e-13 -8.6 4.36e+00 - 1.00e+00 1.00e+00h 1\n", + " 24 -1.0427884e+08 3.14e-09 2.03e-11 -11.2 4.33e+00 - 1.00e+00 1.00e+00h 1\n", "\n", - "Number of Iterations....: 74\n", + "Number of Iterations....: 24\n", "\n", " (scaled) (unscaled)\n", - "Objective...............: -1.6119507851269793e+02 -1.0427883997850099e+08\n", - "Dual infeasibility......: 9.3066982868688585e-12 6.0206037947252707e-06\n", - "Constraint violation....: 1.0186340659856796e-10 9.3132257461547852e-10\n", - "Complementarity.........: 1.4067955349081809e-11 9.1007124920134500e-06\n", - "Overall NLP error.......: 1.0186340659856796e-10 9.1007124920134500e-06\n", - "\n", - "\n", - "Number of objective function evaluations = 109\n", - "Number of objective gradient evaluations = 75\n", - "Number of equality constraint evaluations = 109\n", - "Number of inequality constraint evaluations = 109\n", - "Number of equality constraint Jacobian evaluations = 75\n", - "Number of inequality constraint Jacobian evaluations = 75\n", - "Number of Lagrangian Hessian evaluations = 74\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 0.060\n", - "Total CPU secs in NLP function evaluations = 0.010\n", + "Objective...............: -7.4466968713582915e+01 -1.0427883997850099e+08\n", + "Dual infeasibility......: 2.0257749320973842e-11 2.8367672758258825e-05\n", + "Constraint violation....: 1.3824319466948509e-10 3.1432136893272400e-09\n", + "Complementarity.........: 6.5249453183277711e-12 9.1371213367821990e-06\n", + "Overall NLP error.......: 1.3824319466948509e-10 2.8367672758258825e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 52\n", + "Number of objective gradient evaluations = 25\n", + "Number of equality constraint evaluations = 52\n", + "Number of inequality constraint evaluations = 52\n", + "Number of equality constraint Jacobian evaluations = 25\n", + "Number of inequality constraint Jacobian evaluations = 25\n", + "Number of Lagrangian Hessian evaluations = 24\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.028\n", + "Total CPU secs in NLP function evaluations = 0.001\n", "\n", "EXIT: Optimal Solution Found.\n" ] @@ -3932,7 +3967,7 @@ "Optimal solution process results:\n", "\n", "\n", - "Extent of reaction: 311.3069854950048\n", + "Extent of reaction: 311.30698549500477\n", "Stoichiometry of each component normalized by the extent:\n", "CH4 : 0.0\n", "H2 : -2.0\n", @@ -3941,27 +3976,27 @@ "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", "\n", "Reaction conversion: 0.8500000099996615\n", - "Reactor duty (MW): -59.34022107299144\n", - "Duty from Reaction (MW)): 28.216865165267237\n", - "Compressor work (MW): 8.44420706806932e-25\n", - "Turbine work (MW): -2.491301208383534\n", - "Feed Mixer outlet temperature (C)): 20.051714213753428\n", - "Recycle Mixer outlet temperature (C)): 41.54321437801781\n", - "Feed Compressor outlet temperature (C)): 41.54321437801781\n", + "Reactor duty (MW): -59.340221072991014\n", + "Duty from Reaction (MW)): 28.216865165267233\n", + "Compressor work (MW): 1.2861669211016399e-24\n", + "Turbine work (MW): -2.4913012083840025\n", + "Feed Mixer outlet temperature (C)): 20.05171421375354\n", + "Recycle Mixer outlet temperature (C)): 41.54321437801775\n", + "Feed Compressor outlet temperature (C)): 41.54321437801792\n", "Feed Compressor outlet pressure (Pa)): 5100000.0\n", "Heater outlet temperature (C)): 215.0\n", - "Reactor outlet temperature (C)): 231.85000478420352\n", - "Turbine outlet temperature (C)): 141.50037862881612\n", - "Turbine outlet pressure (Pa)): 1487177.2483577346\n", - "Cooler outlet temperature (C)): 52.56999699056837\n", + "Reactor outlet temperature (C)): 231.85000478422364\n", + "Turbine outlet temperature (C)): 141.50037862882152\n", + "Turbine outlet pressure (Pa)): 1487177.2483574792\n", + "Cooler outlet temperature (C)): 52.56999699077659\n", "Flash outlet temperature (C)): 134.0\n", "Purge percentage (amount of vapor vented to exhaust): 9.999999000026644 %\n", "Methanol recovery(%): 92.05882105498138\n", - "annualized capital cost ($/year) = 259559.90821304667\n", - "operating cost ($/year) = 525130020.7095513\n", - "sales ($/year) = 140033684437.28275\n", + "annualized capital cost ($/year) = 259559.90821288762\n", + "operating cost ($/year) = 525130020.7095608\n", + "sales ($/year) = 140033684437.2827\n", "raw materials cost ($/year) = 35229454878.16397\n", - "revenue (1000$/year)= 104278839.978501\n", + "revenue (1000$/year)= 104278839.97850098\n", "\n", "\n", "====================================================================================\n", @@ -4072,7 +4107,21 @@ "\n", "print()\n", "print(\"Solving optimization problem...\")\n", + "\n", + "# Pass 1: smoothed VLE transition\n", + "eps_nominal = value(m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq)\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "\n", "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "# Pass 2: restore default smoothness\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "\n", + "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", "\n", "print(\"Optimal solution process results:\")\n", "report(m)" @@ -4095,8 +4144,13 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:18.114029600Z", + "start_time": "2026-02-20T21:01:18.109467400Z" + } + }, "outputs": [], "source": [] } @@ -4118,7 +4172,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.12.11" } }, "nbformat": 4, diff --git a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_test.ipynb b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_test.ipynb index a7ec0962..d80f67ad 100644 --- a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_test.ipynb +++ b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_test.ipynb @@ -1,733 +1,4342 @@ { - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "header", - "hide-cell" - ] - }, - "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", - "# Design of Advanced Energy Systems (IDAES).\n", - "#\n", - "# Copyright (c) 2018-2023 by the software owners: The Regents of the\n", - "# University of California, through Lawrence Berkeley National Laboratory,\n", - "# National Technology & Engineering Solutions of Sandia, LLC, Carnegie Mellon\n", - "# University, West Virginia University Research Corporation, et al.\n", - "# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n", - "# for full copyright and license information.\n", - "###############################################################################" + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.077272400Z", + "start_time": "2026-02-20T21:01:12.065134800Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:48.799943Z", + "iopub.status.busy": "2026-02-20T21:02:48.799943Z", + "iopub.status.idle": "2026-02-20T21:02:48.804200Z", + "shell.execute_reply": "2026-02-20T21:02:48.804200Z" + }, + "tags": [ + "header", + "hide-cell" + ] + }, + "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", + "# Design of Advanced Energy Systems (IDAES).\n", + "#\n", + "# Copyright (c) 2018-2023 by the software owners: The Regents of the\n", + "# University of California, through Lawrence Berkeley National Laboratory,\n", + "# National Technology & Engineering Solutions of Sandia, LLC, Carnegie Mellon\n", + "# University, West Virginia University Research Corporation, et al.\n", + "# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n", + "# for full copyright and license information.\n", + "###############################################################################" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Methanol Synthesis Flowsheet Example\n", + "Maintainer: Brandon Paul \n", + "Author: Brandon Paul \n", + "Updated: 2023-06-01 \n", + "\n", + "The purpose of this notebook is to demonstrate flowsheet synthesis integrating IDAES modeling tools, including the Unit Model Library, Property and Reaction Framework, IDAES scaling tools and the Process Costing Framework. The example leverages imports from external flowsheet scripts, and demonstrates implementation of separate VLE and vapor-only property packages to reduce model complexity where applicable.\n", + "\n", + "## Simplified Hydrogen Reformation System\n", + "\n", + "This example demonstrates a steady-state model of methanol synthesis from hydrogen and carbon monoxide. To simulate relevant natural gas components, the reactant vapors are mixed stoichiometrically and brought to optimal reaction conditions prior to entering the gas-phase reactor. Vapor liquid equilibrium is mainly applicable in the post-reactor Flash unit for methanol recovery, and is accounted for by separate vapor and VLE thermophysical property packages. See `methanol_flowsheet.py` for more information on how to assemble the flowsheet, as well as [idaes_examples.mod.methanol.methanol_ideal_VLE.py](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_VLE.py), [idaes_examples.mod.methanol.methanol_ideal_vapor](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_vapor.py) and [idaes_examples.mod.methanol.methanol_reactions](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_reactions.py) for more information on the thermophyscial and reaction properties.\n", + "\n", + "This example is a reasonable approximation for gas-phase methanol synthesis systems and does not represent any particular chemical process. To simplify the system and increase tractability, hydrogen and carbon monoxide feeds are considered in lieu of multi-step mechanisms for carbon dioxide conversion to methanol. General process descriptions for gas-phase synthesis, as well as thermophysical and reaction properties for carbon monoxide hydrogenation, were taken from the following publication:\n", + "\n", + "Nieminen, H.; Laari, A.; Koiranen, T. CO2 Hydrogenation to Methanol by a Liquid-Phase Process with Alcoholic Solvents: A Techno-Economic Analysis. Processes 2019, 7, 405. https://doi.org/10.3390/pr7070405" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Introduction\n", + "\n", + "This example demonstrates a simulation of methanol synthesis from hydrogen and carbon monoxide. Each methanol flowsheet module includes several built-in methods. This notebook demonstrates building the flowsheet, implementing model scaling, initialization and solving a square problem, costing and final constrained optimization.\n", + "\n", + "The ```build_model()``` method creates the Pyomo concrete model and builds the flowsheet by importing thermophysical and reaction properties and unit models and defining stream connections between these units. This method also implements appropriate default scaling on state and property variables.\n", + "\n", + "The ```set_inputs()``` method adds the appropriate initial specifications on the feed streams and unit operations. Specifications upstream of the reactor largely remain fixed throughout the optimization.\n", + "\n", + "The ```scale_flowsheet()``` method implements generic variable, unit model state variable, unit model constraint and Arc equality constraint scaling via IDAES scaling tools. Scaling factors are hard-coded in the flowsheet scripts to adjust for order of magnitude factors in appropriate constraints and simplify numerical solver calculations.\n", + "\n", + "The ```initialize_flowsheet()``` method uses the initial guess to initialize the models sequentially, solving each unit and propagating the results to the outlet stream to converge the next unit more quickly. This occurs just before the flowsheet-level solver call.\n", + "\n", + "The ```add_costing()``` method creates new variables and constraints related to unit model capital cost and operating cost calculations, and defines an objective function for the process economics. This method is called after the flowsheet-level solver call, and the flowsheet is resolved once costing is added. Capital costs are estimated using built-in costing methods within IDAES, and operating costs are estimated from a combination of known cost coefficients and surrogate models.\n", + "\n", + "The ```report()``` method displays relevant model results after the flowsheet has been fully solved." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Problem Statement \n", + "\n", + "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", + "\n", + "## 2.1. Main Inputs: \n", + "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", + "- Pre-reactor compressor outlet pressure (Pa)\n", + "- Pre-reactor heater outlet temperature (K)\n", + "\n", + "## 2.2. Main Outputs:\n", + "- Extent of reaction (mol/s)\n", + "- Reactor duty (W)\n", + "- Turbine duty (W)\n", + "- Methanol recovery (%)\n", + "- Annual revenue (USD/year)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.101680200Z", + "start_time": "2026-02-20T21:01:12.087272100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:48.805381Z", + "iopub.status.busy": "2026-02-20T21:02:48.805381Z", + "iopub.status.idle": "2026-02-20T21:02:48.811980Z", + "shell.execute_reply": "2026-02-20T21:02:48.811980Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA48AAACpCAYAAACLdAi5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAC0vSURBVHhe7d2/duI6tMDhnfsYt4YpsuYJ4AlImqnSTgdlaKZLmS4NKcNat5g2VZqBJwhPkJXiwLvkassSCMfGBvwX/76zfAaMbWRLVryRLF99GQIAAAAAwAH/4/4FAAAAACAVwSMAAAAAIBPBIwAAAAAgE8EjAAAAACATwSMAAAAA5LV5luHVlVxtp6E8b9xnR1vKJNzW8FlO3lQFCB4BAAAAdJoGbscZyGz9JfrgivVMZNo/JYDUwPFG5uOF3Y7d1t2rPC3dxw1E8AgAAACg844PICO9+wcZy0pe/5nocTmRq+FEJkNtRYz+HbqocvM83GtZ3Dw/ytysuXgZuTm6rXfRt3bZbYvkx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AAAAANBSeVoUz2l1tLR1sP8qd+sw4CvGcnIlj9drN9BONQgeAQAAAHROJcGj6476eldtkFcWgkcAAAAAnVNN8HhZuOcRAAAAQOdoUKjBYRoCx+8IHgEAAAAAmQgeAQAAAOBCbZ6HcjV8lo17fw6CRwAAAACdlNZ1tdAuq+55jLrNq6uJ2Mcy2nlDefYRXey9jqQaLX8lw+1CxnKynb/32YHt9W7vZLB6lX/BZk5F8AgAAAAApVjKpD+V1Xhhg9Gv9bU8Zj3V3wSIb7/MsmZ5fcbjavq0Czjtcx6jz74WY/NZP3oe5CG9H/JTVvKZ+bDJbASPAAAAADor3vqor4tqddw8P4oJ92TxMopm9O7l3b9OM3oRv8j6cyUyuJa+eb3592pCwLH88quPfpl3Ih//ZTUp9uV6kGe5bASPAAAAAFC5lUz7rguqtk66uSZMlOdhNP9mPpDZ33vRJ0SGgWQkCgpX2ybFtO1FdsudjuARAAAAACpnAsO164K6npl3Xk/u3323VbEBoXZN7UeRouxCwLVE8aQPJ9O2VxyCRwAAAACd5ruu6lRUl1VlB6uRuTyGA9tk3qS40/vx073yr+fy5ldfvpl3A7m71XbJbLsg83QEjwAAAABQBr3H0Q1sE3Un/ZSHjHse7aM1XCB7dWPCw9k6ugdy9GIH0Jnf7D4bL97lPjN2jFoof/7IF2QecmUi6+JCawAAAABooaJbHRtDWzv7r3K3zhNoHkbLIwAAAIDOu9Q2NTtK6+BOcvZuPYiWRwAAAABAJloeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAABlE/h+1/fUys0mHlQAAAABJRU5ErkJggg==", + "text/plain": [ + "" ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from IPython.display import Image\n", + "\n", + "Image(\"methanol_flowsheet.png\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3. Import and Solve Flowsheet\n", + "## 3.1 Import Pyomo and IDAES Libraries" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, let's import the relevant Pyomo and IDAES Libraries:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.133188600Z", + "start_time": "2026-02-20T21:01:12.108593100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:48.843518Z", + "iopub.status.busy": "2026-02-20T21:02:48.843518Z", + "iopub.status.idle": "2026-02-20T21:02:51.487294Z", + "shell.execute_reply": "2026-02-20T21:02:51.487294Z" + } + }, + "outputs": [], + "source": [ + "import pytest\n", + "import os\n", + "\n", + "# Import Pyomo libraries\n", + "from pyomo.environ import (\n", + " Constraint,\n", + " Objective,\n", + " Var,\n", + " Expression,\n", + " Param,\n", + " ConcreteModel,\n", + " TransformationFactory,\n", + " value,\n", + " maximize,\n", + " units as pyunits,\n", + ")\n", + "from pyomo.environ import TerminationCondition\n", + "from pyomo.network import Arc\n", + "\n", + "# Import IDAES core libraries\n", + "from idaes.core import FlowsheetBlock\n", + "from idaes.core.solvers import get_solver\n", + "from idaes.core.util import scaling as iscale\n", + "from idaes.core.util.model_statistics import degrees_of_freedom\n", + "from idaes.core.util.initialization import propagate_state\n", + "\n", + "# Import required property modules\n", + "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", + "\n", + "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", + "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", + "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", + "\n", + "from idaes.models.unit_models import (\n", + " Feed,\n", + " Mixer,\n", + " Heater,\n", + " Compressor,\n", + " Turbine,\n", + " StoichiometricReactor,\n", + " Flash,\n", + " Product,\n", + ")\n", + "from idaes.models.unit_models.mixer import MomentumMixingType\n", + "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", + "from idaes.core import UnitModelCostingBlock\n", + "from idaes.models.costing.SSLW import SSLWCosting\n", + "\n", + "# import flowsheet functions\n", + "from methanol_flowsheet import (\n", + " build_model,\n", + " set_inputs,\n", + " scale_flowsheet,\n", + " initialize_flowsheet,\n", + " add_costing,\n", + " report,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3.2 Build and Solve Flowsheet\n", + "The methanol flowsheet methods are called sequentially below, following the workflow contained in the ```main()``` method in `methanol_flowsheet.py`. First, let's set the solver options. IDAES contains a default solver `get_solver` which calls IPOPT using standard settings, and we set an iteration cap of 100 to catch nonconverging solver runs." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:12.163219200Z", + "start_time": "2026-02-20T21:01:12.134801600Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:51.489319Z", + "iopub.status.busy": "2026-02-20T21:02:51.489319Z", + "iopub.status.idle": "2026-02-20T21:02:51.492852Z", + "shell.execute_reply": "2026-02-20T21:02:51.492852Z" + } + }, + "outputs": [], + "source": [ + "# Set solver options\n", + "solver = get_solver() # IPOPT\n", + "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", + "solver.options = optarg" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we will build and solve the initial flowsheet using imported flowsheet methods - see `methanol_flowsheet.py` for complete method scripts.\n", + "\n", + "In the code below, we first define a Pyomo model object and build the model by defining each unit block with relevant property packages. As mentioned earlier, only the Flash unit (and the liquid outlet Product block) employ the VLE property package to ensure fast convergence of vapor-only processes.\n", + "\n", + "The process inputs are set for stoichiometric hydrogen and carbon monoxide feeds according to the process diagram in section 2.2. In the output below, the script returns the expected degrees of freedom for the model for each unit (compressor pressure change, heater duty, reactor duty and conversion, turbine pressure change and efficiency, cooler duty and flash duty and pressure change) and the actual model degrees of freedom before input specification, after the feed inputs are specified (flow, enthalpy, pressure, and composition for each feed) and after the unit model inputs are specified.\n", + "\n", + "After setting process inputs, we have a square problem for initialization. Here, we first implement IDAES scaling tools to create a more tractable problem during the solve step, and then sequentially initialize and propagate results from each unit block. As expected, the model only performs dew and bubble point calculations for the Flash and CH3OH product blocks where liquid phases are present and we obtain a square, solved problem:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.890006Z", + "start_time": "2026-02-20T21:01:12.164401100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:51.495253Z", + "iopub.status.busy": "2026-02-20T21:02:51.493863Z", + "iopub.status.idle": "2026-02-20T21:02:53.135410Z", + "shell.execute_reply": "2026-02-20T21:02:53.135410Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unit degrees of freedom\n", + "M101 0\n", + "C101 1\n", + "H101 1\n", + "R101 2\n", + "T101 2\n", + "H102 1\n", + "F101 2\n", + "Total DOF: 23\n", + "DOF after streams specified: 9\n", + "DOF after units specified: 0\n", + "\n", + "2026-02-20 14:02:51 [INFO] idaes.init.fs.H2.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.H2.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.H2.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.H2: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.CO.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.CO.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.CO.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.CO: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.H2_WGS_state: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.H2_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.CO_WGS_state: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.CO_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.mixed_state: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:51 [INFO] idaes.init.fs.M101.mixed_state: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.C101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.C101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101.control_volume.reactions: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.R101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.properties_isentropic: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.properties_isentropic: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101.properties_isentropic: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.T101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H102.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H102.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H102.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H102.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H102.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.H102: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.F101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.EXHAUST.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.EXHAUST.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.EXHAUST.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.EXHAUST: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.CH3OH.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.CH3OH.properties: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:52 [INFO] idaes.init.fs.CH3OH.properties: Equilibrium temperature initialization completed.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:53 [INFO] idaes.init.fs.CH3OH.properties: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:53 [INFO] idaes.init.fs.CH3OH.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:53 [INFO] idaes.init.fs.CH3OH.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:53 [INFO] idaes.init.fs.CH3OH: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 955\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 607\n", + "\n", + "Total number of variables............................: 310\n", + " variables with only lower bounds: 35\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 310\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 2.77e+00 -1.0 1.00e-02 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 1.21e+00 -1.0 1.00e-04 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 6.98e-10 1.00e+03 -1.0 9.90e-07 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Constraint violation....: 1.1368683772161603e-13 6.9849193096160889e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 1.1368683772161603e-13 6.9849193096160889e-10\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.003\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "source": [ + "# Build and solve flowsheet\n", + "m = ConcreteModel()\n", + "build_model(m) # build flowsheet by adding unit models and property packages\n", + "set_inputs(m) # unit and stream specifications\n", + "scale_flowsheet(m) # flowsheet and unit model level scaling\n", + "initialize_flowsheet(m) # rigorous initialization scheme\n", + "\n", + "print(\"DOF before solve: \", degrees_of_freedom(m))\n", + "print()\n", + "print(\"Solving initial problem...\")\n", + "\n", + "results = solver.solve(m, tee=True) # initial square problem solve" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:14.896961Z", + "start_time": "2026-02-20T21:01:14.890006Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.136921Z", + "iopub.status.busy": "2026-02-20T21:02:53.136921Z", + "iopub.status.idle": "2026-02-20T21:02:53.140029Z", + "shell.execute_reply": "2026-02-20T21:02:53.140029Z" + }, + "tags": [ + "testing" + ] + }, + "outputs": [], + "source": [ + "# check optimal termination\n", + "assert results.solver.termination_condition == TerminationCondition.optimal" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3.3 Flowsheet Costing and Optimization\n", + "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs. Additional, we calculate reactor operating costs as a function of conversion and assume constant rates for electricity, heating and cooling costs. Capital costs are annualized over 15 years, and revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, including a check on the reaction stoichiometry, relevant duty and state variable values, economic results, and stream tables for feed and product streams:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:15.080743Z", + "start_time": "2026-02-20T21:01:14.897531200Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.142545Z", + "iopub.status.busy": "2026-02-20T21:02:53.141539Z", + "iopub.status.idle": "2026-02-20T21:02:53.260308Z", + "shell.execute_reply": "2026-02-20T21:02:53.260308Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Solving with costing...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 971\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 611\n", + "\n", + "Total number of variables............................: 319\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 319\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 -2.8492051e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9068962e+07 5.76e+04 6.45e+01 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9074767e+07 5.71e+02 9.98e+00 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9074825e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9074825e+07 1.05e-09 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4948186430824137e+01 -2.9074824816033222e+07\n", + "Dual infeasibility......: 3.6708958239217049e-07 2.3745263485255724e-01\n", + "Constraint violation....: 4.5474735088646412e-12 1.0477378964424133e-09\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 2.3745263485255724e-01\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.003\n", + "Total CPU secs in NLP function evaluations = 0.001\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Initial solution process results:\n", + "\n", + "\n", + "Extent of reaction: 237.6004779\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.21917830318435\n", + "Duty from Reaction (MW)): 21.536107316856\n", + "Turbine work (MW): -0.9593346445867499\n", + "Mixer outlet temperature (C)): 20.051714213753257\n", + "Compressor outlet temperature (C)): 20.051714213753257\n", + "Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.8781524424324\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Methanol recovery(%): 60.004430129216836\n", + "annualized capital cost ($/year) = 219790.5044704343\n", + "operating cost ($/year) = 380701687.4964806\n", + "sales ($/year) = 64685201172.198135\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29074824.816033214\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.23\n", + " Total Mole Fraction CH4 dimensionless 2.8373e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.57\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" + ] + } + ], + "source": [ + "add_costing(m) # re-solve with costing equations\n", + "print()\n", + "print(\"Solving with costing...\")\n", + "results2 = solver.solve(m, tee=True)\n", + "\n", + "print(\"Initial solution process results:\")\n", + "report(m) # display initial solution results" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:15.090200200Z", + "start_time": "2026-02-20T21:01:15.081745600Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.261813Z", + "iopub.status.busy": "2026-02-20T21:02:53.261813Z", + "iopub.status.idle": "2026-02-20T21:02:53.266090Z", + "shell.execute_reply": "2026-02-20T21:02:53.266090Z" + }, + "tags": [ + "testing" + ] + }, + "outputs": [], + "source": [ + "# check optimal termination\n", + "assert results2.solver.termination_condition == TerminationCondition.optimal" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:15.228147700Z", + "start_time": "2026-02-20T21:01:15.091200900Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.268165Z", + "iopub.status.busy": "2026-02-20T21:02:53.268165Z", + "iopub.status.idle": "2026-02-20T21:02:53.374557Z", + "shell.execute_reply": "2026-02-20T21:02:53.374557Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 975\n", + "Number of nonzeros in inequality constraint Jacobian.: 8\n", + "Number of nonzeros in Lagrangian Hessian.............: 613\n", + "\n", + "Total number of variables............................: 322\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 259\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 318\n", + "Total number of inequality constraints...............: 8\n", + " inequality constraints with only lower bounds: 4\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 4\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8492012e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8402807e+07 2.72e+04 9.71e+01 -1.0 8.82e+06 - 4.99e-02 2.59e-02h 1\n", + " 2 -2.8406592e+07 2.70e+04 9.55e+01 -1.0 8.56e+06 - 7.51e-02 8.58e-03h 1\n", + " 3 -2.8493711e+07 2.29e+04 3.69e+02 -1.0 8.41e+06 - 1.67e-01 1.52e-01h 1\n", + " 4 -2.8493256e+07 2.28e+04 1.20e+04 -1.0 4.60e+06 - 1.00e-01 2.61e-03h 1\n", + " 5 -2.8504483e+07 2.24e+04 1.20e+04 -1.0 4.52e+06 - 2.44e-02 2.38e-02h 1\n", + " 6 -2.8536508e+07 2.16e+04 2.28e+04 -1.0 4.39e+06 - 5.48e-02 6.86e-02h 1\n", + " 7 -2.8537589e+07 2.16e+04 1.35e+05 -1.0 3.94e+06 - 2.56e-01 2.49e-03h 1\n", + " 8 -2.8537637e+07 2.15e+04 6.77e+06 -1.0 1.30e+06 - 4.68e-01 1.17e-04h 1\n", + " 9 -2.8910081e+07 8.51e+04 2.07e+06 -1.0 1.31e+06 - 4.38e-01 9.05e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -2.8916017e+07 7.81e+04 1.11e+08 -1.0 9.39e+04 -4.0 3.56e-03 8.26e-02h 1\n", + " 11 -2.8916050e+07 7.80e+04 1.11e+08 -1.0 8.73e+04 -4.5 9.12e-02 9.05e-04h 1\n", + " 12 -2.8951501e+07 1.29e+04 3.00e+07 -1.0 8.73e+04 - 1.37e-02 9.90e-01h 1\n", + " 13 -2.8964697e+07 3.52e+03 9.82e+06 -1.0 2.95e+04 - 8.80e-01 9.92e-01h 1\n", + " 14 -2.9150638e+07 4.25e+00 6.53e+07 -1.0 1.59e+04 - 9.88e-01 1.00e+00h 1\n", + " 15 -3.2694771e+07 3.47e+03 1.38e+08 -1.0 3.00e+05 - 3.58e-01 1.00e+00f 1\n", + " 16 -3.9657884e+07 3.74e+02 4.98e+06 -1.0 6.48e+05 - 9.11e-01 1.00e+00F 1\n", + " 17 -5.8700677e+07 2.03e+04 1.12e+06 -1.0 2.00e+06 - 2.65e-01 1.00e+00F 1\n", + " 18 -7.8085174e+07 1.40e+05 4.14e+05 -1.0 4.34e+06 - 7.55e-01 7.57e-01f 1\n", + " 19 -7.9333792e+07 1.60e+05 2.63e+05 -1.0 3.52e+06 - 9.63e-01 3.03e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -7.7164009e+07 3.20e+03 7.59e+03 -1.0 4.56e+05 - 9.91e-01 1.00e+00h 1\n", + " 21 -7.7545831e+07 3.83e+03 5.53e+01 -1.0 2.78e+05 - 1.00e+00 1.00e+00h 1\n", + " 22 -7.7683360e+07 9.76e+02 2.23e+06 -2.5 6.32e+04 - 1.00e+00 7.70e-01h 1\n", + " 23 -7.7696221e+07 8.35e+00 1.48e+02 -2.5 6.87e+04 - 1.00e+00 1.00e+00h 1\n", + " 24 -7.7696183e+07 8.31e-03 4.61e-03 -2.5 2.13e+03 - 1.00e+00 1.00e+00h 1\n", + " 25 -7.7699949e+07 5.36e+00 1.27e+04 -5.7 7.60e+04 - 9.49e-01 9.94e-01f 1\n", + " 26 -7.7700458e+07 8.84e+01 1.03e+03 -5.7 3.66e+05 - 9.25e-01 9.72e-01h 1\n", + " 27 -7.7700530e+07 1.74e+01 1.01e+01 -5.7 6.59e+04 - 1.00e+00 8.03e-01h 1\n", + " 28 -7.7700531e+07 2.07e-04 4.22e-06 -5.7 1.25e+03 - 1.00e+00 1.00e+00h 1\n", + " 29 -7.7700536e+07 9.48e-04 1.29e-01 -8.6 1.69e+03 - 1.00e+00 9.99e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 30 -7.7700536e+07 6.52e-09 5.32e-11 -8.6 1.52e+00 - 1.00e+00 1.00e+00f 1\n", + " 31 -7.7700536e+07 8.38e-09 6.97e-11 -10.9 2.16e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 31\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.2012103932708916e+02 -7.7700535938862860e+07\n", + "Dual infeasibility......: 6.9713197782916848e-11 4.5094122229452131e-05\n", + "Constraint violation....: 9.4587448984384537e-11 8.3819031715393066e-09\n", + "Complementarity.........: 1.4074777632989367e-11 9.1042982264387185e-06\n", + "Overall NLP error.......: 9.4587448984384537e-11 4.5094122229452131e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 34\n", + "Number of objective gradient evaluations = 32\n", + "Number of equality constraint evaluations = 34\n", + "Number of inequality constraint evaluations = 34\n", + "Number of equality constraint Jacobian evaluations = 32\n", + "Number of inequality constraint Jacobian evaluations = 32\n", + "Number of Lagrangian Hessian evaluations = 31\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.023\n", + "Total CPU secs in NLP function evaluations = 0.004\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Optimal solution process results:" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "Extent of reaction: 269.2805447879921\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.8500000099999546\n", + "Reactor duty (MW): -51.363573577545786\n", + "Duty from Reaction (MW)): 24.407588579583603\n", + "Turbine work (MW): -1.9904899177794815\n", + "Mixer outlet temperature (C)): 20.0517142137536\n", + "Compressor outlet temperature (C)): 20.0517142137536\n", + "Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 231.85000468716584\n", + "Turbine outlet temperature (C)): 139.85888172675686\n", + "Turbine outlet pressure (Pa)): 1427653.3547820917\n", + "Cooler outlet temperature (C)): 52.56999709299214\n", + "Flash outlet temperature (C)): 134.0\n", + "Methanol recovery(%): 92.8035547465754\n", + "annualized capital cost ($/year) = 235547.18924473316\n", + "operating cost ($/year) = 451663512.6847629\n", + "sales ($/year) = 113381889876.90082\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 77700535.93886285\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 165.54\n", + " Total Mole Fraction CH4 dimensionless 5.7630e-06\n", + " Total Mole Fraction CO dimensionless 0.28706\n", + " Total Mole Fraction H2 dimensionless 0.59587\n", + " Total Mole Fraction CH3OH dimensionless 0.11706\n", + " Molar Enthalpy joule / mole -52313.\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 249.90\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3792e+05\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n" + ] + } + ], + "source": [ + "# Set up Optimization Problem (Maximize Revenue)\n", + "# keep process pre-reaction fixed and unfix some post-process specs\n", + "m.fs.R101.conversion.unfix()\n", + "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", + "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", + "m.fs.R101.outlet_temp.deactivate()\n", + "m.fs.R101.outlet_t_lb = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", + ")\n", + "m.fs.R101.outlet_t_ub = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", + ")\n", + "\n", + "# Optimize turbine work (or delta P)\n", + "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", + "m.fs.T101.outlet_p_lb = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", + ")\n", + "m.fs.T101.outlet_p_ub = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", + ")\n", + "\n", + "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", + "m.fs.H102.outlet_temp.deactivate()\n", + "m.fs.H102.outlet_t_lb = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", + " >= 407.15 * 0.8 * pyunits.K\n", + ")\n", + "m.fs.H102.outlet_t_ub = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", + ")\n", + "\n", + "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", + "\n", + "m.fs.F101.isothermal = Constraint(\n", + " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", + " == m.fs.F101.control_volume.properties_in[0].temperature\n", + ")\n", + "\n", + "print()\n", + "print(\"Solving optimization problem...\")\n", + "opt_res = solver.solve(m, tee=True)\n", + "\n", + "print(\"Optimal solution process results:\")\n", + "report(m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As expected, the process achieves a much greater revenue as a result of increasing conversion and lowering the inlet temperature to the Flash unit to encourage methanol recovery in the liquid phase. The results show a slight increase in equipment and operating costs from these changes, as well as a small loss of methanol in the exhaust." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:15.238140100Z", + "start_time": "2026-02-20T21:01:15.228701500Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.376067Z", + "iopub.status.busy": "2026-02-20T21:02:53.376067Z", + "iopub.status.idle": "2026-02-20T21:02:53.381088Z", + "shell.execute_reply": "2026-02-20T21:02:53.381088Z" + }, + "tags": [ + "testing" + ] + }, + "outputs": [], + "source": [ + "# testing model results\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "assert value(m.fs.R101.rate_reaction_extent[0, \"R1\"]) == pytest.approx(\n", + " 269.2805, rel=1e-5\n", + ")\n", + "assert value(m.fs.R101.heat_duty[0]) / 1e6 == pytest.approx(-51.3636, rel=1e-5)\n", + "assert value(m.fs.T101.work_isentropic[0]) / 1e6 == pytest.approx(-1.9905, rel=1e-5)\n", + "assert value(m.fs.F101.recovery * 100) == pytest.approx(92.8036, rel=1e-5)\n", + "assert value(m.fs.objective) / 1e6 == pytest.approx(77.7005, rel=1e-5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4. Problem Statement - Analyzing Benefit of Recycling Flash Vapor\n", + "\n", + "To increase the efficiency of the process as well as overall methanol production and revenue, we can add a recycle stream to send most of the Flash vapor back to the start of the process. This will reduce methanol loss in the exhaust and increase feed utilization, resulting in increased operating costs and increased production (revenue) at the same conversion. Note that for conversions less than 100%, a simulation with no purge will never converge due to accumulation of gases within the system. Therefore, to ensure we close the mass balance we set a lower bound at 10% purge from the Flash vapor to the exhaust. We expect to see a marginal increase in operating costs due to increased flow, and a much larger increase in overall production resulting in a higher total revenue.\n", + "\n", + "By adding a recycle to the flowsheet, we significantly decrease the tractability of the problem and require a better initial guess. The SequentialDecomposition algorithm automatically determines a stream to *tear*, or use to break the solve loop, and iterates from a set of user-supplied initial guesses until converging on the optimal solution. The code below calls an initialization method to automatically determine the tear stream. See the initialization method of `methanol_flowsheet_w_recycle.py` for further details Sequential Decomposition scheme.\n", + "\n", + "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", + "\n", + "## 4.1. Main Inputs: \n", + "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", + "- Pre-reactor compressor outlet pressure (Pa)\n", + "- Pre-reactor heater outlet temperature (K)\n", + "\n", + "## 4.2. Main Outputs:\n", + "- Extent of reaction (mol/s)\n", + "- Reactor duty (W)\n", + "- Compressor duty (W)\n", + "- Turbine duty (W)\n", + "- Methanol recovery (%)\n", + "- Purge percentage (%)\n", + "- Annual revenue (USD/year)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:15.248401100Z", + "start_time": "2026-02-20T21:01:15.239141700Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.383119Z", + "iopub.status.busy": "2026-02-20T21:02:53.383119Z", + "iopub.status.idle": "2026-02-20T21:02:53.387635Z", + "shell.execute_reply": "2026-02-20T21:02:53.387635Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAABCsAAAEKCAYAAAA7A99lAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAETCSURBVHhe7d09cuJM2+jxy+8uzslOFUzgmhWIFYCTiZxOBqFJJpvQmRMIoeoNJnXkxLACswKXgxv2wumr1Q0NlkACSQjx/z2P7jFCHy21JKRL/XG3NgQAAAAAAKAm/sf9CwAAAAAAUAsEKwAAAAAAQK0QrAAAAAAAALVCsAIAAAAAANQKwQoAAAAAAFArBCsAAAAAAECtEKwAAAAAAOAGzAd3cnfXkfHKjagxghUAAAAAAOQUP/jvDp3OQOZ1DQSsxvI8Nf9Gj/LQikdZq7kMOnH6B3M3bmMl40Fnu41Ht89M75a1M+wsONsyCVYAAAAAAJDLSv77dH8GFoup9Nr1LLmwen+Vhfk3enwQH6tYjTty1+7JVL/4RgMPbRmGX9rtG8i3mEZm2ZdJsAIAAAAA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vUQBYEKwAAAAAAzaRtVLiGMOPqGV/y90ibFbarURc4uetNJRot4zYsuhPb4Oa0t/2uP/uQp6OxirgExs8f2YIaiN2tiwxbAQAAAABwgqJLVdSGluZov8rjMktgAx4lKwAAAAAAF9fU9+i2F5HoUTLWFoFDyQoAAAAAAFArlKwAAAAAAAC1QrACAAAAAADUCsEKAAAAAABQKwQrAAAAAABArRCsAAAAAAAAtUKwAgAAAAAA1ArBCgAAAAAAUCsEKwAAAAAAQK0QrAAAAAAAALVCsAIAAAAAANQKwQoAAAAAAFArBCsAAAAAAECtEKwAAAAAAAA1IvL/AccPhEZ19gnJAAAAAElFTkSuQmCC", + "text/plain": [ + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from IPython.display import Image\n", + "\n", + "Image(\"methanol_flowsheet_recycle.png\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5. Import and Solve Recycle Flowsheet\n", + "## 5.1 Import Pyomo and IDAES Libraries\n", + "As we are rebuilding the model, we need to import require Pyomo and IDAES libraries:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:15.257940Z", + "start_time": "2026-02-20T21:01:15.249681700Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.389672Z", + "iopub.status.busy": "2026-02-20T21:02:53.389672Z", + "iopub.status.idle": "2026-02-20T21:02:53.395462Z", + "shell.execute_reply": "2026-02-20T21:02:53.395462Z" + } + }, + "outputs": [], + "source": [ + "import pytest\n", + "import os\n", + "\n", + "# Import Pyomo libraries\n", + "from pyomo.environ import (\n", + " Constraint,\n", + " Objective,\n", + " Var,\n", + " Expression,\n", + " Param,\n", + " ConcreteModel,\n", + " TransformationFactory,\n", + " value,\n", + " maximize,\n", + " units as pyunits,\n", + ")\n", + "from pyomo.environ import TerminationCondition\n", + "from pyomo.network import Arc, SequentialDecomposition\n", + "\n", + "# Import IDAES core libraries\n", + "from idaes.core import FlowsheetBlock\n", + "from idaes.core.solvers import get_solver\n", + "from idaes.core.util import scaling as iscale\n", + "from idaes.core.util.model_statistics import degrees_of_freedom\n", + "from idaes.core.util.initialization import propagate_state\n", + "\n", + "# Import required models\n", + "\n", + "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", + "\n", + "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", + "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", + "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", + "\n", + "from idaes.models.unit_models import (\n", + " Feed,\n", + " Mixer,\n", + " Heater,\n", + " Compressor,\n", + " Turbine,\n", + " StoichiometricReactor,\n", + " Flash,\n", + " Separator as Splitter,\n", + " Product,\n", + ")\n", + "from idaes.models.unit_models.mixer import MomentumMixingType\n", + "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", + "from idaes.core import UnitModelCostingBlock\n", + "from idaes.models.costing.SSLW import SSLWCosting\n", + "import idaes.logger as idaeslog\n", + "\n", + "# import flowsheet functions\n", + "from methanol_flowsheet_w_recycle import (\n", + " build_model,\n", + " set_inputs,\n", + " scale_flowsheet,\n", + " initialize_flowsheet,\n", + " add_costing,\n", + " report,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5.2 Build and Solve Recycle Flowsheet\n", + "As before, we will first build the flowsheet, set required inputs, initialize and solve a square problem. Recycling methanol to pre-reactor blocks complicates VLE calculations, and limiting VLE calculations to the Flash unit and liquid Product block greatly increases tractability during initialization. All initial feed and unit specifications are identical to the non-recycle case; the Sequential Decomposition algorithm automatically selects the compressor feed as the tear stream and uses \"no recycle\" results as a first guess. In the output below, the solver solves all units and then resolves select blocks with updated inlet results, followed by a full flowsheet solve:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:18.400079700Z", + "start_time": "2026-02-20T21:01:15.257940Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:53.397491Z", + "iopub.status.busy": "2026-02-20T21:02:53.397491Z", + "iopub.status.idle": "2026-02-20T21:02:56.082394Z", + "shell.execute_reply": "2026-02-20T21:02:56.082394Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unit degrees of freedom\n", + "M101 0\n", + "C101 1\n", + "H101 1\n", + "R101 2\n", + "T101 2\n", + "H102 1\n", + "F101 2\n", + "M102 0\n", + "S101 1\n", + "Total DOF: 24\n", + "DOF after streams specified: 10\n", + "DOF after units specified: 0\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Tear Stream:\n", + "fs.s02 : fs.M102.outlet to fs.C101.inlet\n", + "\n", + "Calculation order:\n", + "fs.H2\n", + "fs.M101\n", + "fs.R101\n", + "fs.T101\n", + "fs.H102\n", + "fs.F101\n", + "fs.S101\n", + "fs.EXHAUST\n", + "\n", + "Initial DOF = 0\n", + "Solving fs.H2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.CO\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.C101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.M101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Methanol Synthesis Flowsheet Example\n", - "Maintainer: Brandon Paul \n", - "Author: Brandon Paul \n", - "Updated: 2023-06-01 \n", - "\n", - "The purpose of this notebook is to demonstrate flowsheet synthesis integrating IDAES modeling tools, including the Unit Model Library, Property and Reaction Framework, IDAES scaling tools and the Process Costing Framework. The example leverages imports from external flowsheet scripts, and demonstrates implementation of separate VLE and vapor-only property packages to reduce model complexity where applicable.\n", - "\n", - "## Simplified Hydrogen Reformation System\n", - "\n", - "This example demonstrates a steady-state model of methanol synthesis from hydrogen and carbon monoxide. To simulate relevant natural gas components, the reactant vapors are mixed stoichiometrically and brought to optimal reaction conditions prior to entering the gas-phase reactor. Vapor liquid equilibrium is mainly applicable in the post-reactor Flash unit for methanol recovery, and is accounted for by separate vapor and VLE thermophysical property packages. See `methanol_flowsheet.py` for more information on how to assemble the flowsheet, as well as [idaes_examples.mod.methanol.methanol_ideal_VLE.py](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_VLE.py), [idaes_examples.mod.methanol.methanol_ideal_vapor](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_vapor.py) and [idaes_examples.mod.methanol.methanol_reactions](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_reactions.py) for more information on the thermophyscial and reaction properties.\n", - "\n", - "This example is a reasonable approximation for gas-phase methanol synthesis systems and does not represent any particular chemical process. To simplify the system and increase tractability, hydrogen and carbon monoxide feeds are considered in lieu of multi-step mechanisms for carbon dioxide conversion to methanol. General process descriptions for gas-phase synthesis, as well as thermophysical and reaction properties for carbon monoxide hydrogenation, were taken from the following publication:\n", - "\n", - "Nieminen, H.; Laari, A.; Koiranen, T. CO2 Hydrogenation to Methanol by a Liquid-Phase Process with Alcoholic Solvents: A Techno-Economic Analysis. Processes 2019, 7, 405. https://doi.org/10.3390/pr7070405" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 1. Introduction\n", - "\n", - "This example demonstrates a simulation of methanol synthesis from hydrogen and carbon monoxide. Each methanol flowsheet module includes several built-in methods. This notebook demonstrates building the flowsheet, implementing model scaling, initialization and solving a square problem, costing and final constrained optimization.\n", - "\n", - "The ```build_model()``` method creates the Pyomo concrete model and builds the flowsheet by importing thermophysical and reaction properties and unit models and defining stream connections between these units. This method also implements appropriate default scaling on state and property variables.\n", - "\n", - "The ```set_inputs()``` method adds the appropriate initial specifications on the feed streams and unit operations. Specifications upstream of the reactor largely remain fixed throughout the optimization.\n", - "\n", - "The ```scale_flowsheet()``` method implements generic variable, unit model state variable, unit model constraint and Arc equality constraint scaling via IDAES scaling tools. Scaling factors are hard-coded in the flowsheet scripts to adjust for order of magnitude factors in appropriate constraints and simplify numerical solver calculations.\n", - "\n", - "The ```initialize_flowsheet()``` method uses the initial guess to initialize the models sequentially, solving each unit and propagating the results to the outlet stream to converge the next unit more quickly. This occurs just before the flowsheet-level solver call.\n", - "\n", - "The ```add_costing()``` method creates new variables and constraints related to unit model capital cost and operating cost calculations, and defines an objective function for the process economics. This method is called after the flowsheet-level solver call, and the flowsheet is resolved once costing is added. Capital costs are estimated using built-in costing methods within IDAES, and operating costs are estimated from a combination of known cost coefficients and surrogate models.\n", - "\n", - "The ```report()``` method displays relevant model results after the flowsheet has been fully solved." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 2. Problem Statement \n", - "\n", - "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", - "\n", - "## 2.1. Main Inputs: \n", - "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", - "- Pre-reactor compressor outlet pressure (Pa)\n", - "- Pre-reactor heater outlet temperature (K)\n", - "\n", - "## 2.2. Main Outputs:\n", - "- Extent of reaction (mol/s)\n", - "- Reactor duty (W)\n", - "- Turbine duty (W)\n", - "- Methanol recovery (%)\n", - "- Annual revenue (USD/year)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from IPython.display import Image\n", - "\n", - "Image(\"methanol_flowsheet.png\")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 3. Import and Solve Flowsheet\n", - "## 3.1 Import Pyomo and IDAES Libraries" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "First, let's import the relevant Pyomo and IDAES Libraries:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] }, { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "import pytest\n", - "import os\n", - "\n", - "# Import Pyomo libraries\n", - "from pyomo.environ import (\n", - " Constraint,\n", - " Objective,\n", - " Var,\n", - " Expression,\n", - " Param,\n", - " ConcreteModel,\n", - " TransformationFactory,\n", - " value,\n", - " maximize,\n", - " units as pyunits,\n", - ")\n", - "from pyomo.environ import TerminationCondition\n", - "from pyomo.network import Arc\n", - "\n", - "# Import IDAES core libraries\n", - "from idaes.core import FlowsheetBlock\n", - "from idaes.core.solvers import get_solver\n", - "from idaes.core.util import scaling as iscale\n", - "from idaes.core.util.model_statistics import degrees_of_freedom\n", - "from idaes.core.util.initialization import propagate_state\n", - "\n", - "# Import required property modules\n", - "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", - "\n", - "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", - "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", - "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", - "\n", - "from idaes.models.unit_models import (\n", - " Feed,\n", - " Mixer,\n", - " Heater,\n", - " Compressor,\n", - " Turbine,\n", - " StoichiometricReactor,\n", - " Flash,\n", - " Product,\n", - ")\n", - "from idaes.models.unit_models.mixer import MomentumMixingType\n", - "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", - "from idaes.core import UnitModelCostingBlock\n", - "from idaes.models.costing.SSLW import SSLWCosting\n", - "\n", - "# import flowsheet functions\n", - "from methanol_flowsheet import (\n", - " build_model,\n", - " set_inputs,\n", - " scale_flowsheet,\n", - " initialize_flowsheet,\n", - " add_costing,\n", - " report,\n", - ")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + " " + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.2 Build and Solve Flowsheet\n", - "The methanol flowsheet methods are called sequentially below, following the workflow contained in the ```main()``` method in `methanol_flowsheet.py`. First, let's set the solver options. IDAES contains a default solver `get_solver` which calls IPOPT using standard settings, and we set an iteration cap of 100 to catch nonconverging solver runs." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "Solving fs.H101\n" + ] }, { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "# Set solver options\n", - "solver = get_solver() # IPOPT\n", - "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", - "solver.options = optarg" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Next, we will build and solve the initial flowsheet using imported flowsheet methods - see `methanol_flowsheet.py` for complete method scripts.\n", - "\n", - "In the code below, we first define a Pyomo model object and build the model by defining each unit block with relevant property packages. As mentioned earlier, only the Flash unit (and the liquid outlet Product block) employ the VLE property package to ensure fast convergence of vapor-only processes.\n", - "\n", - "The process inputs are set for stoichiometric hydrogen and carbon monoxide feeds according to the process diagram in section 2.2. In the output below, the script returns the expected degrees of freedom for the model for each unit (compressor pressure change, heater duty, reactor duty and conversion, turbine pressure change and efficiency, cooler duty and flash duty and pressure change) and the actual model degrees of freedom before input specification, after the feed inputs are specified (flow, enthalpy, pressure, and composition for each feed) and after the unit model inputs are specified.\n", - "\n", - "After setting process inputs, we have a square problem for initialization. Here, we first implement IDAES scaling tools to create a more tractable problem during the solve step, and then sequentially initialize and propagate results from each unit block. As expected, the model only performs dew and bubble point calculations for the Flash and CH3OH product blocks where liquid phases are present and we obtain a square, solved problem:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Build and solve flowsheet\n", - "m = ConcreteModel()\n", - "build_model(m) # build flowsheet by adding unit models and property packages\n", - "set_inputs(m) # unit and stream specifications\n", - "scale_flowsheet(m) # flowsheet and unit model level scaling\n", - "initialize_flowsheet(m) # rigorous initialization scheme\n", - "\n", - "print(\"DOF before solve: \", degrees_of_freedom(m))\n", - "print()\n", - "print(\"Solving initial problem...\")\n", - "\n", - "results = solver.solve(m, tee=True) # initial square problem solve" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "tags": [ - "testing" - ] - }, - "outputs": [], - "source": [ - "# check optimal termination\n", - "assert results.solver.termination_condition == TerminationCondition.optimal" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.3 Flowsheet Costing and Optimization\n", - "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs. Additional, we calculate reactor operating costs as a function of conversion and assume constant rates for electricity, heating and cooling costs. Capital costs are annualized over 15 years, and revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, including a check on the reaction stoichiometry, relevant duty and state variable values, economic results, and stream tables for feed and product streams:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "add_costing(m) # re-solve with costing equations\n", - "print()\n", - "print(\"Solving with costing...\")\n", - "results2 = solver.solve(m, tee=True)\n", - "\n", - "print(\"Initial solution process results:\")\n", - "report(m) # display initial solution results" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "tags": [ - "testing" - ] - }, - "outputs": [], - "source": [ - "# check optimal termination\n", - "assert results2.solver.termination_condition == TerminationCondition.optimal" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.R101\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Set up Optimization Problem (Maximize Revenue)\n", - "# keep process pre-reaction fixed and unfix some post-process specs\n", - "m.fs.R101.conversion.unfix()\n", - "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", - "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", - "m.fs.R101.outlet_temp.deactivate()\n", - "m.fs.R101.outlet_t_lb = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", - ")\n", - "m.fs.R101.outlet_t_ub = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", - ")\n", - "\n", - "# Optimize turbine work (or delta P)\n", - "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", - "m.fs.T101.outlet_p_lb = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", - ")\n", - "m.fs.T101.outlet_p_ub = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", - ")\n", - "\n", - "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", - "m.fs.H102.outlet_temp.deactivate()\n", - "m.fs.H102.outlet_t_lb = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", - " >= 407.15 * 0.8 * pyunits.K\n", - ")\n", - "m.fs.H102.outlet_t_ub = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", - ")\n", - "\n", - "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", - "\n", - "m.fs.F101.isothermal = Constraint(\n", - " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", - " == m.fs.F101.control_volume.properties_in[0].temperature\n", - ")\n", - "\n", - "print()\n", - "print(\"Solving optimization problem...\")\n", - "opt_res = solver.solve(m, tee=True)\n", - "\n", - "print(\"Optimal solution process results:\")\n", - "report(m)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As expected, the process achieves a much greater revenue as a result of increasing conversion and lowering the inlet temperature to the Flash unit to encourage methanol recovery in the liquid phase. The results show a slight increase in equipment and operating costs from these changes, as well as a small loss of methanol in the exhaust." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "tags": [ - "testing" - ] - }, - "outputs": [], - "source": [ - "# testing model results\n", - "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", - "\n", - "assert value(m.fs.R101.rate_reaction_extent[0, \"R1\"]) == pytest.approx(\n", - " 269.2805, rel=1e-5\n", - ")\n", - "assert value(m.fs.R101.heat_duty[0]) / 1e6 == pytest.approx(-51.3636, rel=1e-5)\n", - "assert value(m.fs.T101.work_isentropic[0]) / 1e6 == pytest.approx(-1.9905, rel=1e-5)\n", - "assert value(m.fs.F101.recovery * 100) == pytest.approx(92.8036, rel=1e-5)\n", - "assert value(m.fs.objective) / 1e6 == pytest.approx(77.7005, rel=1e-5)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 4. Problem Statement - Analyzing Benefit of Recycling Flash Vapor\n", - "\n", - "To increase the efficiency of the process as well as overall methanol production and revenue, we can add a recycle stream to send most of the Flash vapor back to the start of the process. This will reduce methanol loss in the exhaust and increase feed utilization, resulting in increased operating costs and increased production (revenue) at the same conversion. Note that for conversions less than 100%, a simulation with no purge will never converge due to accumulation of gases within the system. Therefore, to ensure we close the mass balance we set a lower bound at 10% purge from the Flash vapor to the exhaust. We expect to see a marginal increase in operating costs due to increased flow, and a much larger increase in overall production resulting in a higher total revenue.\n", - "\n", - "By adding a recycle to the flowsheet, we significantly decrease the tractability of the problem and require a better initial guess. The SequentialDecomposition algorithm automatically determines a stream to *tear*, or use to break the solve loop, and iterates from a set of user-supplied initial guesses until converging on the optimal solution. The code below calls an initialization method to automatically determine the tear stream. See the initialization method of `methanol_flowsheet_w_recycle.py` for further details Sequential Decomposition scheme.\n", - "\n", - "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", - "\n", - "## 4.1. Main Inputs: \n", - "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", - "- Pre-reactor compressor outlet pressure (Pa)\n", - "- Pre-reactor heater outlet temperature (K)\n", - "\n", - "## 4.2. Main Outputs:\n", - "- Extent of reaction (mol/s)\n", - "- Reactor duty (W)\n", - "- Compressor duty (W)\n", - "- Turbine duty (W)\n", - "- Methanol recovery (%)\n", - "- Purge percentage (%)\n", - "- Annual revenue (USD/year)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "from IPython.display import Image\n", - "\n", - "Image(\"methanol_flowsheet_recycle.png\")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 5. Import and Solve Recycle Flowsheet\n", - "## 5.1 Import Pyomo and IDAES Libraries\n", - "As we are rebuilding the model, we need to import require Pyomo and IDAES libraries:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] }, { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [], - "source": [ - "import pytest\n", - "import os\n", - "\n", - "# Import Pyomo libraries\n", - "from pyomo.environ import (\n", - " Constraint,\n", - " Objective,\n", - " Var,\n", - " Expression,\n", - " Param,\n", - " ConcreteModel,\n", - " TransformationFactory,\n", - " value,\n", - " maximize,\n", - " units as pyunits,\n", - ")\n", - "from pyomo.environ import TerminationCondition\n", - "from pyomo.network import Arc, SequentialDecomposition\n", - "\n", - "# Import IDAES core libraries\n", - "from idaes.core import FlowsheetBlock\n", - "from idaes.core.solvers import get_solver\n", - "from idaes.core.util import scaling as iscale\n", - "from idaes.core.util.model_statistics import degrees_of_freedom\n", - "from idaes.core.util.initialization import propagate_state\n", - "\n", - "# Import required models\n", - "\n", - "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", - "\n", - "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", - "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", - "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", - "\n", - "from idaes.models.unit_models import (\n", - " Feed,\n", - " Mixer,\n", - " Heater,\n", - " Compressor,\n", - " Turbine,\n", - " StoichiometricReactor,\n", - " Flash,\n", - " Separator as Splitter,\n", - " Product,\n", - ")\n", - "from idaes.models.unit_models.mixer import MomentumMixingType\n", - "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", - "from idaes.core import UnitModelCostingBlock\n", - "from idaes.models.costing.SSLW import SSLWCosting\n", - "import idaes.logger as idaeslog\n", - "\n", - "# import flowsheet functions\n", - "from methanol_flowsheet_w_recycle import (\n", - " build_model,\n", - " set_inputs,\n", - " scale_flowsheet,\n", - " initialize_flowsheet,\n", - " add_costing,\n", - " report,\n", - ")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.T101\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 5.2 Build and Solve Recycle Flowsheet\n", - "As before, we will first build the flowsheet, set required inputs, initialize and solve a square problem. Recycling methanol to pre-reactor blocks complicates VLE calculations, and limiting VLE calculations to the Flash unit and liquid Product block greatly increases tractability during initialization. All initial feed and unit specifications are identical to the non-recycle case; the Sequential Decomposition algorithm automatically selects the compressor feed as the tear stream and uses \"no recycle\" results as a first guess. In the output below, the solver solves all units and then resolves select blocks with updated inlet results, followed by a full flowsheet solve:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Build and solve flowsheet\n", - "solver = get_solver() # IPOPT\n", - "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", - "solver.options = optarg\n", - "\n", - "m = ConcreteModel() # create a new model so we may reference 'm' below\n", - "build_model(m) # build flowsheet\n", - "set_inputs(m) # unit and stream specifications\n", - "scale_flowsheet(m) # flowsheet and unit model level scaling\n", - "\n", - "# let the solver determine the tear stream\n", - "initialize_flowsheet(m) # rigorous initialization scheme\n", - "\n", - "print(\"DOF before solve: \", degrees_of_freedom(m))\n", - "print()\n", - "print(\"Solving initial problem...\")\n", - "results = solver.solve(m, tee=True)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "tags": [ - "testing" - ] - }, - "outputs": [], - "source": [ - "# check optimal termination\n", - "assert results.solver.termination_condition == TerminationCondition.optimal" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 5.3 Flowsheet Costing and Optimization\n", - "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs, reactor operating costs and utility costs for heating, cooling and electricity. As before, revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, which are updated for new results with the presence of a recycle stream:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "add_costing(m) # re-solve with costing equations\n", - "print()\n", - "results2 = solver.solve(m, tee=True)\n", - "\n", - "print(\"Initial solution process results:\")\n", - "report(m) # display initial solution results" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "tags": [ - "testing" - ] - }, - "outputs": [], - "source": [ - "# check optimal termination\n", - "assert results2.solver.termination_condition == TerminationCondition.optimal" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions, including a purge between 10-50% of flash vapor. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Set up Optimization Problem (Maximize Revenue)\n", - "# keep process pre-reaction fixed and unfix some post-process specs\n", - "m.fs.R101.conversion.unfix()\n", - "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", - "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", - "m.fs.R101.outlet_temp.deactivate()\n", - "m.fs.R101.outlet_t_lb = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", - ")\n", - "m.fs.R101.outlet_t_ub = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", - ")\n", - "\n", - "# Optimize turbine work (or delta P)\n", - "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", - "m.fs.T101.outlet_p_lb = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", - ")\n", - "m.fs.T101.outlet_p_ub = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", - ")\n", - "\n", - "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", - "m.fs.H102.outlet_temp.deactivate()\n", - "m.fs.H102.outlet_t_lb = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", - " >= 407.15 * 0.8 * pyunits.K\n", - ")\n", - "m.fs.H102.outlet_t_ub = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", - ")\n", - "\n", - "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", - "\n", - "m.fs.F101.isothermal = Constraint(\n", - " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", - " == m.fs.F101.control_volume.properties_in[0].temperature\n", - ")\n", - "\n", - "m.fs.S101.split_fraction[0, \"purge\"].unfix() # allow some gas recycle\n", - "m.fs.S101.split_fraction_lb = Constraint(\n", - " expr=m.fs.S101.split_fraction[0, \"purge\"] >= 0.10\n", - ") # min 10% purge\n", - "m.fs.S101.split_fraction_ub = Constraint(\n", - " expr=m.fs.S101.split_fraction[0, \"purge\"] <= 0.50\n", - ") # max 50% purge\n", - "\n", - "print()\n", - "print(\"Solving optimization problem...\")\n", - "opt_res = solver.solve(m, tee=True)\n", - "\n", - "print(\"Optimal solution process results:\")\n", - "report(m)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As expected, recycling methanol and gases from the flash vapor achieves much greater methanol production, and process cost increases are small compared to the increase in revenue. Note that the reaction conversion and flash inlet temperature did not change, and we obtain the same percentage methanol recovery. We can see in the stream tables that far more of the inlet material exits as methanol than in the non-recycle process (note that we do not have a mole balance due to the reaction stoichiometry). The results show a slight increase in equipment and operating costs from increased throughput on each unit." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "tags": [ - "testing" - ] - }, - "outputs": [], - "source": [ - "# testing model results\n", - "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", - "\n", - "assert value(m.fs.R101.rate_reaction_extent[0, \"R1\"]) == pytest.approx(\n", - " 311.3070, rel=1e-5\n", - ")\n", - "assert value(m.fs.R101.heat_duty[0]) / 1e6 == pytest.approx(-59.3402, rel=1e-5)\n", - "assert value(m.fs.C101.work_mechanical[0]) / 1e6 == pytest.approx(0, abs=1e-5)\n", - "assert value(m.fs.T101.work_isentropic[0]) / 1e6 == pytest.approx(-2.4913, rel=1e-5)\n", - "assert value(m.fs.F101.recovery * 100) == pytest.approx(92.0589, rel=1e-5)\n", - "assert value(m.fs.S101.split_fraction[0, \"purge\"] * 100) == pytest.approx(\n", - " 10.0000, rel=1e-5\n", - ")\n", - "assert value(m.fs.objective) / 1e6 == pytest.approx(104.2789, rel=1e-5)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 6. Summary\n", - "The present example demonstrates building, initializing and optimizing a methanol synthesis problem in IDAES. The imported scripts implement models from the IDAES pre-defined unit model library, the IDAES Property and Reaction Framework, targeted thermophysical properties for specific unit blocks, Pyomo's Sequential Decomposition methods, the IDAES Costing Framework for capital cost calculations, and integration of custom surrogate expressions for operating cost calculations. The methanol synthesis flowsheet methods may be imported into any external script, and users may build, initialize and optimize the entire model via the `main()` method in each flowsheet." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.H102\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.F101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.S101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.CH3OH\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.EXHAUST\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.M102\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.H2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.CO\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.M101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.EXHAUST\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "Solving fs.CH3OH\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Final DOF = 0\n", + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1211\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 768\n", + "\n", + "Total number of variables............................: 397\n", + " variables with only lower bounds: 41\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 397\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 4.22e+03 -1.0 1.96e+03 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 3.86e+03 -1.0 2.03e+01 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 7.44e-06 1.01e+03 -1.0 2.01e-01 - 9.90e-01 1.00e+00h 1\n", + "Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 1.0099088928127792e+05 1.0099088928127792e+05\n", + "Constraint violation....: 2.4014227693119351e-10 7.4444105848670006e-06\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 2.4014227693119351e-10 1.0099088928127792e+05\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.004\n", + "Total CPU secs in NLP function evaluations = 0.001\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "source": [ + "# Build and solve flowsheet\n", + "solver = get_solver() # IPOPT\n", + "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", + "solver.options = optarg\n", + "\n", + "m = ConcreteModel() # create a new model so we may reference 'm' below\n", + "build_model(m) # build flowsheet\n", + "set_inputs(m) # unit and stream specifications\n", + "scale_flowsheet(m) # flowsheet and unit model level scaling\n", + "\n", + "# let the solver determine the tear stream\n", + "initialize_flowsheet(m) # rigorous initialization scheme\n", + "\n", + "print(\"DOF before solve: \", degrees_of_freedom(m))\n", + "print()\n", + "print(\"Solving initial problem...\")\n", + "results = solver.solve(m, tee=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:18.405668400Z", + "start_time": "2026-02-20T21:01:18.400079700Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:56.084426Z", + "iopub.status.busy": "2026-02-20T21:02:56.084426Z", + "iopub.status.idle": "2026-02-20T21:02:56.086933Z", + "shell.execute_reply": "2026-02-20T21:02:56.086933Z" + }, + "tags": [ + "testing" + ] + }, + "outputs": [], + "source": [ + "# check optimal termination\n", + "assert results.solver.termination_condition == TerminationCondition.optimal" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5.3 Flowsheet Costing and Optimization\n", + "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs, reactor operating costs and utility costs for heating, cooling and electricity. As before, revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, which are updated for new results with the presence of a recycle stream:" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:18.574150200Z", + "start_time": "2026-02-20T21:01:18.407172200Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:56.088962Z", + "iopub.status.busy": "2026-02-20T21:02:56.088962Z", + "iopub.status.idle": "2026-02-20T21:02:56.217626Z", + "shell.execute_reply": "2026-02-20T21:02:56.217626Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1227\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 772\n", + "\n", + "Total number of variables............................: 406\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 406\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 -2.8497869e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9074832e+07 5.76e+04 4.22e+03 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9080637e+07 5.71e+02 3.82e+03 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9080695e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9080695e+07 9.31e-10 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4953175283791907e+01 -2.9080695361147854e+07\n", + "Dual infeasibility......: 2.4946824403693549e-06 1.6138370562967401e+00\n", + "Constraint violation....: 4.5474735088646412e-12 9.3132257461547852e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 1.6138370562967401e+00\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.005\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Initial solution process results:" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "Extent of reaction: 237.6064180604515\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.22029794711382\n", + "Duty from Reaction (MW)): 21.536645732999325\n", + "Compressor work (MW): -2.5668711294294714e-15\n", + "Turbine work (MW): -0.959378502391431\n", + "Feed Mixer outlet temperature (C)): 20.051714213753144\n", + "Recycle Mixer outlet temperature (C)): 20.056485612776214\n", + "Feed Compressor outlet temperature (C)): 20.0564856127761\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.87840947667888\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 99.99 %\n", + "Methanol recovery(%): 60.005984934911716\n", + "annualized capital cost ($/year) = 219794.2325658716\n", + "operating cost ($/year) = 380711692.18369955\n", + "sales ($/year) = 64691081725.72807\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29080695.36114784\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.21\n", + " Total Mole Fraction CH4 dimensionless 2.8375e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.58\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" + ] + } + ], + "source": [ + "add_costing(m) # re-solve with costing equations\n", + "print()\n", + "results2 = solver.solve(m, tee=True)\n", + "\n", + "print(\"Initial solution process results:\")\n", + "report(m) # display initial solution results" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:18.582616800Z", + "start_time": "2026-02-20T21:01:18.575222Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:56.219647Z", + "iopub.status.busy": "2026-02-20T21:02:56.219647Z", + "iopub.status.idle": "2026-02-20T21:02:56.222020Z", + "shell.execute_reply": "2026-02-20T21:02:56.222020Z" + }, + "tags": [ + "testing" + ] + }, + "outputs": [], + "source": [ + "# check optimal termination\n", + "assert results2.solver.termination_condition == TerminationCondition.optimal" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions, including a purge between 10-50% of flash vapor. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:19.012069500Z", + "start_time": "2026-02-20T21:01:18.583630200Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:56.224039Z", + "iopub.status.busy": "2026-02-20T21:02:56.224039Z", + "iopub.status.idle": "2026-02-20T21:02:56.614792Z", + "shell.execute_reply": "2026-02-20T21:02:56.614792Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8497829e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8431127e+07 2.74e+04 9.77e+01 -1.0 8.82e+06 - 4.99e-02 1.94e-02h 1\n", + " 2 -2.8430719e+07 2.74e+04 7.81e+02 -1.0 8.52e+06 - 3.76e-02 1.99e-04h 1\n", + " 3 -2.8524903e+07 2.48e+04 1.61e+05 -1.0 6.46e+06 - 2.49e-04 9.25e-02f 1\n", + " 4 -2.8526723e+07 2.48e+04 1.61e+05 -1.0 5.76e+06 - 5.84e-02 9.84e-04h 1\n", + " 5 -2.8554206e+07 2.48e+04 1.60e+05 -1.0 1.49e+07 - 3.32e-03 8.96e-04h 1\n", + " 6 -2.9123967e+07 2.43e+04 1.52e+05 -1.0 1.49e+07 - 1.23e-01 1.84e-02f 1\n", + " 7 -2.9208690e+07 2.43e+04 1.51e+05 -1.0 9.71e+06 - 2.32e-02 2.78e-03h 1\n", + " 8 -3.0003175e+07 2.36e+04 1.08e+06 -1.0 9.31e+06 - 1.92e-01 2.61e-02h 1\n", + " 9 -3.1468200e+07 2.25e+04 1.09e+06 -1.0 8.71e+06 - 6.69e-02 4.91e-02f 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -3.1583903e+07 2.24e+04 1.14e+07 -1.0 5.51e+06 - 3.91e-01 3.89e-03h 1\n", + " 11 -4.3112078e+07 3.08e+04 5.71e+06 -1.0 5.49e+06 - 1.57e-01 3.86e-01f 1\n", + " 12 -4.3711661e+07 4.53e+04 5.09e+06 -1.0 3.67e+06 - 8.46e-02 2.88e-02h 1\n", + " 13 -4.3718221e+07 4.53e+04 1.94e+06 -1.0 3.57e+06 - 5.81e-01 3.23e-04h 1\n", + " 14 -4.3760623e+07 4.51e+04 4.16e+07 -1.0 3.56e+06 - 4.25e-01 5.93e-03h 1\n", + " 15 -4.4646398e+07 7.99e+04 5.37e+07 -1.0 3.54e+06 - 6.75e-01 1.23e-01h 4\n", + " 16 -6.6613749e+07 4.71e+04 6.18e+06 -1.0 3.14e+06 - 7.83e-01 9.90e-01H 1\n", + " 17 -6.5999969e+07 4.71e+04 3.10e+06 -1.0 2.01e+07 - 3.61e-03 3.25e-03h 5\n", + " 18 -6.5249518e+07 4.72e+04 3.12e+07 -1.0 1.74e+07 - 4.59e-05 4.34e-03h 5\n", + " 19 -6.4064695e+07 2.26e+03 9.68e+06 -1.0 8.00e+04 - 3.33e-04 9.87e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -6.4051103e+07 1.77e+03 8.53e+03 -1.0 2.66e+03 - 9.89e-01 1.00e+00h 1\n", + " 21 -6.5080976e+07 1.26e+03 4.14e+05 -1.0 1.04e+05 - 9.50e-01 9.92e-01f 1\n", + " 22 -7.5335243e+07 1.38e+05 3.86e+06 -1.0 1.20e+06 - 2.39e-01 1.00e+00f 1\n", + " 23 -7.4658996e+07 9.99e+04 2.12e+06 -1.0 1.07e+05 -4.0 9.90e-01 2.78e-01h 1\n", + " 24 -7.4649764e+07 9.94e+04 2.08e+06 -1.0 7.73e+04 -4.5 5.39e-01 5.23e-03h 1\n", + " 25 -7.4613845e+07 9.73e+04 2.01e+06 -1.0 7.23e+04 -5.0 1.00e+00 2.08e-02h 1\n", + " 26 -7.4421363e+07 8.62e+04 1.78e+06 -1.0 7.09e+04 -5.4 5.88e-01 1.14e-01h 1\n", + " 27 -7.4390154e+07 8.46e+04 1.75e+06 -1.0 7.84e+04 -5.9 1.21e-02 1.83e-02h 1\n", + " 28 -7.2740081e+07 3.01e+02 1.73e+06 -1.0 1.09e+05 -6.4 1.05e-04 1.00e+00h 1\n", + " 29 -7.2726278e+07 1.44e-01 6.68e+02 -1.0 5.95e+02 -6.9 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", + " 30 -7.2726419e+07 7.97e-05 2.12e+01 -1.7 1.63e+02 -7.3 1.00e+00 1.00e+00f 1\n", + " 31 -8.6665745e+07 8.89e+03 9.70e+05 -2.5 5.14e+06 - 2.89e-02 5.94e-01f 1\n", + " 32 -8.6649468e+07 8.59e+03 6.03e+05 -2.5 1.66e+04 -7.8 9.58e-01 3.35e-02h 1\n", + " 33 -8.6148813e+07 1.45e+01 6.46e+04 -2.5 2.26e+04 -8.3 8.44e-02 1.00e+00h 1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 34 -8.6163785e+07 4.53e-03 1.68e+00 -2.5 3.37e+03 -8.8 1.00e+00 1.00e+00h 1\n", + " 35 -8.6204319e+07 4.58e-02 7.40e-02 -2.5 1.03e+04 -9.2 1.00e+00 1.00e+00f 1\n", + " 36 -8.6333114e+07 3.92e-01 1.69e+02 -3.8 3.04e+04 -9.7 1.00e+00 1.00e+00f 1\n", + " 37 -8.6713987e+07 3.42e+00 4.46e-01 -3.8 9.15e+04 -10.2 1.00e+00 1.00e+00f 1\n", + " 38 -8.7245785e+07 7.78e+00 1.64e+00 -3.8 2.74e+05 -10.7 1.00e+00 4.68e-01f 1\n", + " 39 -9.0563354e+07 2.18e+02 6.58e+00 -3.8 8.00e+05 -11.2 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", + " 40 -9.9476688e+07 6.32e+02 4.50e+01 -3.8 2.39e+06 -11.6 1.00e+00 9.22e-01f 1\n", + " 41 -9.9478624e+07 6.32e+02 4.50e+01 -3.8 5.59e+06 -12.1 1.12e-01 8.94e-05h 1\n", + " 42 -1.0299591e+08 3.80e+04 1.01e+02 -3.8 7.08e+06 -12.6 4.04e-01 1.44e-01f 1\n", + " 43 -1.0299655e+08 3.80e+04 1.08e+02 -3.8 1.39e+06 - 6.91e-01 2.06e-04h 1\n", + " 44 -1.0436244e+08 3.39e+05 1.55e+01 -3.8 2.01e+06 - 1.00e+00 1.00e+00h 1\n", + " 45 -1.0441522e+08 3.19e+05 1.27e+02 -3.8 4.87e+06 - 9.54e-01 8.06e-02h 1\n", + " 46 -1.0438806e+08 2.70e+05 9.30e+01 -3.8 1.25e+07 - 2.30e-01 1.54e-01h 1\n", + " 47 -1.0435495e+08 2.01e+05 1.05e+01 -3.8 9.64e+05 - 8.19e-01 2.54e-01h 1\n", + " 48 -1.0426618e+08 2.01e+03 2.19e+01 -3.8 1.81e+06 - 1.20e-01 1.00e+00h 1\n", + " 49 -1.0426992e+08 2.91e+02 3.40e-01 -3.8 6.45e+04 -13.1 1.00e+00 9.64e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 50 -1.0427006e+08 2.52e+02 4.03e+02 -3.8 6.80e+06 - 5.54e-03 2.57e-01h 1\n", + " 51 -1.0427055e+08 2.92e+02 3.97e+02 -3.8 3.24e+06 - 1.33e-01 1.97e-02h 1\n", + " 52 -1.0427008e+08 1.05e+02 1.15e+05 -3.8 2.71e+04 - 7.76e-04 1.00e+00f 1\n", + " 53 -1.0427044e+08 9.41e+01 7.74e+04 -3.8 4.75e+04 -12.6 1.00e+00 3.26e-01h 2\n", + " 54 -1.0427081e+08 9.98e+01 6.24e+04 -3.8 8.03e+04 -13.1 1.00e+00 1.91e-01h 2\n", + " 55 -1.0427080e+08 8.21e-01 1.24e+00 -3.8 7.52e+04 - 1.00e+00 1.00e+00h 1\n", + " 56 -1.0427114e+08 2.09e+01 2.34e+02 -3.8 3.16e+04 -12.7 1.00e+00 4.65e-01h 2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 57 -1.0427107e+08 4.98e-01 5.37e+00 -3.8 1.61e+04 - 1.00e+00 1.00e+00h 1\n", + " 58 -1.0427121e+08 3.58e+00 1.04e+03 -3.8 1.22e+04 -12.3 1.00e+00 4.79e-01h 2\n", + " 59 -1.0427120e+08 8.56e-03 3.90e+00 -3.8 1.47e+03 - 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", + " 60 -1.0427265e+08 3.69e+02 2.06e+03 -3.8 6.13e+04 -12.7 1.00e+00 1.00e+00f 1\n", + " 61 -1.0427267e+08 8.82e-03 8.41e-01 -3.8 2.14e+04 - 1.00e+00 1.00e+00h 1\n", + " 62 -1.0427488e+08 8.81e+02 4.71e+03 -3.8 9.30e+04 -13.2 9.57e-01 1.00e+00h 1\n", + " 63 -1.0427489e+08 1.12e-02 8.43e+03 -3.8 2.41e+04 - 4.26e-01 1.00e+00h 1\n", + " 64 -1.0427588e+08 1.77e+02 2.25e+02 -3.8 4.16e+04 -12.8 1.00e+00 1.00e+00h 1\n", + " 65 -1.0427569e+08 7.17e+00 2.18e+02 -3.8 9.45e+03 - 8.56e-01 1.00e+00h 1\n", + " 66 -1.0427569e+08 3.81e-04 1.34e+03 -3.8 7.69e+02 - 3.56e-01 1.00e+00h 1\n", + " 67 -1.0427568e+08 5.99e-04 1.01e+02 -3.8 7.28e+01 - 6.32e-01 1.00e+00h 1\n", + " 68 -1.0427568e+08 5.44e-04 1.32e+02 -3.8 6.86e+01 - 5.69e-01 1.00e+00h 1\n", + " 69 -1.0427569e+08 3.30e-03 2.05e+01 -3.8 2.50e+02 - 6.00e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 70 -1.0427569e+08 1.33e-05 2.19e+01 -3.8 2.05e+02 - 5.83e-01 1.00e+00h 1\n", + " 71 -1.0427569e+08 1.09e-03 3.63e+00 -3.8 5.68e+02 - 5.94e-01 1.00e+00f 1\n", + " 72 -1.0427569e+08 6.75e-04 3.84e+00 -3.8 1.21e+03 - 5.81e-01 1.00e+00h 1\n", + " 73 -1.0427569e+08 6.52e-03 6.49e-01 -3.8 3.03e+03 - 5.80e-01 1.00e+00h 1\n", + " 74 -1.0427570e+08 3.77e-02 6.80e-01 -3.8 7.51e+03 - 5.69e-01 1.00e+00h 1\n", + " 75 -1.0427573e+08 2.57e-01 1.17e-01 -3.8 1.96e+04 - 5.45e-01 1.00e+00h 1\n", + " 76 -1.0427580e+08 2.17e+00 1.46e-01 -3.8 5.66e+04 - 4.91e-01 1.00e+00h 1\n", + " 77 -1.0427608e+08 3.10e+01 6.00e-02 -3.8 2.13e+05 - 3.77e-01 1.00e+00h 1\n", + " 78 -1.0427817e+08 1.76e+03 5.49e-01 -3.8 1.56e+06 - 1.85e-01 1.00e+00h 1\n", + " 79 -1.0427835e+08 1.67e+03 6.12e-01 -3.8 1.75e+06 - 9.50e-01 6.05e-02h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 80 -1.0427838e+08 3.76e-01 2.22e-04 -3.8 9.99e+04 - 1.00e+00 1.00e+00h 1\n", + " 81 -1.0427881e+08 2.24e+00 1.80e+02 -5.7 8.49e+04 - 9.88e-01 1.00e+00h 1\n", + " 82 -1.0427883e+08 9.31e-02 1.16e-03 -5.7 1.69e+04 - 1.00e+00 9.65e-01h 1\n", + " 83 -1.0427883e+08 1.60e-05 1.37e-08 -5.7 9.08e+02 - 1.00e+00 1.00e+00f 1\n", + " 84 -1.0427884e+08 5.70e-04 5.09e-06 -8.6 1.48e+03 - 1.00e+00 1.00e+00h 1\n", + " 85 -1.0427884e+08 5.59e-09 2.35e-13 -8.6 7.18e-01 - 1.00e+00 1.00e+00h 1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 86 -1.0427884e+08 2.79e-09 9.30e-12 -10.9 1.99e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 86\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.6119507851267775e+02 -1.0427883997848792e+08\n", + "Dual infeasibility......: 9.2995983076271742e-12 6.0160107413515216e-06\n", + "Constraint violation....: 1.0913936421275139e-10 2.7939677238464355e-09\n", + "Complementarity.........: 1.4067955341342552e-11 9.1007124870068398e-06\n", + "Overall NLP error.......: 1.0913936421275139e-10 9.1007124870068398e-06\n", + "\n", + "\n", + "Number of objective function evaluations = 118\n", + "Number of objective gradient evaluations = 87\n", + "Number of equality constraint evaluations = 118\n", + "Number of inequality constraint evaluations = 118\n", + "Number of equality constraint Jacobian evaluations = 87\n", + "Number of inequality constraint Jacobian evaluations = 87\n", + "Number of Lagrangian Hessian evaluations = 86\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.096\n", + "Total CPU secs in NLP function evaluations = 0.010\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -1.0301714e+08 2.98e+05 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -1.0365412e+08 1.32e+05 4.21e+01 -1.0 8.57e+04 - 8.59e-01 5.52e-01h 1\n", + " 2 -1.0410108e+08 5.26e+04 7.56e+03 -1.0 5.09e+04 - 9.61e-01 5.97e-01h 1\n", + " 3 -1.0413437e+08 2.06e+04 2.27e+02 -1.0 2.41e+04 - 9.37e-01 6.07e-01h 1\n", + " 4 -1.0424131e+08 1.93e+02 5.00e+03 -1.0 1.94e+05 - 9.87e-01 9.90e-01h 1\n", + " 5 -1.0420077e+08 9.43e+00 3.43e+03 -1.0 1.40e+05 - 9.11e-01 9.91e-01h 1\n", + " 6 -1.0416592e+08 2.19e+01 9.98e+05 -1.0 7.17e+05 - 7.26e-01 1.56e-02f 7\n", + " 7 -1.0366377e+08 9.17e+01 5.74e+05 -1.0 4.94e+05 - 5.51e-01 1.00e+00H 1\n", + " 8 -1.0363147e+08 9.84e+01 7.49e+06 -1.0 9.50e+05 - 9.90e-01 1.56e-02f 7\n", + " 9 -1.0252180e+08 7.86e+02 3.75e+04 -1.0 1.53e+06 - 7.68e-01 1.00e+00F 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -1.0190033e+08 6.00e+00 1.87e+03 -1.0 2.37e+05 - 1.00e+00 1.00e+00H 1\n", + " 11 -1.0201665e+08 1.13e+01 8.51e+01 -1.0 1.34e+05 - 1.00e+00 1.00e+00H 1\n", + " 12 -1.0416792e+08 1.89e+04 2.50e+06 -2.5 1.28e+06 - 3.10e-01 5.67e-01f 1\n", + " 13 -1.0432990e+08 7.37e+04 1.94e+05 -2.5 1.61e+06 - 8.21e-01 6.69e-01h 1\n", + " 14 -1.0425973e+08 1.27e+02 1.47e+03 -2.5 4.32e+04 - 1.00e+00 1.00e+00h 1\n", + " 15 -1.0426575e+08 1.07e+01 1.87e-01 -2.5 5.16e+04 - 1.00e+00 1.00e+00h 1\n", + " 16 -1.0427763e+08 2.48e+01 2.62e+01 -3.8 6.19e+04 - 1.00e+00 1.00e+00h 1\n", + " 17 -1.0427797e+08 9.99e+01 2.44e-03 -3.8 3.85e+05 - 1.00e+00 1.00e+00h 1\n", + " 18 -1.0427790e+08 1.94e+00 1.79e-05 -3.8 5.18e+04 - 1.00e+00 1.00e+00h 1\n", + " 19 -1.0427873e+08 8.25e+00 5.26e+02 -5.7 1.32e+05 - 9.65e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -1.0427883e+08 1.02e+00 6.20e-03 -5.7 6.34e+04 - 1.00e+00 9.13e-01h 1\n", + " 21 -1.0427883e+08 2.22e-03 7.11e-08 -5.7 2.00e+03 - 1.00e+00 1.00e+00f 1\n", + " 22 -1.0427884e+08 2.66e-03 1.10e-05 -8.6 3.26e+03 - 1.00e+00 1.00e+00h 1\n", + " 23 -1.0427884e+08 1.16e-08 1.82e-13 -8.6 4.36e+00 - 1.00e+00 1.00e+00h 1\n", + " 24 -1.0427884e+08 3.14e-09 2.03e-11 -11.2 4.33e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 24\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -7.4466968713582915e+01 -1.0427883997850099e+08\n", + "Dual infeasibility......: 2.0257749320973842e-11 2.8367672758258825e-05\n", + "Constraint violation....: 1.3824319466948509e-10 3.1432136893272400e-09\n", + "Complementarity.........: 6.5249453183277711e-12 9.1371213367821990e-06\n", + "Overall NLP error.......: 1.3824319466948509e-10 2.8367672758258825e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 52\n", + "Number of objective gradient evaluations = 25\n", + "Number of equality constraint evaluations = 52\n", + "Number of inequality constraint evaluations = 52\n", + "Number of equality constraint Jacobian evaluations = 25\n", + "Number of inequality constraint Jacobian evaluations = 25\n", + "Number of Lagrangian Hessian evaluations = 24\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.020\n", + "Total CPU secs in NLP function evaluations = 0.007\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Optimal solution process results:\n", + "\n", + "\n", + "Extent of reaction: 311.30698549500477\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.8500000099996615\n", + "Reactor duty (MW): -59.340221072991014\n", + "Duty from Reaction (MW)): 28.216865165267233\n", + "Compressor work (MW): 1.2861669211016399e-24\n", + "Turbine work (MW): -2.4913012083840025\n", + "Feed Mixer outlet temperature (C)): 20.05171421375354\n", + "Recycle Mixer outlet temperature (C)): 41.54321437801775\n", + "Feed Compressor outlet temperature (C)): 41.54321437801792\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 231.85000478422364\n", + "Turbine outlet temperature (C)): 141.50037862882152\n", + "Turbine outlet pressure (Pa)): 1487177.2483574792\n", + "Cooler outlet temperature (C)): 52.56999699077659\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 9.999999000026644 %\n", + "Methanol recovery(%): 92.05882105498138\n", + "annualized capital cost ($/year) = 259559.90821288762\n", + "operating cost ($/year) = 525130020.7095608\n", + "sales ($/year) = 140033684437.2827\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 104278839.97850098\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 22.743\n", + " Total Mole Fraction CH4 dimensionless 4.1946e-05\n", + " Total Mole Fraction CO dimensionless 0.24155\n", + " Total Mole Fraction H2 dimensionless 0.64134\n", + " Total Mole Fraction CH3OH dimensionless 0.11706\n", + " Molar Enthalpy joule / mole -47286.\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 308.65\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3792e+05\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n" + ] } - ], - "metadata": { - "celltoolbar": "Tags", - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.12" + ], + "source": [ + "# Set up Optimization Problem (Maximize Revenue)\n", + "# keep process pre-reaction fixed and unfix some post-process specs\n", + "m.fs.R101.conversion.unfix()\n", + "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", + "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", + "m.fs.R101.outlet_temp.deactivate()\n", + "m.fs.R101.outlet_t_lb = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", + ")\n", + "m.fs.R101.outlet_t_ub = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", + ")\n", + "\n", + "# Optimize turbine work (or delta P)\n", + "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", + "m.fs.T101.outlet_p_lb = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", + ")\n", + "m.fs.T101.outlet_p_ub = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", + ")\n", + "\n", + "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", + "m.fs.H102.outlet_temp.deactivate()\n", + "m.fs.H102.outlet_t_lb = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", + " >= 407.15 * 0.8 * pyunits.K\n", + ")\n", + "m.fs.H102.outlet_t_ub = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", + ")\n", + "\n", + "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", + "\n", + "m.fs.F101.isothermal = Constraint(\n", + " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", + " == m.fs.F101.control_volume.properties_in[0].temperature\n", + ")\n", + "\n", + "m.fs.S101.split_fraction[0, \"purge\"].unfix() # allow some gas recycle\n", + "m.fs.S101.split_fraction_lb = Constraint(\n", + " expr=m.fs.S101.split_fraction[0, \"purge\"] >= 0.10\n", + ") # min 10% purge\n", + "m.fs.S101.split_fraction_ub = Constraint(\n", + " expr=m.fs.S101.split_fraction[0, \"purge\"] <= 0.50\n", + ") # max 50% purge\n", + "\n", + "print()\n", + "print(\"Solving optimization problem...\")\n", + "\n", + "# Pass 1: smoothed VLE transition\n", + "eps_nominal = value(m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq)\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "\n", + "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "# Pass 2: restore default smoothness\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "\n", + "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "print(\"Optimal solution process results:\")\n", + "report(m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As expected, recycling methanol and gases from the flash vapor achieves much greater methanol production, and process cost increases are small compared to the increase in revenue. Note that the reaction conversion and flash inlet temperature did not change, and we obtain the same percentage methanol recovery. We can see in the stream tables that far more of the inlet material exits as methanol than in the non-recycle process (note that we do not have a mole balance due to the reaction stoichiometry). The results show a slight increase in equipment and operating costs from increased throughput on each unit." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:19.020892900Z", + "start_time": "2026-02-20T21:01:19.013109200Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:56.616850Z", + "iopub.status.busy": "2026-02-20T21:02:56.616850Z", + "iopub.status.idle": "2026-02-20T21:02:56.621454Z", + "shell.execute_reply": "2026-02-20T21:02:56.621454Z" + }, + "tags": [ + "testing" + ] + }, + "outputs": [], + "source": [ + "# testing model results\n", + "assert value(m.fs.R101.rate_reaction_extent[0, \"R1\"]) == pytest.approx(\n", + " 311.3070, rel=1e-5\n", + ")\n", + "assert value(m.fs.R101.heat_duty[0]) / 1e6 == pytest.approx(-59.3402, rel=1e-5)\n", + "assert value(m.fs.C101.work_mechanical[0]) / 1e6 == pytest.approx(0, abs=1e-5)\n", + "assert value(m.fs.T101.work_isentropic[0]) / 1e6 == pytest.approx(-2.4913, rel=1e-5)\n", + "assert value(m.fs.F101.recovery * 100) == pytest.approx(92.0589, rel=1e-5)\n", + "assert value(m.fs.S101.split_fraction[0, \"purge\"] * 100) == pytest.approx(\n", + " 10.0000, rel=1e-5\n", + ")\n", + "assert value(m.fs.objective) / 1e6 == pytest.approx(104.2789, rel=1e-5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6. Summary\n", + "The present example demonstrates building, initializing and optimizing a methanol synthesis problem in IDAES. The imported scripts implement models from the IDAES pre-defined unit model library, the IDAES Property and Reaction Framework, targeted thermophysical properties for specific unit blocks, Pyomo's Sequential Decomposition methods, the IDAES Costing Framework for capital cost calculations, and integration of custom surrogate expressions for operating cost calculations. The methanol synthesis flowsheet methods may be imported into any external script, and users may build, initialize and optimize the entire model via the `main()` method in each flowsheet." + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:19.024997Z", + "start_time": "2026-02-20T21:01:19.020892900Z" } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "celltoolbar": "Tags", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" }, - "nbformat": 4, - "nbformat_minor": 3 + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.11" + } + }, + "nbformat": 4, + "nbformat_minor": 3 } diff --git a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_usr.ipynb b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_usr.ipynb index 86592750..5dc08bb9 100644 --- a/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_usr.ipynb +++ b/idaes_examples/notebooks/docs/flowsheets/methanol_synthesis_usr.ipynb @@ -1,629 +1,4167 @@ { - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "header", - "hide-cell" - ] - }, - "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", - "# Design of Advanced Energy Systems (IDAES).\n", - "#\n", - "# Copyright (c) 2018-2023 by the software owners: The Regents of the\n", - "# University of California, through Lawrence Berkeley National Laboratory,\n", - "# National Technology & Engineering Solutions of Sandia, LLC, Carnegie Mellon\n", - "# University, West Virginia University Research Corporation, et al.\n", - "# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n", - "# for full copyright and license information.\n", - "###############################################################################" + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:16.618908800Z", + "start_time": "2026-02-20T21:01:16.610747300Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:30.225238Z", + "iopub.status.busy": "2026-02-20T21:02:30.224224Z", + "iopub.status.idle": "2026-02-20T21:02:30.228354Z", + "shell.execute_reply": "2026-02-20T21:02:30.228354Z" + }, + "tags": [ + "header", + "hide-cell" + ] + }, + "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", + "# Design of Advanced Energy Systems (IDAES).\n", + "#\n", + "# Copyright (c) 2018-2023 by the software owners: The Regents of the\n", + "# University of California, through Lawrence Berkeley National Laboratory,\n", + "# National Technology & Engineering Solutions of Sandia, LLC, Carnegie Mellon\n", + "# University, West Virginia University Research Corporation, et al.\n", + "# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md\n", + "# for full copyright and license information.\n", + "###############################################################################" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Methanol Synthesis Flowsheet Example\n", + "Maintainer: Brandon Paul \n", + "Author: Brandon Paul \n", + "Updated: 2023-06-01 \n", + "\n", + "The purpose of this notebook is to demonstrate flowsheet synthesis integrating IDAES modeling tools, including the Unit Model Library, Property and Reaction Framework, IDAES scaling tools and the Process Costing Framework. The example leverages imports from external flowsheet scripts, and demonstrates implementation of separate VLE and vapor-only property packages to reduce model complexity where applicable.\n", + "\n", + "## Simplified Hydrogen Reformation System\n", + "\n", + "This example demonstrates a steady-state model of methanol synthesis from hydrogen and carbon monoxide. To simulate relevant natural gas components, the reactant vapors are mixed stoichiometrically and brought to optimal reaction conditions prior to entering the gas-phase reactor. Vapor liquid equilibrium is mainly applicable in the post-reactor Flash unit for methanol recovery, and is accounted for by separate vapor and VLE thermophysical property packages. See `methanol_flowsheet.py` for more information on how to assemble the flowsheet, as well as [idaes_examples.mod.methanol.methanol_ideal_VLE.py](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_VLE.py), [idaes_examples.mod.methanol.methanol_ideal_vapor](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_vapor.py) and [idaes_examples.mod.methanol.methanol_reactions](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_reactions.py) for more information on the thermophyscial and reaction properties.\n", + "\n", + "This example is a reasonable approximation for gas-phase methanol synthesis systems and does not represent any particular chemical process. To simplify the system and increase tractability, hydrogen and carbon monoxide feeds are considered in lieu of multi-step mechanisms for carbon dioxide conversion to methanol. General process descriptions for gas-phase synthesis, as well as thermophysical and reaction properties for carbon monoxide hydrogenation, were taken from the following publication:\n", + "\n", + "Nieminen, H.; Laari, A.; Koiranen, T. CO2 Hydrogenation to Methanol by a Liquid-Phase Process with Alcoholic Solvents: A Techno-Economic Analysis. Processes 2019, 7, 405. https://doi.org/10.3390/pr7070405" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. Introduction\n", + "\n", + "This example demonstrates a simulation of methanol synthesis from hydrogen and carbon monoxide. Each methanol flowsheet module includes several built-in methods. This notebook demonstrates building the flowsheet, implementing model scaling, initialization and solving a square problem, costing and final constrained optimization.\n", + "\n", + "The ```build_model()``` method creates the Pyomo concrete model and builds the flowsheet by importing thermophysical and reaction properties and unit models and defining stream connections between these units. This method also implements appropriate default scaling on state and property variables.\n", + "\n", + "The ```set_inputs()``` method adds the appropriate initial specifications on the feed streams and unit operations. Specifications upstream of the reactor largely remain fixed throughout the optimization.\n", + "\n", + "The ```scale_flowsheet()``` method implements generic variable, unit model state variable, unit model constraint and Arc equality constraint scaling via IDAES scaling tools. Scaling factors are hard-coded in the flowsheet scripts to adjust for order of magnitude factors in appropriate constraints and simplify numerical solver calculations.\n", + "\n", + "The ```initialize_flowsheet()``` method uses the initial guess to initialize the models sequentially, solving each unit and propagating the results to the outlet stream to converge the next unit more quickly. This occurs just before the flowsheet-level solver call.\n", + "\n", + "The ```add_costing()``` method creates new variables and constraints related to unit model capital cost and operating cost calculations, and defines an objective function for the process economics. This method is called after the flowsheet-level solver call, and the flowsheet is resolved once costing is added. Capital costs are estimated using built-in costing methods within IDAES, and operating costs are estimated from a combination of known cost coefficients and surrogate models.\n", + "\n", + "The ```report()``` method displays relevant model results after the flowsheet has been fully solved." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2. Problem Statement \n", + "\n", + "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", + "\n", + "## 2.1. Main Inputs: \n", + "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", + "- Pre-reactor compressor outlet pressure (Pa)\n", + "- Pre-reactor heater outlet temperature (K)\n", + "\n", + "## 2.2. Main Outputs:\n", + "- Extent of reaction (mol/s)\n", + "- Reactor duty (W)\n", + "- Turbine duty (W)\n", + "- Methanol recovery (%)\n", + "- Annual revenue (USD/year)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:16.638532300Z", + "start_time": "2026-02-20T21:01:16.620391500Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:30.229848Z", + "iopub.status.busy": "2026-02-20T21:02:30.229848Z", + "iopub.status.idle": "2026-02-20T21:02:30.235273Z", + "shell.execute_reply": "2026-02-20T21:02:30.235273Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA48AAACpCAYAAACLdAi5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAC0vSURBVHhe7d2/duI6tMDhnfsYt4YpsuYJ4AlImqnSTgdlaKZLmS4NKcNat5g2VZqBJwhPkJXiwLvkassSCMfGBvwX/76zfAaMbWRLVryRLF99GQIAAAAAwAH/4/4FAAAAACAVwSMAAAAAIBPBIwAAAAAgE8EjAAAAACATwSMAAAAA5LV5luHVlVxtp6E8b9xnR1vKJNzW8FlO3lQFCB4BAAAAdJoGbscZyGz9JfrgivVMZNo/JYDUwPFG5uOF3Y7d1t2rPC3dxw1E8AgAAACg844PICO9+wcZy0pe/5nocTmRq+FEJkNtRYz+HbqocvM83GtZ3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ZH7jurrawXPexTVMGgOpshHyykTRp4XRAAAAANBSeVoUz2l1tLR1sP8qd+sw4CvGcnIlj9drN9BONQgeAQAAAHROJcGj6476eldtkFcWgkcAAAAAnVNN8HhZuOcRAAAAQOdoUKjBYRoCx+8IHgEAAAAAmQgeAQAAAOBCbZ6HcjV8lo17fw6CRwAAAACdlNZ1tdAuq+55jLrNq6uJ2Mcy2nlDefYRXey9jqQaLX8lw+1CxnKynb/32YHt9W7vZLB6lX/BZk5F8AgAAAAApVjKpD+V1Xhhg9Gv9bU8Zj3V3wSIb7/MsmZ5fcbjavq0Czjtcx6jz74WY/NZP3oe5CG9H/JTVvKZ+bDJbASPAAAAADor3vqor4tqddw8P4oJ92TxMopm9O7l3b9OM3oRv8j6cyUyuJa+eb3592pCwLH88quPfpl3Ih//ZTUp9uV6kGe5bASPAAAAAFC5lUz7rguqtk66uSZMlOdhNP9mPpDZ33vRJ0SGgWQkCgpX2ybFtO1FdsudjuARAAAAACpnAsO164K6npl3Xk/u3323VbEBoXZN7UeRouxCwLVE8aQPJ9O2VxyCRwAAAACd5ruu6lRUl1VlB6uRuTyGA9tk3qS40/vx073yr+fy5ldfvpl3A7m71XbJbLsg83QEjwAAAABQBr3H0Q1sE3Un/ZSHjHse7aM1XCB7dWPCw9k6ugdy9GIH0Jnf7D4bL97lPjN2jFoof/7IF2QecmUi6+JCawAAAABooaJbHRtDWzv7r3K3zhNoHkbLIwAAAIDOu9Q2NTtK6+BOcvZuPYiWRwAAAABAJloeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAAJkIHgEAAAAAmQgeAQAAAACZCB4BAAAAABlE/h+1/fUys0mHlQAAAABJRU5ErkJggg==", + "text/plain": [ + "" ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from IPython.display import Image\n", + "\n", + "Image(\"methanol_flowsheet.png\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 3. Import and Solve Flowsheet\n", + "## 3.1 Import Pyomo and IDAES Libraries" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, let's import the relevant Pyomo and IDAES Libraries:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:19.471901300Z", + "start_time": "2026-02-20T21:01:16.639577700Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:30.264498Z", + "iopub.status.busy": "2026-02-20T21:02:30.264498Z", + "iopub.status.idle": "2026-02-20T21:02:32.853029Z", + "shell.execute_reply": "2026-02-20T21:02:32.853029Z" + } + }, + "outputs": [], + "source": [ + "import pytest\n", + "import os\n", + "\n", + "# Import Pyomo libraries\n", + "from pyomo.environ import (\n", + " Constraint,\n", + " Objective,\n", + " Var,\n", + " Expression,\n", + " Param,\n", + " ConcreteModel,\n", + " TransformationFactory,\n", + " value,\n", + " maximize,\n", + " units as pyunits,\n", + ")\n", + "from pyomo.environ import TerminationCondition\n", + "from pyomo.network import Arc\n", + "\n", + "# Import IDAES core libraries\n", + "from idaes.core import FlowsheetBlock\n", + "from idaes.core.solvers import get_solver\n", + "from idaes.core.util import scaling as iscale\n", + "from idaes.core.util.model_statistics import degrees_of_freedom\n", + "from idaes.core.util.initialization import propagate_state\n", + "\n", + "# Import required property modules\n", + "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", + "\n", + "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", + "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", + "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", + "\n", + "from idaes.models.unit_models import (\n", + " Feed,\n", + " Mixer,\n", + " Heater,\n", + " Compressor,\n", + " Turbine,\n", + " StoichiometricReactor,\n", + " Flash,\n", + " Product,\n", + ")\n", + "from idaes.models.unit_models.mixer import MomentumMixingType\n", + "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", + "from idaes.core import UnitModelCostingBlock\n", + "from idaes.models.costing.SSLW import SSLWCosting\n", + "\n", + "# import flowsheet functions\n", + "from methanol_flowsheet import (\n", + " build_model,\n", + " set_inputs,\n", + " scale_flowsheet,\n", + " initialize_flowsheet,\n", + " add_costing,\n", + " report,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3.2 Build and Solve Flowsheet\n", + "The methanol flowsheet methods are called sequentially below, following the workflow contained in the ```main()``` method in `methanol_flowsheet.py`. First, let's set the solver options. IDAES contains a default solver `get_solver` which calls IPOPT using standard settings, and we set an iteration cap of 100 to catch nonconverging solver runs." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:19.487034800Z", + "start_time": "2026-02-20T21:01:19.478574800Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:32.855088Z", + "iopub.status.busy": "2026-02-20T21:02:32.855088Z", + "iopub.status.idle": "2026-02-20T21:02:32.858220Z", + "shell.execute_reply": "2026-02-20T21:02:32.858220Z" + } + }, + "outputs": [], + "source": [ + "# Set solver options\n", + "solver = get_solver() # IPOPT\n", + "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", + "solver.options = optarg" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we will build and solve the initial flowsheet using imported flowsheet methods - see `methanol_flowsheet.py` for complete method scripts.\n", + "\n", + "In the code below, we first define a Pyomo model object and build the model by defining each unit block with relevant property packages. As mentioned earlier, only the Flash unit (and the liquid outlet Product block) employ the VLE property package to ensure fast convergence of vapor-only processes.\n", + "\n", + "The process inputs are set for stoichiometric hydrogen and carbon monoxide feeds according to the process diagram in section 2.2. In the output below, the script returns the expected degrees of freedom for the model for each unit (compressor pressure change, heater duty, reactor duty and conversion, turbine pressure change and efficiency, cooler duty and flash duty and pressure change) and the actual model degrees of freedom before input specification, after the feed inputs are specified (flow, enthalpy, pressure, and composition for each feed) and after the unit model inputs are specified.\n", + "\n", + "After setting process inputs, we have a square problem for initialization. Here, we first implement IDAES scaling tools to create a more tractable problem during the solve step, and then sequentially initialize and propagate results from each unit block. As expected, the model only performs dew and bubble point calculations for the Flash and CH3OH product blocks where liquid phases are present and we obtain a square, solved problem:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:21.865944300Z", + "start_time": "2026-02-20T21:01:19.489272100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:32.860304Z", + "iopub.status.busy": "2026-02-20T21:02:32.859268Z", + "iopub.status.idle": "2026-02-20T21:02:35.178680Z", + "shell.execute_reply": "2026-02-20T21:02:35.178680Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unit degrees of freedom\n", + "M101 0\n", + "C101 1\n", + "H101 1\n", + "R101 2\n", + "T101 2\n", + "H102 1\n", + "F101 2\n", + "Total DOF: 23\n", + "DOF after streams specified: 9\n", + "DOF after units specified: 0\n", + "\n", + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H2.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H2.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H2.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H2: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.CO.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.CO.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.CO.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.CO: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.H2_WGS_state: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.H2_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.CO_WGS_state: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.CO_WGS_state: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.mixed_state: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.mixed_state: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101.mixed_state: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.M101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.C101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.C101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.C101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.C101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.C101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.C101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:33 [INFO] idaes.init.fs.H101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101.control_volume.reactions: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.R101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.control_volume.properties_out: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.properties_isentropic: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.properties_isentropic: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101.properties_isentropic: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.T101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H102.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H102.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H102.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H102.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H102.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.H102: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_in: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_in: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_in: Equilibrium temperature initialization completed.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_in: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_in: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_out: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_out: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_out: Equilibrium temperature initialization completed.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_out: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume.properties_out: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101.control_volume: Initialization Complete\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.F101: Initialization Complete: optimal - Optimal Solution Found\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:34 [INFO] idaes.init.fs.EXHAUST.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.EXHAUST.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.EXHAUST.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.EXHAUST: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH.properties: Starting initialization\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH.properties: Bubble, dew, and critical point initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH.properties: Equilibrium temperature initialization completed.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH.properties: Phase equilibrium initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH.properties: Property initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH.properties: Property package initialization: optimal - Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2026-02-20 14:02:35 [INFO] idaes.init.fs.CH3OH: Initialization Complete.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 955\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 607\n", + "\n", + "Total number of variables............................: 310\n", + " variables with only lower bounds: 35\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 310\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 2.77e+00 -1.0 1.00e-02 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 1.21e+00 -1.0 1.00e-04 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 6.98e-10 1.00e+03 -1.0 9.90e-07 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Constraint violation....: 1.1368683772161603e-13 6.9849193096160889e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 1.1368683772161603e-13 6.9849193096160889e-10\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.003\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "source": [ + "# Build and solve flowsheet\n", + "m = ConcreteModel()\n", + "build_model(m) # build flowsheet by adding unit models and property packages\n", + "set_inputs(m) # unit and stream specifications\n", + "scale_flowsheet(m) # flowsheet and unit model level scaling\n", + "initialize_flowsheet(m) # rigorous initialization scheme\n", + "\n", + "print(\"DOF before solve: \", degrees_of_freedom(m))\n", + "print()\n", + "print(\"Solving initial problem...\")\n", + "\n", + "results = solver.solve(m, tee=True) # initial square problem solve" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3.3 Flowsheet Costing and Optimization\n", + "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs. Additional, we calculate reactor operating costs as a function of conversion and assume constant rates for electricity, heating and cooling costs. Capital costs are annualized over 15 years, and revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, including a check on the reaction stoichiometry, relevant duty and state variable values, economic results, and stream tables for feed and product streams:" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:22.045476800Z", + "start_time": "2026-02-20T21:01:21.869055Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:35.179690Z", + "iopub.status.busy": "2026-02-20T21:02:35.179690Z", + "iopub.status.idle": "2026-02-20T21:02:35.297484Z", + "shell.execute_reply": "2026-02-20T21:02:35.297484Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Solving with costing...\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 971\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 611\n", + "\n", + "Total number of variables............................: 319\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 258\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 319\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 -2.8492051e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9068962e+07 5.76e+04 6.45e+01 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9074767e+07 5.71e+02 9.98e+00 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9074825e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9074825e+07 1.05e-09 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4948186430824137e+01 -2.9074824816033222e+07\n", + "Dual infeasibility......: 3.6708958239217049e-07 2.3745263485255724e-01\n", + "Constraint violation....: 4.5474735088646412e-12 1.0477378964424133e-09\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 2.3745263485255724e-01\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.003\n", + "Total CPU secs in NLP function evaluations = 0.001\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Initial solution process results:" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "Extent of reaction: 237.6004779\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.21917830318435\n", + "Duty from Reaction (MW)): 21.536107316856\n", + "Turbine work (MW): -0.9593346445867499\n", + "Mixer outlet temperature (C)): 20.051714213753257\n", + "Compressor outlet temperature (C)): 20.051714213753257\n", + "Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.8781524424324\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Methanol recovery(%): 60.004430129216836\n", + "annualized capital cost ($/year) = 219790.5044704343\n", + "operating cost ($/year) = 380701687.4964806\n", + "sales ($/year) = 64685201172.198135\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29074824.816033214\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.23\n", + " Total Mole Fraction CH4 dimensionless 2.8373e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.57\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" + ] + } + ], + "source": [ + "add_costing(m) # re-solve with costing equations\n", + "print()\n", + "print(\"Solving with costing...\")\n", + "results2 = solver.solve(m, tee=True)\n", + "\n", + "print(\"Initial solution process results:\")\n", + "report(m) # display initial solution results" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:22.214714100Z", + "start_time": "2026-02-20T21:01:22.048059700Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:35.299499Z", + "iopub.status.busy": "2026-02-20T21:02:35.298494Z", + "iopub.status.idle": "2026-02-20T21:02:35.406313Z", + "shell.execute_reply": "2026-02-20T21:02:35.406313Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 160 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 975\n", + "Number of nonzeros in inequality constraint Jacobian.: 8\n", + "Number of nonzeros in Lagrangian Hessian.............: 613\n", + "\n", + "Total number of variables............................: 322\n", + " variables with only lower bounds: 43\n", + " variables with lower and upper bounds: 259\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 318\n", + "Total number of inequality constraints...............: 8\n", + " inequality constraints with only lower bounds: 4\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 4\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8492012e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8402807e+07 2.72e+04 9.71e+01 -1.0 8.82e+06 - 4.99e-02 2.59e-02h 1\n", + " 2 -2.8406592e+07 2.70e+04 9.55e+01 -1.0 8.56e+06 - 7.51e-02 8.58e-03h 1\n", + " 3 -2.8493711e+07 2.29e+04 3.69e+02 -1.0 8.41e+06 - 1.67e-01 1.52e-01h 1\n", + " 4 -2.8493256e+07 2.28e+04 1.20e+04 -1.0 4.60e+06 - 1.00e-01 2.61e-03h 1\n", + " 5 -2.8504483e+07 2.24e+04 1.20e+04 -1.0 4.52e+06 - 2.44e-02 2.38e-02h 1\n", + " 6 -2.8536508e+07 2.16e+04 2.28e+04 -1.0 4.39e+06 - 5.48e-02 6.86e-02h 1\n", + " 7 -2.8537589e+07 2.16e+04 1.35e+05 -1.0 3.94e+06 - 2.56e-01 2.49e-03h 1\n", + " 8 -2.8537637e+07 2.15e+04 6.77e+06 -1.0 1.30e+06 - 4.68e-01 1.17e-04h 1\n", + " 9 -2.8910081e+07 8.51e+04 2.07e+06 -1.0 1.31e+06 - 4.38e-01 9.05e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -2.8916017e+07 7.81e+04 1.11e+08 -1.0 9.39e+04 -4.0 3.56e-03 8.26e-02h 1\n", + " 11 -2.8916050e+07 7.80e+04 1.11e+08 -1.0 8.73e+04 -4.5 9.12e-02 9.05e-04h 1\n", + " 12 -2.8951501e+07 1.29e+04 3.00e+07 -1.0 8.73e+04 - 1.37e-02 9.90e-01h 1\n", + " 13 -2.8964697e+07 3.52e+03 9.82e+06 -1.0 2.95e+04 - 8.80e-01 9.92e-01h 1\n", + " 14 -2.9150638e+07 4.25e+00 6.53e+07 -1.0 1.59e+04 - 9.88e-01 1.00e+00h 1\n", + " 15 -3.2694771e+07 3.47e+03 1.38e+08 -1.0 3.00e+05 - 3.58e-01 1.00e+00f 1\n", + " 16 -3.9657884e+07 3.74e+02 4.98e+06 -1.0 6.48e+05 - 9.11e-01 1.00e+00F 1\n", + " 17 -5.8700677e+07 2.03e+04 1.12e+06 -1.0 2.00e+06 - 2.65e-01 1.00e+00F 1\n", + " 18 -7.8085174e+07 1.40e+05 4.14e+05 -1.0 4.34e+06 - 7.55e-01 7.57e-01f 1\n", + " 19 -7.9333792e+07 1.60e+05 2.63e+05 -1.0 3.52e+06 - 9.63e-01 3.03e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -7.7164009e+07 3.20e+03 7.59e+03 -1.0 4.56e+05 - 9.91e-01 1.00e+00h 1\n", + " 21 -7.7545831e+07 3.83e+03 5.53e+01 -1.0 2.78e+05 - 1.00e+00 1.00e+00h 1\n", + " 22 -7.7683360e+07 9.76e+02 2.23e+06 -2.5 6.32e+04 - 1.00e+00 7.70e-01h 1\n", + " 23 -7.7696221e+07 8.35e+00 1.48e+02 -2.5 6.87e+04 - 1.00e+00 1.00e+00h 1\n", + " 24 -7.7696183e+07 8.31e-03 4.61e-03 -2.5 2.13e+03 - 1.00e+00 1.00e+00h 1\n", + " 25 -7.7699949e+07 5.36e+00 1.27e+04 -5.7 7.60e+04 - 9.49e-01 9.94e-01f 1\n", + " 26 -7.7700458e+07 8.84e+01 1.03e+03 -5.7 3.66e+05 - 9.25e-01 9.72e-01h 1\n", + " 27 -7.7700530e+07 1.74e+01 1.01e+01 -5.7 6.59e+04 - 1.00e+00 8.03e-01h 1\n", + " 28 -7.7700531e+07 2.07e-04 4.22e-06 -5.7 1.25e+03 - 1.00e+00 1.00e+00h 1\n", + " 29 -7.7700536e+07 9.48e-04 1.29e-01 -8.6 1.69e+03 - 1.00e+00 9.99e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 30 -7.7700536e+07 6.52e-09 5.32e-11 -8.6 1.52e+00 - 1.00e+00 1.00e+00f 1\n", + " 31 -7.7700536e+07 8.38e-09 6.97e-11 -10.9 2.16e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 31\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.2012103932708916e+02 -7.7700535938862860e+07\n", + "Dual infeasibility......: 6.9713197782916848e-11 4.5094122229452131e-05\n", + "Constraint violation....: 9.4587448984384537e-11 8.3819031715393066e-09\n", + "Complementarity.........: 1.4074777632989367e-11 9.1042982264387185e-06\n", + "Overall NLP error.......: 9.4587448984384537e-11 4.5094122229452131e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 34\n", + "Number of objective gradient evaluations = 32\n", + "Number of equality constraint evaluations = 34\n", + "Number of inequality constraint evaluations = 34\n", + "Number of equality constraint Jacobian evaluations = 32\n", + "Number of inequality constraint Jacobian evaluations = 32\n", + "Number of Lagrangian Hessian evaluations = 31\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.027\n", + "Total CPU secs in NLP function evaluations = 0.001\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Optimal solution process results:" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "Extent of reaction: 269.2805447879921\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.8500000099999546\n", + "Reactor duty (MW): -51.363573577545786\n", + "Duty from Reaction (MW)): 24.407588579583603\n", + "Turbine work (MW): -1.9904899177794815\n", + "Mixer outlet temperature (C)): 20.0517142137536\n", + "Compressor outlet temperature (C)): 20.0517142137536\n", + "Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 231.85000468716584\n", + "Turbine outlet temperature (C)): 139.85888172675686\n", + "Turbine outlet pressure (Pa)): 1427653.3547820917\n", + "Cooler outlet temperature (C)): 52.56999709299214\n", + "Flash outlet temperature (C)): 134.0\n", + "Methanol recovery(%): 92.8035547465754\n", + "annualized capital cost ($/year) = 235547.18924473316\n", + "operating cost ($/year) = 451663512.6847629\n", + "sales ($/year) = 113381889876.90082\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 77700535.93886285\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 165.54\n", + " Total Mole Fraction CH4 dimensionless 5.7630e-06\n", + " Total Mole Fraction CO dimensionless 0.28706\n", + " Total Mole Fraction H2 dimensionless 0.59587\n", + " Total Mole Fraction CH3OH dimensionless 0.11706\n", + " Molar Enthalpy joule / mole -52313.\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 249.90\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3792e+05\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n" + ] + } + ], + "source": [ + "# Set up Optimization Problem (Maximize Revenue)\n", + "# keep process pre-reaction fixed and unfix some post-process specs\n", + "m.fs.R101.conversion.unfix()\n", + "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", + "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", + "m.fs.R101.outlet_temp.deactivate()\n", + "m.fs.R101.outlet_t_lb = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", + ")\n", + "m.fs.R101.outlet_t_ub = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", + ")\n", + "\n", + "# Optimize turbine work (or delta P)\n", + "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", + "m.fs.T101.outlet_p_lb = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", + ")\n", + "m.fs.T101.outlet_p_ub = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", + ")\n", + "\n", + "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", + "m.fs.H102.outlet_temp.deactivate()\n", + "m.fs.H102.outlet_t_lb = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", + " >= 407.15 * 0.8 * pyunits.K\n", + ")\n", + "m.fs.H102.outlet_t_ub = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", + ")\n", + "\n", + "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", + "\n", + "m.fs.F101.isothermal = Constraint(\n", + " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", + " == m.fs.F101.control_volume.properties_in[0].temperature\n", + ")\n", + "\n", + "print()\n", + "print(\"Solving optimization problem...\")\n", + "opt_res = solver.solve(m, tee=True)\n", + "\n", + "print(\"Optimal solution process results:\")\n", + "report(m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As expected, the process achieves a much greater revenue as a result of increasing conversion and lowering the inlet temperature to the Flash unit to encourage methanol recovery in the liquid phase. The results show a slight increase in equipment and operating costs from these changes, as well as a small loss of methanol in the exhaust." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4. Problem Statement - Analyzing Benefit of Recycling Flash Vapor\n", + "\n", + "To increase the efficiency of the process as well as overall methanol production and revenue, we can add a recycle stream to send most of the Flash vapor back to the start of the process. This will reduce methanol loss in the exhaust and increase feed utilization, resulting in increased operating costs and increased production (revenue) at the same conversion. Note that for conversions less than 100%, a simulation with no purge will never converge due to accumulation of gases within the system. Therefore, to ensure we close the mass balance we set a lower bound at 10% purge from the Flash vapor to the exhaust. We expect to see a marginal increase in operating costs due to increased flow, and a much larger increase in overall production resulting in a higher total revenue.\n", + "\n", + "By adding a recycle to the flowsheet, we significantly decrease the tractability of the problem and require a better initial guess. The SequentialDecomposition algorithm automatically determines a stream to *tear*, or use to break the solve loop, and iterates from a set of user-supplied initial guesses until converging on the optimal solution. The code below calls an initialization method to automatically determine the tear stream. See the initialization method of `methanol_flowsheet_w_recycle.py` for further details Sequential Decomposition scheme.\n", + "\n", + "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", + "\n", + "## 4.1. Main Inputs: \n", + "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", + "- Pre-reactor compressor outlet pressure (Pa)\n", + "- Pre-reactor heater outlet temperature (K)\n", + "\n", + "## 4.2. Main Outputs:\n", + "- Extent of reaction (mol/s)\n", + "- Reactor duty (W)\n", + "- Compressor duty (W)\n", + "- Turbine duty (W)\n", + "- Methanol recovery (%)\n", + "- Purge percentage (%)\n", + "- Annual revenue (USD/year)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:22.259161200Z", + "start_time": "2026-02-20T21:01:22.214714100Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:35.408476Z", + "iopub.status.busy": "2026-02-20T21:02:35.408476Z", + "iopub.status.idle": "2026-02-20T21:02:35.414016Z", + "shell.execute_reply": "2026-02-20T21:02:35.414016Z" + } + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAABCsAAAEKCAYAAAA7A99lAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAETCSURBVHhe7d09cuJM2+jxy+8uzslOFUzgmhWIFYCTiZxOBqFJJpvQmRMIoeoNJnXkxLACswKXgxv2wumr1Q0NlkACSQjx/z2P7jFCHy21JKRL/XG3NgQAAAAAAKAm/sf9CwAAAAAAUAsEKwAAAAAAQK0QrAAAAAAAALVCsAIAAAAAANQKwQoAAAAAAFArBCsAAAAAAECtEKwAAAAAAOAGzAd3cnfXkfHKjagxghUAAAAAAOQUP/jvDp3OQOZ1DQSsxvI8Nf9Gj/LQikdZq7kMOnH6B3M3bmMl40Fnu41Ht89M75a1M+wsONsyCVYAAAAAAJDLSv77dH8GFoup9Nr1LLmwen+Vhfk3enwQH6tYjTty1+7JVL/4RgMPbRmGX9rtG8i3mEZm2ZdJsAIAAAAAgBP1Z2tZr82wnEk/0jELeX2vX7Ri+WVDFfK4KVaxkvdXk/7RTEZ9Nyo0f5GhjSn0ZbbUbVzKyG7fVN6ORivMP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bAQAAAABwgqJLVdSGluZov8rjMktgAx4lKwAAAAAAF9fU9+i2F5HoUTLWFoFDyQoAAAAAAFArlKwAAAAAAAC1QrACAAAAAADUCsEKAAAAAABQKwQrAAAAAABArRCsAAAAAAAAtUKwAgAAAAAA1ArBCgAAAAAAUCsEKwAAAAAAQK0QrAAAAAAAALVCsAIAAAAAANQKwQoAAAAAAFArBCsAAAAAAECtEKwAAAAAAAA1IvL/AccPhEZ19gnJAAAAAElFTkSuQmCC", + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from IPython.display import Image\n", + "\n", + "Image(\"methanol_flowsheet_recycle.png\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 5. Import and Solve Recycle Flowsheet\n", + "## 5.1 Import Pyomo and IDAES Libraries\n", + "As we are rebuilding the model, we need to import require Pyomo and IDAES libraries:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:22.273109Z", + "start_time": "2026-02-20T21:01:22.260217300Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:35.416309Z", + "iopub.status.busy": "2026-02-20T21:02:35.416309Z", + "iopub.status.idle": "2026-02-20T21:02:35.423025Z", + "shell.execute_reply": "2026-02-20T21:02:35.423025Z" + } + }, + "outputs": [], + "source": [ + "import pytest\n", + "import os\n", + "\n", + "# Import Pyomo libraries\n", + "from pyomo.environ import (\n", + " Constraint,\n", + " Objective,\n", + " Var,\n", + " Expression,\n", + " Param,\n", + " ConcreteModel,\n", + " TransformationFactory,\n", + " value,\n", + " maximize,\n", + " units as pyunits,\n", + ")\n", + "from pyomo.environ import TerminationCondition\n", + "from pyomo.network import Arc, SequentialDecomposition\n", + "\n", + "# Import IDAES core libraries\n", + "from idaes.core import FlowsheetBlock\n", + "from idaes.core.solvers import get_solver\n", + "from idaes.core.util import scaling as iscale\n", + "from idaes.core.util.model_statistics import degrees_of_freedom\n", + "from idaes.core.util.initialization import propagate_state\n", + "\n", + "# Import required models\n", + "\n", + "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", + "\n", + "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", + "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", + "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", + "\n", + "from idaes.models.unit_models import (\n", + " Feed,\n", + " Mixer,\n", + " Heater,\n", + " Compressor,\n", + " Turbine,\n", + " StoichiometricReactor,\n", + " Flash,\n", + " Separator as Splitter,\n", + " Product,\n", + ")\n", + "from idaes.models.unit_models.mixer import MomentumMixingType\n", + "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", + "from idaes.core import UnitModelCostingBlock\n", + "from idaes.models.costing.SSLW import SSLWCosting\n", + "import idaes.logger as idaeslog\n", + "\n", + "# import flowsheet functions\n", + "from methanol_flowsheet_w_recycle import (\n", + " build_model,\n", + " set_inputs,\n", + " scale_flowsheet,\n", + " initialize_flowsheet,\n", + " add_costing,\n", + " report,\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5.2 Build and Solve Recycle Flowsheet\n", + "As before, we will first build the flowsheet, set required inputs, initialize and solve a square problem. Recycling methanol to pre-reactor blocks complicates VLE calculations, and limiting VLE calculations to the Flash unit and liquid Product block greatly increases tractability during initialization. All initial feed and unit specifications are identical to the non-recycle case; the Sequential Decomposition algorithm automatically selects the compressor feed as the tear stream and uses \"no recycle\" results as a first guess. In the output below, the solver solves all units and then resolves select blocks with updated inlet results, followed by a full flowsheet solve:" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:25.017570500Z", + "start_time": "2026-02-20T21:01:22.274110600Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:35.425050Z", + "iopub.status.busy": "2026-02-20T21:02:35.424039Z", + "iopub.status.idle": "2026-02-20T21:02:37.938812Z", + "shell.execute_reply": "2026-02-20T21:02:37.938812Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Unit degrees of freedom\n", + "M101 0\n", + "C101 1\n", + "H101 1\n", + "R101 2\n", + "T101 2\n", + "H102 1\n", + "F101 2\n", + "M102 0\n", + "S101 1\n", + "Total DOF: 24\n", + "DOF after streams specified: 10\n", + "DOF after units specified: 0\n", + "\n", + "Tear Stream:\n", + "fs.s02 : fs.M102.outlet to fs.C101.inlet\n", + "\n", + "Calculation order:\n", + "fs.H2\n", + "fs.M101\n", + "fs.R101\n", + "fs.T101\n", + "fs.H102\n", + "fs.F101\n", + "fs.S101\n", + "fs.EXHAUST\n", + "\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Initial DOF = 0\n", + "Solving fs.H2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.CO\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.C101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Methanol Synthesis Flowsheet Example\n", - "Maintainer: Brandon Paul \n", - "Author: Brandon Paul \n", - "Updated: 2023-06-01 \n", - "\n", - "The purpose of this notebook is to demonstrate flowsheet synthesis integrating IDAES modeling tools, including the Unit Model Library, Property and Reaction Framework, IDAES scaling tools and the Process Costing Framework. The example leverages imports from external flowsheet scripts, and demonstrates implementation of separate VLE and vapor-only property packages to reduce model complexity where applicable.\n", - "\n", - "## Simplified Hydrogen Reformation System\n", - "\n", - "This example demonstrates a steady-state model of methanol synthesis from hydrogen and carbon monoxide. To simulate relevant natural gas components, the reactant vapors are mixed stoichiometrically and brought to optimal reaction conditions prior to entering the gas-phase reactor. Vapor liquid equilibrium is mainly applicable in the post-reactor Flash unit for methanol recovery, and is accounted for by separate vapor and VLE thermophysical property packages. See `methanol_flowsheet.py` for more information on how to assemble the flowsheet, as well as [idaes_examples.mod.methanol.methanol_ideal_VLE.py](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_VLE.py), [idaes_examples.mod.methanol.methanol_ideal_vapor](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_ideal_vapor.py) and [idaes_examples.mod.methanol.methanol_reactions](https://github.com/IDAES/examples-pse/tree/main/pkg/idaes_examples/common/methanol/methanol_reactions.py) for more information on the thermophyscial and reaction properties.\n", - "\n", - "This example is a reasonable approximation for gas-phase methanol synthesis systems and does not represent any particular chemical process. To simplify the system and increase tractability, hydrogen and carbon monoxide feeds are considered in lieu of multi-step mechanisms for carbon dioxide conversion to methanol. General process descriptions for gas-phase synthesis, as well as thermophysical and reaction properties for carbon monoxide hydrogenation, were taken from the following publication:\n", - "\n", - "Nieminen, H.; Laari, A.; Koiranen, T. CO2 Hydrogenation to Methanol by a Liquid-Phase Process with Alcoholic Solvents: A Techno-Economic Analysis. Processes 2019, 7, 405. https://doi.org/10.3390/pr7070405" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.M101\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 1. Introduction\n", - "\n", - "This example demonstrates a simulation of methanol synthesis from hydrogen and carbon monoxide. Each methanol flowsheet module includes several built-in methods. This notebook demonstrates building the flowsheet, implementing model scaling, initialization and solving a square problem, costing and final constrained optimization.\n", - "\n", - "The ```build_model()``` method creates the Pyomo concrete model and builds the flowsheet by importing thermophysical and reaction properties and unit models and defining stream connections between these units. This method also implements appropriate default scaling on state and property variables.\n", - "\n", - "The ```set_inputs()``` method adds the appropriate initial specifications on the feed streams and unit operations. Specifications upstream of the reactor largely remain fixed throughout the optimization.\n", - "\n", - "The ```scale_flowsheet()``` method implements generic variable, unit model state variable, unit model constraint and Arc equality constraint scaling via IDAES scaling tools. Scaling factors are hard-coded in the flowsheet scripts to adjust for order of magnitude factors in appropriate constraints and simplify numerical solver calculations.\n", - "\n", - "The ```initialize_flowsheet()``` method uses the initial guess to initialize the models sequentially, solving each unit and propagating the results to the outlet stream to converge the next unit more quickly. This occurs just before the flowsheet-level solver call.\n", - "\n", - "The ```add_costing()``` method creates new variables and constraints related to unit model capital cost and operating cost calculations, and defines an objective function for the process economics. This method is called after the flowsheet-level solver call, and the flowsheet is resolved once costing is added. Capital costs are estimated using built-in costing methods within IDAES, and operating costs are estimated from a combination of known cost coefficients and surrogate models.\n", - "\n", - "The ```report()``` method displays relevant model results after the flowsheet has been fully solved." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 2. Problem Statement \n", - "\n", - "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", - "\n", - "## 2.1. Main Inputs: \n", - "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", - "- Pre-reactor compressor outlet pressure (Pa)\n", - "- Pre-reactor heater outlet temperature (K)\n", - "\n", - "## 2.2. Main Outputs:\n", - "- Extent of reaction (mol/s)\n", - "- Reactor duty (W)\n", - "- Turbine duty (W)\n", - "- Methanol recovery (%)\n", - "- Annual revenue (USD/year)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "from IPython.display import Image\n", - "\n", - "Image(\"methanol_flowsheet.png\")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 3. Import and Solve Flowsheet\n", - "## 3.1 Import Pyomo and IDAES Libraries" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "First, let's import the relevant Pyomo and IDAES Libraries:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "import pytest\n", - "import os\n", - "\n", - "# Import Pyomo libraries\n", - "from pyomo.environ import (\n", - " Constraint,\n", - " Objective,\n", - " Var,\n", - " Expression,\n", - " Param,\n", - " ConcreteModel,\n", - " TransformationFactory,\n", - " value,\n", - " maximize,\n", - " units as pyunits,\n", - ")\n", - "from pyomo.environ import TerminationCondition\n", - "from pyomo.network import Arc\n", - "\n", - "# Import IDAES core libraries\n", - "from idaes.core import FlowsheetBlock\n", - "from idaes.core.solvers import get_solver\n", - "from idaes.core.util import scaling as iscale\n", - "from idaes.core.util.model_statistics import degrees_of_freedom\n", - "from idaes.core.util.initialization import propagate_state\n", - "\n", - "# Import required property modules\n", - "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", - "\n", - "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", - "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", - "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", - "\n", - "from idaes.models.unit_models import (\n", - " Feed,\n", - " Mixer,\n", - " Heater,\n", - " Compressor,\n", - " Turbine,\n", - " StoichiometricReactor,\n", - " Flash,\n", - " Product,\n", - ")\n", - "from idaes.models.unit_models.mixer import MomentumMixingType\n", - "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", - "from idaes.core import UnitModelCostingBlock\n", - "from idaes.models.costing.SSLW import SSLWCosting\n", - "\n", - "# import flowsheet functions\n", - "from methanol_flowsheet import (\n", - " build_model,\n", - " set_inputs,\n", - " scale_flowsheet,\n", - " initialize_flowsheet,\n", - " add_costing,\n", - " report,\n", - ")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.2 Build and Solve Flowsheet\n", - "The methanol flowsheet methods are called sequentially below, following the workflow contained in the ```main()``` method in `methanol_flowsheet.py`. First, let's set the solver options. IDAES contains a default solver `get_solver` which calls IPOPT using standard settings, and we set an iteration cap of 100 to catch nonconverging solver runs." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "# Set solver options\n", - "solver = get_solver() # IPOPT\n", - "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", - "solver.options = optarg" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Next, we will build and solve the initial flowsheet using imported flowsheet methods - see `methanol_flowsheet.py` for complete method scripts.\n", - "\n", - "In the code below, we first define a Pyomo model object and build the model by defining each unit block with relevant property packages. As mentioned earlier, only the Flash unit (and the liquid outlet Product block) employ the VLE property package to ensure fast convergence of vapor-only processes.\n", - "\n", - "The process inputs are set for stoichiometric hydrogen and carbon monoxide feeds according to the process diagram in section 2.2. In the output below, the script returns the expected degrees of freedom for the model for each unit (compressor pressure change, heater duty, reactor duty and conversion, turbine pressure change and efficiency, cooler duty and flash duty and pressure change) and the actual model degrees of freedom before input specification, after the feed inputs are specified (flow, enthalpy, pressure, and composition for each feed) and after the unit model inputs are specified.\n", - "\n", - "After setting process inputs, we have a square problem for initialization. Here, we first implement IDAES scaling tools to create a more tractable problem during the solve step, and then sequentially initialize and propagate results from each unit block. As expected, the model only performs dew and bubble point calculations for the Flash and CH3OH product blocks where liquid phases are present and we obtain a square, solved problem:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] }, { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Build and solve flowsheet\n", - "m = ConcreteModel()\n", - "build_model(m) # build flowsheet by adding unit models and property packages\n", - "set_inputs(m) # unit and stream specifications\n", - "scale_flowsheet(m) # flowsheet and unit model level scaling\n", - "initialize_flowsheet(m) # rigorous initialization scheme\n", - "\n", - "print(\"DOF before solve: \", degrees_of_freedom(m))\n", - "print()\n", - "print(\"Solving initial problem...\")\n", - "\n", - "results = solver.solve(m, tee=True) # initial square problem solve" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.H101\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.3 Flowsheet Costing and Optimization\n", - "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs. Additional, we calculate reactor operating costs as a function of conversion and assume constant rates for electricity, heating and cooling costs. Capital costs are annualized over 15 years, and revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, including a check on the reaction stoichiometry, relevant duty and state variable values, economic results, and stream tables for feed and product streams:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "add_costing(m) # re-solve with costing equations\n", - "print()\n", - "print(\"Solving with costing...\")\n", - "results2 = solver.solve(m, tee=True)\n", - "\n", - "print(\"Initial solution process results:\")\n", - "report(m) # display initial solution results" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Set up Optimization Problem (Maximize Revenue)\n", - "# keep process pre-reaction fixed and unfix some post-process specs\n", - "m.fs.R101.conversion.unfix()\n", - "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", - "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", - "m.fs.R101.outlet_temp.deactivate()\n", - "m.fs.R101.outlet_t_lb = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", - ")\n", - "m.fs.R101.outlet_t_ub = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", - ")\n", - "\n", - "# Optimize turbine work (or delta P)\n", - "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", - "m.fs.T101.outlet_p_lb = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", - ")\n", - "m.fs.T101.outlet_p_ub = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", - ")\n", - "\n", - "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", - "m.fs.H102.outlet_temp.deactivate()\n", - "m.fs.H102.outlet_t_lb = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", - " >= 407.15 * 0.8 * pyunits.K\n", - ")\n", - "m.fs.H102.outlet_t_ub = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", - ")\n", - "\n", - "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", - "\n", - "m.fs.F101.isothermal = Constraint(\n", - " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", - " == m.fs.F101.control_volume.properties_in[0].temperature\n", - ")\n", - "\n", - "print()\n", - "print(\"Solving optimization problem...\")\n", - "opt_res = solver.solve(m, tee=True)\n", - "\n", - "print(\"Optimal solution process results:\")\n", - "report(m)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As expected, the process achieves a much greater revenue as a result of increasing conversion and lowering the inlet temperature to the Flash unit to encourage methanol recovery in the liquid phase. The results show a slight increase in equipment and operating costs from these changes, as well as a small loss of methanol in the exhaust." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 4. Problem Statement - Analyzing Benefit of Recycling Flash Vapor\n", - "\n", - "To increase the efficiency of the process as well as overall methanol production and revenue, we can add a recycle stream to send most of the Flash vapor back to the start of the process. This will reduce methanol loss in the exhaust and increase feed utilization, resulting in increased operating costs and increased production (revenue) at the same conversion. Note that for conversions less than 100%, a simulation with no purge will never converge due to accumulation of gases within the system. Therefore, to ensure we close the mass balance we set a lower bound at 10% purge from the Flash vapor to the exhaust. We expect to see a marginal increase in operating costs due to increased flow, and a much larger increase in overall production resulting in a higher total revenue.\n", - "\n", - "By adding a recycle to the flowsheet, we significantly decrease the tractability of the problem and require a better initial guess. The SequentialDecomposition algorithm automatically determines a stream to *tear*, or use to break the solve loop, and iterates from a set of user-supplied initial guesses until converging on the optimal solution. The code below calls an initialization method to automatically determine the tear stream. See the initialization method of `methanol_flowsheet_w_recycle.py` for further details Sequential Decomposition scheme.\n", - "\n", - "For given raw material flows and optimal reactor conditions, we will calculate the extent of reaction, relevant process results including reactor duty and turbine duty, methanol recovery, and relevant economic results including annual revenue.\n", - "\n", - "## 4.1. Main Inputs: \n", - "- Raw material inlets (F - mol/s, P - Pa, h - j/mol, x - mole fraction)\n", - "- Pre-reactor compressor outlet pressure (Pa)\n", - "- Pre-reactor heater outlet temperature (K)\n", - "\n", - "## 4.2. Main Outputs:\n", - "- Extent of reaction (mol/s)\n", - "- Reactor duty (W)\n", - "- Compressor duty (W)\n", - "- Turbine duty (W)\n", - "- Methanol recovery (%)\n", - "- Purge percentage (%)\n", - "- Annual revenue (USD/year)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "from IPython.display import Image\n", - "\n", - "Image(\"methanol_flowsheet_recycle.png\")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.R101\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 5. Import and Solve Recycle Flowsheet\n", - "## 5.1 Import Pyomo and IDAES Libraries\n", - "As we are rebuilding the model, we need to import require Pyomo and IDAES libraries:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [], - "source": [ - "import pytest\n", - "import os\n", - "\n", - "# Import Pyomo libraries\n", - "from pyomo.environ import (\n", - " Constraint,\n", - " Objective,\n", - " Var,\n", - " Expression,\n", - " Param,\n", - " ConcreteModel,\n", - " TransformationFactory,\n", - " value,\n", - " maximize,\n", - " units as pyunits,\n", - ")\n", - "from pyomo.environ import TerminationCondition\n", - "from pyomo.network import Arc, SequentialDecomposition\n", - "\n", - "# Import IDAES core libraries\n", - "from idaes.core import FlowsheetBlock\n", - "from idaes.core.solvers import get_solver\n", - "from idaes.core.util import scaling as iscale\n", - "from idaes.core.util.model_statistics import degrees_of_freedom\n", - "from idaes.core.util.initialization import propagate_state\n", - "\n", - "# Import required models\n", - "\n", - "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", - "\n", - "from idaes_examples.mod.methanol import methanol_ideal_VLE as thermo_props_VLE\n", - "from idaes_examples.mod.methanol import methanol_ideal_vapor as thermo_props_vapor\n", - "from idaes_examples.mod.methanol import methanol_reactions as reaction_props\n", - "\n", - "from idaes.models.unit_models import (\n", - " Feed,\n", - " Mixer,\n", - " Heater,\n", - " Compressor,\n", - " Turbine,\n", - " StoichiometricReactor,\n", - " Flash,\n", - " Separator as Splitter,\n", - " Product,\n", - ")\n", - "from idaes.models.unit_models.mixer import MomentumMixingType\n", - "from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption\n", - "from idaes.core import UnitModelCostingBlock\n", - "from idaes.models.costing.SSLW import SSLWCosting\n", - "import idaes.logger as idaeslog\n", - "\n", - "# import flowsheet functions\n", - "from methanol_flowsheet_w_recycle import (\n", - " build_model,\n", - " set_inputs,\n", - " scale_flowsheet,\n", - " initialize_flowsheet,\n", - " add_costing,\n", - " report,\n", - ")" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 5.2 Build and Solve Recycle Flowsheet\n", - "As before, we will first build the flowsheet, set required inputs, initialize and solve a square problem. Recycling methanol to pre-reactor blocks complicates VLE calculations, and limiting VLE calculations to the Flash unit and liquid Product block greatly increases tractability during initialization. All initial feed and unit specifications are identical to the non-recycle case; the Sequential Decomposition algorithm automatically selects the compressor feed as the tear stream and uses \"no recycle\" results as a first guess. In the output below, the solver solves all units and then resolves select blocks with updated inlet results, followed by a full flowsheet solve:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Build and solve flowsheet\n", - "solver = get_solver() # IPOPT\n", - "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", - "solver.options = optarg\n", - "\n", - "m = ConcreteModel() # create a new model so we may reference 'm' below\n", - "build_model(m) # build flowsheet\n", - "set_inputs(m) # unit and stream specifications\n", - "scale_flowsheet(m) # flowsheet and unit model level scaling\n", - "\n", - "# let the solver determine the tear stream\n", - "initialize_flowsheet(m) # rigorous initialization scheme\n", - "\n", - "print(\"DOF before solve: \", degrees_of_freedom(m))\n", - "print()\n", - "print(\"Solving initial problem...\")\n", - "results = solver.solve(m, tee=True)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 5.3 Flowsheet Costing and Optimization\n", - "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs, reactor operating costs and utility costs for heating, cooling and electricity. As before, revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, which are updated for new results with the presence of a recycle stream:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "add_costing(m) # re-solve with costing equations\n", - "print()\n", - "results2 = solver.solve(m, tee=True)\n", - "\n", - "print(\"Initial solution process results:\")\n", - "report(m) # display initial solution results" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 15 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions, including a purge between 10-50% of flash vapor. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] }, { - "cell_type": "code", - "execution_count": 16, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "# Set up Optimization Problem (Maximize Revenue)\n", - "# keep process pre-reaction fixed and unfix some post-process specs\n", - "m.fs.R101.conversion.unfix()\n", - "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", - "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", - "m.fs.R101.outlet_temp.deactivate()\n", - "m.fs.R101.outlet_t_lb = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", - ")\n", - "m.fs.R101.outlet_t_ub = Constraint(\n", - " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", - ")\n", - "\n", - "# Optimize turbine work (or delta P)\n", - "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", - "m.fs.T101.outlet_p_lb = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", - ")\n", - "m.fs.T101.outlet_p_ub = Constraint(\n", - " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", - ")\n", - "\n", - "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", - "m.fs.H102.outlet_temp.deactivate()\n", - "m.fs.H102.outlet_t_lb = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", - " >= 407.15 * 0.8 * pyunits.K\n", - ")\n", - "m.fs.H102.outlet_t_ub = Constraint(\n", - " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", - ")\n", - "\n", - "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", - "\n", - "m.fs.F101.isothermal = Constraint(\n", - " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", - " == m.fs.F101.control_volume.properties_in[0].temperature\n", - ")\n", - "\n", - "m.fs.S101.split_fraction[0, \"purge\"].unfix() # allow some gas recycle\n", - "m.fs.S101.split_fraction_lb = Constraint(\n", - " expr=m.fs.S101.split_fraction[0, \"purge\"] >= 0.10\n", - ") # min 10% purge\n", - "m.fs.S101.split_fraction_ub = Constraint(\n", - " expr=m.fs.S101.split_fraction[0, \"purge\"] <= 0.50\n", - ") # max 50% purge\n", - "\n", - "print()\n", - "print(\"Solving optimization problem...\")\n", - "opt_res = solver.solve(m, tee=True)\n", - "\n", - "print(\"Optimal solution process results:\")\n", - "report(m)" - ] + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.T101\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As expected, recycling methanol and gases from the flash vapor achieves much greater methanol production, and process cost increases are small compared to the increase in revenue. Note that the reaction conversion and flash inlet temperature did not change, and we obtain the same percentage methanol recovery. We can see in the stream tables that far more of the inlet material exits as methanol than in the non-recycle process (note that we do not have a mole balance due to the reaction stoichiometry). The results show a slight increase in equipment and operating costs from increased throughput on each unit." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] }, { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 6. Summary\n", - "The present example demonstrates building, initializing and optimizing a methanol synthesis problem in IDAES. The imported scripts implement models from the IDAES pre-defined unit model library, the IDAES Property and Reaction Framework, targeted thermophysical properties for specific unit blocks, Pyomo's Sequential Decomposition methods, the IDAES Costing Framework for capital cost calculations, and integration of custom surrogate expressions for operating cost calculations. The methanol synthesis flowsheet methods may be imported into any external script, and users may build, initialize and optimize the entire model via the `main()` method in each flowsheet." - ] + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 9\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 23 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.H102\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.F101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 42 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.S101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 12 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.CH3OH\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.EXHAUST\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.M102\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.H2\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.CO\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.M101\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 6 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 14\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 18 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = 0\n", + "Solving fs.EXHAUST\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 4 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n", + "Solving fs.CH3OH\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 16\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 8\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 7 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "DOF = " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 0\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Final DOF = 0\n", + "DOF before solve: 0\n", + "\n", + "Solving initial problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1211\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 768\n", + "\n", + "Total number of variables............................: 397\n", + " variables with only lower bounds: 41\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 397\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 2.79e+04 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 0.0000000e+00 2.79e+02 4.22e+03 -1.0 1.96e+03 - 9.90e-01 9.90e-01h 1\n", + " 2 0.0000000e+00 2.77e+00 3.86e+03 -1.0 2.03e+01 - 9.90e-01 9.90e-01h 1\n", + " 3 0.0000000e+00 7.44e-06 1.01e+03 -1.0 2.01e-01 - 9.90e-01 1.00e+00h 1\n", + "Cannot recompute multipliers for feasibility problem. Error in eq_mult_calculator\n", + "\n", + "Number of Iterations....: 3\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Dual infeasibility......: 1.0099088928127792e+05 1.0099088928127792e+05\n", + "Constraint violation....: 2.4014227693119351e-10 7.4444105848670006e-06\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 2.4014227693119351e-10 1.0099088928127792e+05\n", + "\n", + "\n", + "Number of objective function evaluations = 4\n", + "Number of objective gradient evaluations = 4\n", + "Number of equality constraint evaluations = 4\n", + "Number of inequality constraint evaluations = 0\n", + "Number of equality constraint Jacobian evaluations = 4\n", + "Number of inequality constraint Jacobian evaluations = 0\n", + "Number of Lagrangian Hessian evaluations = 3\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.006\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + } + ], + "source": [ + "# Build and solve flowsheet\n", + "solver = get_solver() # IPOPT\n", + "optarg = {\"tol\": 1e-6, \"max_iter\": 100}\n", + "solver.options = optarg\n", + "\n", + "m = ConcreteModel() # create a new model so we may reference 'm' below\n", + "build_model(m) # build flowsheet\n", + "set_inputs(m) # unit and stream specifications\n", + "scale_flowsheet(m) # flowsheet and unit model level scaling\n", + "\n", + "# let the solver determine the tear stream\n", + "initialize_flowsheet(m) # rigorous initialization scheme\n", + "\n", + "print(\"DOF before solve: \", degrees_of_freedom(m))\n", + "print()\n", + "print(\"Solving initial problem...\")\n", + "results = solver.solve(m, tee=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5.3 Flowsheet Costing and Optimization\n", + "Now that we have a well-initialized and solved flowsheet, we can add process economics and optimize the revenue. We utilize IDAES costing tools to calculate reactor and flash vessel capital cost, and implement surrogate models to account for heat exchanger capital costs, reactor operating costs and utility costs for heating, cooling and electricity. As before, revenue is determined from total liquid methanol sales, operating costs, annualized capital costs and feed raw material costs. The flowsheet report method returns key process results, which are updated for new results with the presence of a recycle stream:" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:25.159753600Z", + "start_time": "2026-02-20T21:01:25.017570500Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:37.940822Z", + "iopub.status.busy": "2026-02-20T21:02:37.940822Z", + "iopub.status.idle": "2026-02-20T21:02:38.068616Z", + "shell.execute_reply": "2026-02-20T21:02:38.068616Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 98\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1227\n", + "Number of nonzeros in inequality constraint Jacobian.: 0\n", + "Number of nonzeros in Lagrangian Hessian.............: 772\n", + "\n", + "Total number of variables............................: 406\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 336\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 406\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 -2.8497869e+07 9.10e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.9074832e+07 5.76e+04 4.22e+03 -1.0 1.20e+05 - 5.03e-02 9.90e-01h 1\n", + " 2 -2.9080637e+07 5.71e+02 3.82e+03 -1.0 5.72e+04 - 9.81e-01 9.90e-01h 1\n", + " 3 -2.9080695e+07 5.22e-05 1.00e+03 -1.0 5.67e+02 - 9.90e-01 1.00e+00h 1\n", + " 4 -2.9080695e+07 9.31e-10 9.90e+04 -1.0 5.22e-05 - 9.90e-01 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 4\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -4.4953175283791907e+01 -2.9080695361147854e+07\n", + "Dual infeasibility......: 2.4946824403693549e-06 1.6138370562967401e+00\n", + "Constraint violation....: 4.5474735088646412e-12 9.3132257461547852e-10\n", + "Complementarity.........: 0.0000000000000000e+00 0.0000000000000000e+00\n", + "Overall NLP error.......: 4.5474735088646412e-12 1.6138370562967401e+00\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.006\n", + "Total CPU secs in NLP function evaluations = 0.000\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Initial solution process results:\n", + "\n", + "\n", + "Extent of reaction: 237.6064180604515\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.75\n", + "Reactor duty (MW): -45.22029794711382\n", + "Duty from Reaction (MW)): 21.536645732999325\n", + "Compressor work (MW): -2.5668711294294714e-15\n", + "Turbine work (MW): -0.959378502391431\n", + "Feed Mixer outlet temperature (C)): 20.051714213753144\n", + "Recycle Mixer outlet temperature (C)): 20.056485612776214\n", + "Feed Compressor outlet temperature (C)): 20.0564856127761\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 234.0\n", + "Turbine outlet temperature (C)): 192.87840947667888\n", + "Turbine outlet pressure (Pa)): 3100000.0\n", + "Cooler outlet temperature (C)): 134.0\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 99.99 %\n", + "Methanol recovery(%): 60.005984934911716\n", + "annualized capital cost ($/year) = 219794.2325658716\n", + "operating cost ($/year) = 380711692.18369955\n", + "sales ($/year) = 64691081725.72807\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 29080695.36114784\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 336.21\n", + " Total Mole Fraction CH4 dimensionless 2.8375e-06\n", + " Total Mole Fraction CO dimensionless 0.23555\n", + " Total Mole Fraction H2 dimensionless 0.48181\n", + " Total Mole Fraction CH3OH dimensionless 0.28263\n", + " Molar Enthalpy joule / mole -80218.\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 142.58\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3813e+05\n", + " Pressure pascal 3.1000e+06\n", + "====================================================================================\n" + ] + } + ], + "source": [ + "add_costing(m) # re-solve with costing equations\n", + "print()\n", + "results2 = solver.solve(m, tee=True)\n", + "\n", + "print(\"Initial solution process results:\")\n", + "report(m) # display initial solution results" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's unfix some specifications and determine an optimal revenue. We set bounds on our decision variables to constrain our objective to physical and economically sensible solutions, including a purge between 10-50% of flash vapor. The pre-reactor section mixes the feeds and brings the reactants to optimal temperature and pressure, and we only unfix downstream unit specifications:" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:25.618074700Z", + "start_time": "2026-02-20T21:01:25.159753600Z" + }, + "execution": { + "iopub.execute_input": "2026-02-20T21:02:38.069628Z", + "iopub.status.busy": "2026-02-20T21:02:38.069628Z", + "iopub.status.idle": "2026-02-20T21:02:38.463172Z", + "shell.execute_reply": "2026-02-20T21:02:38.463172Z" + }, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Solving optimization problem...\n", + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -2.8497829e+07 2.79e+04 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -2.8431127e+07 2.74e+04 9.77e+01 -1.0 8.82e+06 - 4.99e-02 1.94e-02h 1\n", + " 2 -2.8430719e+07 2.74e+04 7.81e+02 -1.0 8.52e+06 - 3.76e-02 1.99e-04h 1\n", + " 3 -2.8524903e+07 2.48e+04 1.61e+05 -1.0 6.46e+06 - 2.49e-04 9.25e-02f 1\n", + " 4 -2.8526723e+07 2.48e+04 1.61e+05 -1.0 5.76e+06 - 5.84e-02 9.84e-04h 1\n", + " 5 -2.8554206e+07 2.48e+04 1.60e+05 -1.0 1.49e+07 - 3.32e-03 8.96e-04h 1\n", + " 6 -2.9123967e+07 2.43e+04 1.52e+05 -1.0 1.49e+07 - 1.23e-01 1.84e-02f 1\n", + " 7 -2.9208690e+07 2.43e+04 1.51e+05 -1.0 9.71e+06 - 2.32e-02 2.78e-03h 1\n", + " 8 -3.0003175e+07 2.36e+04 1.08e+06 -1.0 9.31e+06 - 1.92e-01 2.61e-02h 1\n", + " 9 -3.1468200e+07 2.25e+04 1.09e+06 -1.0 8.71e+06 - 6.69e-02 4.91e-02f 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -3.1583903e+07 2.24e+04 1.14e+07 -1.0 5.51e+06 - 3.91e-01 3.89e-03h 1\n", + " 11 -4.3112078e+07 3.08e+04 5.71e+06 -1.0 5.49e+06 - 1.57e-01 3.86e-01f 1\n", + " 12 -4.3711661e+07 4.53e+04 5.09e+06 -1.0 3.67e+06 - 8.46e-02 2.88e-02h 1\n", + " 13 -4.3718221e+07 4.53e+04 1.94e+06 -1.0 3.57e+06 - 5.81e-01 3.23e-04h 1\n", + " 14 -4.3760623e+07 4.51e+04 4.16e+07 -1.0 3.56e+06 - 4.25e-01 5.93e-03h 1\n", + " 15 -4.4646398e+07 7.99e+04 5.37e+07 -1.0 3.54e+06 - 6.75e-01 1.23e-01h 4\n", + " 16 -6.6613749e+07 4.71e+04 6.18e+06 -1.0 3.14e+06 - 7.83e-01 9.90e-01H 1\n", + " 17 -6.5999969e+07 4.71e+04 3.10e+06 -1.0 2.01e+07 - 3.61e-03 3.25e-03h 5\n", + " 18 -6.5249518e+07 4.72e+04 3.12e+07 -1.0 1.74e+07 - 4.59e-05 4.34e-03h 5\n", + " 19 -6.4064695e+07 2.26e+03 9.68e+06 -1.0 8.00e+04 - 3.33e-04 9.87e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -6.4051103e+07 1.77e+03 8.53e+03 -1.0 2.66e+03 - 9.89e-01 1.00e+00h 1\n", + " 21 -6.5080976e+07 1.26e+03 4.14e+05 -1.0 1.04e+05 - 9.50e-01 9.92e-01f 1\n", + " 22 -7.5335243e+07 1.38e+05 3.86e+06 -1.0 1.20e+06 - 2.39e-01 1.00e+00f 1\n", + " 23 -7.4658996e+07 9.99e+04 2.12e+06 -1.0 1.07e+05 -4.0 9.90e-01 2.78e-01h 1\n", + " 24 -7.4649764e+07 9.94e+04 2.08e+06 -1.0 7.73e+04 -4.5 5.39e-01 5.23e-03h 1\n", + " 25 -7.4613845e+07 9.73e+04 2.01e+06 -1.0 7.23e+04 -5.0 1.00e+00 2.08e-02h 1\n", + " 26 -7.4421363e+07 8.62e+04 1.78e+06 -1.0 7.09e+04 -5.4 5.88e-01 1.14e-01h 1\n", + " 27 -7.4390154e+07 8.46e+04 1.75e+06 -1.0 7.84e+04 -5.9 1.21e-02 1.83e-02h 1\n", + " 28 -7.2740081e+07 3.01e+02 1.73e+06 -1.0 1.09e+05 -6.4 1.05e-04 1.00e+00h 1\n", + " 29 -7.2726278e+07 1.44e-01 6.68e+02 -1.0 5.95e+02 -6.9 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", + " 30 -7.2726419e+07 7.97e-05 2.12e+01 -1.7 1.63e+02 -7.3 1.00e+00 1.00e+00f 1\n", + " 31 -8.6665745e+07 8.89e+03 9.70e+05 -2.5 5.14e+06 - 2.89e-02 5.94e-01f 1\n", + " 32 -8.6649468e+07 8.59e+03 6.03e+05 -2.5 1.66e+04 -7.8 9.58e-01 3.35e-02h 1\n", + " 33 -8.6148813e+07 1.45e+01 6.46e+04 -2.5 2.26e+04 -8.3 8.44e-02 1.00e+00h 1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 34 -8.6163785e+07 4.53e-03 1.68e+00 -2.5 3.37e+03 -8.8 1.00e+00 1.00e+00h 1\n", + " 35 -8.6204319e+07 4.58e-02 7.40e-02 -2.5 1.03e+04 -9.2 1.00e+00 1.00e+00f 1\n", + " 36 -8.6333114e+07 3.92e-01 1.69e+02 -3.8 3.04e+04 -9.7 1.00e+00 1.00e+00f 1\n", + " 37 -8.6713987e+07 3.42e+00 4.46e-01 -3.8 9.15e+04 -10.2 1.00e+00 1.00e+00f 1\n", + " 38 -8.7245785e+07 7.78e+00 1.64e+00 -3.8 2.74e+05 -10.7 1.00e+00 4.68e-01f 1\n", + " 39 -9.0563354e+07 2.18e+02 6.58e+00 -3.8 8.00e+05 -11.2 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", + " 40 -9.9476688e+07 6.32e+02 4.50e+01 -3.8 2.39e+06 -11.6 1.00e+00 9.22e-01f 1\n", + " 41 -9.9478624e+07 6.32e+02 4.50e+01 -3.8 5.59e+06 -12.1 1.12e-01 8.94e-05h 1\n", + " 42 -1.0299591e+08 3.80e+04 1.01e+02 -3.8 7.08e+06 -12.6 4.04e-01 1.44e-01f 1\n", + " 43 -1.0299655e+08 3.80e+04 1.08e+02 -3.8 1.39e+06 - 6.91e-01 2.06e-04h 1\n", + " 44 -1.0436244e+08 3.39e+05 1.55e+01 -3.8 2.01e+06 - 1.00e+00 1.00e+00h 1\n", + " 45 -1.0441522e+08 3.19e+05 1.27e+02 -3.8 4.87e+06 - 9.54e-01 8.06e-02h 1\n", + " 46 -1.0438806e+08 2.70e+05 9.30e+01 -3.8 1.25e+07 - 2.30e-01 1.54e-01h 1\n", + " 47 -1.0435495e+08 2.01e+05 1.05e+01 -3.8 9.64e+05 - 8.19e-01 2.54e-01h 1\n", + " 48 -1.0426618e+08 2.01e+03 2.19e+01 -3.8 1.81e+06 - 1.20e-01 1.00e+00h 1\n", + " 49 -1.0426992e+08 2.91e+02 3.40e-01 -3.8 6.45e+04 -13.1 1.00e+00 9.64e-01h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 50 -1.0427006e+08 2.52e+02 4.03e+02 -3.8 6.80e+06 - 5.54e-03 2.57e-01h 1\n", + " 51 -1.0427055e+08 2.92e+02 3.97e+02 -3.8 3.24e+06 - 1.33e-01 1.97e-02h 1\n", + " 52 -1.0427008e+08 1.05e+02 1.15e+05 -3.8 2.71e+04 - 7.76e-04 1.00e+00f 1\n", + " 53 -1.0427044e+08 9.41e+01 7.74e+04 -3.8 4.75e+04 -12.6 1.00e+00 3.26e-01h 2\n", + " 54 -1.0427081e+08 9.98e+01 6.24e+04 -3.8 8.03e+04 -13.1 1.00e+00 1.91e-01h 2\n", + " 55 -1.0427080e+08 8.21e-01 1.24e+00 -3.8 7.52e+04 - 1.00e+00 1.00e+00h 1\n", + " 56 -1.0427114e+08 2.09e+01 2.34e+02 -3.8 3.16e+04 -12.7 1.00e+00 4.65e-01h 2\n", + " 57 -1.0427107e+08 4.98e-01 5.37e+00 -3.8 1.61e+04 - 1.00e+00 1.00e+00h 1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 58 -1.0427121e+08 3.58e+00 1.04e+03 -3.8 1.22e+04 -12.3 1.00e+00 4.79e-01h 2\n", + " 59 -1.0427120e+08 8.56e-03 3.90e+00 -3.8 1.47e+03 - 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", + " 60 -1.0427265e+08 3.69e+02 2.06e+03 -3.8 6.13e+04 -12.7 1.00e+00 1.00e+00f 1\n", + " 61 -1.0427267e+08 8.82e-03 8.41e-01 -3.8 2.14e+04 - 1.00e+00 1.00e+00h 1\n", + " 62 -1.0427488e+08 8.81e+02 4.71e+03 -3.8 9.30e+04 -13.2 9.57e-01 1.00e+00h 1\n", + " 63 -1.0427489e+08 1.12e-02 8.43e+03 -3.8 2.41e+04 - 4.26e-01 1.00e+00h 1\n", + " 64 -1.0427588e+08 1.77e+02 2.25e+02 -3.8 4.16e+04 -12.8 1.00e+00 1.00e+00h 1\n", + " 65 -1.0427569e+08 7.17e+00 2.18e+02 -3.8 9.45e+03 - 8.56e-01 1.00e+00h 1\n", + " 66 -1.0427569e+08 3.81e-04 1.34e+03 -3.8 7.69e+02 - 3.56e-01 1.00e+00h 1\n", + " 67 -1.0427568e+08 5.99e-04 1.01e+02 -3.8 7.28e+01 - 6.32e-01 1.00e+00h 1\n", + " 68 -1.0427568e+08 5.44e-04 1.32e+02 -3.8 6.86e+01 - 5.69e-01 1.00e+00h 1\n", + " 69 -1.0427569e+08 3.30e-03 2.05e+01 -3.8 2.50e+02 - 6.00e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 70 -1.0427569e+08 1.33e-05 2.19e+01 -3.8 2.05e+02 - 5.83e-01 1.00e+00h 1\n", + " 71 -1.0427569e+08 1.09e-03 3.63e+00 -3.8 5.68e+02 - 5.94e-01 1.00e+00f 1\n", + " 72 -1.0427569e+08 6.75e-04 3.84e+00 -3.8 1.21e+03 - 5.81e-01 1.00e+00h 1\n", + " 73 -1.0427569e+08 6.52e-03 6.49e-01 -3.8 3.03e+03 - 5.80e-01 1.00e+00h 1\n", + " 74 -1.0427570e+08 3.77e-02 6.80e-01 -3.8 7.51e+03 - 5.69e-01 1.00e+00h 1\n", + " 75 -1.0427573e+08 2.57e-01 1.17e-01 -3.8 1.96e+04 - 5.45e-01 1.00e+00h 1\n", + " 76 -1.0427580e+08 2.17e+00 1.46e-01 -3.8 5.66e+04 - 4.91e-01 1.00e+00h 1\n", + " 77 -1.0427608e+08 3.10e+01 6.00e-02 -3.8 2.13e+05 - 3.77e-01 1.00e+00h 1\n", + " 78 -1.0427817e+08 1.76e+03 5.49e-01 -3.8 1.56e+06 - 1.85e-01 1.00e+00h 1\n", + " 79 -1.0427835e+08 1.67e+03 6.12e-01 -3.8 1.75e+06 - 9.50e-01 6.05e-02h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 80 -1.0427838e+08 3.76e-01 2.22e-04 -3.8 9.99e+04 - 1.00e+00 1.00e+00h 1\n", + " 81 -1.0427881e+08 2.24e+00 1.80e+02 -5.7 8.49e+04 - 9.88e-01 1.00e+00h 1\n", + " 82 -1.0427883e+08 9.31e-02 1.16e-03 -5.7 1.69e+04 - 1.00e+00 9.65e-01h 1\n", + " 83 -1.0427883e+08 1.60e-05 1.37e-08 -5.7 9.08e+02 - 1.00e+00 1.00e+00f 1\n", + " 84 -1.0427884e+08 5.70e-04 5.09e-06 -8.6 1.48e+03 - 1.00e+00 1.00e+00h 1\n", + " 85 -1.0427884e+08 5.59e-09 2.35e-13 -8.6 7.18e-01 - 1.00e+00 1.00e+00h 1\n", + " 86 -1.0427884e+08 2.79e-09 9.30e-12 -10.9 1.99e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 86\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -1.6119507851267775e+02 -1.0427883997848792e+08\n", + "Dual infeasibility......: 9.2995983076271742e-12 6.0160107413515216e-06\n", + "Constraint violation....: 1.0913936421275139e-10 2.7939677238464355e-09\n", + "Complementarity.........: 1.4067955341342552e-11 9.1007124870068398e-06\n", + "Overall NLP error.......: 1.0913936421275139e-10 9.1007124870068398e-06\n", + "\n", + "\n", + "Number of objective function evaluations = 118\n", + "Number of objective gradient evaluations = 87\n", + "Number of equality constraint evaluations = 118\n", + "Number of inequality constraint evaluations = 118\n", + "Number of equality constraint Jacobian evaluations = 87\n", + "Number of inequality constraint Jacobian evaluations = 87\n", + "Number of Lagrangian Hessian evaluations = 86\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.092\n", + "Total CPU secs in NLP function evaluations = 0.014\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 96\n", + "component keys that are not exported as part of the NL file. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "WARNING: model contains export suffix 'scaling_factor' that contains 190 keys\n", + "that are not Var, Constraint, Objective, or the model. Skipping.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ipopt 3.13.2: tol=1e-06\n", + "max_iter=100\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\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 ma27.\n", + "\n", + "Number of nonzeros in equality constraint Jacobian...: 1236\n", + "Number of nonzeros in inequality constraint Jacobian.: 10\n", + "Number of nonzeros in Lagrangian Hessian.............: 779\n", + "\n", + "Total number of variables............................: 410\n", + " variables with only lower bounds: 49\n", + " variables with lower and upper bounds: 337\n", + " variables with only upper bounds: 1\n", + "Total number of equality constraints.................: 405\n", + "Total number of inequality constraints...............: 10\n", + " inequality constraints with only lower bounds: 5\n", + " inequality constraints with lower and upper bounds: 0\n", + " inequality constraints with only upper bounds: 5\n", + "\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 0 -1.0301714e+08 2.98e+05 1.00e+02 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", + " 1 -1.0365412e+08 1.32e+05 4.21e+01 -1.0 8.57e+04 - 8.59e-01 5.52e-01h 1\n", + " 2 -1.0410108e+08 5.26e+04 7.56e+03 -1.0 5.09e+04 - 9.61e-01 5.97e-01h 1\n", + " 3 -1.0413437e+08 2.06e+04 2.27e+02 -1.0 2.41e+04 - 9.37e-01 6.07e-01h 1\n", + " 4 -1.0424131e+08 1.93e+02 5.00e+03 -1.0 1.94e+05 - 9.87e-01 9.90e-01h 1\n", + " 5 -1.0420077e+08 9.43e+00 3.43e+03 -1.0 1.40e+05 - 9.11e-01 9.91e-01h 1\n", + " 6 -1.0416592e+08 2.19e+01 9.98e+05 -1.0 7.17e+05 - 7.26e-01 1.56e-02f 7\n", + " 7 -1.0366377e+08 9.17e+01 5.74e+05 -1.0 4.94e+05 - 5.51e-01 1.00e+00H 1\n", + " 8 -1.0363147e+08 9.84e+01 7.49e+06 -1.0 9.50e+05 - 9.90e-01 1.56e-02f 7\n", + " 9 -1.0252180e+08 7.86e+02 3.75e+04 -1.0 1.53e+06 - 7.68e-01 1.00e+00F 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 10 -1.0190033e+08 6.00e+00 1.87e+03 -1.0 2.37e+05 - 1.00e+00 1.00e+00H 1\n", + " 11 -1.0201665e+08 1.13e+01 8.51e+01 -1.0 1.34e+05 - 1.00e+00 1.00e+00H 1\n", + " 12 -1.0416792e+08 1.89e+04 2.50e+06 -2.5 1.28e+06 - 3.10e-01 5.67e-01f 1\n", + " 13 -1.0432990e+08 7.37e+04 1.94e+05 -2.5 1.61e+06 - 8.21e-01 6.69e-01h 1\n", + " 14 -1.0425973e+08 1.27e+02 1.47e+03 -2.5 4.32e+04 - 1.00e+00 1.00e+00h 1\n", + " 15 -1.0426575e+08 1.07e+01 1.87e-01 -2.5 5.16e+04 - 1.00e+00 1.00e+00h 1\n", + " 16 -1.0427763e+08 2.48e+01 2.62e+01 -3.8 6.19e+04 - 1.00e+00 1.00e+00h 1\n", + " 17 -1.0427797e+08 9.99e+01 2.44e-03 -3.8 3.85e+05 - 1.00e+00 1.00e+00h 1\n", + " 18 -1.0427790e+08 1.94e+00 1.79e-05 -3.8 5.18e+04 - 1.00e+00 1.00e+00h 1\n", + " 19 -1.0427873e+08 8.25e+00 5.26e+02 -5.7 1.32e+05 - 9.65e-01 1.00e+00h 1\n", + "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", + " 20 -1.0427883e+08 1.02e+00 6.20e-03 -5.7 6.34e+04 - 1.00e+00 9.13e-01h 1\n", + " 21 -1.0427883e+08 2.22e-03 7.11e-08 -5.7 2.00e+03 - 1.00e+00 1.00e+00f 1\n", + " 22 -1.0427884e+08 2.66e-03 1.10e-05 -8.6 3.26e+03 - 1.00e+00 1.00e+00h 1\n", + " 23 -1.0427884e+08 1.16e-08 1.82e-13 -8.6 4.36e+00 - 1.00e+00 1.00e+00h 1\n", + " 24 -1.0427884e+08 3.14e-09 2.03e-11 -11.2 4.33e+00 - 1.00e+00 1.00e+00h 1\n", + "\n", + "Number of Iterations....: 24\n", + "\n", + " (scaled) (unscaled)\n", + "Objective...............: -7.4466968713582915e+01 -1.0427883997850099e+08\n", + "Dual infeasibility......: 2.0257749320973842e-11 2.8367672758258825e-05\n", + "Constraint violation....: 1.3824319466948509e-10 3.1432136893272400e-09\n", + "Complementarity.........: 6.5249453183277711e-12 9.1371213367821990e-06\n", + "Overall NLP error.......: 1.3824319466948509e-10 2.8367672758258825e-05\n", + "\n", + "\n", + "Number of objective function evaluations = 52\n", + "Number of objective gradient evaluations = 25\n", + "Number of equality constraint evaluations = 52\n", + "Number of inequality constraint evaluations = 52\n", + "Number of equality constraint Jacobian evaluations = 25\n", + "Number of inequality constraint Jacobian evaluations = 25\n", + "Number of Lagrangian Hessian evaluations = 24\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.027\n", + "Total CPU secs in NLP function evaluations = 0.002\n", + "\n", + "EXIT: Optimal Solution Found.\n" + ] }, { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "name": "stdout", + "output_type": "stream", + "text": [ + "Optimal solution process results:\n", + "\n", + "\n", + "Extent of reaction: 311.30698549500477\n", + "Stoichiometry of each component normalized by the extent:\n", + "CH4 : 0.0\n", + "H2 : -2.0\n", + "CH3OH : 1.0\n", + "CO : -1.0\n", + "These coefficients should follow 1*CO + 2*H2 => 1*CH3OH\n", + "\n", + "Reaction conversion: 0.8500000099996615\n", + "Reactor duty (MW): -59.340221072991014\n", + "Duty from Reaction (MW)): 28.216865165267233\n", + "Compressor work (MW): 1.2861669211016399e-24\n", + "Turbine work (MW): -2.4913012083840025\n", + "Feed Mixer outlet temperature (C)): 20.05171421375354\n", + "Recycle Mixer outlet temperature (C)): 41.54321437801775\n", + "Feed Compressor outlet temperature (C)): 41.54321437801792\n", + "Feed Compressor outlet pressure (Pa)): 5100000.0\n", + "Heater outlet temperature (C)): 215.0\n", + "Reactor outlet temperature (C)): 231.85000478422364\n", + "Turbine outlet temperature (C)): 141.50037862882152\n", + "Turbine outlet pressure (Pa)): 1487177.2483574792\n", + "Cooler outlet temperature (C)): 52.56999699077659\n", + "Flash outlet temperature (C)): 134.0\n", + "Purge percentage (amount of vapor vented to exhaust): 9.999999000026644 %\n", + "Methanol recovery(%): 92.05882105498138\n", + "annualized capital cost ($/year) = 259559.90821288762\n", + "operating cost ($/year) = 525130020.7095608\n", + "sales ($/year) = 140033684437.2827\n", + "raw materials cost ($/year) = 35229454878.16397\n", + "revenue (1000$/year)= 104278839.97850098\n", + "\n", + "\n", + "====================================================================================\n", + "Unit : fs.H2 Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 637.20\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000e-06\n", + " Total Mole Fraction H2 dimensionless 1.0000\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -142.40\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CO Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Outlet \n", + " Total Molar Flowrate mole / second 316.80\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-06\n", + " Total Mole Fraction CO dimensionless 1.0000\n", + " Total Mole Fraction H2 dimensionless 1.0000e-06\n", + " Total Mole Fraction CH3OH dimensionless 1.0000e-06\n", + " Molar Enthalpy joule / mole -1.1068e+05\n", + " Pressure pascal 3.0000e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.EXHAUST Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 22.743\n", + " Total Mole Fraction CH4 dimensionless 4.1946e-05\n", + " Total Mole Fraction CO dimensionless 0.24155\n", + " Total Mole Fraction H2 dimensionless 0.64134\n", + " Total Mole Fraction CH3OH dimensionless 0.11706\n", + " Molar Enthalpy joule / mole -47286.\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n", + "\n", + "====================================================================================\n", + "Unit : fs.CH3OH Time: 0.0\n", + "------------------------------------------------------------------------------------\n", + " Stream Table\n", + " Units Inlet \n", + " Total Molar Flowrate mole / second 308.65\n", + " Total Mole Fraction CH4 dimensionless 1.0000e-08\n", + " Total Mole Fraction CO dimensionless 1.0000e-08\n", + " Total Mole Fraction H2 dimensionless 1.0000e-08\n", + " Total Mole Fraction CH3OH dimensionless 1.0000\n", + " Molar Enthalpy joule / mole -2.3792e+05\n", + " Pressure pascal 7.4845e+06\n", + "====================================================================================\n" + ] } - ], - "metadata": { - "celltoolbar": "Tags", - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.12" + ], + "source": [ + "# Set up Optimization Problem (Maximize Revenue)\n", + "# keep process pre-reaction fixed and unfix some post-process specs\n", + "m.fs.R101.conversion.unfix()\n", + "m.fs.R101.conversion_lb = Constraint(expr=m.fs.R101.conversion >= 0.75)\n", + "m.fs.R101.conversion_ub = Constraint(expr=m.fs.R101.conversion <= 0.85)\n", + "m.fs.R101.outlet_temp.deactivate()\n", + "m.fs.R101.outlet_t_lb = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature >= 405 * pyunits.K\n", + ")\n", + "m.fs.R101.outlet_t_ub = Constraint(\n", + " expr=m.fs.R101.control_volume.properties_out[0.0].temperature <= 505 * pyunits.K\n", + ")\n", + "\n", + "# Optimize turbine work (or delta P)\n", + "m.fs.T101.deltaP.unfix() # optimize turbine work recovery/pressure drop\n", + "m.fs.T101.outlet_p_lb = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] >= 10e5 * pyunits.Pa\n", + ")\n", + "m.fs.T101.outlet_p_ub = Constraint(\n", + " expr=m.fs.T101.outlet.pressure[0] <= 51e5 * 0.8 * pyunits.Pa\n", + ")\n", + "\n", + "# Optimize Cooler outlet temperature - unfix cooler outlet temperature\n", + "m.fs.H102.outlet_temp.deactivate()\n", + "m.fs.H102.outlet_t_lb = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature\n", + " >= 407.15 * 0.8 * pyunits.K\n", + ")\n", + "m.fs.H102.outlet_t_ub = Constraint(\n", + " expr=m.fs.H102.control_volume.properties_out[0.0].temperature <= 480 * pyunits.K\n", + ")\n", + "\n", + "m.fs.F101.deltaP.unfix() # allow pressure change in streams\n", + "\n", + "m.fs.F101.isothermal = Constraint(\n", + " expr=m.fs.F101.control_volume.properties_out[0].temperature\n", + " == m.fs.F101.control_volume.properties_in[0].temperature\n", + ")\n", + "\n", + "m.fs.S101.split_fraction[0, \"purge\"].unfix() # allow some gas recycle\n", + "m.fs.S101.split_fraction_lb = Constraint(\n", + " expr=m.fs.S101.split_fraction[0, \"purge\"] >= 0.10\n", + ") # min 10% purge\n", + "m.fs.S101.split_fraction_ub = Constraint(\n", + " expr=m.fs.S101.split_fraction[0, \"purge\"] <= 0.50\n", + ") # max 50% purge\n", + "\n", + "print()\n", + "print(\"Solving optimization problem...\")\n", + "\n", + "# Pass 1: smoothed VLE transition\n", + "eps_nominal = value(m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq)\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal * 2.5)\n", + "\n", + "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "# Pass 2: restore default smoothness\n", + "m.fs.F101.control_volume.properties_in[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "m.fs.F101.control_volume.properties_out[0.0].eps_2_Vap_Liq.set_value(eps_nominal)\n", + "\n", + "opt_res = solver.solve(m, tee=True)\n", + "assert opt_res.solver.termination_condition == TerminationCondition.optimal\n", + "\n", + "print(\"Optimal solution process results:\")\n", + "report(m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As expected, recycling methanol and gases from the flash vapor achieves much greater methanol production, and process cost increases are small compared to the increase in revenue. Note that the reaction conversion and flash inlet temperature did not change, and we obtain the same percentage methanol recovery. We can see in the stream tables that far more of the inlet material exits as methanol than in the non-recycle process (note that we do not have a mole balance due to the reaction stoichiometry). The results show a slight increase in equipment and operating costs from increased throughput on each unit." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 6. Summary\n", + "The present example demonstrates building, initializing and optimizing a methanol synthesis problem in IDAES. The imported scripts implement models from the IDAES pre-defined unit model library, the IDAES Property and Reaction Framework, targeted thermophysical properties for specific unit blocks, Pyomo's Sequential Decomposition methods, the IDAES Costing Framework for capital cost calculations, and integration of custom surrogate expressions for operating cost calculations. The methanol synthesis flowsheet methods may be imported into any external script, and users may build, initialize and optimize the entire model via the `main()` method in each flowsheet." + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "ExecuteTime": { + "end_time": "2026-02-20T21:01:25.622948300Z", + "start_time": "2026-02-20T21:01:25.619116Z" } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "celltoolbar": "Tags", + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" }, - "nbformat": 4, - "nbformat_minor": 3 + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.11" + } + }, + "nbformat": 4, + "nbformat_minor": 3 }