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 Simulation and Optimization
DPsim
DPsim
Commits
48c9b67a
Commit
48c9b67a
authored
Oct 07, 2020
by
Jan Dinkelbach
Committed by
Markus Mirz
Nov 21, 2020
Browse files
Fix CI
parent
37a5aba0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Examples/Notebooks/Circuits/EMT_Slack_PiLine_PQLoad_with_PF_Init.ipynb
View file @
48c9b67a
...
...
@@ -31,7 +31,7 @@
"import matplotlib.pyplot as plt\n",
"import re\n",
"\n",
"%matplotlib widget"
"
#
%matplotlib widget"
]
},
{
...
...
%% Cell type:markdown id: tags:
# DP Simulation of topology with slack, line and PQ load
%% Cell type:code id: tags:
```
python
%%
bash
TOP
=
$
{
TOP
:
-
$
(
git
rev
-
parse
--
show
-
toplevel
)}
PATH
=
$
{
TOP
}
/
build
/
Examples
/
Cxx
EMT_Slack_PiLine_PQLoad_with_PF_Init
```
%% Cell type:code id: tags:
```
python
from
villas.dataprocessing.readtools
import
*
from
villas.dataprocessing.timeseries
import
*
import
matplotlib.pyplot
as
plt
import
re
%
matplotlib
widget
#
%matplotlib widget
```
%% Cell type:markdown id: tags:
## PF results
%% Cell type:code id: tags:
```
python
modelName
=
'EMT_Slack_PiLine_PQLoad_with_PF_Init_PF'
path
=
'logs/'
+
modelName
+
'/'
dpsim_result_file
=
path
+
modelName
+
'.csv'
ts_dpsim_pf
=
read_timeseries_csv
(
dpsim_result_file
)
```
%% Cell type:markdown id: tags:
## EMT results
%% Cell type:code id: tags:
```
python
modelName
=
'EMT_Slack_PiLine_PQLoad_with_PF_Init_EMT'
path
=
'logs/'
+
modelName
+
'/'
dpsim_result_file
=
path
+
modelName
+
'.csv'
PEAK1PH_TO_RMS3PH
=
np
.
sqrt
(
3.0
/
2.0
)
ts_dpsim
=
read_timeseries_csv
(
dpsim_result_file
)
```
%% Cell type:code id: tags:
```
python
plt
.
figure
(
figsize
=
(
12
,
6
))
for
ts_name
,
ts_obj
in
ts_dpsim
.
items
():
if
'_0'
in
ts_name
:
plt
.
plot
(
ts_obj
.
time
,
PEAK1PH_TO_RMS3PH
*
ts_obj
.
values
,
label
=
ts_name
)
for
ts_name
,
ts_obj
in
ts_dpsim_pf
.
items
():
plt
.
plot
(
ts_obj
.
time
,
ts_obj
.
abs
().
values
,
label
=
ts_name
+
'_pf'
,
linestyle
=
':'
)
plt
.
legend
()
plt
.
show
()
```
%% Cell type:code id: tags:
```
python
```
...
...
Examples/Notebooks/Circuits/EMT_Slack_PiLine_VSI_with_PF_Init.ipynb
View file @
48c9b67a
...
...
@@ -31,7 +31,7 @@
"import matplotlib.pyplot as plt\n",
"import re\n",
"\n",
"%matplotlib widget"
"
#
%matplotlib widget"
]
},
{
...
...
%% Cell type:markdown id: tags:
# DP Simulation of topology with slack, line and PQ load
%% Cell type:code id: tags:
```
python
%%
bash
TOP
=
$
{
TOP
:
-
$
(
git
rev
-
parse
--
show
-
toplevel
)}
PATH
=
$
{
TOP
}
/
build
/
Examples
/
Cxx
EMT_Slack_PiLine_VSI_with_PF_Init
```
%% Cell type:code id: tags:
```
python
from
villas.dataprocessing.readtools
import
*
from
villas.dataprocessing.timeseries
import
*
import
matplotlib.pyplot
as
plt
import
re
%
matplotlib
widget
#
%matplotlib widget
```
%% Cell type:markdown id: tags:
## PF results
%% Cell type:code id: tags:
```
python
modelName
=
'EMT_Slack_PiLine_VSI_with_PF_Init_PF'
path
=
'logs/'
+
modelName
+
'/'
dpsim_result_file
=
path
+
modelName
+
'.csv'
ts_dpsim_pf
=
read_timeseries_csv
(
dpsim_result_file
)
```
%% Cell type:markdown id: tags:
## EMT results
%% Cell type:code id: tags:
```
python
modelName
=
'EMT_Slack_PiLine_VSI_with_PF_Init_EMT'
path
=
'logs/'
+
modelName
+
'/'
dpsim_result_file
=
path
+
modelName
+
'.csv'
PEAK1PH_TO_RMS3PH
=
np
.
sqrt
(
3.0
/
2.0
)
ts_dpsim
=
read_timeseries_csv
(
dpsim_result_file
)
```
%% Cell type:code id: tags:
```
python
plt
.
figure
(
figsize
=
(
12
,
6
))
for
ts_name
,
ts_obj
in
ts_dpsim
.
items
():
if
'_0'
in
ts_name
:
plt
.
plot
(
ts_obj
.
time
,
PEAK1PH_TO_RMS3PH
*
ts_obj
.
values
,
label
=
ts_name
)
for
ts_name
,
ts_obj
in
ts_dpsim_pf
.
items
():
plt
.
plot
(
ts_obj
.
time
,
ts_obj
.
abs
().
values
,
label
=
ts_name
+
'_pf'
,
linestyle
=
':'
)
plt
.
legend
()
plt
.
show
()
```
%% Cell type:code id: tags:
```
python
```
...
...
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