Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcosovic committed Sep 8, 2023
1 parent e5cd46f commit a60b9c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
matrix:
julia-version: ['1.8.3']
julia-arch: [x64]
os: [windows-latest, macOS-latest]
os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
- os: macOS-latest
julia-arch: x86
Expand Down
1 change: 1 addition & 0 deletions src/utility/internal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ macro default(mode::Symbol)
if mode == :unit || mode == :voltage
prefix.voltageMagnitude = 0.0
prefix.voltageAngle = 1.0
prefix.baseVoltage = 1.0
end

if mode == :unit || mode == :current
Expand Down
9 changes: 6 additions & 3 deletions test/powerFlow/reusing.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@testset "DC Power Flow" begin
@default(unit)
@default(template)

################ Resuing First Pass ################
system = powerSystem(string(pathData, "case14test.m"))

Expand Down Expand Up @@ -74,7 +77,7 @@ end

updateBus!(system; label = 14, active = 0.12, reactive = 0.13, conductance = 0.1, susceptance = 0.15, magnitude = 1.2, angle = -0.17)
addBranch!(system; from = 2, to = 3, resistance = 0.02, reactance = 0.03, susceptance = 0.01, conductance = 0.0001, turnsRatio = 0.95, shiftAngle = -0.17)
updateBranch!(system; label = 12, status = 0, resistance = 0.02, reactance = 0.03, susceptance = 0.01)
updateBranch!(system; label = 12, status = 0, resistance = 0.02, reactance = 0.03, susceptance = 0.001)
updateBranch!(system; label = 12, status = 1)
addGenerator!(system; bus = 16, active = 0.8, reactive = 0.2, magnitude = 0.95)
addGenerator!(system; bus = 4, active = 0.8, reactive = 0.2, magnitude = 0.9)
Expand All @@ -100,7 +103,7 @@ end

updateBus!(resystem, reusing; label = 14, active = 0.12, reactive = 0.13, conductance = 0.1, susceptance = 0.15, magnitude = 1.2, angle = -0.17)
addBranch!(resystem, reusing; from = 2, to = 3, resistance = 0.02, reactance = 0.03, susceptance = 0.01, conductance = 0.0001, turnsRatio = 0.95, shiftAngle = -0.17)
updateBranch!(resystem, reusing; label = 12, status = 0, resistance = 0.02, reactance = 0.03, susceptance = 0.01)
updateBranch!(resystem, reusing; label = 12, status = 0, resistance = 0.02, reactance = 0.03, susceptance = 0.001)
updateBranch!(resystem, reusing; label = 12, status = 1)
addGenerator!(resystem, reusing; bus = 16, active = 0.8, reactive = 0.2, magnitude = 0.95)
addGenerator!(resystem, reusing; bus = 4, active = 0.8, reactive = 0.2, magnitude = 0.9)
Expand All @@ -117,7 +120,7 @@ end
power!(resystem, reusing)
current!(resystem, reusing)

####### Compare Voltages, Powers, and Currents #######
###### Compare Voltages, Powers, and Currents #######
approxStruct(analysis.voltage, reusing.voltage)
approxStruct(analysis.power.injection, reusing.power.injection)
approxStruct(analysis.power.supply, reusing.power.supply)
Expand Down
8 changes: 5 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ include("powerSystem/buildUpdate.jl")

######## Power flow ##########
include("powerFlow/analysis.jl")
include("powerFlow/limits.jl")
include("powerFlow/reusing.jl")
include("powerFlow/limits.jl")






######## Optimal Power flow ##########
# include("optimalPowerFlow/solution.jl")

0 comments on commit a60b9c9

Please sign in to comment.