Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VILLASdataprocessing
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
VILLASframework
VILLASdataprocessing
Commits
544adbc6
Commit
544adbc6
authored
6 years ago
by
Jan Dinkelbach
Browse files
Options
Downloads
Patches
Plain Diff
refactoring example script for comparison of neplan and dpsim results
parent
1cd070f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/compareresults/compare_neplan_dpsim.py
+13
-19
13 additions, 19 deletions
examples/compareresults/compare_neplan_dpsim.py
with
13 additions
and
19 deletions
examples/compareresults/compare_neplan_dpsim
_CIGRE-MV-NoTap
.py
→
examples/compareresults/compare_neplan_dpsim.py
+
13
−
19
View file @
544adbc6
...
...
@@ -2,33 +2,31 @@ from villas.dataprocessing.readtools import *
from
villas.dataprocessing.timeseries
import
*
import
villas.dataprocessing.validationtools
as
validationtools
#
reference rtf data directory
file
=
r
"
..\..\..
\reference-results\Neplan\ReferenceGrids\CIGRE_MV_NoTap.rlf
"
#
Path to NEPLAN result file (power flow result in *.rlf format)
neplan_result_file
=
r
"
D:\git\data
\reference-results\Neplan\ReferenceGrids\CIGRE_MV_NoTap.rlf
"
# Read in NEPLAN data
# Path to DPsim result file (power flow result in *.csv format)
dpsim_result_file
=
"
D:
\\
git
\\
code
\\
dpsim-powerflow-integration
\\
dpsim
\\
build
\\
Dependencies
\\
fpotencia
\\
src
\\
test
\\
Logs
\\
CIGRE-MV-NoTap-Neplan.csv
"
print
(
'
************************ Test for read in all variable start ****************
'
)
ts_NEPLAN
=
read_timeseries_NEPLAN_loadflow
(
file
)
# Read in NEPLAN results
print
(
'
************************ reading neplan power flow data start ****************
'
)
ts_NEPLAN
=
read_timeseries_NEPLAN_loadflow
(
neplan_result_file
)
for
i
in
range
(
len
(
ts_NEPLAN
)):
print
(
'
%s is %s
'
%
(
ts_NEPLAN
[
i
].
name
,
ts_NEPLAN
[
i
].
values
))
# result as list of TimeSeries
print
(
'
************************
Test for
read
in
all variable
end ****************
'
)
print
(
'
************************ readin
g neplan power flow data
end ****************
'
)
print
(
'
\n
'
)
# Read in
CIM
powerflow
data
# Read in
DPsim
powerflow
results
print
(
'
************************ reading dpsim power flow data start ****************
'
)
path
=
"
D:
\\
HiWi_ACS
\\
dpsim_jzh_pfinteg
\\
dpsim
\\
build
\\
Dependencies
\\
fpotencia
\\
src
\\
test
\\
Logs
\\
"
logName
=
'
CIGRE-MV-NoTap-Neplan
'
;
dataType
=
'
.csv
'
;
logFilename
=
path
+
logName
+
dataType
;
ts_dpsim
=
read_timeseries_csv
(
logFilename
)
ts_dpsim
=
read_timeseries_csv
(
dpsim_result_file
)
for
ts
,
values
in
ts_dpsim
.
items
():
ts_abs
=
values
.
abs
(
ts
+
'
.Vpp
'
)
ts_phase
=
values
.
phase
(
ts
+
'
.Vangle
'
)
print
(
ts_abs
.
name
+
'
:
'
+
str
(
ts_abs
.
values
)
+
'
\n
'
+
ts_phase
.
name
+
'
:
'
+
str
(
ts_phase
.
values
))
print
(
'
************************ reading dpsim power flow data end ****************
'
)
#
compare CIM-pf data with NEPLAN
net_name
=
'
WSCC-9bus
'
#
Converting both timeseries objects to a common format (here the Modelica format) and afterwards compare and assert the results
net_name
=
'
CIGRE_MV_NoTap
'
threshold
=
0.5
print
(
'
************************ convert neplan to modelica start ****************
'
)
res_ref
=
validationtools
.
convert_neplan_to_modelica_timeseries
(
ts_NEPLAN
)
...
...
@@ -37,16 +35,12 @@ for i in range(len(res_ref)):
print
(
res_ref
[
i
].
values
)
print
(
'
************************ convert neplan to modelica end ****************
'
)
print
(
'
************************ convert dpsim to modelica start ****************
'
)
ts_dpsimList
=
validationtools
.
convert_dpsim_to_modelica_timeseries
(
ts_dpsim
)
for
i
in
range
(
len
(
ts_dpsimList
)):
print
(
ts_dpsimList
[
i
].
name
)
print
(
ts_dpsimList
[
i
].
values
)
print
(
'
************************ convert dpsim to modelica end ****************
'
)
res_err
=
validationtools
.
compare_timeseries
(
res_ref
,
ts_dpsimList
)
validationtools
.
assert_modelia_results
(
net_name
,
res_err
,
threshold
)
validationtools
.
assert_modelia_results
(
net_name
,
res_err
,
threshold
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment