Skip to content

Comments

Add Wind+PEM tracking and stochastic bidding documentation#1090

Closed
Xinhe-Chen wants to merge 10 commits intoIDAES:mainfrom
Xinhe-Chen:update_dl_doc
Closed

Add Wind+PEM tracking and stochastic bidding documentation#1090
Xinhe-Chen wants to merge 10 commits intoIDAES:mainfrom
Xinhe-Chen:update_dl_doc

Conversation

@Xinhe-Chen
Copy link
Contributor

Fixes

Summary/Motivation:

Add documentation for wind+pem renewable IES tracking and stochastic bidding.

Changes proposed in this PR:

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. 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.

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 70.32% // Head: 70.26% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (3074b65) compared to base (b30c054).
Patch has no changes to coverable lines.

❗ Current head 3074b65 differs from pull request most recent head 8367219. Consider uploading reports for the commit 8367219 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1090      +/-   ##
==========================================
- Coverage   70.32%   70.26%   -0.06%     
==========================================
  Files         405      405              
  Lines       66342    66266      -76     
  Branches    12342    12320      -22     
==========================================
- Hits        46653    46564      -89     
- Misses      17319    17328       +9     
- Partials     2370     2374       +4     
Impacted Files Coverage Δ
idaes/core/util/model_diagnostics.py 39.32% <0.00%> (-9.90%) ⬇️
idaes/ver.py 61.53% <0.00%> (-4.62%) ⬇️
idaes/core/base/control_volume1d.py 89.18% <0.00%> (-0.98%) ⬇️
idaes/core/base/control_volume_base.py 90.54% <0.00%> (-0.98%) ⬇️
...xtra/power_generation/properties/flue_gas_ideal.py 77.50% <0.00%> (-0.49%) ⬇️
idaes/core/base/property_set.py 96.98% <0.00%> (-0.16%) ⬇️
idaes/core/base/property_meta.py 94.44% <0.00%> (ø)
idaes/core/base/control_volume0d.py 89.40% <0.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Xinhe-Chen
Copy link
Contributor Author

@adowling2 @dguittet This is ready to review.

@Xinhe-Chen Xinhe-Chen marked this pull request as ready for review February 15, 2023 01:43
@adowling2
Copy link
Contributor

I'll review this later tonight.

@adowling2
Copy link
Contributor

@radhakrishnatg could be another good reviewer

@andrewlee94
Copy link
Contributor

@adowling2 Note however that we hope to cut a release candidate today (pending a Pyomo release), so you might need to work with @ksbeattie and @lbianchi-lbl if this needs to be part of the February release.

@dguittet
Copy link
Contributor

adding @bknueven also for his input

@dguittet
Copy link
Contributor

I'm confused as to why this is being merged into the documentation at this point in time. Where is the actual code? There is already an existing Bidder.py in IDAES but it isn't specific for Wind + PEM. Is the Wind + PEM feature going to be a modification of the existing Bidder.py, or is there supposed to be another piece of code in addition? Is there going to be in IDAES many different Bidders for different technology use cases?

@Xinhe-Chen
Copy link
Contributor Author

I'm confused as to why this is being merged into the documentation at this point in time. Where is the actual code? There is already an existing Bidder.py in IDAES but it isn't specific for Wind + PEM. Is the Wind + PEM feature going to be a modification of the existing Bidder.py, or is there supposed to be another piece of code in addition? Is there going to be in IDAES many different Bidders for different technology use cases?

@dguittet I think this is what we are going to implement next stage and we will have the docs in advance.

@bknueven
Copy link
Contributor

I am also a bit confused. It would seem like this documentation should also exist in dispatches. If IDAES were to document an example shouldn't it start with the one already included? https://github.com/IDAES/idaes-pse/tree/main/idaes/apps/grid_integration/examples.

@andrewlee94
Copy link
Contributor

andrewlee94 commented Feb 16, 2023

@Xinhe-Chen I also find it strange that you are adding documentation for something that does not exist yet. It is fine to work on it ahead of time, but it generally shouldn't be added to the actual docs until the code that goes with it is ready. Otherwise, users reading the docs will expect these features to be there, and then be confused when they are not.


Some wind, battery, PEM models and the double-loop simulation example can be found in Dispatches GitHub repository.

https://dispatches.readthedocs.io/en/main/models/renewables/index.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that this is referring out to models in DISPATCHES makes me think that this documentation does not belong in IDAES. The IDAES docs should only cover things that can be run using IDAES code - we cannot be dependent on DISPATCHES as that creates a recursive loop.

Real-time Bidding Problem for Wind+PEM IES
------------------------------------------

.. math:: \max \quad \sum_{t \in T_{DA}}\hat{\pi}_{t}^{DA}\hat{P}_{t}^{DA}\Delta t + \sum_{t\in T_{RT}, s\in S}\omega_{s}[\pi_{t,s}^{RT}(P_{t,s}^{RT} -\hat{P}_{t}^{DA})\Delta t + Pr^{H}m_{t,s}^{H} - c_{t,s} - \omega_{t}^{RT} P_{t,s}^{underbid}] - C_{fix}
Copy link
Contributor

@andrewlee94 andrewlee94 Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks like an example problem, not a reference to the details of specific functions. The Reference Guides section should focus only on the technical specs of functionality in IDAES.

Examples should go in the Examples repository, where we would want corresponding code meaning that this further reinforces my feeling that this belongs in DISPATCHES.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Andrew. I will talk to Prof. Dowling about this PR!

.. math:: P_{t,s}^{DA} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (4)
.. math:: P_{t,s}^{RT} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (5)
.. math:: P_{t,s}^{wind} \leq f_{t} P_{max}^{wind} \quad \forall t, s \quad \quad (6)
.. math:: P_{t,s}^{DA} + P_{t,s}^{PEM} \leq P_{max}^{wind} \quad \forall t, s \quad \quad (7)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the DA + PEM powers be less than the the available power at that time, and not the absolute PMax?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constraint makes sense but I'm wondering if this constraint (combined also with 17) is flexible enough to allow for the use case where the PEM is used in RT when the plant's DA bid is accepted but in RT the grid doesn't actually take the option of that DA power. Or perhaps other cases... @bknueven any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, eqn 7 has an typo. I will fix that.

I think we may increase the weight of the hydrogen revenue at the DA bidding so that the electricity bid will be more conservative. In such case, we can reduce the underbidding. But the cost is we will lose some revenue from DA market.


:math:`P_{max}^{PEM}`: PEM max capacity, MW.

:math:`f_{t}`: Wind power generation capacity factor at hour t, MW/MW.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the RT or DA capacity factor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the manuscript of RE paper, we only have one f_t. IMO, in DA we use DA cf and in RT we use RT cf.

.. math:: P_{t,s}^{DA} \leq P_{t,s}^{RT} \quad \forall t, s \quad \quad (1)
.. math:: P_{t,s} = P^{RT}_{t,s} \quad \forall t, s \quad \quad (2)
.. math:: (\pi_{t,s'}^{DA} - \pi_{t,s}^{DA})(P_{t,s'}^{DA} - P_{t,s}^{DA}) \geq 0 \quad \forall s \in S, \forall s' \in S \backslash s, \forall t \in T^{DA} \quad \quad (3)
.. math:: P_{t,s}^{DA} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is P_{t,s}^{wind} DA or RT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P_{t,s}^{wind} is bounded by the f_{t}P_{wind}^{max}. Here we can use DA cf in DA problem and RT cf in RT problem.

.. math:: P_{t,s} = P^{RT}_{t,s} \quad \forall t, s \quad \quad (2)
.. math:: (\pi_{t,s'}^{DA} - \pi_{t,s}^{DA})(P_{t,s'}^{DA} - P_{t,s}^{DA}) \geq 0 \quad \forall s \in S, \forall s' \in S \backslash s, \forall t \in T^{DA} \quad \quad (3)
.. math:: P_{t,s}^{DA} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (4)
.. math:: P_{t,s}^{RT} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is P_{t,s}^{wind} DA or RT?

@Xinhe-Chen
Copy link
Contributor Author

I am also a bit confused. It would seem like this documentation should also exist in dispatches. If IDAES were to document an example shouldn't it start with the one already included? https://github.com/IDAES/idaes-pse/tree/main/idaes/apps/grid_integration/examples.

I think we need this PR for a milestone regarding hydrogen co-production.

@Xinhe-Chen
Copy link
Contributor Author

Decision on Feb 16: Merge this PR after the codes are merged.

@andrewlee94 andrewlee94 added Priority:Low Low Priority Issue or PR Priority:Normal Normal Priority Issue or PR and removed Priority:Low Low Priority Issue or PR labels Feb 16, 2023
@ksbeattie ksbeattie marked this pull request as draft February 23, 2023 19:20
@ksbeattie
Copy link
Member

I've converted this to a draft PR since it appears that this won't be part of the Feb (2.0) release. Please let me know if that's not going to be the case.

@ksbeattie
Copy link
Member

Update (Apr 17th): This is waiting on code that is in @dguittet branch. This is not required for the June release of DISPATCHES but will be included afterwards.

@ksbeattie
Copy link
Member

@Xinhe-Chen, @dguittet, @adowling2 is this still going to be done (in idaes)?

@adowling2
Copy link
Contributor

Yes.

@ksbeattie
Copy link
Member

Yes.

I've added this to the Nov release board and updated the branch since it's been quite a while. Let me know if Nov is not a practical timeline for this.

@ksbeattie
Copy link
Member

@adowling2, the Nov release is coming up. Is this going to happen in the next few weeks?

@adowling2
Copy link
Contributor

No, push to Feb.

@ksbeattie
Copy link
Member

@Xinhe-Chen & @adowling2 can this be updated, reviewed and merge for this Feb 2024 release?

@Xinhe-Chen
Copy link
Contributor Author

@ksbeattie @adowling2 Sorry for the late reply. The wind + PEM bidder has been done in dispatches. I will clean up the codes and add tests to merge them into IDAES.
I don't think I can do this in the Feb release, I would like to postpone this PR to the March release. Many thanks.

@ksbeattie
Copy link
Member

@ksbeattie @adowling2 Sorry for the late reply. The wind + PEM bidder has been done in dispatches. I will clean up the codes and add tests to merge them into IDAES. I don't think I can do this in the Feb release, I would like to postpone this PR to the March release. Many thanks.

I've taken this off the Feb release board. When we create the next release board, please come to the dev call to have this added back to that board.

@ksbeattie
Copy link
Member

@adowling2 , @Xinhe-Chen: Might this now be a candidate for a May release?

@Xinhe-Chen
Copy link
Contributor Author

@adowling2 , @Xinhe-Chen: Might this now be a candidate for a May release?

Yes. I am still working on this PR and it will be good to put it on May release.

@Xinhe-Chen
Copy link
Contributor Author

The documentation is moved to #1407

@andrewlee94
Copy link
Contributor

@Xinhe-Chen Seeing as the documentation has been moved, can we close this PR?

@Xinhe-Chen
Copy link
Contributor Author

@Xinhe-Chen Seeing as the documentation has been moved, can we close this PR?

Yes I think we can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DISPATCHES Priority:Normal Normal Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants