Skip to content

Commit

Permalink
Improved the incorporation of dpsimpy to the path
Browse files Browse the repository at this point in the history
Signed-off-by: pipeacosta <[email protected]>
  • Loading branch information
pipeacosta authored and martinmoraga committed Dec 4, 2023
1 parent 31a2778 commit 7a04a5e
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions examples/Notebooks/MatDyn/Kundur2Areas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.insert(0,'/home/mmo/git/ieee14/dpsim/python/src/dpsim')\n",
"sys.path.insert(0,'/home/mmo/git/ieee14/dpsim/build')\n",
"sys.path.remove('/home/mmo/git/lund-anm-control')\n",
"import sys, os\n",
"\n",
"notebook_dir = os.path.abspath('')\n",
"dpsim_root_dir = os.path.join(notebook_dir, \"../../..\")\n",
"\n",
"sys.path.insert(0, os.path.join(dpsim_root_dir, 'python/src/dpsim'))\n",
"sys.path.insert(0, os.path.join(dpsim_root_dir, 'build'))\n",
"\n",
"import matpower\n",
"import dpsimpy\n",
Expand All @@ -59,8 +62,8 @@
"outputs": [],
"source": [
"# simulation files\n",
"path_static_file = '/home/mmo/git/ieee14/dpsim/examples/Notebooks/MatDyn/Kundur2Areas/Kundur2Areas.mat'\n",
"path_dynamic_file = '/home/mmo/git/ieee14/dpsim/examples/Notebooks/MatDyn/Kundur2Areas/Kundur2Areas_dyn.mat'"
"path_static_file = os.path.join(notebook_dir, 'Kundur2Areas/Kundur2Areas.mat')\n",
"path_dynamic_file = os.path.join(notebook_dir, 'Kundur2Areas/Kundur2Areas_dyn.mat')\n"
]
},
{
Expand Down Expand Up @@ -457,7 +460,7 @@
"\n",
"#url = 'https://raw.githubusercontent.com/dpsim-simulator/reference-results/master/PSAT/SMIB-Fault/#PSAT_3OrderSyGen_SMIB_Fault_100mS_TS_1mS.out.txt'\n",
"#local_file_3Order = 'reference-results/PSAT_3OrderSyGen_SMIB_Fault_100mS_TS_1mS.out'\n",
"local_file = '/home/mmo/git/ieee14/dpsim/examples/Notebooks/MatDyn/Kundur2Areas/PSAT_Kundur2Areas_Fault_TimeStep_100uS_Tol_1e-5.out'\n",
"local_file = os.path.join(notebook_dir, 'Kundur2Areas/PSAT_Kundur2Areas_Fault_TimeStep_100uS_Tol_1e-5.out')\n",
"\n",
"#urllib.request.urlretrieve(url, local_file_3Order) \n",
"ts_psat = read_timeseries_dpsim(local_file)"
Expand Down Expand Up @@ -820,6 +823,13 @@
"nominal_voltage = 230000\n",
"plot_node_volt_abs(varname_dpsim, varname_psat, ts_dpsim_sp, ts_dpsim_dp, ts_dpsim_emt, ts_dpsim_sp_low_inertia, ts_dpsim_dp_low_inertia, ts_dpsim_emt_low_inertia, ts_psat, nominal_voltage)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -838,7 +848,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.11"
},
"tests": {
"skip": true
Expand Down

0 comments on commit 7a04a5e

Please sign in to comment.