Skip to content

Commit

Permalink
[Post rebase fixes] notebooks
Browse files Browse the repository at this point in the history
Signed-off-by: Ghassen Nakti <[email protected]>
  • Loading branch information
gnakti committed Jul 16, 2023
1 parent bac8ad8 commit c5cb0f9
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 47 deletions.
81 changes: 55 additions & 26 deletions examples/Notebooks/Circuits/EMT_DP_SP_SynGenTrStab_3Bus_Fault.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import villas.dataprocessing.readtools as rt\n",
Expand Down Expand Up @@ -48,7 +50,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"#-----------Power system-----------\n",
Expand Down Expand Up @@ -139,7 +143,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"time_step_pf = final_time\n",
Expand Down Expand Up @@ -224,7 +230,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sim_name_emt = sim_name + \"_EMT\"\n",
Expand Down Expand Up @@ -346,7 +354,7 @@
"sim_emt.set_domain(dpsimpy.Domain.EMT)\n",
"sim_emt.add_logger(logger_emt)\n",
"sim_emt.do_system_matrix_recomputation(True)\n",
"sim_emt.set_mna_solver_implementation(dpsimpy.MnaSolverImpl.EigenSparse)\n",
"sim_emt.set_direct_solver_implementation(dpsimpy.DirectLinearSolverImpl.SparseLU)\n",
"\n",
"\n",
"# Events\n",
Expand Down Expand Up @@ -378,7 +386,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"#-----------Power system-----------\n",
Expand Down Expand Up @@ -469,7 +479,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"time_step_pf = final_time\n",
Expand Down Expand Up @@ -560,7 +572,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sim_name_dp = sim_name + \"_DP\"\n",
Expand Down Expand Up @@ -700,7 +714,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"#-----------Power system-----------\n",
Expand Down Expand Up @@ -791,7 +807,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"time_step_pf = final_time\n",
Expand Down Expand Up @@ -882,7 +900,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sim_name_sp = sim_name + \"_SP\"\n",
Expand Down Expand Up @@ -1015,7 +1035,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"work_dir = 'logs/SP_SynGenTrStab_3Bus_Fault_SP/'\n",
Expand All @@ -1034,7 +1056,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"work_dir = 'logs/DP_SynGenTrStab_3Bus_Fault_DP/'\n",
Expand All @@ -1055,7 +1079,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"work_dir = 'logs/EMT_SynGenTrStab_3Bus_Fault_EMT/'\n",
Expand All @@ -1074,7 +1100,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"timestep=50e-6;\n",
Expand Down Expand Up @@ -1115,7 +1143,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"f= plt.figure(figsize=(16,8))\n",
Expand Down Expand Up @@ -1149,7 +1179,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"f= plt.figure(figsize=(16,8))\n",
Expand Down Expand Up @@ -1191,7 +1223,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"f= plt.figure(figsize=(16,8))\n",
Expand Down Expand Up @@ -1233,7 +1267,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"f= plt.figure(figsize=(16,8))\n",
Expand All @@ -1252,13 +1288,6 @@
" plt.plot(ts_emt3ph_TrStab_dl[name+'1'].interpolate(timestep).time[begin_idx:end_idx], ts_emt3ph_TrStab_dl[name+'2'].interpolate(timestep).values[begin_idx:end_idx]*180/3.14 - ts_emt3ph_TrStab_dl[name+'1'].interpolate(timestep).values[begin_idx:end_idx]*180/3.14, label=name + ' EMT')\n",
"plt.legend()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,13 +1137,6 @@
" plt.plot(ts_emt3ph_TrStab_dl[name+'1'].interpolate(timestep).time[begin_idx:end_idx], ts_emt3ph_TrStab_dl[name+'2'].interpolate(timestep).values[begin_idx:end_idx]*180/3.14 - ts_emt3ph_TrStab_dl[name+'1'].interpolate(timestep).values[begin_idx:end_idx]*180/3.14, label=name + ' EMT')\n",
"plt.legend()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
33 changes: 19 additions & 14 deletions examples/Notebooks/Circuits/EMT_DP_SP_SynGenTrStab_SMIB_Fault.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import villas.dataprocessing.readtools as rt\n",
Expand Down Expand Up @@ -42,7 +44,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Power System\n",
Expand Down Expand Up @@ -103,7 +107,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sim_name_pf = sim_name + \"_PF\"\n",
Expand Down Expand Up @@ -175,7 +181,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sim_name_emt = sim_name + \"_EMT\" \n",
Expand Down Expand Up @@ -253,7 +261,7 @@
"sim_emt.set_domain(dpsimpy.Domain.EMT)\n",
"sim_emt.add_logger(logger_emt)\n",
"sim_emt.do_system_matrix_recomputation(True)\n",
"sim_emt.set_mna_solver_implementation(dpsimpy.MnaSolverImpl.EigenSparse)\n",
"sim_emt.set_direct_solver_implementation(dpsimpy.DirectLinearSolverImpl.SparseLU)\n",
"\n",
"\n",
"# Events\n",
Expand Down Expand Up @@ -285,7 +293,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Power System\n",
Expand Down Expand Up @@ -1015,7 +1025,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"plt.figure(figsize=(12,8))\n",
Expand All @@ -1033,13 +1045,6 @@
"plt.legend(fontsize=18)\n",
"plt.show()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit c5cb0f9

Please sign in to comment.