Skip to content

Commit

Permalink
resolve rebase errors
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Moraga <[email protected]>
  • Loading branch information
martinmoraga committed Oct 26, 2023
1 parent 45fa65f commit 8bec7ef
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,8 @@
"\n",
" # pi line\n",
" pi_line = dpsimpy.dp.ph1.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
" pi_line.set_parameters(series_resistance=line_resistance,\n",
" series_inductance=line_inductance,\n",
" parallel_capacitance=line_capacitance,\n",
" parallel_conductance=line_conductance)\n",
" pi_line.set_parameters(R=line_resistance, L=line_inductance,\n",
" C=line_capacitance, G=line_conductance)\n",
"\n",
" # Slack\n",
" slack = dpsimpy.dp.ph1.NetworkInjection('slack', dpsimpy.LogLevel.debug)\n",
Expand Down
100 changes: 50 additions & 50 deletions examples/Notebooks/Circuits/DP_Slack_PiLine_VSI_with_PF_Init.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# DP Simulation of topology with slack, line and VSI"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from villas.dataprocessing.readtools import *\n",
"from villas.dataprocessing.timeseries import *\n",
Expand All @@ -18,27 +20,27 @@
"import dpsimpy\n",
"\n",
"# %matplotlib widget"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Simulation"
],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Parameterization"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"final_time = 1.0\n",
"time_step = 1e-5\n",
Expand All @@ -47,20 +49,20 @@
"cmd_scale_P = 1.0\n",
"cmd_scale_I = 1.0\n",
"V_nom = 20e3"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Powerflow for Initialization"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"time_step_pf = final_time\n",
"final_time_pf = final_time + time_step_pf\n",
Expand Down Expand Up @@ -106,20 +108,20 @@
"sim_pf.do_init_from_nodes_and_terminals(False)\n",
"sim_pf.add_logger(logger_pf)\n",
"sim_pf.run()"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Dynamic Simulation"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"time_step_dp = time_step\n",
"final_time_dp = final_time + time_step_dp\n",
Expand All @@ -135,7 +137,7 @@
"extnet_dp.set_parameters(complex(V_nom, 0))\n",
"\n",
"line_dp = dpsimpy.dp.ph1.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_dp.set_parameters(series_resistance=0.5*5, series_inductance=(0.5/314)*5, parallel_capacitance=(50e-6/314)*5)\n",
"line_dp.set_parameters(R=0.5*5, L=(0.5/314)*5, C=(50e-6/314)*5)\n",
"\n",
"pv = dpsimpy.dp.ph1.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down Expand Up @@ -208,53 +210,53 @@
"sim_dp.add_event(load_step_event)\n",
"sim_dp.add_logger(logger_dp)\n",
"sim_dp.run()"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## PF results"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"modelName = 'DP_Slack_PiLine_VSI_with_PF_Init_PF'\n",
"path = 'logs/' + modelName + '/'\n",
"dpsim_result_file = path + modelName + '.csv'\n",
"\n",
"ts_dpsim_pf = read_timeseries_csv(dpsim_result_file)"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DP results"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"modelName = 'DP_Slack_PiLine_VSI_with_PF_Init_DP'\n",
"path = 'logs/' + modelName + '/'\n",
"dpsim_result_file = path + modelName + '.csv'\n",
"\n",
"ts_dpsim = read_timeseries_csv(dpsim_result_file)"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig = plt.figure(figsize=(12,6))\n",
"for ts_name, ts_obj in ts_dpsim.items():\n",
Expand All @@ -268,13 +270,13 @@
"plt.xlabel('Zeit [s]')\n",
"plt.ylabel('Spannung [kV]')\n",
"plt.show()"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"plt.figure(figsize=(12,6))\n",
"for ts_name, ts_obj in ts_dpsim.items():\n",
Expand All @@ -283,13 +285,13 @@
"plt.xlim(4.999, 5.004)\n",
"plt.legend()\n",
"plt.show()"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig = plt.figure(figsize=(12,6))\n",
"ts_5 = ts_dpsim['i12']\n",
Expand All @@ -303,9 +305,7 @@
"plt.xlabel('Zeit [s]')\n",
"plt.ylabel('Stromänderung [A/Zeitschritt]')\n",
"plt.show()\n"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -342,6 +342,8 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#fig = plt.figure(figsize=(12,6))\n",
"\n",
Expand All @@ -358,13 +360,13 @@
"#plt.xlabel('Zeit [s]')\n",
"#plt.ylabel('Stromstärke [A]')\n",
"#pass"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#plt.figure(figsize=(12,6))\n",
"\n",
Expand All @@ -375,16 +377,14 @@
"#plt.xlabel('Frequenz [Hz]')\n",
"#plt.ylabel('Gain')\n",
"#pass"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"source": [],
"metadata": {},
"outputs": [],
"metadata": {}
"source": []
}
],
"metadata": {
Expand Down
8 changes: 4 additions & 4 deletions examples/Notebooks/Circuits/EMT_DP_SP_Slack_PiLine_VSI.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@
"\n",
"line_emt = dpsimpy.emt.ph3.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_emt.set_parameters(\n",
" series_resistance=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" series_inductance=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" parallel_capacitance=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
" R=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" L=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" C=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
"\n",
"pv = dpsimpy.emt.ph3.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down Expand Up @@ -326,7 +326,7 @@
"extnet_dp.set_parameters(complex(V_nom, 0))\n",
"\n",
"line_dp = dpsimpy.dp.ph1.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_dp.set_parameters(series_resistance=0.5*5, series_inductance=(0.5/314)*5, parallel_capacitance=(50e-6/314)*5)\n",
"line_dp.set_parameters(R=0.5*5, L=(0.5/314)*5, C=(50e-6/314)*5)\n",
"\n",
"pv = dpsimpy.dp.ph1.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@
"\n",
"line_emt = dpsimpy.emt.ph3.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_emt.set_parameters(\n",
" series_resistance=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" series_inductance=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" parallel_capacitance=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
" R=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" L=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" C=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
"\n",
"pv = dpsimpy.emt.ph3.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down Expand Up @@ -336,9 +336,9 @@
"\n",
"line_emt = dpsimpy.emt.ph3.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_emt.set_parameters(\n",
" series_resistance=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" series_inductance=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" parallel_capacitance=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
" R=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" L=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" C=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
"\n",
"pv = dpsimpy.emt.ph3.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down Expand Up @@ -722,7 +722,7 @@
"extnet_dp.set_parameters(complex(V_nom, 0))\n",
"\n",
"line_dp = dpsimpy.dp.ph1.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_dp.set_parameters(series_resistance=0.5*5, series_inductance=(0.5/314)*5, parallel_capacitance=(50e-6/314)*5)\n",
"line_dp.set_parameters(R=0.5*5, L=(0.5/314)*5, C=(50e-6/314)*5)\n",
"\n",
"pv = dpsimpy.dp.ph1.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down Expand Up @@ -915,7 +915,7 @@
"extnet_dp.set_parameters(complex(V_nom, 0))\n",
"\n",
"line_dp = dpsimpy.dp.ph1.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_dp.set_parameters(series_resistance=0.5*5, series_inductance=(0.5/314)*5, parallel_capacitance=(50e-6/314)*5)\n",
"line_dp.set_parameters(R=0.5*5, L=(0.5/314)*5, C=(50e-6/314)*5)\n",
"\n",
"pv = dpsimpy.dp.ph1.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@
"\n",
"line_emt = dpsimpy.emt.ph3.PiLine('PiLine', dpsimpy.LogLevel.debug)\n",
"line_emt.set_parameters(\n",
" series_resistance=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" series_inductance=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" parallel_capacitance=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
" R=dpsimpy.Math.single_phase_parameter_to_three_phase(0.5*5),\n",
" L=dpsimpy.Math.single_phase_parameter_to_three_phase((0.5/314)*5),\n",
" C=dpsimpy.Math.single_phase_parameter_to_three_phase((50e-6/314)*5))\n",
"\n",
"pv = dpsimpy.emt.ph3.AvVoltageSourceInverterDQ(\"pv\", \"pv\", dpsimpy.LogLevel.debug, with_trafo=True)\n",
"pv.set_parameters(sys_omega=2 * np.pi * 50, sys_volt_nom=V_nom, p_ref=100e3, q_ref=50e3)\n",
Expand Down
Loading

0 comments on commit 8bec7ef

Please sign in to comment.