Robbybp / surrogate-vs-implicit

Comparing surrogate models and implicit function formulations for chemical process models
Other
1 stars 0 forks source link

To review Full Space ATR Flowsheet #3

Closed sbugosen closed 1 year ago

sbugosen commented 1 year ago

Hi Robert, regarding the degrees of freedom, I added a conversion constraint and now the degrees of freedom are 2, as expected. However, as discussed, it's better if you also take a look at the file because of your experience. Maybe I missed something.

Also, I modified the constraints to have a more interesting optimization problem. The file runs and the results are reasonable.

sbugosen commented 1 year ago

Also, if you decide not to include a conversion constraint and just fix the outlet temperature in the reactor, you can also do that and you'll end up with 2 degrees of freedom, as expected. In this case, you should comment out constraint "max_reformer_outlet_temp" and replace that with "m.fs.reformer.outlet.temperature[0].fix(1060)".

So the question is, do we include a conversion constraint, or do we fix outlet reformer temperature?

Robbybp commented 1 year ago

@sbugosen I figured out why Lagrange multipliers for inert species are included: they are multiplied by coefficients of zero because the elements Ar and N don't appear in any other species, but are also multiplied by a mutable parameter, m.fs.reformer.gibbs_scaling, so IncidenceGraphInterface doesn't properly filter them out. I've opened a Pyomo PR to fix this here: https://github.com/Pyomo/pyomo/pull/2882. In the meantime, the workaround is to manually exclude them when iterating over igraph.variables.

sbugosen commented 1 year ago

@Robbybp Glad I was able to contribute in some way to this :). I'm still trying to debug the implicit ATR (the other PR). At least ALAMO and FullSpace are already solved.

sbugosen commented 1 year ago

It looks good!