diff --git a/idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb b/idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb index e016f2f6..38ae3a06 100644 --- a/idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb +++ b/idaes_examples/notebooks/docs/diagnostics/structural_singularity.ipynb @@ -43,11 +43,11 @@ "jp-MarkdownHeadingCollapsed": true }, "source": [ - "## Construct our model\n", + "# Constructing the model\n", "\n", "Suppose a collaborator has given us a model to work with. They give us a square model and tell us what the degrees of freedom are. We construct an optimization problem and try to solve it. In this tutorial, we don't want to worry too much about the details that go into constructing the model. This has been provided in the `idaes_examples.mod.diagnostics.gas_solid_contactors.model` module.\n", "\n", - "### Model details (OKAY TO SKIP)\n", + "## Model details (OKAY TO SKIP)\n", "\n", "The model we are trying to optimize is a dynamic model of a moving bed chemical looping combustion reactor. The model has been described by [Okoli et al.][1] and [Parker and Biegler][2]. This is a gas-solid reactor with counter-current flow. The degrees of freedom are gas and solid inlet flow rates, and we are trying to minimize the deviation from a desired operating point via a least-squares objective function.\n", "\n", @@ -352,7 +352,7 @@ "\n", "But this equation isn't here... so we need to add it.\n", "\n", - "## Fixing the model\n", + "# Fixing the model\n", "\n", "We'll start by creating a fresh copy of the model, so we don't accidentally rely on IPOPT's point of termination." ] @@ -681,7 +681,7 @@ "source": [ "It worked! For the simple optimization problem we have set up, this solve looks a lot more like what we expect.\n", "\n", - "## Takeaways from this tutorial\n", + "# Takeaways from this tutorial\n", "What have we learned?\n", "1. IPOPT using non-zero regularization coefficients hints at a singular Jacobian (especially when \"L\"/\"l\" diagnostic tags are present).\n", "2. When this happens, start by calling `report_structural_issues` to check for a structural singularity. If this looks good, call `report_numerical_issues` to check for a numerical singularity.\n", @@ -715,6 +715,14 @@ "[4]: https://dl.acm.org/doi/10.1145/98267.98287\n", "[5]: https://www.sciencedirect.com/science/article/pii/S0098135423002533\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f2d2592a-f740-4659-a0c0-787b70648b1c", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb b/idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb index 580db65c..59a0fa43 100644 --- a/idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb +++ b/idaes_examples/notebooks/docs/diagnostics/structural_singularity_doc.ipynb @@ -40,11 +40,11 @@ "jp-MarkdownHeadingCollapsed": true }, "source": [ - "## Construct our model\n", + "# Constructing the model\n", "\n", "Suppose a collaborator has given us a model to work with. They give us a square model and tell us what the degrees of freedom are. We construct an optimization problem and try to solve it. In this tutorial, we don't want to worry too much about the details that go into constructing the model. This has been provided in the `idaes_examples.mod.diagnostics.gas_solid_contactors.model` module.\n", "\n", - "### Model details (OKAY TO SKIP)\n", + "## Model details (OKAY TO SKIP)\n", "\n", "The model we are trying to optimize is a dynamic model of a moving bed chemical looping combustion reactor. The model has been described by [Okoli et al.][1] and [Parker and Biegler][2]. This is a gas-solid reactor with counter-current flow. The degrees of freedom are gas and solid inlet flow rates, and we are trying to minimize the deviation from a desired operating point via a least-squares objective function.\n", "\n", @@ -72,7 +72,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:12 [WARNING] idaes.core.base.property_meta: DEPRECATED: The property name diffusion_comp in property metadata is\n", + "2024-05-30 11:42:42 [WARNING] idaes.core.base.property_meta: DEPRECATED: The property name diffusion_comp in property metadata is\n", "not a recognized standard property name defined in this PropertySet.\n", "Please refer to IDAES standard names in the IDAES documentation. You\n", "can use the define_custom_properties() rather than the\n", @@ -158,28 +158,28 @@ "output_type": "stream", "text": [ "Initializing steady model\n", - "2024-05-24 17:39:12 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" + "2024-05-30 11:42:42 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:12 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" + "2024-05-30 11:42:42 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:12 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" + "2024-05-30 11:42:42 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:13 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" + "2024-05-30 11:42:43 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" ] }, { @@ -324,7 +324,7 @@ "Number of equality constraint Jacobian evaluations = 1\n", "Number of inequality constraint Jacobian evaluations = 0\n", "Number of Lagrangian Hessian evaluations = 0\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 0.798\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 0.801\n", "Total CPU secs in NLP function evaluations = 0.001\n", "\n", "EXIT: Optimal Solution Found.\n", @@ -371,28 +371,28 @@ "output_type": "stream", "text": [ "Initializing steady model\n", - "2024-05-24 17:39:14 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" + "2024-05-30 11:42:44 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:14 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" + "2024-05-30 11:42:44 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:14 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" + "2024-05-30 11:42:45 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:15 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" + "2024-05-30 11:42:45 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" ] }, { @@ -593,7 +593,7 @@ "text": [ "Ipopt 3.13.2: max_iter=20\n", "print_user_options=yes\n", - "option_file_name=/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpzo3fzubx_ipopt.opt\n" + "option_file_name=/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp63b4a3v6_ipopt.opt\n" ] }, { @@ -601,14 +601,14 @@ "output_type": "stream", "text": [ "\n", - "Using option file \"/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpzo3fzubx_ipopt.opt\".\n", + "Using option file \"/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp63b4a3v6_ipopt.opt\".\n", "\n", "\n", "List of user-set options:\n", "\n", " Name Value used\n", " max_iter = 20 yes\n", - " option_file_name = /var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpzo3fzubx_ipopt.opt yes\n", + " option_file_name = /var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp63b4a3v6_ipopt.opt yes\n", " print_info_string = yes yes\n", " print_user_options = yes yes\n", "\n", @@ -808,8 +808,8 @@ "Number of equality constraint Jacobian evaluations = 21\n", "Number of inequality constraint Jacobian evaluations = 0\n", "Number of Lagrangian Hessian evaluations = 20\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 14.070\n", - "Total CPU secs in NLP function evaluations = 0.062\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 14.076\n", + "Total CPU secs in NLP function evaluations = 0.064\n", "\n", "EXIT: Maximum Number of Iterations Exceeded.\n" ] @@ -2067,7 +2067,7 @@ "\n", "But this equation isn't here... so we need to add it.\n", "\n", - "## Fixing the model\n", + "# Fixing the model\n", "\n", "We'll start by creating a fresh copy of the model, so we don't accidentally rely on IPOPT's point of termination." ] @@ -2083,28 +2083,28 @@ "text": [ "Constructing a steady model to initialize the dynamic model\n", "Initializing steady model\n", - "2024-05-24 17:39:39 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" + "2024-05-30 11:43:09 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:39 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" + "2024-05-30 11:43:09 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:39 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" + "2024-05-30 11:43:09 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:39 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" + "2024-05-30 11:43:09 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" ] }, { @@ -2261,28 +2261,28 @@ "output_type": "stream", "text": [ "Initializing steady model\n", - "2024-05-24 17:39:41 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" + "2024-05-30 11:43:11 [INFO] idaes.init.fs.MB: Initialize Thermophysical Properties\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:41 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" + "2024-05-30 11:43:11 [INFO] idaes.init.fs.MB: Initialize Hydrodynamics\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:41 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" + "2024-05-30 11:43:11 [INFO] idaes.init.fs.MB: Initialize Mass Balances\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:39:41 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" + "2024-05-30 11:43:12 [INFO] idaes.init.fs.MB: Initialize Energy Balances\n" ] }, { @@ -2846,7 +2846,7 @@ "text": [ "Ipopt 3.13.2: max_iter=20\n", "print_user_options=yes\n", - "option_file_name=/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp5dzmb8mz_ipopt.opt\n" + "option_file_name=/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpy22_ekko_ipopt.opt\n" ] }, { @@ -2854,14 +2854,14 @@ "output_type": "stream", "text": [ "\n", - "Using option file \"/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp5dzmb8mz_ipopt.opt\".\n", + "Using option file \"/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpy22_ekko_ipopt.opt\".\n", "\n", "\n", "List of user-set options:\n", "\n", " Name Value used\n", " max_iter = 20 yes\n", - " option_file_name = /var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp5dzmb8mz_ipopt.opt yes\n", + " option_file_name = /var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpy22_ekko_ipopt.opt yes\n", " print_info_string = yes yes\n", " print_user_options = yes yes\n", "\n", @@ -3061,7 +3061,7 @@ "Number of equality constraint Jacobian evaluations = 21\n", "Number of inequality constraint Jacobian evaluations = 0\n", "Number of Lagrangian Hessian evaluations = 20\n", - "Total CPU secs in IPOPT (w/o function evaluations) = 40.807\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 40.818\n", "Total CPU secs in NLP function evaluations = 0.085\n", "\n", "EXIT: Maximum Number of Iterations Exceeded.\n" @@ -3106,7 +3106,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2024-05-24 17:40:35 [INFO] idaes.core.util.model_diagnostics: Factor is exactly singular\n" + "2024-05-30 11:44:05 [INFO] idaes.core.util.model_diagnostics: Factor is exactly singular\n" ] }, { @@ -3423,7 +3423,7 @@ "text": [ "Ipopt 3.13.2: max_iter=20\n", "print_user_options=yes\n", - "option_file_name=/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp3_4po4n__ipopt.opt\n" + "option_file_name=/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpqgpeccsf_ipopt.opt\n" ] }, { @@ -3431,14 +3431,14 @@ "output_type": "stream", "text": [ "\n", - "Using option file \"/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp3_4po4n__ipopt.opt\".\n", + "Using option file \"/var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpqgpeccsf_ipopt.opt\".\n", "\n", "\n", "List of user-set options:\n", "\n", " Name Value used\n", " max_iter = 20 yes\n", - " option_file_name = /var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmp3_4po4n__ipopt.opt yes\n", + " option_file_name = /var/folders/j3/k8s7mg5x053c0rgp8sd87d540016lk/T/tmpqgpeccsf_ipopt.opt yes\n", " print_info_string = yes yes\n", " print_user_options = yes yes\n", "\n", @@ -3524,7 +3524,7 @@ "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) = 5.221\n", + "Total CPU secs in IPOPT (w/o function evaluations) = 5.218\n", "Total CPU secs in NLP function evaluations = 0.011\n", "\n", "EXIT: Optimal Solution Found.\n" @@ -3555,7 +3555,7 @@ "source": [ "It worked! For the simple optimization problem we have set up, this solve looks a lot more like what we expect.\n", "\n", - "## Takeaways from this tutorial\n", + "# Takeaways from this tutorial\n", "What have we learned?\n", "1. IPOPT using non-zero regularization coefficients hints at a singular Jacobian (especially when \"L\"/\"l\" diagnostic tags are present).\n", "2. When this happens, start by calling `report_structural_issues` to check for a structural singularity. If this looks good, call `report_numerical_issues` to check for a numerical singularity.\n", @@ -3588,6 +3588,13 @@ "[4]: https://dl.acm.org/doi/10.1145/98267.98287\n", "[5]: https://www.sciencedirect.com/science/article/pii/S0098135423002533\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/idaes_examples/notebooks/docs/diagnostics/structural_singularity_test.ipynb b/idaes_examples/notebooks/docs/diagnostics/structural_singularity_test.ipynb index 6f7c466e..f1b30afe 100644 --- a/idaes_examples/notebooks/docs/diagnostics/structural_singularity_test.ipynb +++ b/idaes_examples/notebooks/docs/diagnostics/structural_singularity_test.ipynb @@ -40,11 +40,11 @@ "jp-MarkdownHeadingCollapsed": true }, "source": [ - "## Construct our model\n", + "# Constructing the model\n", "\n", "Suppose a collaborator has given us a model to work with. They give us a square model and tell us what the degrees of freedom are. We construct an optimization problem and try to solve it. In this tutorial, we don't want to worry too much about the details that go into constructing the model. This has been provided in the `idaes_examples.mod.diagnostics.gas_solid_contactors.model` module.\n", "\n", - "### Model details (OKAY TO SKIP)\n", + "## Model details (OKAY TO SKIP)\n", "\n", "The model we are trying to optimize is a dynamic model of a moving bed chemical looping combustion reactor. The model has been described by [Okoli et al.][1] and [Parker and Biegler][2]. This is a gas-solid reactor with counter-current flow. The degrees of freedom are gas and solid inlet flow rates, and we are trying to minimize the deviation from a desired operating point via a least-squares objective function.\n", "\n", @@ -327,7 +327,7 @@ "\n", "But this equation isn't here... so we need to add it.\n", "\n", - "## Fixing the model\n", + "# Fixing the model\n", "\n", "We'll start by creating a fresh copy of the model, so we don't accidentally rely on IPOPT's point of termination." ] @@ -626,7 +626,7 @@ "source": [ "It worked! For the simple optimization problem we have set up, this solve looks a lot more like what we expect.\n", "\n", - "## Takeaways from this tutorial\n", + "# Takeaways from this tutorial\n", "What have we learned?\n", "1. IPOPT using non-zero regularization coefficients hints at a singular Jacobian (especially when \"L\"/\"l\" diagnostic tags are present).\n", "2. When this happens, start by calling `report_structural_issues` to check for a structural singularity. If this looks good, call `report_numerical_issues` to check for a numerical singularity.\n", @@ -659,6 +659,13 @@ "[4]: https://dl.acm.org/doi/10.1145/98267.98287\n", "[5]: https://www.sciencedirect.com/science/article/pii/S0098135423002533\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/idaes_examples/notebooks/docs/diagnostics/structural_singularity_usr.ipynb b/idaes_examples/notebooks/docs/diagnostics/structural_singularity_usr.ipynb index 6f7c466e..f1b30afe 100644 --- a/idaes_examples/notebooks/docs/diagnostics/structural_singularity_usr.ipynb +++ b/idaes_examples/notebooks/docs/diagnostics/structural_singularity_usr.ipynb @@ -40,11 +40,11 @@ "jp-MarkdownHeadingCollapsed": true }, "source": [ - "## Construct our model\n", + "# Constructing the model\n", "\n", "Suppose a collaborator has given us a model to work with. They give us a square model and tell us what the degrees of freedom are. We construct an optimization problem and try to solve it. In this tutorial, we don't want to worry too much about the details that go into constructing the model. This has been provided in the `idaes_examples.mod.diagnostics.gas_solid_contactors.model` module.\n", "\n", - "### Model details (OKAY TO SKIP)\n", + "## Model details (OKAY TO SKIP)\n", "\n", "The model we are trying to optimize is a dynamic model of a moving bed chemical looping combustion reactor. The model has been described by [Okoli et al.][1] and [Parker and Biegler][2]. This is a gas-solid reactor with counter-current flow. The degrees of freedom are gas and solid inlet flow rates, and we are trying to minimize the deviation from a desired operating point via a least-squares objective function.\n", "\n", @@ -327,7 +327,7 @@ "\n", "But this equation isn't here... so we need to add it.\n", "\n", - "## Fixing the model\n", + "# Fixing the model\n", "\n", "We'll start by creating a fresh copy of the model, so we don't accidentally rely on IPOPT's point of termination." ] @@ -626,7 +626,7 @@ "source": [ "It worked! For the simple optimization problem we have set up, this solve looks a lot more like what we expect.\n", "\n", - "## Takeaways from this tutorial\n", + "# Takeaways from this tutorial\n", "What have we learned?\n", "1. IPOPT using non-zero regularization coefficients hints at a singular Jacobian (especially when \"L\"/\"l\" diagnostic tags are present).\n", "2. When this happens, start by calling `report_structural_issues` to check for a structural singularity. If this looks good, call `report_numerical_issues` to check for a numerical singularity.\n", @@ -659,6 +659,13 @@ "[4]: https://dl.acm.org/doi/10.1145/98267.98287\n", "[5]: https://www.sciencedirect.com/science/article/pii/S0098135423002533\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {