Skip to content
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

Add Wind+PEM tracking and stochastic bidding documentation #1090

Closed
wants to merge 10 commits into from
149 changes: 149 additions & 0 deletions docs/reference_guides/apps/grid_integration/Bidder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,155 @@
each of these uncertain price and power output pairs formulates a segment in the
bidding curves.

Here we present a stochastic bidding model for a renewable integated energy system (Wind generator + PEM).

Check warning on line 16 in docs/reference_guides/apps/grid_integration/Bidder.rst

View workflow job for this annotation

GitHub Actions / Check Spelling

"integated" should be "integrated".


Day-Ahead Bidding Problem for Wind + PEM IES
---------------------------------------------

The objective function is the expected profit, which equals the revenue substracts the cost.

Check warning on line 22 in docs/reference_guides/apps/grid_integration/Bidder.rst

View workflow job for this annotation

GitHub Actions / Check Spelling

"substracts" should be "subtracts".
We want to consider the revenue from the electricity market and the hydrogen market.

.. math:: \max \quad \sum_{s \in S, t \in T^{DA}}\omega_{s}[{(\pi_{t,s}^{DA}P_{t,s}^{DA} + \pi_{t,s}^{RT}(P_{t,s}^{RT}-P_{t,s}^{DA}))\Delta t + Pr^{H}m_{t,s}^{H}- c_{t,s}}] - C_{fix}

s.t.

.. 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}^{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?

.. 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_{t,s}^{PEM} \leq P_{max}^{PEM} \quad \forall t, s \quad \quad (8)
.. math:: m_{t,s}^{H} = P_{t,s}^{PEM}C_{H}\Delta t \quad \forall t, s \quad \quad (9)
.. math:: c_{t,s} = C^{op} P_{t,s}^{PEM}\quad \forall t, s \quad \quad (10)
.. math:: C_{fix} = C_{fix}^{wind}P_{max}^{wind} + C_{fix}^{PEM}P_{max}^{PEM} \quad \quad (11)

Equation (1) requires the day-ahead offering power is less or equal to the real-time offering power
in order to avoid underbidding. Equation (2) states that the RT offering power is the same as the
IES power output to the grid. In the bidding mode, the market rules require the offering power is
non-decreasing (convex) with its marginal cost in an energy bid. This rule is represented by equation (3).
Equation (4) to equation (9) are process model constraints. Equation (10) calculates the operation costs for IES
and equation (11) calculate the fixed cost for IES.

**Parameters**

:math:`\omega_{s}`: Frequency of each scenario.

:math:`\pi^{DA}_{t,s}`: Day-ahead LMP forecasting from forecaster at hour t for scenario s, \$/MWh.

:math:`\pi^{RT}_{t,s}`: Real-time LMP forecasting from forecaster at hour t for scenario s, \$/MWh.

:math:`Pr^{H}`: Market price for hydrogen, \$/kg.

: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_{max}^{wind}`: Wind generator max capacity, MW.

:math:`C^{op}`: PEM operation cost coefficient, \$/MW.

:math:`C_{fix}^{wind}`: Wind generator fixed cost coefficient, \$/MW.

:math:`C_{fix}^{PEM}`: PEM fixed cost coefficient, \$/MW.

:math:`C_{H}`: Electricity to hydrogen conversion rate, kg/MWh.


**Variables**

:math:`P_{t,s}`: IES power output to the grid at hour t in scenario s, MW.

:math:`P_{t,s}^{DA}`: Day-ahead offering power at hour t in scenario s, MW.

:math:`P_{t,s}^{RT}`: Real-time offering power at hour t in scenario s, MW.

:math:`P_{t,s}^{wind}`: Wind power generation at hour t in scenario s, MW.

:math:`P_{t,s}^{PEM}`: Power delivered to PEM at hour t in scenario s, MW.

:math:`m_{t,s}^{H}`: Hydrogen production mass at hour t in scenario s, kg.

:math:`c_{t,s}`: IES operational cost at hour t in scenario s, \$.


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
Member

@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!


s.t.

.. math:: \hat{P}^{DA}_{t} \leq P_{t,s}^{RT} + P_{t,s}^{underbid} \quad \forall t, s \quad \quad (12)
.. math:: P_{t,s}^{RT} = P_{t,s} \quad \forall t, s \quad \quad (13)
.. math:: (\pi_{t,s'}^{RT} - \pi_{t,s}^{RT})(P_{t,s'}^{RT} - P_{t,s}^{RT}) \geq 0 \quad \forall s \in S, \forall s' \in S \backslash s, \forall t \in T^{RT} \quad \quad (14)
.. math:: P_{t,s}^{RT} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (15)
.. math:: P_{t,s}^{wind} \leq f_{t}P_{wind}^{max} \quad \forall t, s \quad \quad (16)
.. math:: P_{t,s}^{RT} + P_{t,s}^{PEM} \leq P_{t,s}^{wind} \quad \forall t, s \quad \quad (17)
.. math:: P_{t,s}^{PEM} \leq P_{max}^{PEM} \quad \forall t, s \quad \quad (18)
.. math:: m_{t,s}^{H} = P_{t,s}^{PEM}C_{H}\Delta t \quad \forall t, s \quad \quad (19)
.. math:: c_{t,s} = C^{op} P_{t,s}^{PEM}\quad \forall t, s \quad \quad (20)
.. math:: C_{fix} = C_{fix}^{wind}P_{max}^{wind} + C_{fix}^{PEM}P_{max}^{PEM} \quad \quad (21)

Before the actual operations, electricity markets allow the resources to submit real-time energy bids to
correct deviations from the day-ahead market. At this time, both day-ahead LMP :math:`\hat{\pi}_{t}^{DA}`
and day-ahead dispatch level :math:`\hat{P}_{t}^{DA}` have been realized as a result of the
day-ahead market clearing. In real-time market, due to the forecaster error and some other reasons, the
real-time offering power may not realize promises that generator owner makes in the day-ahead market. We
call this 'underbidding' and underbiding energy will be penaltized by the ISO. To prevent the underbidding
and loss of revenue, we add a relaxed lower bound for the real-time offering power with a slack
variable :math:`P_{t,s}^{underbid}` for underbidding in equation (12) and penalized in the objective function.

**Parameters**

:math:`\omega_{s}`: Frequency of each scenario.

:math:`\omega_{t}^{RT}`: Penalty for underbidding at real-time at hour t, \$/MWh.

:math:`\hat{\pi}_{t}^{DA}`: Realized day-ahead energy LMP signals at hour t, \$/MWh.

:math:`\hat{P}_{t}^{DA}`: Realized day-ahead dispatch level at hour t, \$/MWH.

:math:`\pi^{RT}_{t,s}`: Real-time LMP forecasting from forecaster at hour t for scenario s, \$/MWh.

:math:`Pr^{H}`: Market price for hydrogen, \$/kg.

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

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

:math:`P_{max}^{wind}`: Wind generator max capacity, MW.

:math:`C^{op}`: PEM operation cost coefficient, \$/MW.

:math:`C_{fix}^{wind}`: Wind generator fixed cost coefficient, \$/MW.

:math:`C_{fix}^{PEM}`: PEM fixed cost coefficient, \$/MW.

:math:`C_{H}`: Electricity to hydrogen conversion rate, kg/MWh.

**Variables**

:math:`P_{t,s}`: IES power output to the grid at hour t in scenario s, MW.

:math:`P_{t,s}^{underbid}`: The amount of underbidding power in real-time at hour t in scenario s, MW.

:math:`P_{t,s}^{RT}`: Real-time offering power at hour t in scenario s, MW.

:math:`P_{t,s}^{wind}`: Wind power generation at hour t in scenario s, MW.

:math:`P_{t,s}^{PEM}`: Power delivered to PEM at hour t in scenario s, MW.

:math:`m_{t,s}^{H}`: Hydrogen production mass at hour t in scenario s, kg.

:math:`c_{t,s}`: IES operational cost at hour t in scenario s, \$.

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
Member

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.


.. |example_bid| image:: images/example_bid.png
:width: 800
:alt: Alternative text
Expand Down
53 changes: 53 additions & 0 deletions docs/reference_guides/apps/grid_integration/Tracker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,59 @@ integrated energy system which consists of a thermal generator and an energy sto
The figure shows that to track the dispatch (load) the energy system can optimally
use power output from charging and discharging cycle.


Tracking Problem for Wind+PEM IES
----------------------------------

Here we present a tracking problem example for wind + PEM IES.


.. math:: \min \quad \sum_{t \in T^{RT}} (c_{t,0} + \omega_{t}(P^{+}_{t,0} + P^{-}_{t,0})) - C_{fix}

s.t.

.. math:: P_{t,0} + P_{t,0}^{-} = \hat{P}^{RT}_{t} + P^{+}_{t,0} \quad \forall t

.. math:: P_{t,0} + \hat{P}_{t,0}^{PEM} \leq \hat{P}_{wind}^{RT} \quad \forall t

.. math:: P_{t,0}^{PEM} \leq P_{max}^{PEM} \quad \forall t

.. math:: m_{t,0}^{H} = P_{t,0}^{PEM}C_{H}\Delta t \quad \forall t

.. math:: c_{t,0} = C^{op} P_{t,0}^{PEM}\quad \forall t

.. math:: C_{fix} = C_{fix}^{wind}P_{max}^{wind} + C_{fix}^{PEM}P_{max}^{PEM}

**Parameters**

:math:`\hat{P}^{RT}_{t}`: Realized real-time dispatch level at hour t, MW.

:math:`\hat{P}_{wind}^{RT}`: Realized wind generation power at hour t, MW.

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

:math:`C^{op}`: PEM operation cost coefficient, \$/MW.

:math:`C_{fix}^{wind}`: Wind generator fixed cost coefficient, \$/MW.

:math:`C_{fix}^{PEM}`: PEM fixed cost coefficient, \$/MW.

:math:`C_{H}`: Electricity to hydrogen conversion rate, kg/MWh.

**Variables**

:math:`P_{t,0}`: IES power output to the grid at hour t in scenario 0, MW.

:math:`P_{t,0}^{PEM}`: Power delivered to PEM at hour t in scenario 0, MW.

:math:`P_{t,0}^{+}`: Power over-delivered by the IES to the grid at hour t in scenario 0, MW.

:math:`P_{t,0}^{-}`: Power under-delivered by the IES to the grid at hour t in scenario 0, MW.

:math:`m_{t,0}^{H}`: Hydrogen production mass at hour t in scenario 0, kg.

:math:`c_{t,0}`: IES operational cost at hour t in scenario 0, \$.

.. |tracking_example| image:: images/tracking_example.png
:width: 1200
:alt: Alternative text
Expand Down
2 changes: 1 addition & 1 deletion docs/reference_guides/apps/grid_integration/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ the operational (hours to year timescale) interactions between energy systems an
wholesale electricity markets. For more information, please look at the introduction section.

.. toctree::
:maxdepth: 2
:maxdepth: 1

Introduction
Implementation
Expand Down
Loading