Skip to content

Commit

Permalink
Allow gen_var negative power (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
anamileva committed Aug 23, 2024
1 parent f2898b0 commit 3bd28c9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions gridpath/project/operations/operational_types/gen_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def add_model_components(
| | :code:`GenVar_Max_Downward_Reserves_Constraint` |
| | *Defined over*: :code:`GEN_VAR_OPR_TMPS` |
| |
| Downward reserves cannot exceed power provision. |
| Downward reserves cannot exceed power provision when the capacity |
| factor is non-negative (power is non-negative); otherwise they are set |
| to zero. |
+-------------------------------------------------------------------------+
"""
Expand Down Expand Up @@ -203,7 +205,7 @@ def add_model_components(
# Variables
###########################################################################

m.GenVar_Provide_Power_MW = Var(m.GEN_VAR_OPR_TMPS, within=NonNegativeReals)
m.GenVar_Provide_Power_MW = Var(m.GEN_VAR_OPR_TMPS, within=Reals)
m.GenVar_Scheduled_Curtailment_MW = Var(m.GEN_VAR_OPR_TMPS, within=NonNegativeReals)

# Expressions
Expand Down Expand Up @@ -317,7 +319,7 @@ def max_power_rule(mod, g, tmp):
**Constraint Name**: GenVar_Max_Power_Constraint
**Enforced Over**: GEN_VAR_OPR_TMPS
Power provision plus upward services cannot exceed available power, which
Power provision plus curtailment cannot exceed available power, which
is equal to the available capacity multiplied by the capacity factor.
"""
return (
Expand Down Expand Up @@ -346,10 +348,13 @@ def max_downward_reserves_rule(mod, g, tmp):
Downward reserves can't exceed power provision.
"""
return (
mod.GenVar_Provide_Power_MW[g, tmp] - mod.GenVar_Downwards_Reserves_MW[g, tmp]
>= 0
)
if mod.gen_var_cap_factor[g, tmp] >= 0:
return (
mod.GenVar_Downwards_Reserves_MW[g, tmp]
<= mod.GenVar_Provide_Power_MW[g, tmp]
)
else:
return mod.GenVar_Downwards_Reserves_MW[g, tmp] == 0


# Operational Type Methods
Expand Down

0 comments on commit 3bd28c9

Please sign in to comment.