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 Thermal Slacks for UB and LB constraints (including ramps) #1207

Merged
merged 15 commits into from
Jan 7, 2025
2 changes: 2 additions & 0 deletions docs/src/api/PowerSimulations.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ For a list of variables for each device refer to its Formulations page.
ActivePowerVariable
ReactivePowerVariable
PieceWiseLinearCostVariable
RateofChangeConstraintSlackUp
RateofChangeConstraintSlackDown
```

### Thermal Unit Variables
Expand Down
44 changes: 40 additions & 4 deletions docs/src/formulation_library/ThermalGen.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,22 @@ ThermalStandardDispatch
+ Bounds: [0.0, ]
+ Symbol: ``q^\text{th}``

If Slack variables are enabled (`use_slacks = true`):

- [`RateofChangeConstraintSlackUp`](@ref):

+ Bounds: [0.0, ]
+ Default initial value: 0.0
+ Default proportional cost: 2e5
+ Symbol: ``p^\text{sl,up}``

- [`RateofChangeConstraintSlackDown`](@ref):

+ Bounds: [0.0, ]
+ Default initial value: 0.0
+ Default proportional cost: 2e5
+ Symbol: ``p^\text{sl,dn}``

**Static Parameters:**

- ``P^\text{th,min}`` = `PowerSystems.get_active_power_limits(device).min`
Expand All @@ -223,8 +239,10 @@ For each thermal unit creates the range constraints for its active and reactive
\begin{align*}
& P^\text{th,min} \le p^\text{th}_t \le P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\
& Q^\text{th,min} \le q^\text{th}_t \le Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\
& -R^\text{th,dn} \le p_1^\text{th} - p^\text{th, init} \le R^\text{th,up} \\
& -R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} \le R^\text{th,up}, \quad \forall t\in \{2, \dots, T\}
& p_1^\text{th} - p^\text{th, init} - p_1^\text{sl,up} \le R^\text{th,up} \\
& p_t^\text{th} - p_{t-1}^\text{th} - p_t^\text{sl,up}\le R^\text{th,up}, \quad \forall t\in \{2, \dots, T\} \\
& -R^\text{th,dn} \le p_1^\text{th} - p^\text{th, init} + p_1^\text{sl,dn} \\
& -R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} + p_t^\text{sl,dn}, \quad \forall t\in \{2, \dots, T\} \\
\end{align*}
```

Expand Down Expand Up @@ -498,6 +516,22 @@ ThermalStandardUnitCommitment
+ Bounds: ``\{0,1\}``
+ Symbol: ``w_t^\text{th}``

If Slack variables are enabled (`use_slacks = true`):

- [`RateofChangeConstraintSlackUp`](@ref):

+ Bounds: [0.0, ]
+ Default initial value: 0.0
+ Default proportional cost: 2e5
+ Symbol: ``p^\text{sl,up}``

- [`RateofChangeConstraintSlackDown`](@ref):

+ Bounds: [0.0, ]
+ Default initial value: 0.0
+ Default proportional cost: 2e5
+ Symbol: ``p^\text{sl,dn}``

**Auxiliary Variables:**

- [`TimeDurationOn`](@ref):
Expand Down Expand Up @@ -537,8 +571,10 @@ For each thermal unit creates the range constraints for its active and reactive
\begin{align*}
& u^\text{th}_t P^\text{th,min} \le p^\text{th}_t \le u^\text{th}_t P^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\
& u_t^\text{th} Q^\text{th,min} \le q^\text{th}_t \le u_t^\text{th} Q^\text{th,max}, \quad \forall t\in \{1, \dots, T\} \\
& -R^\text{th,dn} \le p_1^\text{th} - p^\text{th, init} \le R^\text{th,up} \\
& -R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} \le R^\text{th,up}, \quad \forall t\in \{2, \dots, T\} \\
& p_1^\text{th} - p^\text{th, init} - p_1^\text{sl,up} \le R^\text{th,up} \\
& p_t^\text{th} - p_{t-1}^\text{th} - p_t^\text{sl,up} \le R^\text{th,up}, \quad \forall t\in \{2, \dots, T\} \\
& -R^\text{th,dn} \le p_1^\text{th} - p^\text{th, init} + p_1^\text{sl,dn} \\
& -R^\text{th,dn} \le p_t^\text{th} - p_{t-1}^\text{th} + p_t^\text{sl,dn}, \quad \forall t\in \{2, \dots, T\} \\
& u_1^\text{th} = u^\text{th,init} + v_1^\text{th} - w_1^\text{th} \\
& u_t^\text{th} = u_{t-1}^\text{th} + v_t^\text{th} - w_t^\text{th}, \quad \forall t \in \{2,\dots,T\} \\
& v_t^\text{th} + w_t^\text{th} \le 1, \quad \forall t \in \{1,\dots,T\}
Expand Down
2 changes: 2 additions & 0 deletions src/PowerSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ export LowerBoundFeedForwardSlack
export InterfaceFlowSlackUp
export InterfaceFlowSlackDown
export PieceWiseLinearCostVariable
export RateofChangeConstraintSlackUp
export RateofChangeConstraintSlackDown

# Auxiliary variables
export TimeDurationOn
Expand Down
15 changes: 15 additions & 0 deletions src/core/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,19 @@
"""
struct LowerBoundFeedForwardSlack <: VariableType end

"""
Struct to dispatch the creation of Slack variables for rate of change constraints up limits

Docs abbreviation: ``p^\\text{sl,up}``
"""
struct RateofChangeConstraintSlackUp <: VariableType end
"""
Struct to dispatch the creation of Slack variables for rate of change constraints down limits

Docs abbreviation: ``p^\\text{sl,dn}``
"""
struct RateofChangeConstraintSlackDown <: VariableType end

const START_VARIABLES = (HotStartVariable, WarmStartVariable, ColdStartVariable)

should_write_resulting_value(::Type{PieceWiseLinearCostVariable}) = false
Expand All @@ -312,6 +325,8 @@
convert_result_to_natural_units(::Type{ReactivePowerVariable}) = true
convert_result_to_natural_units(::Type{ActivePowerReserveVariable}) = true
convert_result_to_natural_units(::Type{ServiceRequirementVariable}) = true
convert_result_to_natural_units(::Type{RateofChangeConstraintSlackUp}) = true
convert_result_to_natural_units(::Type{RateofChangeConstraintSlackDown}) = true

Check warning on line 329 in src/core/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/core/variables.jl#L328-L329

Added lines #L328 - L329 were not covered by tests
convert_result_to_natural_units(::Type{AreaMismatchVariable}) = true
convert_result_to_natural_units(::Type{DeltaActivePowerUpVariable}) = true
convert_result_to_natural_units(::Type{DeltaActivePowerDownVariable}) = true
Expand Down
Loading
Loading