-
Notifications
You must be signed in to change notification settings - Fork 81
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 2t line physical model #1205
Open
rodrigomha
wants to merge
10
commits into
main
Choose a base branch
from
rh/add_2t_physical_model
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c879689
add 2t line
rodrigomha da53cb9
add export
rodrigomha b73c7a0
add voltage limits
rodrigomha 5fb82df
update type to minmax
rodrigomha 3f79431
update to quadraticcurve
rodrigomha 071b893
add from and to limits
rodrigomha 697bb2d
Merge branch 'main' into rh/add_2t_physical_model
rodrigomha cd4500d
update name to VSC line
rodrigomha 3fc6b33
add reactive power limits
rodrigomha 9409259
Merge branch 'main' into rh/add_2t_physical_model
rodrigomha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
#= | ||
This file is auto-generated. Do not edit. | ||
=# | ||
|
||
#! format: off | ||
|
||
""" | ||
mutable struct TwoTerminalVSCLine <: ACBranch | ||
name::String | ||
available::Bool | ||
active_power_flow::Float64 | ||
rating::Float64 | ||
active_power_limits_from::MinMax | ||
active_power_limits_to::MinMax | ||
arc::Arc | ||
converter_loss::Union{LinearCurve, QuadraticCurve} | ||
dc_current::Float64 | ||
max_dc_current::Float64 | ||
g::Float64 | ||
voltage_limits::MinMax | ||
services::Vector{Service} | ||
ext::Dict{String, Any} | ||
internal::InfrastructureSystemsInternal | ||
end | ||
|
||
A High Voltage DC line, which must be connected to an [`ACBus`](@ref) on each end. | ||
|
||
This model is appropriate for operational simulations with a linearized DC power flow approximation with losses using a voltage-current model. For modeling a DC network, see [`TModelHVDCLine`](@ref) | ||
|
||
# Arguments | ||
- `name::String`: Name of the component. Components of the same type (e.g., `PowerLoad`) must have unique names, but components of different types (e.g., `PowerLoad` and `ACBus`) can have the same name | ||
- `available::Bool`: Indicator of whether the component is connected and online (`true`) or disconnected, offline, or down (`false`). Unavailable components are excluded during simulations | ||
- `active_power_flow::Float64`: Initial condition of active power flowing from the from-bus to the to-bus in DC. | ||
- `rating::Float64`: Maximum output power rating of the converter (MVA), validation range: `(0, nothing)` | ||
- `active_power_limits_from::MinMax`: Minimum and maximum active power flows to the FROM node (MW) | ||
- `active_power_limits_to::MinMax`: Minimum and maximum active power flows to the TO node (MW) | ||
- `arc::Arc`: An [`Arc`](@ref) defining this line `from` a bus `to` another bus | ||
- `converter_loss::Union{LinearCurve, QuadraticCurve}`: (default: `LinearCurve(0.0)`) Loss model coefficients. It accepts a linear model or quadratic. Same converter data is used in both ends. | ||
- `dc_current::Float64`: (default: `0.0`) DC current (A) on the converter on the from-bus DC side. | ||
- `max_dc_current::Float64`: (default: `1e8`) Maximum stable dc current limits (A). Includes converter and DC line. | ||
- `g::Float64`: (default: `0.0`) Series conductance of the DC line in pu ([`SYSTEM_BASE`](@ref per_unit)) | ||
- `voltage_limits::MinMax`: (default: `(min=0.0, max=999.9)`) Limits on the Voltage at the DC Bus. | ||
- `services::Vector{Service}`: (default: `Device[]`) Services that this device contributes to | ||
- `ext::Dict{String, Any}`: (default: `Dict{String, Any}()`) An [*ext*ra dictionary](@ref additional_fields) for users to add metadata that are not used in simulation, such as latitude and longitude. | ||
- `internal::InfrastructureSystemsInternal`: (**Do not modify.**) PowerSystems.jl internal reference | ||
""" | ||
mutable struct TwoTerminalVSCLine <: ACBranch | ||
"Name of the component. Components of the same type (e.g., `PowerLoad`) must have unique names, but components of different types (e.g., `PowerLoad` and `ACBus`) can have the same name" | ||
name::String | ||
"Indicator of whether the component is connected and online (`true`) or disconnected, offline, or down (`false`). Unavailable components are excluded during simulations" | ||
available::Bool | ||
"Initial condition of active power flowing from the from-bus to the to-bus in DC." | ||
active_power_flow::Float64 | ||
"Maximum output power rating of the converter (MVA)" | ||
rating::Float64 | ||
"Minimum and maximum active power flows to the FROM node (MW)" | ||
active_power_limits_from::MinMax | ||
"Minimum and maximum active power flows to the TO node (MW)" | ||
active_power_limits_to::MinMax | ||
"An [`Arc`](@ref) defining this line `from` a bus `to` another bus" | ||
arc::Arc | ||
"Loss model coefficients. It accepts a linear model or quadratic. Same converter data is used in both ends." | ||
converter_loss::Union{LinearCurve, QuadraticCurve} | ||
"DC current (A) on the converter on the from-bus DC side." | ||
dc_current::Float64 | ||
"Maximum stable dc current limits (A). Includes converter and DC line." | ||
max_dc_current::Float64 | ||
"Series conductance of the DC line in pu ([`SYSTEM_BASE`](@ref per_unit))" | ||
g::Float64 | ||
"Limits on the Voltage at the DC Bus." | ||
voltage_limits::MinMax | ||
"Services that this device contributes to" | ||
services::Vector{Service} | ||
"An [*ext*ra dictionary](@ref additional_fields) for users to add metadata that are not used in simulation, such as latitude and longitude." | ||
ext::Dict{String, Any} | ||
"(**Do not modify.**) PowerSystems.jl internal reference" | ||
internal::InfrastructureSystemsInternal | ||
end | ||
|
||
function TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss=LinearCurve(0.0), dc_current=0.0, max_dc_current=1e8, g=0.0, voltage_limits=(min=0.0, max=999.9), services=Device[], ext=Dict{String, Any}(), ) | ||
TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss, dc_current, max_dc_current, g, voltage_limits, services, ext, InfrastructureSystemsInternal(), ) | ||
end | ||
|
||
function TwoTerminalVSCLine(; name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss=LinearCurve(0.0), dc_current=0.0, max_dc_current=1e8, g=0.0, voltage_limits=(min=0.0, max=999.9), services=Device[], ext=Dict{String, Any}(), internal=InfrastructureSystemsInternal(), ) | ||
TwoTerminalVSCLine(name, available, active_power_flow, rating, active_power_limits_from, active_power_limits_to, arc, converter_loss, dc_current, max_dc_current, g, voltage_limits, services, ext, internal, ) | ||
end | ||
|
||
# Constructor for demo purposes; non-functional. | ||
function TwoTerminalVSCLine(::Nothing) | ||
TwoTerminalVSCLine(; | ||
name="init", | ||
available=false, | ||
active_power_flow=0.0, | ||
rating=0.0, | ||
active_power_limits_from=(min=0.0, max=0.0), | ||
active_power_limits_to=(min=0.0, max=0.0), | ||
arc=Arc(ACBus(nothing), ACBus(nothing)), | ||
converter_loss=LinearCurve(0.0), | ||
dc_current=0.0, | ||
max_dc_current=0.0, | ||
g=0.0, | ||
voltage_limits=(min=0.0, max=0.0), | ||
services=Device[], | ||
ext=Dict{String, Any}(), | ||
) | ||
end | ||
|
||
"""Get [`TwoTerminalVSCLine`](@ref) `name`.""" | ||
get_name(value::TwoTerminalVSCLine) = value.name | ||
"""Get [`TwoTerminalVSCLine`](@ref) `available`.""" | ||
get_available(value::TwoTerminalVSCLine) = value.available | ||
"""Get [`TwoTerminalVSCLine`](@ref) `active_power_flow`.""" | ||
get_active_power_flow(value::TwoTerminalVSCLine) = get_value(value, value.active_power_flow) | ||
"""Get [`TwoTerminalVSCLine`](@ref) `rating`.""" | ||
get_rating(value::TwoTerminalVSCLine) = get_value(value, value.rating) | ||
"""Get [`TwoTerminalVSCLine`](@ref) `active_power_limits_from`.""" | ||
get_active_power_limits_from(value::TwoTerminalVSCLine) = get_value(value, value.active_power_limits_from) | ||
"""Get [`TwoTerminalVSCLine`](@ref) `active_power_limits_to`.""" | ||
get_active_power_limits_to(value::TwoTerminalVSCLine) = get_value(value, value.active_power_limits_to) | ||
"""Get [`TwoTerminalVSCLine`](@ref) `arc`.""" | ||
get_arc(value::TwoTerminalVSCLine) = value.arc | ||
"""Get [`TwoTerminalVSCLine`](@ref) `converter_loss`.""" | ||
get_converter_loss(value::TwoTerminalVSCLine) = value.converter_loss | ||
"""Get [`TwoTerminalVSCLine`](@ref) `dc_current`.""" | ||
get_dc_current(value::TwoTerminalVSCLine) = value.dc_current | ||
"""Get [`TwoTerminalVSCLine`](@ref) `max_dc_current`.""" | ||
get_max_dc_current(value::TwoTerminalVSCLine) = value.max_dc_current | ||
"""Get [`TwoTerminalVSCLine`](@ref) `g`.""" | ||
get_g(value::TwoTerminalVSCLine) = value.g | ||
"""Get [`TwoTerminalVSCLine`](@ref) `voltage_limits`.""" | ||
get_voltage_limits(value::TwoTerminalVSCLine) = value.voltage_limits | ||
"""Get [`TwoTerminalVSCLine`](@ref) `services`.""" | ||
get_services(value::TwoTerminalVSCLine) = value.services | ||
"""Get [`TwoTerminalVSCLine`](@ref) `ext`.""" | ||
get_ext(value::TwoTerminalVSCLine) = value.ext | ||
"""Get [`TwoTerminalVSCLine`](@ref) `internal`.""" | ||
get_internal(value::TwoTerminalVSCLine) = value.internal | ||
|
||
"""Set [`TwoTerminalVSCLine`](@ref) `available`.""" | ||
set_available!(value::TwoTerminalVSCLine, val) = value.available = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `active_power_flow`.""" | ||
set_active_power_flow!(value::TwoTerminalVSCLine, val) = value.active_power_flow = set_value(value, val) | ||
"""Set [`TwoTerminalVSCLine`](@ref) `rating`.""" | ||
set_rating!(value::TwoTerminalVSCLine, val) = value.rating = set_value(value, val) | ||
"""Set [`TwoTerminalVSCLine`](@ref) `active_power_limits_from`.""" | ||
set_active_power_limits_from!(value::TwoTerminalVSCLine, val) = value.active_power_limits_from = set_value(value, val) | ||
"""Set [`TwoTerminalVSCLine`](@ref) `active_power_limits_to`.""" | ||
set_active_power_limits_to!(value::TwoTerminalVSCLine, val) = value.active_power_limits_to = set_value(value, val) | ||
"""Set [`TwoTerminalVSCLine`](@ref) `arc`.""" | ||
set_arc!(value::TwoTerminalVSCLine, val) = value.arc = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `converter_loss`.""" | ||
set_converter_loss!(value::TwoTerminalVSCLine, val) = value.converter_loss = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `dc_current`.""" | ||
set_dc_current!(value::TwoTerminalVSCLine, val) = value.dc_current = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `max_dc_current`.""" | ||
set_max_dc_current!(value::TwoTerminalVSCLine, val) = value.max_dc_current = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `g`.""" | ||
set_g!(value::TwoTerminalVSCLine, val) = value.g = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `voltage_limits`.""" | ||
set_voltage_limits!(value::TwoTerminalVSCLine, val) = value.voltage_limits = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `services`.""" | ||
set_services!(value::TwoTerminalVSCLine, val) = value.services = val | ||
"""Set [`TwoTerminalVSCLine`](@ref) `ext`.""" | ||
set_ext!(value::TwoTerminalVSCLine, val) = value.ext = val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment that this will be dropped in PSY 5.0 please.