Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
Power System Automation and Monitoring
pyVolt
pyVolt
Commits
6b707a23
Commit
6b707a23
authored
Feb 20, 2019
by
martin.moraga
Browse files
fixed some errors
parent
502c02b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
acs/state_estimation/nv_powerflow_cim.py
View file @
6b707a23
...
...
@@ -147,7 +147,7 @@ class PowerflowResults():
"""
S1
=
np
.
array
([])
for
branch
in
self
.
branches
:
S1
=
np
.
append
(
S
,
branch
.
power
)
S1
=
np
.
append
(
S
1
,
branch
.
power
)
return
S1
def
get_S2
(
self
):
...
...
@@ -157,7 +157,7 @@ class PowerflowResults():
"""
S2
=
np
.
array
([])
for
branch
in
self
.
branches
:
S2
=
np
.
append
(
S
,
branch
.
power2
)
S2
=
np
.
append
(
S
2
,
branch
.
power2
)
return
S2
def
solve
(
system
):
...
...
@@ -243,7 +243,8 @@ def solve(system):
results
.
calculateIinj
()
results
.
calculateSinj
()
results
.
calculateI
()
results
.
calculateS
()
results
.
calculateS1
()
results
.
calculateS2
()
return
results
,
num_iter
...
...
examples/95bus_tests/test_nv_powerflow_cim.py
View file @
6b707a23
...
...
@@ -26,18 +26,12 @@ branch, node = py_95bus_network_data.Network_95_nodes(Base, slackV)
V
,
I
,
Iinj
,
S1
,
S2
,
Sinj
,
num_iter
=
solve
(
branch
,
node
)
system
=
network
.
load_python_data
(
node
,
branch
,
node
.
type
)
res
=
nv_powerflow_cim
.
PF_Results
()
res
.
V
,
res
.
num_iter
=
nv_powerflow_cim
.
solve
(
system
)
res
.
I
=
nv_powerflow_cim
.
calculateI
(
system
,
res
.
V
)
res
.
Iinj
=
nv_powerflow_cim
.
calculateInj
(
system
,
res
.
I
)
res
.
S1
=
nv_powerflow_cim
.
calculateS1
(
system
,
res
.
V
,
res
.
I
)
res
.
S2
=
nv_powerflow_cim
.
calculateS2
(
system
,
res
.
V
,
res
.
I
)
res
.
Sinj
=
nv_powerflow_cim
.
calculateSinj
(
res
.
V
,
res
.
Iinj
)
res
,
num_iter
=
nv_powerflow_cim
.
solve
(
system
)
# Show numerical comparison
print
(
"res.V==V? "
+
str
(
not
np
.
any
(
res
.
V
-
V
)))
print
(
"res.I==I? "
+
str
(
not
np
.
any
(
res
.
I
-
I
)))
print
(
"res.Iinj==Iinj? "
+
str
(
not
np
.
any
(
res
.
Iinj
-
Iinj
)))
print
(
"res.S1==S1? "
+
str
(
not
np
.
any
(
res
.
S1
-
S1
)))
print
(
"res.S2==S2? "
+
str
(
not
np
.
any
(
res
.
S2
-
S2
)))
print
(
"res.Sinj==Sinj? "
+
str
(
not
np
.
any
(
res
.
Sinj
-
Sinj
)))
\ No newline at end of file
print
(
"res.V==V? "
+
str
(
not
np
.
any
(
res
.
get_voltages
()
-
V
)))
print
(
"res.I==I? "
+
str
(
not
np
.
any
(
res
.
getI
()
-
I
)))
print
(
"res.Iinj==Iinj? "
+
str
(
not
np
.
any
(
res
.
get_Iinj
()
-
Iinj
)))
print
(
"res.S1==S1? "
+
str
(
not
np
.
any
(
res
.
get_S1
()
-
S1
)))
print
(
"res.S2==S2? "
+
str
(
not
np
.
any
(
res
.
get_S2
()
-
S2
)))
print
(
"res.Sinj==Sinj? "
+
str
(
not
np
.
any
(
res
.
get_Sinj
()
-
Sinj
)))
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment