-
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 Conductor.cmatrix and shunt_admittances.jl
- Loading branch information
Showing
11 changed files
with
156 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
yj(j::AbstractString, net::Network{SinglePhase})::ComplexF64 | ||
Shunt admittance of bus `j` | ||
""" | ||
function yj(j::AbstractString, net::Network{SinglePhase})::ComplexF64 | ||
if :ShuntAdmittance in keys(net[j]) | ||
return net[j][:ShuntAdmittance].g + im * net[j][:ShuntAdmittance].b | ||
end | ||
return 0.0 + im * 0.0 | ||
end | ||
|
||
|
||
""" | ||
yj(j::AbstractString, net::Network{MultiPhase})::Matrix{ComplexF64} | ||
Shunt admittance of bus `j` | ||
""" | ||
function yj(j::AbstractString, net::Network{MultiPhase})::Matrix{ComplexF64} | ||
if :ShuntAdmittance in keys(net[j]) | ||
return net[j][:ShuntAdmittance].gmatrix + im * net[j][:ShuntAdmittance].bmatrix | ||
end | ||
return zeros(3,3) + im * zeros(3,3) | ||
end |
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,33 @@ | ||
Clear ! borrowed from OpenDSSDirect.jl | ||
New Circuit.3Bus_example | ||
! define a really stiff source | ||
~ basekv=0.4 pu=0.9959 MVAsc1=1e6 MVAsc3=1e6 basemva=0.5 | ||
|
||
|
||
New linecode.556MCM nphases=3 basefreq=50 ! ohms per 5 mile | ||
~ rmatrix = ( 0.1000 | 0.0400 0.1000 | 0.0400 0.0400 0.1000) | ||
~ xmatrix = ( 0.0583 | 0.0233 0.0583 | 0.0233 0.0233 0.0583) | ||
~ cmatrix = (50 | -0 50 | -0 -0 50 ) ! small capacitance | ||
|
||
|
||
New linecode.4/0QUAD nphases=3 basefreq=50 ! ohms per 100ft | ||
~ rmatrix = ( 0.1167 | 0.0467 0.1167 | 0.0467 0.0467 0.1167) | ||
~ xmatrix = (0.0667 | 0.0267 0.0667 | 0.0267 0.0267 0.0667 ) | ||
~ cmatrix = (40 | -0 40 | -0 -0 40 ) ! small capacitance | ||
|
||
|
||
New Line.OHLine bus1=sourcebus.1.2.3 Primary.1.2.3 linecode = 556MCM length=1 ! 5 mile line | ||
New Line.Quad Bus1=Primary.1.2.3 loadbus.1.2.3 linecode = 4/0QUAD length=1 ! 100 ft | ||
|
||
|
||
New Load.L1 phases=1 loadbus.1.0 ( 0.4 3 sqrt / ) kW=9 kvar=3 model=1 | ||
New Load.L2 phases=1 loadbus.2.0 ( 0.4 3 sqrt / ) kW=6 kvar=3 model=1 | ||
New Load.L3 phases=1 loadbus.3.0 ( 0.4 3 sqrt / ) kW=6 kvar=3 model=1 | ||
|
||
|
||
Set voltagebases=[0.4] | ||
Set tolerance=0.000001 | ||
set defaultbasefreq=50 | ||
Calcvoltagebases | ||
|
||
Solve |
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,18 @@ | ||
@testset "shunt inputs and methods" begin | ||
|
||
@testset "single phase" begin | ||
net = Network_Papavasiliou_2018() | ||
@test real(yj("1", net)) ≈ 0.0 | ||
@test imag(yj("1", net)) ≈ 0.0011 | ||
|
||
end | ||
|
||
@testset "multi phase" begin | ||
fp = joinpath("data", "case3_unbalanced.dss") | ||
net = Network(fp) | ||
f = 2π*60 * 1e-9 # nanofarads to siemens | ||
@test all(imag(yj("primary", net)) .≈ f * [25.0 0 0; 0 25 0; 0 0 25]) | ||
@test all(imag(yj("loadbus", net)) .≈ f * [20.0 0 0; 0 20 0; 0 0 20]) | ||
end | ||
|
||
end |