Skip to content

Commit b2b50ea

Browse files
Copilotjd-lara
authored andcommitted
Add reactive_power_limits to InterconnectingConverter (#1669)
* Initial plan * Add reactive_power_limits field to InterconnectingConverter Agent-Logs-Url: https://github.com/Sienna-Platform/PowerSystems.jl/sessions/1101af9f-308b-4e5a-9e1f-2800fb31a921 Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jd-lara <16385323+jd-lara@users.noreply.github.com>
1 parent 1c8739c commit b2b50ea

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

src/descriptors/power_system_structs.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5084,6 +5084,15 @@
50845084
},
50855085
"validation_action": "warn"
50865086
},
5087+
{
5088+
"name": "reactive_power_limits",
5089+
"comment": "Minimum and maximum reactive power limits. Set to `Nothing` if not applicable",
5090+
"null_value": "nothing",
5091+
"data_type": "Union{Nothing, MinMax}",
5092+
"needs_conversion": true,
5093+
"conversion_unit": ":mva",
5094+
"default": "nothing"
5095+
},
50875096
{
50885097
"name": "dc_current",
50895098
"comment": "DC current (A) on the converter",

src/models/generated/InterconnectingConverter.jl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This file is auto-generated. Do not edit.
1414
rating::Float64
1515
active_power_limits::MinMax
1616
base_power::Float64
17+
reactive_power_limits::Union{Nothing, MinMax}
1718
dc_current::Float64
1819
max_dc_current::Float64
1920
loss_function::Union{LinearCurve, QuadraticCurve}
@@ -34,6 +35,7 @@ Interconnecting Power Converter (IPC) for transforming power from an ACBus to a
3435
- `rating::Float64`: Maximum output power rating of the converter (MVA), validation range: `(0, nothing)`
3536
- `active_power_limits::MinMax`: Minimum and maximum stable active power levels (MW)
3637
- `base_power::Float64`: Base power of the converter in MVA, validation range: `(0.0001, nothing)`
38+
- `reactive_power_limits::Union{Nothing, MinMax}`: (default: `nothing`) Minimum and maximum reactive power limits. Set to `Nothing` if not applicable
3739
- `dc_current::Float64`: (default: `0.0`) DC current (A) on the converter
3840
- `max_dc_current::Float64`: (default: `1e8`) Maximum stable dc current limits (A)
3941
- `loss_function::Union{LinearCurve, QuadraticCurve}`: (default: `LinearCurve(0.0)`) Linear or quadratic loss function with respect to the converter current
@@ -59,6 +61,8 @@ mutable struct InterconnectingConverter <: StaticInjection
5961
active_power_limits::MinMax
6062
"Base power of the converter in MVA"
6163
base_power::Float64
64+
"Minimum and maximum reactive power limits. Set to `Nothing` if not applicable"
65+
reactive_power_limits::Union{Nothing, MinMax}
6266
"DC current (A) on the converter"
6367
dc_current::Float64
6468
"Maximum stable dc current limits (A)"
@@ -75,12 +79,12 @@ mutable struct InterconnectingConverter <: StaticInjection
7579
internal::InfrastructureSystemsInternal
7680
end
7781

78-
function InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, dc_current=0.0, max_dc_current=1e8, loss_function=LinearCurve(0.0), services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), )
79-
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, dc_current, max_dc_current, loss_function, services, dynamic_injector, ext, InfrastructureSystemsInternal(), )
82+
function InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, reactive_power_limits=nothing, dc_current=0.0, max_dc_current=1e8, loss_function=LinearCurve(0.0), services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), )
83+
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, reactive_power_limits, dc_current, max_dc_current, loss_function, services, dynamic_injector, ext, InfrastructureSystemsInternal(), )
8084
end
8185

82-
function InterconnectingConverter(; name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, dc_current=0.0, max_dc_current=1e8, loss_function=LinearCurve(0.0), services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), )
83-
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, dc_current, max_dc_current, loss_function, services, dynamic_injector, ext, internal, )
86+
function InterconnectingConverter(; name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, reactive_power_limits=nothing, dc_current=0.0, max_dc_current=1e8, loss_function=LinearCurve(0.0), services=Device[], dynamic_injector=nothing, ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), )
87+
InterconnectingConverter(name, available, bus, dc_bus, active_power, rating, active_power_limits, base_power, reactive_power_limits, dc_current, max_dc_current, loss_function, services, dynamic_injector, ext, internal, )
8488
end
8589

8690
# Constructor for demo purposes; non-functional.
@@ -94,6 +98,7 @@ function InterconnectingConverter(::Nothing)
9498
rating=0.0,
9599
active_power_limits=(min=0.0, max=0.0),
96100
base_power=100,
101+
reactive_power_limits=nothing,
97102
dc_current=0.0,
98103
max_dc_current=0.0,
99104
loss_function=LinearCurve(0.0),
@@ -119,6 +124,8 @@ get_rating(value::InterconnectingConverter) = get_value(value, Val(:rating), Val
119124
get_active_power_limits(value::InterconnectingConverter) = get_value(value, Val(:active_power_limits), Val(:mva))
120125
"""Get [`InterconnectingConverter`](@ref) `base_power`."""
121126
get_base_power(value::InterconnectingConverter) = value.base_power
127+
"""Get [`InterconnectingConverter`](@ref) `reactive_power_limits`."""
128+
get_reactive_power_limits(value::InterconnectingConverter) = get_value(value, Val(:reactive_power_limits), Val(:mva))
122129
"""Get [`InterconnectingConverter`](@ref) `dc_current`."""
123130
get_dc_current(value::InterconnectingConverter) = value.dc_current
124131
"""Get [`InterconnectingConverter`](@ref) `max_dc_current`."""
@@ -148,6 +155,8 @@ set_rating!(value::InterconnectingConverter, val) = value.rating = set_value(val
148155
set_active_power_limits!(value::InterconnectingConverter, val) = value.active_power_limits = set_value(value, Val(:active_power_limits), val, Val(:mva))
149156
"""Set [`InterconnectingConverter`](@ref) `base_power`."""
150157
set_base_power!(value::InterconnectingConverter, val) = value.base_power = val
158+
"""Set [`InterconnectingConverter`](@ref) `reactive_power_limits`."""
159+
set_reactive_power_limits!(value::InterconnectingConverter, val) = value.reactive_power_limits = set_value(value, Val(:reactive_power_limits), val, Val(:mva))
151160
"""Set [`InterconnectingConverter`](@ref) `dc_current`."""
152161
set_dc_current!(value::InterconnectingConverter, val) = value.dc_current = val
153162
"""Set [`InterconnectingConverter`](@ref) `max_dc_current`."""

0 commit comments

Comments
 (0)