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 Lossy Multi-Terminal HVDC models #1128

Draft
wants to merge 10 commits into
base: rhjd/add_ipc_models
Choose a base branch
from
2 changes: 2 additions & 0 deletions src/PowerSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export PhaseAngleControl

######## HVDC models ########
export LossLessConverter
export QuadraticLossConverter
export LossLessLine
export DCLossyLine
######## Load Models ########
export StaticPowerLoad
export PowerLoadInterruption
Expand Down
14 changes: 14 additions & 0 deletions src/core/auxiliary_variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@ Auxiliary Variable for Thermal Generation Models that solve for power above min
"""
struct PowerOutput <: AuxVariableType end

"""
Auxiliary Variable of DC Current Variables for DC Lines formulations

Docs abbreviation: ``i_l^{dc}``
"""
struct DCLineCurrent <: AuxVariableType end

"""
Auxiliary Variable of DC Current Variables for DC Lines formulations

Docs abbreviation: ``p_l^{loss}``
"""
struct DCLineLosses <: AuxVariableType end

convert_result_to_natural_units(::Type{PowerOutput}) = true
65 changes: 65 additions & 0 deletions src/core/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,68 @@ struct LineFlowBoundConstraint <: ConstraintType end

abstract type EventConstraint <: ConstraintType end
struct OutageConstraint <: EventConstraint end

"""
Struct to create the constraints that set the losses through a lossy Interconnecting Power Converter.

For more information check [Converter Formulations](@ref PowerSystems.Converter-Formulations).

The specified constraint is formulated as:

```math
\\begin{align*}
& i_c^{dc} = \\sum_{j \\in \\mathcal{B}^{DC}} \\frac{1}{r_{i,j}} (v_i - v_j), \\quad \\forall t \\in \\{1,\\dots, T\\}
\\end{align*}
```
"""
struct ConverterCurrentBalanceConstraint <: ConstraintType end

"""
Struct to create the constraints that compute the converter DC power based on current and voltage.

For more information check [Converter Formulations](@ref PowerSystems.Converter-Formulations).

The specified constraints are formulated as:

```math
\\begin{align*}
& p_c = 0.5 * (γ^sq - v^sq - i^sq), \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
& γ_c = v_c + i_c, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
\\end{align*}
```
"""
struct ConverterPowerCalculationConstraint <: ConstraintType end

"""
Struct to create the constraints that decide the operation direction of the converter.

For more information check [Converter Formulations](@ref PowerSystems.Converter-Formulations).

The specified constraints are formulated as:

```math
\\begin{align*}
& I_c^{min} (1 - κ_c) <= i_c <= κ_c * I_c^{max}, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
& P_c^{min} (1 - κ_c) <= p_c <= κ_c * P_c^{max}, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
\\end{align*}
```
"""
struct ConverterDirectionConstraint <: ConstraintType end

"""
Struct to create the McCormick envelopes constraints that decide the bounds on the DC active power.

For more information check [Converter Formulations](@ref PowerSystems.Converter-Formulations).

The specified constraints are formulated as:

```math
\\begin{align*}
& p_c >= V^{min} i_c + v_c I^{min} - I^{min}V^{min}, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
& p_c >= V^{max} i_c + v_c I^{max} - I^{max}V^{max}, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
& p_c <= V^{max} i_c + v_c I^{min} - I^{min}V^{max}, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
& p_c <= V^{min} i_c + v_c I^{max} - I^{max}V^{min}, \\quad \\forall t \\in \\{1,\\dots, T\\} \\\\
\\end{align*}
```
"""
struct ConverterMcCormickEnvelopes <: ConstraintType end
2 changes: 2 additions & 0 deletions src/core/expressions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
struct ComponentReserveDownBalanceExpression <: ExpressionType end
struct InterfaceTotalFlow <: ExpressionType end
struct PTDFBranchFlow <: ExpressionType end
struct DCCurrentBalance <: ExpressionType end

should_write_resulting_value(::Type{<:CostExpressions}) = true
should_write_resulting_value(::Type{InterfaceTotalFlow}) = true
should_write_resulting_value(::Type{RawACE}) = true
should_write_resulting_value(::Type{ActivePowerBalance}) = true
should_write_resulting_value(::Type{ReactivePowerBalance}) = true
should_write_resulting_value(::Type{DCCurrentBalance}) = true

Check warning on line 24 in src/core/expressions.jl

View check run for this annotation

Codecov / codecov/patch

src/core/expressions.jl#L24

Added line #L24 was not covered by tests

convert_result_to_natural_units(::Type{InterfaceTotalFlow}) = true
15 changes: 15 additions & 0 deletions src/core/formulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,26 @@ LossLess InterconnectingConverter Model
"""
struct LossLessConverter <: AbstractConverterFormulation end

"""
Linear Loss InterconnectingConverter Model
"""
struct LinearLossConverter <: AbstractConverterFormulation end

"""
Quadratic Loss InterconnectingConverter Model
"""
struct QuadraticLossConverter <: AbstractConverterFormulation end

"""
LossLess Line Abstract Model
"""
struct LossLessLine <: AbstractBranchFormulation end

"""
DC Loss Line Abstract Model
"""
struct DCLossyLine <: AbstractBranchFormulation end

############################## Network Model Formulations ##################################
# These formulations are taken directly from PowerModels

Expand Down
119 changes: 119 additions & 0 deletions src/core/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,125 @@ Docs abbreviation: ``\\theta``
"""
struct VoltageAngle <: VariableType end

"""
Struct to dispatch the creation of Voltage Variables for DC formulations

Docs abbreviation: ``v^{dc}``
"""
struct DCVoltage <: VariableType end

"""
Struct to dispatch the creation of Squared Voltage Variables for DC formulations

Docs abbreviation: ``v^{sq,dc}``
"""
struct SquaredDCVoltage <: VariableType end

"""
Struct to dispatch the creation of DC Converter Current Variables for DC formulations

Docs abbreviation: ``i_c^{dc}``
"""
struct ConverterCurrent <: VariableType end

"""
Struct to dispatch the creation of DC Converter Power Variables for DC formulations

Docs abbreviation: ``p_c^{dc}``
"""
struct ConverterDCPower <: VariableType end

"""
Struct to dispatch the creation of Squared DC Converter Current Variables for DC formulations

Docs abbreviation: ``i_c^{sq,dc}``
"""
struct SquaredConverterCurrent <: VariableType end

"""
Struct to dispatch the creation of DC Converter Positive Term Current Variables for DC formulations

Docs abbreviation: ``i_c^{+,dc}``
"""
struct ConverterPositiveCurrent <: VariableType end

"""
Struct to dispatch the creation of DC Converter Negative Term Current Variables for DC formulations

Docs abbreviation: ``i_c^{-,dc}``
"""
struct ConverterNegativeCurrent <: VariableType end

"""
Struct to dispatch the creation of DC Converter Binary for Absolute Value Current Variables for DC formulations

Docs abbreviation: `\\nu_c``
"""
struct ConverterBinaryAbsoluteValueCurrent <: VariableType end

"""
Struct to dispatch the creation of Binary Variable for Converter Power Direction

Docs abbreviation: ``\\kappa_c^{dc}``
"""
struct ConverterPowerDirection <: VariableType end

"""
Struct to dispatch the creation of Auxiliary Variable for Converter Bilinear term: v * i

Docs abbreviation: ``\\gamma_c^{dc}``
"""
struct AuxBilinearConverterVariable <: VariableType end

"""
Struct to dispatch the creation of Auxiliary Variable for Squared Converter Bilinear term: v * i

Docs abbreviation: ``\\gamma_c^{sq,dc}``
"""
struct AuxBilinearSquaredConverterVariable <: VariableType end

"""
Struct to dispatch the creation of Continuous Interpolation Variable for Squared Converter Voltage

Docs abbreviation: ``\\delta_c^{v}``
"""
struct InterpolationSquaredVoltageVariable <: VariableType end

"""
Struct to dispatch the creation of Binary Interpolation Variable for Squared Converter Voltage

Docs abbreviation: ``z_c^{v}``
"""
struct InterpolationBinarySquaredVoltageVariable <: VariableType end

"""
Struct to dispatch the creation of Continuous Interpolation Variable for Squared Converter Current

Docs abbreviation: ``\\delta_c^{i}``
"""
struct InterpolationSquaredCurrentVariable <: VariableType end

"""
Struct to dispatch the creation of Binary Interpolation Variable for Squared Converter Current

Docs abbreviation: ``z_c^{i}``
"""
struct InterpolationBinarySquaredCurrentVariable <: VariableType end

"""
Struct to dispatch the creation of Continuous Interpolation Variable for Squared Converter AuxVar

Docs abbreviation: ``\\delta_c^{\\gamma}``
"""
struct InterpolationSquaredBilinearVariable <: VariableType end

"""
Struct to dispatch the creation of Binary Interpolation Variable for Squared Converter AuxVar

Docs abbreviation: ``z_c^{\\gamma}``
"""
struct InterpolationBinarySquaredBilinearVariable <: VariableType end

"""
Struct to dispatch the creation of bidirectional Active Power Flow Variables

Expand Down
Loading
Loading