-
Notifications
You must be signed in to change notification settings - Fork 30
Byproduct recovery framework tutorial #141
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #141 +/- ##
=======================================
Coverage 97.03% 97.03%
=======================================
Files 65 65
Lines 9715 9715
=======================================
Hits 9427 9427
Misses 288 288 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Hi @Lingyan90, the content here is good, I have some initial comments.
docs/_toc.yml
Outdated
@@ -5,4 +5,5 @@ chapters: | |||
- file: tutorials/diafiltration | |||
- file: tutorials/diafiltration-solution | |||
- file: tutorials/uky_flowsheet-solution | |||
- file: tutorials/byproduct_recovery_determination |
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.
Rename the file so that the CI framework can find it:
- file: tutorials/byproduct_recovery_determination | |
- file: tutorials/byproduct_recovery_determination-solution |
@@ -0,0 +1,706 @@ | |||
{ |
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.
Add "-solution" to the file name.
"source": [ | ||
"# __Byproduct Recovery Framework Tutorial__\n", | ||
"\n", | ||
"The purpose of this tutorial is to introduce the __byproduct recovery decision framework__ (``determine_byproduct_recovery.py``), which is based on the criterion of whether the total annual revenue is non negative. This framework serves as a supporting tool to help determine whether certain critical minerals (CMs) and/or rare Earth elements (REEs) should be recovered. \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.
"The purpose of this tutorial is to introduce the __byproduct recovery decision framework__ (``determine_byproduct_recovery.py``), which is based on the criterion of whether the total annual revenue is non negative. This framework serves as a supporting tool to help determine whether certain critical minerals (CMs) and/or rare Earth elements (REEs) should be recovered. \n", | |
"The purpose of this tutorial is to introduce the __byproduct recovery decision framework__ (``determine_byproduct_recovery.py``), which determines economic viability of converting waste streams into saleable byproducts based on a known viability criterion. This framework serves as a supporting tool to help determine whether certain critical minerals (CMs) and/or rare Earth elements (REEs) should be recovered. \n", |
"\n", | ||
"While this tutorial focuses on revenue-based decisions, byproduct recovery decisions can also be guided by other criteria—such as the abundance of the byproduct or its current market value.\n", | ||
"\n", | ||
"The decision tree used in this tutorial is referenced from Chapter 8 of the book _Chemical engineering design: principles, practice and economics of plant and process design_ by Towler, Gavin, and Ray Sinnott, Butterworth-Heinemann, 2021.\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.
"The decision tree used in this tutorial is referenced from Chapter 8 of the book _Chemical engineering design: principles, practice and economics of plant and process design_ by Towler, Gavin, and Ray Sinnott, Butterworth-Heinemann, 2021.\n", | |
"The decision tree used in the byproduct recovery decision framework is referenced from Chapter 8 of the book _Chemical engineering design: principles, practice and economics of plant and process design_ by Towler, Gavin, and Ray Sinnott, Butterworth-Heinemann, 2021.\n", |
"The decision tree used in this tutorial is referenced from Chapter 8 of the book _Chemical engineering design: principles, practice and economics of plant and process design_ by Towler, Gavin, and Ray Sinnott, Butterworth-Heinemann, 2021.\n", | ||
"\n", | ||
"\n", | ||
"The framework includes a built in hypothesis example that results in positive revenue. In this tutorial, we will also demonstrate how to apply this framework to assess whether __lithium__ and __colbolt__ should be recovered through a dialfiltration process. \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.
I don't think the sentence is needed.
"The framework includes a built in hypothesis example that results in positive revenue. In this tutorial, we will also demonstrate how to apply this framework to assess whether __lithium__ and __colbolt__ should be recovered through a dialfiltration process. \n", | |
"In this tutorial, we will also demonstrate how to apply this framework to assess whether __lithium__ and __colbolt__ should be recovered through a dialfiltration process. \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.
I revised the first sentence of line 18 to indicate that the framework’s Python script includes a built-in example. I’d prefer to include this information in the tutorial as well, so users can refer to it as a simpler, more accessible example.
"source": [ | ||
"These prices will be used to compute __annual revenue__, which is a key input to the byproduct recovery decision framework.\n", | ||
"\n", | ||
"__2. Specify the Product Putputs__\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.
outputs?
"\n", | ||
"Next, define the __products__ recovered from the byproduct recovery plant.\n", | ||
"\n", | ||
"The __byproduct recovery framework__ accepts flexible inputs, where products are listed in a structure called ``material_list``, and their associated data (e.g. flow rate, price) are organized in a dictionary called ``material_data``.\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.
I would say "modular" or "user" instead of "flexible".
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.
i used "user" instead
"id": "dbe5705c-f654-4190-b490-87cdc41579dd", | ||
"metadata": {}, | ||
"source": [ | ||
"__3. Set Additional Parameters and Evaluate Net Benefit__\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.
I suggest only putting backticks around text if it's code object names, otherwise use bold or italics instead.
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.
yes, bold was intended. updated with bold instead
"source": [ | ||
"__4. Calculate the Overall Net Benefit__\n", | ||
"\n", | ||
"After setting parameters such as production rate, market price, and associated costs for each product, you can use the byproduct recovery framework to calculate the overall net benefit.\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.
avoid "you"
"\n", | ||
"The __overall net benefit__ is used to determine profitability:\n", | ||
"\n", | ||
"- If ``net_benefit_value`` > 0 → The byproduct recovery process is __profitable__.\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.
I thought the criteria was an input, but I see now that it's hard coded at zero. Do we want to make this a user-input with a default at 0, for example a user could pass "2000" and the method would check if the net benefit is greater than or less than $2000.
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.
The final decision message has the information of whether this plant is loss money or have positive net benifit and also shows the final value. I think it fine to put it this way. Users can determine from the final message whether it meet their expectation or not.
rename the tutorial file fix typos
This is related to the generally applicable functionality introduced mainly in #123. |
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.
Great work on this tutorial! It looks good, I just had some comments on formatting and functionality.
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.
Cell ID: 0a29c413-0a01-4f16-bf26-29a60dae142a Line 3: Recommend revising text since REEs are a subset of critical minerals. Also, this framework can be generalized to other byproducts as well (not just CMs). Suggested text:
"This framework serves as a supporting tool to help determine whether evaluated byproducts should be recovered. The focus of this tutorial is critical minerals (CMs), but this framework can be generalized to other recoverable byproducts if appropriate pricing data is provided."
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.
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.
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.
Cell ID: c67e54d8-fa6d-4cbb-85b6-10405d55197d
To install directly from jupyter, required exclamation before pip:
!pip install pyomo
!pip install idaes-pse
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.
Cell ID: 7661675a-353f-48b7-8e8a-ff0a05a813e8 line 5:
Recommend rephrasing to "Installation of PrOMMiS packages require several additional steps, refer the README.me
file for details: https://github.com/prommis/prommis/blob/main/README.md for guidance."
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.
Cell ID: 04c9f0b2-437d-4791-a4a0-950471099cbf line 5 recommend rephrasing to "To determine whether lithium and cobalt should be recovered, the user first needs to import the diafiltration process and access the cost and revenue."
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.
Cell ID: dd13f5b4-1ceb-4755-a220-950708a60bff:
Recommend adding instructions for user to set their own sale prices here as well. They may want to use more updated prices.
Addresses Issue:
This tutorial explains how to use the byproduct recovery framework.
Summary/Motivation:
This tutorial demonstrated how to apply the byproduct recovery framework to an elements recovery plants. A case study of lithium-colbalt recovery from diafiltration process is utilized.
Changes proposed in this PR:
doc\_toc.yml
Reviewer's checklist / merge requirements:
main
branch on the PR author's forkLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution:
I agree my contributions are submitted under the license terms described in the LICENSE.md file
at the top level of this directory.
I represent I am authorized to make the contributions and grant the license. If my employer has
rights to intellectual property that includes these contributions, I represent that I have
received permission to make contributions and grant the required license on behalf of that
employer.