From fcf4211c6eac84e1e3a4413237151c649fbe0881 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Tue, 23 Jan 2024 10:44:50 -0700 Subject: [PATCH] rename --- docs/src/tutorials/pcm_simulation.md | 2 +- src/PowerSimulations.jl | 2 +- src/core/formulations.jl | 2 +- src/core/network_model.jl | 6 ++-- src/core/optimization_container.jl | 2 +- .../device_constructors/branch_constructor.jl | 28 +++++++++---------- src/devices_models/devices/AC_branches.jl | 10 +++---- src/devices_models/devices/HVDCsystems.jl | 2 +- .../devices/common/add_constraint_dual.jl | 2 +- .../devices/common/add_to_expression.jl | 20 ++++++------- src/network_models/copperplate_model.jl | 2 +- src/network_models/network_constructor.jl | 2 +- src/network_models/network_slack_variables.jl | 4 +-- test/performance/performance_test.jl | 2 +- test/run_partitioned_simulation.jl | 2 +- test/test_device_branch_constructors.jl | 18 ++++++------ test/test_device_hvdc.jl | 2 +- ..._device_thermal_generation_constructors.jl | 4 +-- test/test_model_decision.jl | 10 +++---- test/test_network_constructors.jl | 16 +++++------ .../operations_problem_templates.jl | 2 +- 21 files changed, 70 insertions(+), 70 deletions(-) diff --git a/docs/src/tutorials/pcm_simulation.md b/docs/src/tutorials/pcm_simulation.md index 048b49e8dd..bcf7f294fd 100644 --- a/docs/src/tutorials/pcm_simulation.md +++ b/docs/src/tutorials/pcm_simulation.md @@ -78,7 +78,7 @@ example, PSI also provides pre-specified templates for some standard problems: ```@example pcm template_ed = template_economic_dispatch( - network = NetworkModel(StandardPTDFModel, use_slacks = true), + network = NetworkModel(PTDFPowerModel, use_slacks = true), ) ``` diff --git a/src/PowerSimulations.jl b/src/PowerSimulations.jl index d03823aa6b..7dca8191ef 100644 --- a/src/PowerSimulations.jl +++ b/src/PowerSimulations.jl @@ -19,7 +19,7 @@ export SimulationPartitionResults # Network Relevant Exports export NetworkModel -export StandardPTDFModel +export PTDFPowerModel export CopperPlatePowerModel export AreaBalancePowerModel diff --git a/src/core/formulations.jl b/src/core/formulations.jl index 64006b2fdb..b9ea8a7748 100644 --- a/src/core/formulations.jl +++ b/src/core/formulations.jl @@ -152,7 +152,7 @@ struct LossLessLine <: AbstractBranchFormulation end # These formulations are taken directly from PowerModels abstract type AbstractPTDFModel <: PM.AbstractDCPModel end -struct StandardPTDFModel <: AbstractPTDFModel end +struct PTDFPowerModel <: AbstractPTDFModel end struct CopperPlatePowerModel <: PM.AbstractActivePowerModel end struct AreaBalancePowerModel <: PM.AbstractActivePowerModel end diff --git a/src/core/network_model.jl b/src/core/network_model.jl index caa2d8873f..ae8c5c75aa 100644 --- a/src/core/network_model.jl +++ b/src/core/network_model.jl @@ -24,7 +24,7 @@ Establishes the model for a particular device specified by type. # Example ptdf_array = PTDF(system) -thermal_gens = NetworkModel(StandardPTDFModel, ptdf = ptdf_array), +thermal_gens = NetworkModel(PTDFPowerModel, ptdf = ptdf_array), """ mutable struct NetworkModel{T <: PM.AbstractPowerModel} use_slacks::Bool @@ -113,7 +113,7 @@ function instantiate_network_model( return end -function instantiate_network_model(model::NetworkModel{StandardPTDFModel}, sys::PSY.System) +function instantiate_network_model(model::NetworkModel{PTDFPowerModel}, sys::PSY.System) if get_PTDF_matrix(model) === nothing @info "PTDF Matrix not provided. Calculating using PowerNetworkMatrices.PTDF" model.PTDF_matrix = @@ -135,7 +135,7 @@ end function _assign_subnetworks_to_buses( model::NetworkModel{T}, sys::PSY.System, -) where {T <: Union{CopperPlatePowerModel, StandardPTDFModel}} +) where {T <: Union{CopperPlatePowerModel, PTDFPowerModel}} subnetworks = model.subnetworks temp_bus_map = Dict{Int, Int}() radial_network_reduction = PSI.get_radial_network_reduction(model) diff --git a/src/core/optimization_container.jl b/src/core/optimization_container.jl index 086d98dc5e..2953aac2ad 100644 --- a/src/core/optimization_container.jl +++ b/src/core/optimization_container.jl @@ -494,7 +494,7 @@ function _make_system_expressions!( dc_bus_numbers::Vector{Int}, ::Type{T}, bus_reduction_map::Dict{Int64, Set{Int64}}, -) where {T <: StandardPTDFModel} +) where {T <: PTDFPowerModel} time_steps = get_time_steps(container) if isempty(bus_reduction_map) ac_bus_numbers = collect(Iterators.flatten(values(subnetworks))) diff --git a/src/devices_models/device_constructors/branch_constructor.jl b/src/devices_models/device_constructors/branch_constructor.jl index 1318e36527..365d691740 100644 --- a/src/devices_models/device_constructors/branch_constructor.jl +++ b/src/devices_models/device_constructors/branch_constructor.jl @@ -211,7 +211,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, device_model::DeviceModel{T, StaticBranch}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.ACBranch} devices = get_available_components(T, sys, get_attribute(device_model, "filter_function")) @@ -230,7 +230,7 @@ function construct_device!( sys::PSY.System, ::ModelConstructStage, device_model::DeviceModel{T, StaticBranch}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.ACBranch} devices = get_available_components(T, sys, get_attribute(device_model, "filter_function")) @@ -245,7 +245,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, device_model::DeviceModel{T, StaticBranchBounds}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.ACBranch} devices = get_available_components(T, sys, get_attribute(device_model, "filter_function")) @@ -264,7 +264,7 @@ function construct_device!( sys::PSY.System, ::ModelConstructStage, device_model::DeviceModel{T, StaticBranchBounds}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.ACBranch} devices = get_available_components(T, sys, get_attribute(device_model, "filter_function")) @@ -284,7 +284,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, device_model::DeviceModel{T, StaticBranchUnbounded}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.ACBranch} devices = get_available_components(T, sys, get_attribute(device_model, "filter_function")) @@ -303,7 +303,7 @@ function construct_device!( sys::PSY.System, ::ModelConstructStage, model::DeviceModel{T, StaticBranchUnbounded}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.ACBranch} devices = get_available_components(T, sys, get_attribute(model, "filter_function")) @@ -439,7 +439,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, model::DeviceModel{T, HVDCTwoTerminalUnbounded}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: TwoTerminalHVDCTypes} devices = get_available_components(T, sys, get_attribute(model, "filter_function")) @@ -461,7 +461,7 @@ function construct_device!( sys::PSY.System, ::ModelConstructStage, model::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) add_constraint_dual!(container, sys, model) return @@ -497,7 +497,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, model::DeviceModel{T, HVDCTwoTerminalLossless}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: TwoTerminalHVDCTypes} devices = get_available_components(T, sys, get_attribute(model, "filter_function")) @@ -522,7 +522,7 @@ function construct_device!( network_model::NetworkModel{U}, ) where { T <: TwoTerminalHVDCTypes, - U <: StandardPTDFModel, + U <: PTDFPowerModel, } devices = get_available_components(T, sys, get_attribute(model, "filter_function")) @@ -536,7 +536,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, model::DeviceModel{T, HVDCTwoTerminalDispatch}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: TwoTerminalHVDCTypes} devices = get_available_components(T, sys, get_attribute(model, "filter_function")) @@ -586,7 +586,7 @@ function construct_device!( sys::PSY.System, ::ModelConstructStage, model::DeviceModel{T, HVDCTwoTerminalDispatch}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: TwoTerminalHVDCTypes} devices = get_available_components(T, sys, get_attribute(model, "filter_function")) @@ -705,7 +705,7 @@ function construct_device!( sys::PSY.System, ::ArgumentConstructStage, model::DeviceModel{PSY.PhaseShiftingTransformer, PhaseAngleControl}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) devices = get_available_components( PSY.PhaseShiftingTransformer, @@ -749,7 +749,7 @@ function construct_device!( sys::PSY.System, ::ModelConstructStage, model::DeviceModel{PSY.PhaseShiftingTransformer, PhaseAngleControl}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) devices = get_available_components( PSY.PhaseShiftingTransformer, diff --git a/src/devices_models/devices/AC_branches.jl b/src/devices_models/devices/AC_branches.jl index e14215cec1..64d5e47f54 100644 --- a/src/devices_models/devices/AC_branches.jl +++ b/src/devices_models/devices/AC_branches.jl @@ -46,7 +46,7 @@ end function add_variables!( container::OptimizationContainer, ::Type{FlowActivePowerVariable}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, devices::IS.FlattenIteratorWrapper{T}, formulation::AbstractBranchFormulation, ) where {T <: PSY.ACBranch} @@ -345,14 +345,14 @@ function add_constraints!( end """ -Add network flow constraints for ACBranch and NetworkModel with StandardPTDFModel +Add network flow constraints for ACBranch and NetworkModel with PTDFPowerModel """ function add_constraints!( container::OptimizationContainer, ::Type{NetworkFlowConstraint}, devices::IS.FlattenIteratorWrapper{B}, model::DeviceModel{B, <:AbstractBranchFormulation}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {B <: PSY.ACBranch} ptdf = get_PTDF_matrix(network_model) # This is a workaround to not call the same list comprehension to find @@ -388,14 +388,14 @@ function add_constraints!( end """ -Add network flow constraints for PhaseShiftingTransformer and NetworkModel with StandardPTDFModel +Add network flow constraints for PhaseShiftingTransformer and NetworkModel with PTDFPowerModel """ function add_constraints!( container::OptimizationContainer, ::Type{NetworkFlowConstraint}, devices::IS.FlattenIteratorWrapper{T}, model::DeviceModel{T, PhaseAngleControl}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: PSY.PhaseShiftingTransformer} ptdf = get_PTDF_matrix(network_model) branches = PSY.get_name.(devices) diff --git a/src/devices_models/devices/HVDCsystems.jl b/src/devices_models/devices/HVDCsystems.jl index 540b38b043..ad36f26954 100644 --- a/src/devices_models/devices/HVDCsystems.jl +++ b/src/devices_models/devices/HVDCsystems.jl @@ -215,7 +215,7 @@ function add_to_expression!( U <: ActivePowerVariable, V <: PSY.InterconnectingConverter, W <: AbstractConverterFormulation, - X <: StandardPTDFModel + X <: PTDFPowerModel } variable = get_variable(container, U(), V) expression_dc = get_expression(container, T(), PSY.DCBus) diff --git a/src/devices_models/devices/common/add_constraint_dual.jl b/src/devices_models/devices/common/add_constraint_dual.jl index 1d5e9111bd..0b49570ba2 100644 --- a/src/devices_models/devices/common/add_constraint_dual.jl +++ b/src/devices_models/devices/common/add_constraint_dual.jl @@ -31,7 +31,7 @@ function add_constraint_dual!( container::OptimizationContainer, sys::PSY.System, model::NetworkModel{T}, -) where {T <: Union{CopperPlatePowerModel, StandardPTDFModel}} +) where {T <: Union{CopperPlatePowerModel, PTDFPowerModel}} if !isempty(get_duals(model)) for constraint_type in get_duals(model) assign_dual_variable!(container, constraint_type, sys, model) diff --git a/src/devices_models/devices/common/add_to_expression.jl b/src/devices_models/devices/common/add_to_expression.jl index 66c051a556..29bd067dd9 100644 --- a/src/devices_models/devices/common/add_to_expression.jl +++ b/src/devices_models/devices/common/add_to_expression.jl @@ -178,7 +178,7 @@ function add_to_expression!( U <: HVDCLosses, V <: TwoTerminalHVDCTypes, W <: HVDCTwoTerminalDispatch, - X <: Union{StandardPTDFModel, CopperPlatePowerModel}, + X <: Union{PTDFPowerModel, CopperPlatePowerModel}, } variable = get_variable(container, U(), V) expression = get_expression(container, T(), PSY.System) @@ -212,7 +212,7 @@ function add_to_expression!( U <: FlowActivePowerToFromVariable, V <: TwoTerminalHVDCTypes, W <: AbstractDeviceFormulation, - X <: StandardPTDFModel, + X <: PTDFPowerModel, } var = get_variable(container, U(), V) nodal_expr = get_expression(container, T(), PSY.ACBus) @@ -248,7 +248,7 @@ function add_to_expression!( U <: FlowActivePowerFromToVariable, V <: TwoTerminalHVDCTypes, W <: AbstractTwoTerminalDCLineFormulation, - X <: StandardPTDFModel, + X <: PTDFPowerModel, } var = get_variable(container, U(), V) nodal_expr = get_expression(container, T(), PSY.ACBus) @@ -579,7 +579,7 @@ function add_to_expression!( U <: TimeSeriesParameter, V <: PSY.StaticInjection, W <: AbstractDeviceFormulation, - X <: StandardPTDFModel, + X <: PTDFPowerModel, } param_container = get_parameter(container, U(), V) multiplier = get_multiplier_array(param_container) @@ -613,7 +613,7 @@ function add_to_expression!( U <: OnStatusParameter, V <: PSY.ThermalGen, W <: AbstractDeviceFormulation, - X <: StandardPTDFModel, + X <: PTDFPowerModel, } parameter = get_parameter_array(container, U(), V) sys_expr = get_expression(container, T(), PSY.System) @@ -647,7 +647,7 @@ function add_to_expression!( U <: VariableType, V <: PSY.StaticInjection, W <: AbstractDeviceFormulation, - X <: StandardPTDFModel, + X <: PTDFPowerModel, } variable = get_variable(container, U(), V) sys_expr = get_expression(container, T(), PSY.System) @@ -686,7 +686,7 @@ function add_to_expression!( U <: OnVariable, V <: PSY.ThermalGen, W <: Union{AbstractCompactUnitCommitment, ThermalCompactDispatch}, - X <: StandardPTDFModel, + X <: PTDFPowerModel, } variable = get_variable(container, U(), V) sys_expr = get_expression(container, T(), PSY.System) @@ -762,7 +762,7 @@ function add_to_expression!( ::Type{U}, devices::IS.FlattenIteratorWrapper{V}, ::DeviceModel{V, W}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where { T <: ActivePowerBalance, U <: FlowActivePowerVariable, @@ -844,7 +844,7 @@ function add_to_expression!( ::Type{U}, devices::IS.FlattenIteratorWrapper{PSY.PhaseShiftingTransformer}, ::DeviceModel{PSY.PhaseShiftingTransformer, V}, - network_model::NetworkModel{StandardPTDFModel}, + network_model::NetworkModel{PTDFPowerModel}, ) where {T <: ActivePowerBalance, U <: PhaseShifterAngle, V <: PhaseAngleControl} var = get_variable(container, U(), PSY.PhaseShiftingTransformer) expression = get_expression(container, T(), PSY.ACBus) @@ -1076,7 +1076,7 @@ function add_to_expression!( ) where { T <: ActivePowerBalance, U <: Union{SystemBalanceSlackUp, SystemBalanceSlackDown}, - W <: Union{CopperPlatePowerModel, StandardPTDFModel}, + W <: Union{CopperPlatePowerModel, PTDFPowerModel}, } variable = get_variable(container, U(), PSY.System) expression = get_expression(container, T(), PSY.System) diff --git a/src/network_models/copperplate_model.jl b/src/network_models/copperplate_model.jl index a8e8a9d5c2..1cc0886148 100644 --- a/src/network_models/copperplate_model.jl +++ b/src/network_models/copperplate_model.jl @@ -6,7 +6,7 @@ function add_constraints!( ) where { T <: CopperPlateBalanceConstraint, U <: PSY.System, - V <: Union{CopperPlatePowerModel, StandardPTDFModel}, + V <: Union{CopperPlatePowerModel, PTDFPowerModel}, } time_steps = get_time_steps(container) expressions = get_expression(container, ActivePowerBalance(), U) diff --git a/src/network_models/network_constructor.jl b/src/network_models/network_constructor.jl index fc55b9626d..890c6d98d9 100644 --- a/src/network_models/network_constructor.jl +++ b/src/network_models/network_constructor.jl @@ -53,7 +53,7 @@ end function construct_network!( container::OptimizationContainer, sys::PSY.System, - model::NetworkModel{StandardPTDFModel}, + model::NetworkModel{PTDFPowerModel}, ::ProblemTemplate, ) if get_use_slacks(model) diff --git a/src/network_models/network_slack_variables.jl b/src/network_models/network_slack_variables.jl index 82e1638e49..8cc2f16844 100644 --- a/src/network_models/network_slack_variables.jl +++ b/src/network_models/network_slack_variables.jl @@ -10,7 +10,7 @@ function add_variables!( network_model::NetworkModel{U}, ) where { T <: Union{SystemBalanceSlackUp, SystemBalanceSlackDown}, - U <: Union{CopperPlatePowerModel, StandardPTDFModel}, + U <: Union{CopperPlatePowerModel, PTDFPowerModel}, } time_steps = get_time_steps(container) reference_buses = get_reference_buses(network_model) @@ -95,7 +95,7 @@ function objective_function!( container::OptimizationContainer, ::Type{PSY.System}, network_model::NetworkModel{T}, -) where {T <: Union{CopperPlatePowerModel, StandardPTDFModel}} +) where {T <: Union{CopperPlatePowerModel, PTDFPowerModel}} variable_up = get_variable(container, SystemBalanceSlackUp(), PSY.System) variable_dn = get_variable(container, SystemBalanceSlackDown(), PSY.System) reference_buses = get_reference_buses(network_model) diff --git a/test/performance/performance_test.jl b/test/performance/performance_test.jl index f7b0145b29..9d62bc281d 100644 --- a/test/performance/performance_test.jl +++ b/test/performance/performance_test.jl @@ -23,7 +23,7 @@ try for i in 1:2 template_uc = ProblemTemplate( NetworkModel( - StandardPTDFModel; + PTDFPowerModel; use_slacks = true, PTDF_matrix = PTDF(sys_rts_da), duals = [CopperPlateBalanceConstraint], diff --git a/test/run_partitioned_simulation.jl b/test/run_partitioned_simulation.jl index 6cbb5684cb..75e2a99d2c 100644 --- a/test/run_partitioned_simulation.jl +++ b/test/run_partitioned_simulation.jl @@ -113,7 +113,7 @@ function build_simulation( set_network_model!( template_uc, NetworkModel( - StandardPTDFModel; + PTDFPowerModel; PTDF_matrix = PTDF(c_sys5_pjm_da), # duals = [CopperPlateBalanceConstraint] ), diff --git a/test/test_device_branch_constructors.jl b/test/test_device_branch_constructors.jl index c6d404ca80..6768d7dc1d 100644 --- a/test/test_device_branch_constructors.jl +++ b/test/test_device_branch_constructors.jl @@ -1,7 +1,7 @@ @testset "DC Power Flow Models Monitored Line Flow Constraints and Static Unbounded" begin system = PSB.build_system(PSITestSystems, "c_sys5_ml") limits = PSY.get_flow_limits(PSY.get_component(MonitoredLine, system, "1")) - for model in [DCPPowerModel, StandardPTDFModel] + for model in [DCPPowerModel, PTDFPowerModel] template = get_thermal_dispatch_template_network( NetworkModel(model; PTDF_matrix = PTDF(system)), ) @@ -47,7 +47,7 @@ end @testset "DC Power Flow Models Monitored Line Flow Constraints and Static with inequalities" begin system = PSB.build_system(PSITestSystems, "c_sys5_ml") set_rate!(PSY.get_component(Line, system, "2"), 1.5) - for model in [DCPPowerModel, StandardPTDFModel] + for model in [DCPPowerModel, PTDFPowerModel] template = get_thermal_dispatch_template_network( NetworkModel(model; PTDF_matrix = PTDF(system)), ) @@ -67,7 +67,7 @@ end @testset "DC Power Flow Models Monitored Line Flow Constraints and Static with Bounds" begin system = PSB.build_system(PSITestSystems, "c_sys5_ml") set_rate!(PSY.get_component(Line, system, "2"), 1.5) - for model in [DCPPowerModel, StandardPTDFModel] + for model in [DCPPowerModel, PTDFPowerModel] template = get_thermal_dispatch_template_network( NetworkModel(model; PTDF_matrix = PTDF(system)), ) @@ -106,7 +106,7 @@ end transformer = PSY.get_component(Transformer2W, system, "Trans4") rate_limit2w = PSY.get_rate(tap_transformer) - for model in [DCPPowerModel, StandardPTDFModel] + for model in [DCPPowerModel, PTDFPowerModel] template = get_template_dispatch_with_network( NetworkModel(model; PTDF_matrix = PTDF(system)), ) @@ -163,7 +163,7 @@ end transformer = PSY.get_component(Transformer2W, system, "Trans4") rate_limit2w = PSY.get_rate(tap_transformer) - for model in [DCPPowerModel, StandardPTDFModel] + for model in [DCPPowerModel, PTDFPowerModel] template = get_template_dispatch_with_network( NetworkModel(model; PTDF_matrix = PTDF(system)), ) @@ -237,7 +237,7 @@ end add_component!(sys_5, hvdc) template_uc = ProblemTemplate( - NetworkModel(StandardPTDFModel; PTDF_matrix = PTDF(sys_5)), + NetworkModel(PTDFPowerModel; PTDF_matrix = PTDF(sys_5)), ) set_device_model!(template_uc, ThermalStandard, ThermalCompactUnitCommitment) @@ -311,7 +311,7 @@ end ) add_component!(sys_5, hvdc) - for net_model in [DCPPowerModel, StandardPTDFModel] + for net_model in [DCPPowerModel, PTDFPowerModel] @testset "$net_model" begin PSY.set_loss!(hvdc, (l0 = 0.0, l1 = 0.0)) template_uc = ProblemTemplate( @@ -495,7 +495,7 @@ end rate_limit2w = PSY.get_rate(tap_transformer) template = get_template_dispatch_with_network( - NetworkModel(StandardPTDFModel; PTDF_matrix = PTDF(system)), + NetworkModel(PTDFPowerModel; PTDF_matrix = PTDF(system)), ) set_device_model!(template, DeviceModel(TwoTerminalHVDCLine, HVDCTwoTerminalLossless)) model_m = DecisionModel(template, system; optimizer = HiGHS_optimizer) @@ -555,7 +555,7 @@ end add_component!(system, ps) template = get_template_dispatch_with_network( - NetworkModel(StandardPTDFModel; PTDF_matrix = PTDF(system)), + NetworkModel(PTDFPowerModel; PTDF_matrix = PTDF(system)), ) set_device_model!(template, DeviceModel(PhaseShiftingTransformer, PhaseAngleControl)) model_m = DecisionModel(template, system; optimizer = HiGHS_optimizer) diff --git a/test/test_device_hvdc.jl b/test/test_device_hvdc.jl index 2db47195ba..cbc2980b4c 100644 --- a/test/test_device_hvdc.jl +++ b/test/test_device_hvdc.jl @@ -19,7 +19,7 @@ @test solve!(model) == RunStatus.SUCCESSFUL template_uc = ProblemTemplate(NetworkModel( - StandardPTDFModel; + PTDFPowerModel; #use_slacks=true, PTDF_matrix = PTDF(sys_5), #duals=[CopperPlateBalanceConstraint], diff --git a/test/test_device_thermal_generation_constructors.jl b/test/test_device_thermal_generation_constructors.jl index ae77e6e3a1..4f9f1f931d 100644 --- a/test/test_device_thermal_generation_constructors.jl +++ b/test/test_device_thermal_generation_constructors.jl @@ -643,7 +643,7 @@ end c_sys5 = PSB.build_system(PSITestSystems, "c_sys5") c_sys5_dc = PSB.build_system(PSITestSystems, "c_sys5_dc") systems = [c_sys5, c_sys5_dc] - networks = [DCPPowerModel, NFAPowerModel, StandardPTDFModel, CopperPlatePowerModel] + networks = [DCPPowerModel, NFAPowerModel, PTDFPowerModel, CopperPlatePowerModel] commitment_models = [ThermalStandardUnitCommitment, ThermalCompactUnitCommitment] PTDF_ref = IdDict{System, PTDF}(c_sys5 => PTDF(c_sys5), c_sys5_dc => PTDF(c_sys5_dc)) @@ -793,7 +793,7 @@ end @testset "Test Must Run ThermalGen" begin sys_5 = build_system(PSITestSystems, "c_sys5_uc") template_uc = - ProblemTemplate(NetworkModel(StandardPTDFModel; PTDF_matrix = PTDF(sys_5))) + ProblemTemplate(NetworkModel(PTDFPowerModel; PTDF_matrix = PTDF(sys_5))) set_device_model!(template_uc, ThermalStandard, ThermalCompactUnitCommitment) set_device_model!(template_uc, RenewableDispatch, FixedOutput) set_device_model!(template_uc, PowerLoad, StaticPowerLoad) diff --git a/test/test_model_decision.jl b/test/test_model_decision.jl index 13fe6803f4..5b9b91a7f8 100644 --- a/test/test_model_decision.jl +++ b/test/test_model_decision.jl @@ -122,7 +122,7 @@ end @testset "Decision Model Solve with Slacks" begin c_sys5_re = PSB.build_system(PSITestSystems, "c_sys5_re") - networks = [StandardPTDFModel, DCPPowerModel, ACPPowerModel] + networks = [PTDFPowerModel, DCPPowerModel, ACPPowerModel] for network in networks template = get_thermal_dispatch_template_network( NetworkModel(network; use_slacks = true, PTDF_matrix = PTDF(c_sys5_re)), @@ -154,8 +154,8 @@ end @test UC_output == RunStatus.SUCCESSFUL end -@testset "Test Locational Marginal Prices between DC lossless with PowerModels vs StandardPTDFModel" begin - networks = [DCPPowerModel, StandardPTDFModel] +@testset "Test Locational Marginal Prices between DC lossless with PowerModels vs PTDFPowerModel" begin + networks = [DCPPowerModel, PTDFPowerModel] sys = PSB.build_system(PSITestSystems, "c_sys5") ptdf = PTDF(sys) # These are the duals of interest for the test @@ -165,7 +165,7 @@ end template = get_template_dispatch_with_network( NetworkModel(network; PTDF_matrix = ptdf, duals = dual_constraint[ix]), ) - if network == StandardPTDFModel + if network == PTDFPowerModel set_device_model!( template, DeviceModel(PSY.Line, PSI.StaticBranch; duals = [NetworkFlowConstraint]), @@ -178,7 +178,7 @@ end res = ProblemResults(model) # These tests require results to be working - if network == StandardPTDFModel + if network == PTDFPowerModel push!(LMPs, abs.(psi_ptdf_lmps(res, ptdf))) else duals = read_dual(res, NodalBalanceActiveConstraint, ACBus) diff --git a/test/test_network_constructors.jl b/test/test_network_constructors.jl index 945bf06eae..e472b826ee 100644 --- a/test/test_network_constructors.jl +++ b/test/test_network_constructors.jl @@ -87,7 +87,7 @@ end end @testset "Network DC-PF with PTDF Model" begin - template = get_thermal_dispatch_template_network(StandardPTDFModel) + template = get_thermal_dispatch_template_network(PTDFPowerModel) c_sys5 = PSB.build_system(PSITestSystems, "c_sys5") c_sys14 = PSB.build_system(PSITestSystems, "c_sys14") c_sys14_dc = PSB.build_system(PSITestSystems, "c_sys14_dc") @@ -116,7 +116,7 @@ end ) for (ix, sys) in enumerate(systems) template = get_thermal_dispatch_template_network( - NetworkModel(StandardPTDFModel; PTDF_matrix = PTDF_ref[sys]), + NetworkModel(PTDFPowerModel; PTDF_matrix = PTDF_ref[sys]), ) ps_model = DecisionModel(template, sys; optimizer = HiGHS_optimizer) @@ -177,9 +177,9 @@ end c_sys14_dc => 142000.0, ) for (ix, sys) in enumerate(systems) - template = get_thermal_dispatch_template_network(StandardPTDFModel) + template = get_thermal_dispatch_template_network(PTDFPowerModel) template = get_thermal_dispatch_template_network( - NetworkModel(StandardPTDFModel; PTDF_matrix = PTDF_ref[sys]), + NetworkModel(PTDFPowerModel; PTDF_matrix = PTDF_ref[sys]), ) ps_model = DecisionModel(template, sys; optimizer = HiGHS_optimizer) @@ -513,7 +513,7 @@ end set_active_power_limits_to!(hvdc_link, (min = 0.0, max = 0.0)) # Test not passing the PTDF to the Template - template = get_thermal_dispatch_template_network(NetworkModel(StandardPTDFModel)) + template = get_thermal_dispatch_template_network(NetworkModel(PTDFPowerModel)) ps_model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(ps_model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT @@ -553,7 +553,7 @@ end c_sys5 = PSB.build_system(PSISystems, "2Area 5 Bus System") # Test passing a VirtualPTDF Model template = get_thermal_dispatch_template_network( - NetworkModel(StandardPTDFModel; PTDF_matrix = VirtualPTDF(c_sys5)), + NetworkModel(PTDFPowerModel; PTDF_matrix = VirtualPTDF(c_sys5)), ) ps_model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @@ -613,7 +613,7 @@ end set_active_power_limits_to!(hvdc_link, (min = 0.0, max = 0.0)) # Test not passing the PTDF to the Template - template = get_thermal_dispatch_template_network(NetworkModel(StandardPTDFModel)) + template = get_thermal_dispatch_template_network(NetworkModel(PTDFPowerModel)) ps_model = DecisionModel(template, c_sys5; optimizer = HiGHS_optimizer) @test build!(ps_model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT @@ -653,7 +653,7 @@ end @testset "StandardPTDF/DCPPowerModel Radial Branches Test" begin new_sys = PSB.build_system(PSITestSystems, "c_sys5_radial") - for net_model in [DCPPowerModel, StandardPTDFModel] + for net_model in [DCPPowerModel, PTDFPowerModel] template_uc = template_unit_commitment(; network = NetworkModel(net_model; reduce_radial_branches = true, diff --git a/test/test_utils/operations_problem_templates.jl b/test/test_utils/operations_problem_templates.jl index 43c1e5bd1a..3e0a400f29 100644 --- a/test/test_utils/operations_problem_templates.jl +++ b/test/test_utils/operations_problem_templates.jl @@ -63,7 +63,7 @@ function get_template_hydro_st_ed(network = CopperPlatePowerModel, duals = []) return template end -function get_template_dispatch_with_network(network = StandardPTDFModel) +function get_template_dispatch_with_network(network = PTDFPowerModel) template = ProblemTemplate(network) set_device_model!(template, PowerLoad, StaticPowerLoad) set_device_model!(template, ThermalStandard, ThermalBasicDispatch)