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

Market bid cost with pwl cost curve #1182

Open
wants to merge 22 commits into
base: market_bid_cost
Choose a base branch
from

Conversation

purboday
Copy link

@purboday purboday commented Dec 9, 2024

  1. In src/devices_models/devices/common/objective_function/market_bid.jl added function _add_vom_cost_to_objective!.
  2. Updated "Test Thermal Generation MarketBidCost models" in test/test_device_thermal_generation_constructors.jl to make fixed_market_bid_cost run and pass.
  3. Other diffs caused by the formatter.

Copy link
Member

Choose a reason for hiding this comment

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

This file is useful but it shouldn't be checked out into the repo. I'd like the original test to be fixed.

Copy link
Author

Choose a reason for hiding this comment

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

Deleted the file.

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 79.78723% with 19 lines in your changes missing coverage. Please review.

Project coverage is 77.67%. Comparing base (f5b2a6d) to head (e737acb).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ls/devices/common/objective_function/market_bid.jl 79.12% 19 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1182      +/-   ##
==========================================
+ Coverage   77.23%   77.67%   +0.43%     
==========================================
  Files         121      121              
  Lines       13548    13641      +93     
==========================================
+ Hits        10464    10595     +131     
+ Misses       3084     3046      -38     
Flag Coverage Δ
unittests 77.67% <79.78%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/devices_models/devices/thermal_generation.jl 83.33% <100.00%> (-0.64%) ⬇️
src/utils/powersystems_utils.jl 62.50% <100.00%> (+0.36%) ⬆️
...ls/devices/common/objective_function/market_bid.jl 82.60% <79.12%> (+46.18%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Contributor

@GabrielKS GabrielKS left a comment

Choose a reason for hiding this comment

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

A few unsolicited comments from the software development point of view

@@ -179,6 +179,36 @@ function _get_pwl_cost_expression(
)
end

function _get_pwl_cost_expression_decremental(container::OptimizationContainer,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be implemented in a way that does not duplicate as much code from the incremental version? Maybe refactor both functions to call a helper function with the common code?

@@ -320,6 +364,43 @@ function _add_pwl_term!(
return pwl_cost_expressions
end

function _add_pwl_term_decremental!(container::OptimizationContainer,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same note about code duplication here

"""
Check if deceremental pwl offer curve is monotonically decreasing.
"""
function _is_convex_decremental(pwl:: PSY.PiecewiseStepData)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally this function would go in the same place as the existing is_convex, in IS/PSY. Maybe is_concave?

end


function _add_vom_cost_to_objective!(container::OptimizationContainer,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference between these two _add_vom_cost_to_objective! methods?



"""Overload get_variable for MarketBidCost. Returns nothing"""
PSY.get_variable(value::PSY.MarketBidCost) = nothing
Copy link
Contributor

@GabrielKS GabrielKS Jan 28, 2025

Choose a reason for hiding this comment

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

What is this for? If it is needed, it would ideally be put in PowerSystems. See here on "type piracy," better definition here.

@jd-lara jd-lara changed the base branch from main to market_bid_cost February 17, 2025 05:58
@jd-lara
Copy link
Member

jd-lara commented Feb 17, 2025

@GabrielKS and @purboday I changed the target of this PR to a new branch to fully develop and test this feature including the simulation capability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants