-
Notifications
You must be signed in to change notification settings - Fork 234
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
Price taker model for DISPATCHES, Rehashed #1358
base: main
Are you sure you want to change the base?
Changes from 128 commits
a3d688c
67ce6a2
e716c36
e3788fb
8ef54be
f154700
422d0ba
2f36bbb
0aa1034
9042e5c
5549028
2fde47f
d0a6c13
e5f6c07
56d9369
9b5edd4
948f40c
30fed63
fc43a3f
4170501
1d87aea
4710a10
be68154
66db0d8
b39f4d9
799ed0b
7625d07
0c2c461
16710a6
4518240
35ddead
fd15af9
b84ea43
15ea641
53e427e
14ee544
4e10801
d68d8fd
6cd966e
f7e3245
b223cf6
56f8099
48d4d98
fde3f31
5bd0d5b
0df8b45
fd595b4
a54c3ac
70cbaba
85b7bd0
9851b88
6ede14e
d31b272
769ba7b
0bba4d2
b06d467
0cf82bf
6af8c9e
1fc5f53
e991392
f2725cc
522023b
22dbe12
6dbb183
7a86d03
7a24fba
b1629eb
d193e65
fb543c7
460af99
c90bbe1
643707f
8aa02c6
323e4a9
04d07ae
4ae5779
893743d
82f8bdc
ebdc1b2
aad41fb
e2dac86
5ad727e
2ae4635
8762f7b
7110dea
8550569
69c3c9b
177618c
ce4b0fb
343d191
cec302e
652d1cc
d8ade5d
cd3f3d3
ce6b3db
f4cfbdb
cbd7aaa
f10ea59
46a3331
7bdd94d
1c85981
6956d73
8b4b479
646b88b
a1f1eb2
8101448
d8de0dd
fc7369e
75a56f4
df687af
47b66c5
8ac5987
d10b9a7
1e7842a
8b1393a
6481545
b9f3ef4
bd2db6f
9cf4a3a
112761f
fb0a05b
5d960a4
d7a0002
727be78
aebe5b8
411bb60
bd3244c
b8149b5
043ac34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Price Taker | ||
=========== | ||
|
||
Price takers are companies or individuals who must accept market prices since they lack the market share | ||
to directly influence the market price. Likewise, it is assumed that a price taker's resource or energy | ||
system is small enough such that it does not significantly impact the market. When coupled with multi-period modeling, | ||
the price-taker model is able to synthesize grid-centric modeling with steady-state process-centric modeling, as | ||
depicted in figure below. | ||
|
||
.. |pricetaker| image:: images/pricetaker.png | ||
:width: 1200 | ||
:alt: Alternative text | ||
:align: middle | ||
|
||
|pricetaker| | ||
|
||
The following equations represent the multi-period price taker model, where :math:`d` are design decisions, | ||
:math:`u` are operating decisions, :math:`δ` are power decisions, :math:`s` are scenarios (timeseries/representative days), | ||
:math:`w` is weight/frequency, :math:`R` is revenue, :math:`π` is price data, | ||
:math:`C` is capital and operating costs, :math:`g` is the process model, and :math:`h` is the temporal constraint. | ||
|
||
.. math:: | ||
|
||
max_{d,u, δ} = \sum_{s ∈ S} \sum_{t ∈ T} w_{s}[R(d,u_{s,t},δ_{s,t},π_{s,t}) - C(d,u_{s,t},δ_{s,t})] | ||
|
||
.. math:: | ||
|
||
g(d,u_{s,t},δ_{s,t}) = 0; ∀_{s} ∈ S, t ∈ T | ||
|
||
.. math:: | ||
|
||
h(d,u_{s,t},δ_{s,t},u_{s,t+1},δ_{s,t+1}) = 0; ∀_{s} ∈ S, t ∈ T | ||
|
||
|
||
The price taker multi-period modeling workflow involves the integration of multiple software platforms into the IDAES optimization model | ||
and can be broken down into two distinct functions, as shown in the figure below. In part 1, simulated or historical | ||
ISO (Independent System Operator) data is used to generate locational marginal price (LMP) | ||
signals, and production cost models (PCMs) are used to compute and optimize the time-varying dispatch schedules for each | ||
resource based on their respective bid curves. Advanced data analytics (RAVEN) reinterpret the LMP signals and PCM | ||
as stochastic realizations of the LMPs in the form of representative days (or simply the full-year price signals). | ||
In part 2, PRESCIENT uses a variety of input parameters (design capacity, minimum power output, ramp rate, minimum up/down time, marginal cost, no load cost, and startup profile) | ||
to generate data for the market surrogates. Meanwhile, IDAES uses the double loop simulation to integrate detailed | ||
process models (b, ii) into the daily (a, c) and hourly (i, iii) grid operations workflow. | ||
|
||
.. |hybrid_energy_system| image:: images/hybrid_energy_system.png | ||
:width: 1200 | ||
:alt: Alternative text | ||
:align: middle | ||
|
||
|hybrid_energy_system| | ||
|
||
.. module:: idaes.apps.grid_integration.multiperiod.price_taker_model | ||
|
||
.. autoclass:: PriceTakerModel | ||
:members: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Multi-Period Modeling | ||
===================== | ||
|
||
Multi-period modeling can be used to simplify dynamic optimization problems | ||
by linking steady-state models over a time horizon with rate-limiting constraints. | ||
Therefore, sets of constraints at one temporal index will affect decisions taken | ||
at a different moment in time. These interactions can be used to model the relationship | ||
between the energy systems and wholesale electricity markets. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
Price_Taker |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
################################################################################# | ||
# The Institute for the Design of Advanced Energy Systems Integrated Platform | ||
# Framework (IDAES IP) was produced under the DOE Institute for the | ||
# Design of Advanced Energy Systems (IDAES). | ||
# | ||
# Copyright (c) 2018-2023 by the software owners: The Regents of the | ||
# University of California, through Lawrence Berkeley National Laboratory, | ||
# National Technology & Engineering Solutions of Sandia, LLC, Carnegie Mellon | ||
# University, West Virginia University Research Corporation, et al. | ||
# All rights reserved. Please see the files COPYRIGHT.md and LICENSE.md | ||
# for full copyright and license information. | ||
################################################################################# | ||
from functools import reduce | ||
from pyomo.environ import ( | ||
Var, | ||
Param, | ||
Binary, | ||
Expression, | ||
NonNegativeReals, | ||
Constraint, | ||
) | ||
from pyomo.common.config import ConfigValue, In | ||
from idaes.core.base.process_base import declare_process_block_class | ||
from idaes.core.base.process_base import ProcessBlockData | ||
|
||
|
||
@declare_process_block_class("DesignModel") | ||
class DesignModelData(ProcessBlockData): | ||
""" | ||
Class for containing design model ... | ||
""" | ||
|
||
CONFIG = ProcessBlockData.CONFIG() | ||
CONFIG.declare( | ||
"model_func", | ||
ConfigValue( | ||
doc="Function that builds the design model", | ||
), | ||
) | ||
CONFIG.declare( | ||
"model_args", | ||
ConfigValue( | ||
default={}, | ||
doc="Dictionary containing arguments needed for model_func", | ||
), | ||
) | ||
|
||
def build(self): | ||
super().build() | ||
|
||
self.config.model_func(self, **self.config.model_args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a little odd to me - what exactly is the purpose of this class and function? As best I can tell, it appears to be a wrapper that lets a user write the |
||
|
||
|
||
@declare_process_block_class("OperationModel") | ||
class OperationModelData(ProcessBlockData): | ||
""" | ||
Class for containing design model ... | ||
""" | ||
|
||
CONFIG = ProcessBlockData.CONFIG() | ||
CONFIG.declare( | ||
"model_func", | ||
ConfigValue( | ||
doc="Function that builds the design model", | ||
), | ||
) | ||
CONFIG.declare( | ||
"model_args", | ||
ConfigValue( | ||
default={}, | ||
doc="Dictionary containing arguments needed for model_func", | ||
), | ||
) | ||
|
||
CONFIG.declare( | ||
"declare_op_vars", | ||
ConfigValue( | ||
default=True, | ||
domain=In([True, False]), | ||
doc="Should op_mode, startup, shutdown vars be defined?", | ||
), | ||
) | ||
CONFIG.declare( | ||
"append_lmp_data", | ||
ConfigValue( | ||
default=True, | ||
domain=In([True, False]), | ||
doc="Should LMP data automatically be appended to the model?", | ||
), | ||
) | ||
|
||
# noinspection PyAttributeOutsideInit | ||
def build(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, the usage of this class will need to be clearly documented, especially what |
||
super().build() | ||
|
||
# Build the model | ||
if self.config.declare_op_vars: | ||
self.op_mode = Var( | ||
within=Binary, | ||
doc="Binary var: 1 if the unit is operating, 0 otherwise", | ||
) | ||
|
||
self.startup = Var( | ||
within=Binary, | ||
doc="Binary var: 1 if the startup is initiated, 0 otherwise", | ||
) | ||
|
||
self.shutdown = Var( | ||
within=Binary, | ||
doc="Binary var: 1 if the shutdown is initiated, 0 otherwise", | ||
) | ||
|
||
if self.config.append_lmp_data: | ||
self.LMP = Param( | ||
initialize=1, | ||
mutable=True, | ||
doc="Parameter: Will be updated to LMP value at given time", | ||
) | ||
|
||
self.config.model_func(self, **self.config.model_args) | ||
radhakrishnatg marked this conversation as resolved.
Show resolved
Hide resolved
|
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 still do not know enough about what this class actually does to approve this. The docs do not explain what this is or how to use it, and I am not sure what this code actually adds (i.e. is it even necessary?).
For one, this needs a descriptive doc string to explain what it does.
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.
@radhakrishnatg would be the best person to respond to this.