-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add connected_busses, sj, and sj_per_unit methods
supporting single phase unrelaxed BIM
- Loading branch information
Showing
6 changed files
with
88 additions
and
30 deletions.
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
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,30 @@ | ||
@testset "Load struct" begin | ||
bad_load = CommonOPF.Load(; bus="bname") # no load defined | ||
# a warning should be logged about removing bad_load | ||
loads = CommonOPF.Load[bad_load] | ||
clear_log!(test_logger) | ||
CommonOPF.check_busses!(loads) | ||
@test occursin("has been removed", test_logger.logs[end].message) | ||
@test isempty(loads) | ||
|
||
# test fill_load | ||
load = CommonOPF.Load(; | ||
bus="bname", | ||
q_to_p=0.1, | ||
kws1=[10], | ||
kws2=[20], | ||
kws3=[30], | ||
) | ||
CommonOPF.fill_load!(load) | ||
@test load.kvars1 == [1] | ||
@test load.kvars2 == [2] | ||
@test load.kvars3 == [3] | ||
end | ||
|
||
|
||
@testset "sj power getters" begin | ||
net = Network_IEEE13_SinglePhase() | ||
net.Sbase = 1e6 | ||
@test sj("634", net) ≈ [-133.33 + -im*96.67] | ||
@test sj_per_unit("634", net) ≈ [-133.33 + -im*96.67] / 1e3 | ||
end |