Closed yalinli2 closed 1 year ago
OK just checked, S1/O1/S2/O2 are all bad...
@yalinli2, thanks for checking this. The problem was that when I made the tests, I added this line in __init__.py
:
feedstock.price = MFPP()
But the MFPP was in USD per ton (should be USD per kg). It is fixed now. I can work on a new branch and have you review before merging from now on (good idea!).
Regarding MESPs, the ethanol stream is not a product in S2 and O2. You'll need to pass both advanced and cellulosic ethanol streams to solve for the MESP:
>>> from biorefineries import oilcane as oc
>>> oc.load('O2')
>>> oc.tea.solve_price([oc.advanced_ethanol, oc.cellulosic_ethanol])
0.9225516982836797
Because the feedstock price changes with biorefinery for consistency among tests, you'll want to make sure you set the price you want before getting the MESP.
Thanks!
OK thanks @yoelcortes , it's quite strange that the tests didn't even catch such weird results...
I kind of noticed that ethanol
wasn't in the system but didn't think it'd matter since it's been giving reasonable looking results, but I just checked and found there were different, I'll update the calculation, thanks for the note!
Also, I reopened this issue because I noticed that the MESP for S1/O1 configs (esp. O1) have changed substantially (esp. for O1, increased from $1.53/gal to $2.17/gal) between ~you submitted the oilcane revision to now, I'll double-check on this and follow up
And I think I generally close an issue in a timely manner if I believe it's resolved, so I'd appreciate it if you can leave it to me (or other people who post the issue) next time. If the issue's like a week old and no one follows up then sure the person might've forgot about it, but sometimes people will need time to verify, thanks!
@yalinli2, absolutely, thanks for letting me know. Keeping issues open to give enough time for verification is good idea.
Regarding the MESP being different, you can try setting the price of the feedstock back to the original price:
>>> from biorefineries import oilcane as oc
>>> oc.load('O1')
>>> oc.feedstock.price = 0.035
>>> ethanol_kg_per_gal = 2.98668849
>>> oc.tea.solve_price(oc.advanced_ethanol) * ethanol_kg_per_gal
1.6230408644406924
When I made the new tests for oilcane configurations, I forgot the feedstock price was in USD/kg (not USD/ton) so the values looked good to me at the moment jaja. Thanks for catching this error and posting it!
@yoelcortes , thanks so much for the info! It's counter-intuitive to me that we'd want to set the feedstock price based on a decade-old MESP, but at the same time I also don't think setting the same feedstock price for oilcane/sugarcane is fair :)
I updated the codes in the wwt
module (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/commit/a7638666a3754037567795a946a33d73c786981e) and now the results look good, I'll close this issue!
Hi @yoelcortes , I'm getting really bad MESP numbers now:
Haven't checked other configurations though. BTW, if there will be major changes to the oilcane biorefinery, maybe better to open new branch? I can help to review before merging since I've been tracking MESPs/GWPs, thanks!