Skip to content

Commit

Permalink
update structural singularity notebook to have more balanced toc
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbybp committed May 30, 2024
1 parent 6d913c3 commit de0e748
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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."
]
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -593,22 +593,22 @@
"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"
]
},
{
"name": "stdout",
"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",
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -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."
]
Expand All @@ -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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -2846,22 +2846,22 @@
"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"
]
},
{
"name": "stdout",
"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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -3423,22 +3423,22 @@
"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"
]
},
{
"name": "stdout",
"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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
Loading

0 comments on commit de0e748

Please sign in to comment.