-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathtest_device_hvdc.jl
38 lines (35 loc) · 1.92 KB
/
test_device_hvdc.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@testset "HVDC System Tests" begin
sys_5 = build_system(PSISystems, "sys10_pjm_ac_dc")
template_uc = ProblemTemplate(NetworkModel(
DCPPowerModel,
#use_slacks=true,
#PTDF_matrix=PTDF(sys_5),
#duals=[CopperPlateBalanceConstraint],
))
set_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)
set_device_model!(template_uc, RenewableDispatch, RenewableFullDispatch)
set_device_model!(template_uc, PowerLoad, StaticPowerLoad)
set_device_model!(template_uc, DeviceModel(Line, StaticBranch))
set_device_model!(template_uc, DeviceModel(InterconnectingConverter, LossLessConverter))
set_device_model!(template_uc, DeviceModel(TModelHVDCLine, LossLessLine))
model = DecisionModel(template_uc, sys_5; name = "UC", optimizer = HiGHS_optimizer)
@test build!(model; output_dir = mktempdir()) == PSI.ModelBuildStatus.BUILT
moi_tests(model, 1656, 288, 1248, 528, 888, true)
@test solve!(model) == PSI.RunStatus.SUCCESSFULLY_FINALIZED
template_uc = ProblemTemplate(NetworkModel(
PTDFPowerModel;
#use_slacks=true,
PTDF_matrix = PTDF(sys_5),
#duals=[CopperPlateBalanceConstraint],
))
set_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)
set_device_model!(template_uc, RenewableDispatch, RenewableFullDispatch)
set_device_model!(template_uc, PowerLoad, StaticPowerLoad)
set_device_model!(template_uc, DeviceModel(Line, StaticBranch))
set_device_model!(template_uc, DeviceModel(InterconnectingConverter, LossLessConverter))
set_device_model!(template_uc, DeviceModel(TModelHVDCLine, LossLessLine))
model = DecisionModel(template_uc, sys_5; name = "UC", optimizer = HiGHS_optimizer)
@test build!(model; output_dir = mktempdir()) == PSI.ModelBuildStatus.BUILT
moi_tests(model, 1416, 0, 1248, 528, 672, true)
@test solve!(model) == PSI.RunStatus.SUCCESSFULLY_FINALIZED
end