Skip to content

Commit

Permalink
update ffs to branch models
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigomha committed Dec 26, 2024
1 parent 35d9f8e commit 7ab39f7
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ function construct_device!(
),
)
end
devices = get_available_components(device_model, sys)
add_feedforward_arguments!(container, device_model, devices)
return
end

Expand Down Expand Up @@ -452,7 +454,7 @@ function construct_device!(
network_model,
)
add_constraint_dual!(container, sys, device_model)

add_feedforward_constraints!(container, device_model, devices)
return
end

Expand All @@ -466,6 +468,7 @@ function construct_device!(
devices = get_available_components(device_model, sys)
branch_rate_bounds!(container, devices, device_model, network_model)
add_constraint_dual!(container, sys, device_model)
add_feedforward_constraints!(container, device_model, devices)
return
end

Expand Down Expand Up @@ -494,6 +497,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_arguments!(container, model, devices)
end
return
end
Expand All @@ -516,17 +520,20 @@ function construct_device!(
network_model,
)
add_constraint_dual!(container, sys, model)
add_feedforward_constraints!(container, model, devices)
end
return
end

function construct_device!(
::OptimizationContainer,
::PSY.System,
container::OptimizationContainer,
sys::PSY.System,
::ArgumentConstructStage,
::DeviceModel{T, HVDCTwoTerminalUnbounded},
device_model::DeviceModel{T, HVDCTwoTerminalUnbounded},
::NetworkModel{<:PM.AbstractPowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices = get_available_components(device_model, sys)
add_feedforward_arguments!(container, device_model, devices)
return
end

Expand All @@ -537,7 +544,9 @@ function construct_device!(
device_model::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded},
::NetworkModel{<:PM.AbstractPowerModel},
)
devices = get_available_components(device_model, sys)
add_constraint_dual!(container, sys, device_model)
add_feedforward_constraints!(container, device_model, devices)
return
end

Expand All @@ -558,6 +567,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_arguments!(container, model, devices)

Check warning on line 570 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L570

Added line #L570 was not covered by tests
return
end

Expand All @@ -568,7 +578,9 @@ function construct_device!(
device_model::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded},
::NetworkModel{CopperPlatePowerModel},
)
devices = get_available_components(device_model, sys)

Check warning on line 581 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L581

Added line #L581 was not covered by tests
add_constraint_dual!(container, sys, device_model)
add_feedforward_constraints!(container, model, devices)

Check warning on line 583 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L583

Added line #L583 was not covered by tests
return
end

Expand All @@ -590,6 +602,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_arguments!(container, model, devices)
return
end

Expand All @@ -601,17 +614,21 @@ function construct_device!(
model::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded},
network_model::NetworkModel{<:AbstractPTDFModel},
)
devices = get_available_components(model, sys)
add_constraint_dual!(container, sys, model)
add_feedforward_constraints!(container, model, devices)
return
end

function construct_device!(
::OptimizationContainer,
::PSY.System,
container::OptimizationContainer,
sys::PSY.System,
::ArgumentConstructStage,
::DeviceModel{T, HVDCTwoTerminalLossless},
model::DeviceModel{T, HVDCTwoTerminalLossless},
::NetworkModel{<:PM.AbstractPowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices = get_available_components(model, sys)
add_feedforward_arguments!(container, model, devices)
return
end

Expand All @@ -625,6 +642,7 @@ function construct_device!(
devices = get_available_components(model, sys)
add_constraints!(container, FlowRateConstraint, devices, model, network_model)
add_constraint_dual!(container, sys, model)
add_feedforward_constraints!(container, model, devices)
return
end

Expand All @@ -646,6 +664,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_arguments!(container, model, devices)
return
end

Expand All @@ -662,6 +681,7 @@ function construct_device!(
devices = get_available_components(model, sys)
add_constraints!(container, FlowRateConstraint, devices, model, network_model)
add_constraint_dual!(container, sys, model)
add_feedforward_constraints!(container, model, devices)
return
end

Expand Down Expand Up @@ -711,6 +731,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_arguments!(container, model, devices)
return
end

Expand All @@ -725,6 +746,8 @@ function construct_device!(
add_constraints!(container, FlowRateConstraintFromTo, devices, model, network_model)
add_constraints!(container, FlowRateConstraintToFrom, devices, model, network_model)
add_constraints!(container, HVDCPowerBalance, devices, model, network_model)
add_constraint_dual!(container, sys, model)
add_feedforward_constraints!(container, model, devices)
return
end

Expand Down Expand Up @@ -782,6 +805,7 @@ function construct_device!(
add_constraints!(container, FlowRateConstraintFromTo, devices, model, network_model)
add_constraints!(container, FlowRateConstraintToFrom, devices, model, network_model)
add_constraint_dual!(container, sys, model)
add_feedforward_constraints!(container, model, devices)

Check warning on line 808 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L808

Added line #L808 was not covered by tests
return
end

Expand Down Expand Up @@ -826,6 +850,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_arguments!(container, model, devices)

Check warning on line 853 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L853

Added line #L853 was not covered by tests
return
end

Expand All @@ -850,6 +875,7 @@ function construct_device!(
model,
network_model,
)
add_feedforward_constraints!(container, model, devices)

Check warning on line 878 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L878

Added line #L878 was not covered by tests
return
end

Expand Down

0 comments on commit 7ab39f7

Please sign in to comment.