BioSTEAMDevelopmentGroup / Bioindustrial-Park

BioSTEAM's Premier Repository for Biorefinery Models and Results
MIT License
36 stars 17 forks source link

Consultation about kind setting in uncertainty analysis in BioSTEAM #120

Closed zasddsgg closed 1 month ago

zasddsgg commented 2 months ago

Hello, could I ask you some questions about kind setting in uncertainty analysis in BioSTEAM. Thanks for your help. Wish you a good day.

  1. Are the design, coupled and isolated parameters in https://biosteam.readthedocs.io/en/latest/API/evaluation/Parameter.html#:~:text=kind%20(str,in%20any%20way the same as the decision variables, technology parameters, and contextual parameters in the article “BioSTEAM-LCA: An Integrated Modeling Framework for Agile Life Cycle Assessment of Biorefineries under Uncertainty”?

  2. In lactic acid models.py (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L303-L309), solids loading will not only affect the mass and energy balance of the process, but also the unit design, why kind is coupled instead of design?

  3. The different loads (Pretreatment solids loading, Pretreatment sulfuric acid loading, Enzymatic hydrolysis solids loading, Enzyme loading) (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L304-L316, https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L331-L343), the kind are set to coupled, but how does the different loads (Pretreatment solids loading, Pretreatment sulfuric acid loading, Enzymatic hydrolysis solids loading, Enzyme loading) affect the mass and energy balance of the process, including the yield?

  4. For @param(name='Enzymatic hydrolysis time') (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L347), why kind is 'coupled'? Shouldn't the enzymatic hydrolysis time only affect the unit design, how does it affect the energy balance and mass balance?

  5. How do Acidulation time and Enzymatic hydrolysis time affect the mass balance and energy balance of the process (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L411-L416, https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L345-L350)? It seems that they only affect the unit design, so should the kind be design?

  6. Which kind=cost (https://biosteam.readthedocs.io/en/latest/tutorial/Uncertainty_and_sensitivity.html#:~:text=of%20reactors%27%2C-,element%3DR301%2C%20kind%3D%27cost%27%2C,-distribution%3Dshape ) in the tutorial corresponds to design, coupled, isolated in the API (https://biosteam.readthedocs.io/en/latest/API/evaluation/Parameter.html#:~:text=kind%20(str,in%20any%20way.)?

yalinli2 commented 1 month ago
  1. No, those two concepts are not related. 2 and following coupled means the parameter affects mass/energy and design, isolated is usually used when the parameter only affects TEA/LCA.
zasddsgg commented 1 month ago

Thank you for your answer. May I ask you the following questions. Thanks for your help. Wish you a good day.

a) In https://biosteam.readthedocs.io/en/latest/API/evaluation/Model.html#biosteam.evaluation.Model.get_distribution_summary:~:text=kind%20(%7B%27coupled%27%2C%20%27isolated%27%2C%20%27design%27%2C%20%27cost%27%7D%2C%20optional)%20%E2%80%93, when do we choose kind=cost?

b) For kind=coupled, will it re-run the system? Is it running the entire process range? For kind=design, will it re-run the system? Is it running the entire process range? For kind= isolated, it will not re-run the system, right?

c) When do we use kind=design? that is, only the design is affected, and the mass balance and energy balance are not affected.

d) If it only affects the mass balance and energy balance, but does not affect the design, is the kind chosen as coupled?

e) If I am not sure whether it will affect the design, mass balance and energy balance, is it better to use coupled than design and isolated?

f) For the top questions 3, 4, 5and 6, could I trouble you to look at them?

yalinli2 commented 1 month ago

a. When the parameter only affects price (i.e., not mass/energy flow). b. Please see my previous replies on how the resimulation scope is determined. c. Yes d. Yes. e. Yes. Top 3. Loading affects mass. Top 4 and 5. I think it can be changed to design. When the lactic acid module was developed, the design option was not available. Top 6. cost is a different option, @yoelcortes maybe the doc should be updated?

yoelcortes commented 1 month ago

@yalinli2, @zasddsgg,

Parameter kind='cost' and kind='design' are the same. Regardless if you pass 'cost' or 'design', both the design and cost algorithms are rerun when the parameter is simulated. Long ago, they meant different things, but the decision was made to simplify it. This was necessary because of how many times it is not possible to decouple design from costing (e.g., some new unit operations need to optimize their design to minimize cost). I will update the documentation to note that 'design' and 'cost' mean the same thing and both options are kept for backwards compatibility.

Update @yalinli2 , sorry I forgot to update you regarding this change: When running <Model>.evaluate() the complete system always simulates regardless of what kinds of parameters it has ('coupled', 'isolated', or 'design'; it does not matter).

The only time the choice of 'coupled', 'isolated', vs. 'design' comes into play is when:

I will update the documentation to make this more clear later today.

@zasddsgg, for your purposes, don't worry about the kind argument... there is no need to pass any value.

yalinli2 commented 1 month ago

Oh I see, perfect, thanks for the note!

On Sun, May 5, 2024 at 12:01 PM Yoel @.***> wrote:

@yalinli2 https://github.com/yalinli2, @zasddsgg https://github.com/zasddsgg,

For parameters, kind='cost' and kind='design' are the same. Regardless if you pass 'cost' or 'design', both the design and cost algorithms are rerun when the parameter is simulated. Long ago, they meant different things, but the decision was made to simplify it. I will update the documentation to note that 'design' and 'cost' mean the same thing and both options are kept for backwards compatibility.

Update @yalinli2 https://github.com/yalinli2 , sorry I forgot to update you regarding this change: When running .evaluate() the system always simulates completely regardless of what kinds of parameters it has ('coupled', 'isolated', or 'design'; it does not matter). The only time the choice of 'coupled', 'isolated', vs. 'design' comes into play is when:

I will update the documentation to make this more clear later today.

@zasddsgg https://github.com/zasddsgg, for your purposes, don't worry about the kind argument... there is no need to pass any value.

— Reply to this email directly, view it on GitHub https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/issues/120#issuecomment-2094860777, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALV5VLPGOAV2H2RMNYZ63V3ZAZJVLAVCNFSM6AAAAABGX76LAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUHA3DANZXG4 . You are receiving this because you were mentioned.Message ID: @.*** com>

zasddsgg commented 1 month ago

I got it. Thanks for your help.