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

Changes to StaticBranch in FixValueFeedForward #1019

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,16 @@ construct_device!(

# For DC Power only. Implements constraints
function construct_device!(
::OptimizationContainer,
::PSY.System,
container::OptimizationContainer,
sys::PSY.System,
::ArgumentConstructStage,
::DeviceModel{<:PSY.ACBranch, StaticBranch},
model::DeviceModel{T, StaticBranch},
::NetworkModel{<:PM.AbstractActivePowerModel},
)
) where {T <: PSY.ACBranch}
devices =
get_available_components(T, sys, get_attribute(model, "filter_function"))

add_feedforward_arguments!(container, model, devices)
end

# For DC Power only. Implements constraints
Expand All @@ -196,6 +200,7 @@ function construct_device!(
devices =
get_available_components(T, sys, get_attribute(device_model, "filter_function"))
add_constraints!(container, RateLimitConstraint, devices, device_model, network_model)
add_feedforward_constraints!(container, device_model, devices)
add_constraint_dual!(container, sys, device_model)
return
end
Expand Down
1 change: 1 addition & 0 deletions src/devices_models/devices/AC_branches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
get_variable_binary(::PhaseShifterAngle, ::Type{PSY.PhaseShiftingTransformer}, ::AbstractBranchFormulation,) = false

get_variable_multiplier(_, ::Type{<:PSY.ACBranch}, _) = NaN
get_parameter_multiplier(::FixValueParameter, ::PSY.MonitoredLine, ::StaticBranch) = 1.0

Check warning on line 25 in src/devices_models/devices/AC_branches.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/devices/AC_branches.jl#L25

Added line #L25 was not covered by tests
jd-lara marked this conversation as resolved.
Show resolved Hide resolved
get_variable_multiplier(::PhaseShifterAngle, d::PSY.PhaseShiftingTransformer, ::PhaseAngleControl) = 1.0/PSY.get_x(d)

get_initial_conditions_device_model(::OperationModel, ::DeviceModel{T, <:AbstractBranchFormulation}) where {T <: PSY.ACBranch} = DeviceModel(T, StaticBranch)
Expand Down
Loading