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
41abd99b
Commit
41abd99b
authored
Oct 27, 2020
by
Jan Dinkelbach
Committed by
Markus Mirz
Nov 21, 2020
Browse files
add assertion dp vs emt to PiLine example notebook
parent
f77f1f89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Examples/Notebooks/Components/Line.ipynb
View file @
41abd99b
...
...
@@ -295,7 +295,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Compare
DP vs. EMT for
PiLine Component "
"## Compare PiLine Component
DP vs. EMT
"
]
},
{
...
...
@@ -307,7 +307,6 @@
"plt.figure()\n",
"for name in [('v1_0', 'v1_shift'), ('v2_0', 'v2_shift')]:\n",
" plt.plot(piline_component_emt[name[0]].time, np.sqrt(3/2)*piline_component_emt[name[0]].values - piline_component_dp_shifted[name[1]].values, label=name[0]+' vs. '+name[1])\n",
" compare_errors.append(np.absolute(np.sqrt(3/2)*piline_component_emt[name[0]].values - piline_component_dp_shifted[name[1]].values).max())\n",
"plt.legend()"
]
},
...
...
@@ -319,10 +318,27 @@
"source": [
"plt.figure()\n",
"plt.plot(piline_component_emt['iline_0'].time, np.sqrt(3/2)*piline_component_emt['iline_0'].values - piline_component_dp_shifted['iline_shift'].values, label='iline_0'+' vs. '+'iline_shift')\n",
"compare_errors.append(np.absolute(np.sqrt(3/2)*piline_component_emt['iline_0'].values - piline_component_dp_shifted['iline_shift'].values).max())\n",
"plt.legend()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Assertion DP vs. EMT for PiLine Component"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"compare_errors = []\n",
"for name in [('v1_0', 'v1_shift'), ('v2_0', 'v2_shift'), ('iline_0', 'iline_shift')]:\n",
" compare_errors.append(np.absolute(np.sqrt(3/2)*piline_component_emt[name[0]].values - piline_component_dp_shifted[name[1]].values).max())\n",
" print(name[0]+' vs. '+name[1] + ': ' + str(compare_errors[-1]))\n",
"assert np.max(compare_errors) < 1e-3"
]
},
{
...
...
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