Skip to content

Commit

Permalink
Fixing typos from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lee committed Oct 29, 2024
1 parent 97ed834 commit 6da07fe
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions idaes_examples/notebooks/docs/scaling/scaler_workshop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
"source": [
"These diagnostics can help give us an idea of what may be causing problems in our model. From the output above, we can see that the variables with large Jacobian norms (i.e., high sensitivities) are the outlet flow rate and temperature, as well as the rate-based extent of reaction. We can also see that the constraints with large Jacobian norms are the enthalpy balance and H20 material balance for the reactor. Understanding what this means however is often complicated and requires some thought.\n",
"\n",
"For example, one might wonder why the volumetric flow rate at the outlet of the reactor is so important as it is effectively determined by the inlet flow rate (due to the water balance effectively conserving volume). However, it is important to realize that from the point of view of the solver, the outlet flowrate is a free variable that can be manipulated, and that changing the volumetric flowrate at the outlet has a significant effect on the outlet concentrations (all other thing kept constant). Thus as far as the solver is concerned, the outlet volumetric flowrate has a significant impact on the solution. This also explains why the H2O material balance is so important, as this is what governs the outlet flowrate. However, the material balances and concentrations of the other species in the system are what really matter, but this is not reflected in the model Jacobian. Once of the goals of scaling the model should be to balance these to ensure that the water balance does not come to dominate the other species.\n",
"For example, one might wonder why the volumetric flow rate at the outlet of the reactor is so important as it is effectively determined by the inlet flow rate (due to the water balance effectively conserving volume). However, it is important to realize that from the point of view of the solver, the outlet flowrate is a free variable that can be manipulated, and that changing the volumetric flowrate at the outlet has a significant effect on the outlet concentrations (all other things kept constant). Thus as far as the solver is concerned, the outlet volumetric flowrate has a significant impact on the solution. This also explains why the H2O material balance is so important, as this is what governs the outlet flowrate. However, the material balances and concentrations of the other species in the system are what really matter, but this is not reflected in the model Jacobian. Once of the goals of scaling the model should be to balance these to ensure that the water balance does not come to dominate the other species.\n",
"\n",
"## Step 3: Creating a New Scaler Class\n",
"\n",
Expand Down Expand Up @@ -1753,7 +1753,7 @@
"\n",
"However, we might be able to do better by using other constraint scaling schemes, but before we start experimenting we should stop and think about what sort of scaling might make sense for each constraint. We should always also keep in the back of our minds whether additional work is worth the effort, and if we risk over-tuning the scaling for the specific property package we have.\n",
"\n",
"Fortunately, the model in this example is fairly simple and we do not have too many constraints to consider. Firstly, we the unit-level constraint that says that `rate_reaction == 0` for all rate-based reactions. When considering scaling of a constraint we should ignore any 0 terms, thus this constraint has only 1 term and so we should scale based on this. If we use the ``scale_constraint_by_nominal_value`` method for this it will ignore the zero for us, the scheme used does not actually matter as there is only one term to consider.\n",
"Fortunately, the model in this example is fairly simple and we do not have too many constraints to consider. Firstly, we have the unit-level constraint that says that `rate_reaction == 0` for all rate-based reactions. When considering scaling of a constraint we should ignore any 0 terms, thus this constraint has only 1 term and so we should scale based on this. If we use the ``scale_constraint_by_nominal_value`` method for this it will ignore the zero for us, the scheme used does not actually matter as there is only one term to consider.\n",
"\n",
"Next, we have the balance equations which all have the form `0 == In - Out + Gen` - note the equilibrium reactor does not support dynamics so we don't need to think about that. Generation terms can vary a lot, but we basically have two possible cases:\n",
"\n",
Expand Down
Loading

0 comments on commit 6da07fe

Please sign in to comment.