Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Data Processing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACS
P
Public
VILLASframework
Data Processing
Commits
4319ca53
Commit
4319ca53
authored
Nov 30, 2018
by
Jan Dinkelbach
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jzh-validation'
parents
935716c0
5ed303bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
2 deletions
+71
-2
.gitignore
.gitignore
+5
-1
examples/compareresults/compare_neplan_dpsim_WSCC9bus.py
examples/compareresults/compare_neplan_dpsim_WSCC9bus.py
+51
-0
villas/dataprocessing/validationtools.py
villas/dataprocessing/validationtools.py
+15
-1
No files found.
.gitignore
View file @
4319ca53
...
...
@@ -36,4 +36,8 @@ __pycache__
# ignore jupyter notebook files
.ipynb_checkpoints
.eggs
\ No newline at end of file
.eggs
#IDEs
.vscode
.json
\ No newline at end of file
examples/compareresults/compare_neplan_dpsim_WSCC9bus.py
0 → 100644
View file @
4319ca53
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\WSCC-09_RX.rlf"
# Read in NEPLAN data
print
(
'************************ Test for read in all variable start ****************'
)
ts_NEPLAN
=
read_timeseries_NEPLAN_loadflow
(
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
(
'
\n
'
)
# Read in CIM powerflow data
path
=
'..
\\
..
\\
..
\\
..
\\
dpsim_jzh_pfinteg
\\
dpsim
\\
build
\\
Dependencies
\\
fpotencia
\\
src
\\
test
\\
Logs
\\
'
logName
=
'WSCC-09_Neplan'
;
dataType
=
'.csv'
;
logFilename
=
path
+
logName
+
dataType
;
ts_dpsim
=
read_timeseries_csv
(
logFilename
)
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
))
# compare CIM-pf data with NEPLAN
net_name
=
'WSCC-9bus'
threshold
=
0.5
print
(
'************************ convert neplan to modelica start ****************'
)
res_ref
=
validationtools
.
convert_neplan_to_modelica_timeseries
(
ts_NEPLAN
)
for
i
in
range
(
len
(
res_ref
)):
print
(
res_ref
[
i
].
name
)
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
)
villas/dataprocessing/validationtools.py
View file @
4319ca53
...
...
@@ -3,7 +3,7 @@
import
os
from
readtools
import
*
from
.
readtools
import
*
"""
The validationtools are used to validate the simulate results from the model.
...
...
@@ -83,6 +83,20 @@ def convert_simulink_to_modelica_timeseries(simseri):
res
.
append
(
simseri
[
check
])
return
res
def
convert_dpsim_to_modelica_timeseries
(
dpsim_timeseries
):
"""
Convert the steady-state results timeseries from dpsim to modelica timeseries
:param dpsim_timeseries: dict of dpsim timeseries, generated by the csv result file from dpsim
:return: a list of dpsim timeseries
"""
ts_dpsimList
=
[]
for
ts
,
values
in
dpsim_timeseries
.
items
():
ts_abs
=
values
.
abs
(
ts
+
'.Vpp'
)
ts_phase
=
values
.
phase
(
ts
+
'.Vangle'
)
ts_phase
.
values
*=
np
.
pi
/
180
ts_dpsimList
.
append
(
ts_abs
)
ts_dpsimList
.
append
(
ts_phase
)
return
ts_dpsimList
def
compare_timeseries
(
ts1
,
ts2
):
"""
...
...
Write
Preview
Markdown
is supported
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