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
9447d6bb
Commit
9447d6bb
authored
7 years ago
by
Markus Mirz
Browse files
Options
Downloads
Patches
Plain Diff
update and added example
parent
8ff81d90
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dataprocessing/plotdpsim.py
+37
-2
37 additions, 2 deletions
dataprocessing/plotdpsim.py
examples/plot_absolute_example.py
+11
-0
11 additions, 0 deletions
examples/plot_absolute_example.py
with
48 additions
and
2 deletions
dataprocessing/plotdpsim.py
+
37
−
2
View file @
9447d6bb
...
...
@@ -34,8 +34,8 @@ def plot_dpsim_abs_diff(filename1, label1, node1, filename2, label2, node2):
figure_id
=
1
#plt.figure(figure_id)
plt
.
figure
(
figure_id
,
figsize
=
(
12
/
2.54
,
6
/
2.54
),
facecolor
=
'
w
'
,
edgecolor
=
'
k
'
)
plot_single_ts
(
figure_id
,
ts_abs1
)
plot_single_ts
(
figure_id
,
ts_abs2
)
#
plot_single_ts(figure_id, ts_abs1)
#
plot_single_ts(figure_id, ts_abs2)
plot_single_ts
(
figure_id
,
ts_diff
)
plt
.
xlabel
(
'
Time [s]
'
)
plt
.
ylabel
(
'
Voltage [kV]
'
)
...
...
@@ -43,6 +43,41 @@ def plot_dpsim_abs_diff(filename1, label1, node1, filename2, label2, node2):
plt
.
tight_layout
()
plt
.
show
()
def
plot_dpsim_abs
(
filename1
,
label1
,
node1
,
filename2
,
label2
,
node2
):
ts_dpsim1
=
read_time_series_DPsim
(
filename1
)
ts_dpsim2
=
read_time_series_DPsim
(
filename2
)
ts_dpsim1_length
=
len
(
ts_dpsim1
)
im_offset1
=
int
(
ts_dpsim1_length
/
2
)
if
im_offset1
<=
node1
or
node1
<
0
:
print
(
'
Node 1 not available
'
)
exit
()
ts_dpsim2_length
=
len
(
ts_dpsim2
)
im_offset2
=
int
(
ts_dpsim2_length
/
2
)
if
im_offset2
<=
node1
or
node1
<
0
:
print
(
'
Node 2 not available
'
)
exit
()
# this assumes same timestep for both simulations
ts_abs1
=
complex_abs
(
'
node
'
+
str
(
node1
)
+
'
abs
'
,
ts_dpsim1
[
node1
],
ts_dpsim1
[
node1
+
im_offset1
])
ts_abs1
=
scale_ts
(
ts_abs1
.
name
,
ts_abs1
,
0.001
)
ts_abs1
.
label
=
label1
ts_abs2
=
complex_abs
(
'
node
'
+
str
(
node2
)
+
'
abs
'
,
ts_dpsim2
[
node1
],
ts_dpsim2
[
node1
+
im_offset2
])
ts_abs2
=
scale_ts
(
ts_abs2
.
name
,
ts_abs2
,
0.001
)
ts_abs2
.
label
=
label2
figure_id
=
1
# plt.figure(figure_id)
plt
.
figure
(
figure_id
,
figsize
=
(
12
/
2.54
,
6
/
2.54
),
facecolor
=
'
w
'
,
edgecolor
=
'
k
'
)
plot_single_ts
(
figure_id
,
ts_abs1
)
plot_single_ts
(
figure_id
,
ts_abs2
)
plt
.
xlabel
(
'
Time [s]
'
)
plt
.
ylabel
(
'
Voltage [kV]
'
)
plt
.
grid
(
True
)
plt
.
tight_layout
()
plt
.
show
()
def
plot_dpsim_abs_single
(
filename
,
node
):
ts_dpsim
=
read_time_series_DPsim
(
filename
)
...
...
This diff is collapsed.
Click to expand it.
examples/plot_absolute_example.py
0 → 100644
+
11
−
0
View file @
9447d6bb
from
dataprocessing.plotdpsim
import
*
path
=
'
C:
\\
Users
\\
mmi
\\
git
\\
PowerSystemSimulation
\\
gre
\\
step-dist-init
\\
'
plot_dpsim_abs
(
path
+
'
lvector-ref.csv
'
,
'
reference
'
,
2
,
path
+
'
lvector0-local_rm-first-row.csv
'
,
'
local
'
,
2
)
plot_dpsim_abs
(
path
+
'
lvector-ref.csv
'
,
'
reference
'
,
2
,
path
+
'
lvector0-netem.csv
'
,
'
netem
'
,
2
)
plot_dpsim_abs
(
path
+
'
lvector-ref.csv
'
,
'
reference
'
,
2
,
path
+
'
lvector0-dist.csv
'
,
'
dist
'
,
2
)
\ 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