-
Notifications
You must be signed in to change notification settings - Fork 71
Pricetaker implementation for flexible desalination #1592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Note to self and @MarcusHolly - just a reminder that we'll need to add tests, in addition to review/suggesting changes (or implementing changes ourselves) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work on this Radhakrishna! I've mainly left comments on the tutorial, but I can address most/all of them if you don't have the time to do so. As far as testing goes, it's prob easier to wait for the IDAES PR to be put up and merged.
For the file locations, I think we could either keep it as it is currently or just leave the .ipynb file in this tutorial folder and move the rest of the files to a place like watertap/flowsheets/flex_ro. I lean more towards the latter
"""Adds the delayed startup constraints to the model""" | ||
params: um_params.FlexDesalParams = m.params | ||
|
||
# "Shutdown" posttreamt unit if RO startup is initiated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# "Shutdown" posttreamt unit if RO startup is initiated | |
# "Shutdown" post-treatment unit if RO startup is initiated |
) | ||
|
||
else: | ||
raise ValueError("Water production targets not specidied in params") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ValueError("Water production targets not specidied in params") | |
raise ValueError("Water production targets not specified in params") |
" end_date=\"2022-07-15 00:00:00\",\n", | ||
" annual_production_AF=1200,\n", | ||
")\n", | ||
"m.params.intake.nominal_flowrate = 1063.5\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment, I think the tutorial should be explicit in what the units so that users are not left guessing. I can go through and add these when I start working on this
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to the top of the tutorial with the rest of the imports
@@ -0,0 +1,863 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would probably be helpful to have more text-based descriptions of what the following code will do so that users have an easier time going through and understanding this workflow on their own rather than relying solely on the in-line comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would also probably be helpful to have an introductory blurb of what this tutorial will show and briefly introduce the important files (flowsheet.py, params.py, etc.)
"fs.constrain_water_production(m)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"utils.fix_recovery(m, recovery=m.params.ro.nominal_recovery)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline comments and/or text-based descriptions
"\n", | ||
"# Update the time-varying parameters other than the LMP, such as\n", | ||
"# demand costs and emissions intensity. LMP value is updated by default\n", | ||
"m.update_operation_params({\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires the pricetaker updates in IDAES to be merged
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"fs.constrain_water_production(m)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline-comment or description
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"utils.fix_recovery(m, recovery=m.params.ro.nominal_recovery)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In-line comment or description
"# solver = utils.get_gurobi_solver_model(m, mip_gap=0.005)\n", | ||
"solver = pyo.SolverFactory(\"gurobi\")\n", | ||
"solver.options[\"MIPGap\"] = 0.03\n", | ||
"solver.solve(m, tee=True)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we provide an alternative here for those who don't have access to Gurobi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed- it'd be ideal if we had the options in place where we could use the other solver options that we were using when a couple of us lost access to Gurobi (e.g., GAMS solvers, potentially mindtpy if not much trouble to add option, with caveat of bug encountered)
Summary/Motivation:
This PR adds price-taker implementation for flexible desalination.
NOTE: This PR requires changes in this branch: https://github.com/radhakrishnatg/idaes-pse/tree/pt-improvements. So, until the above branch is merged with IDAES main, this PR should not be merged.
EDIT by @adam-a-a: we'll need to point to this IDAES PR: IDAES/idaes-pse#1633
EDIT by @lbianchi-lbl: this also depends on the changes in IDAES/idaes-pse#1579
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: