-
Notifications
You must be signed in to change notification settings - Fork 122
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
Create write_operating_reserve_price_revenue.jl #611
Conversation
For printing the operating reserve prices and revenues
Partial updates to reserve and regulation price documentation and formulation
…gin folder to reserve folder
@JesseJenkins @dharik13 could you please check the formulation? @lbonaldo will need some feedback to refurbish the output writing. |
…f operating reserve and regulation revenue
typo fix for setup
@@ -19,6 +19,7 @@ function load_cap_reserve_margin!(setup::Dict, path::AbstractString, inputs::Dic | |||
mat = extract_matrix_from_dataframe(df, "CapRes") | |||
inputs["dfCapRes"] = mat | |||
inputs["NCapacityReserveMargin"] = size(mat, 2) | |||
print("Number of CRM types is ",inputs["NCapacityReserveMargin"]) |
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.
print("Number of CRM types is ",inputs["NCapacityReserveMargin"]) |
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.
It looks good to me.
For printing the operating reserve prices and revenues
Partial updates to reserve and regulation price documentation and formulation
…gin folder to reserve folder
…f operating reserve and regulation revenue
c96be15
to
5c3cca5
Compare
setup::Dict)::Vector{Float64} | ||
|
||
Operating regulation price for each time step. | ||
This is equal to the dual variable of the regulatin requirement constraint. |
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.
Typo: regulatin
> regulation
.
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.
Typo: "can be obtained form the solver." -> "can be obtained from the solver."
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.
Typo: "of each time steps" --> "in each time step"
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.
Thanks @cfe316 . Addressed these.
if setup["ParameterScale"] == 1 | ||
rsvrevenue *= scale_factor | ||
regrevenue *= scale_factor | ||
end |
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.
This doesn't need to be wrapped with the if
statement since scale_factor
is always defined.
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.
Thanks @cfe316 . Addressed this.
|
||
Function for writing net revenue of different generation technologies. | ||
""" | ||
function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::Model, dfCap::DataFrame, dfESRRev::DataFrame, dfResRevenue::DataFrame, dfChargingcost::DataFrame, dfPower::DataFrame, dfEnergyRevenue::DataFrame, dfSubRevenue::DataFrame, dfRegSubRevenue::DataFrame, dfVreStor::DataFrame) | ||
function write_net_revenue(path::AbstractString, inputs::Dict, setup::Dict, EP::Model, dfCap::DataFrame, dfESRRev::DataFrame, dfResRevenue::DataFrame, dfChargingcost::DataFrame, dfPower::DataFrame, dfEnergyRevenue::DataFrame, dfSubRevenue::DataFrame, dfRegSubRevenue::DataFrame, dfVreStor::DataFrame, dfOpRegRevenue::DataFrame, dfOpRsvRevenue::DataFrame) |
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.
This is a comment. We should really have an "outputs" dictionary so that we don't have this huge list of dataframes.
src/write_outputs/write_outputs.jl
Outdated
@@ -179,6 +179,14 @@ function write_outputs(EP::Model, path::AbstractString, setup::Dict, inputs::Dic | |||
dfResMar_slack = write_reserve_margin_slack(path, inputs, setup, EP) | |||
end | |||
end | |||
|
|||
if setup["Reserves"]==1 && has_duals(EP) == 1 |
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 realize this code is duplicated from elsewhere in the file, but has_duals
returns a boolean, so it's a bit redundant to use an == 1
. You can just do if setup["Reserves"]==1 && has_duals(EP)
.
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.
Thanks @cfe316 . Addressed these in all the instances
Typo fix in documentation. Name of function changed from write_operating_reserve_revenue to write_operating_reserve_regulation_revenue, since the function outputs both reserve and regulation revenue
Replaced all the has_duals(EP)==1 by has_duals(EP), since has_duals(EP) itself returns Boolean
Changed the name of function write_operating_reserve_revenue to write_operating_reserve_regulation_revenue. Also replaced has_duals(EP)==1 by has_duals(EP)
Got rid of the redundant if statement in scale factor
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 Sam,
I'd recommend removing the (... doubled) CHANGELOG entry under Fixed, since this is adding a new feature and not fixing a bug. Usually a PR will be either "Added" or "Fixed" but not both.
CHANGELOG.md
Outdated
- Fixes issue #46 | ||
- Add validation for `Reg_Max` and `Rsv_Max` columns in `Generators_data.csv` when `MUST_RUN` is set to 1 (#576) | ||
- Fix scaling of transmission losses in write_transmission_losses.jl (#621) | ||
- Fixes issue #46 (#611) |
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 Sam, this "fixed" line is now duplicated.
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'll again comment that it's useful to summarize for the reader what has been fixed.
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.
Actually, both lines should be removed as the change has been more accurately summarized in the Added section.
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.
Thanks @cfe316 , just did
…his PR is a feature addition
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.
Looks good now, thanks!
Description
For printing the operating reserve prices and revenues: This PR adds the file
write_operating_reserve_price_revenue.jl
which calculates the annual revenue earned byeach resource for providing operating reserve and regulation services. This PR is motivated by and is attempting to
resolve the Issue #46.
The way this PR has been implemented is very similar to how annual energy revenue is calculated. That is, first the
dual variables corresponding to the operating reserve and regulation constraints are evaluated and then those are multiplied by the decision variable values for the regulation and reserves for each generator.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Please use this format to link issue numbers: Fixes #46
Checklist
How this can be tested
This PR does not alter any output. It can be tested simply by running any of the example cases for which the
Reserve
option is checked.Post-approval checklist for GenX core developers
After the PR is approved