From c69b52dd0b73ccdfe5141f2ea504d44af58f8a67 Mon Sep 17 00:00:00 2001 From: Philipp Fensch Date: Thu, 28 Sep 2023 14:56:43 +0200 Subject: [PATCH] Print assert values Signed-off-by: Philipp Fensch --- ...SMIB_ReducedOrderSG_VBR_TPM_LoadStep.ipynb | 6 + ...DQ7odTrapez_EMT_SynGenVBR_SMIB_Fault.ipynb | 6 +- ...rams_Vs_FundamentalParams_SMIB_Fault.ipynb | 5 +- ...rams_Vs_FundamentalParams_SMIB_Fault.ipynb | 5 +- ...CC_9bus_IdealVS_DP_WSCC_9bus_IdealVS.ipynb | 4 +- ...dation_ReducedOrderSG_VBR_Load_Fault.ipynb | 28 +++- ...derSG_VBR_SMIB_Fault_withControllers.ipynb | 59 ++++++- ...alParams_SMIB_Fault_JsonSyngenParams.ipynb | 3 +- ...derSG_VBR_SMIB_Fault_withControllers.ipynb | 123 +++++++++++++- ...ducedOrderSG_VBR_SMIB_Fault_withPSAT.ipynb | 151 ++++++++---------- ...gen_9Order_DCIM_VBR_Governor_Exciter.ipynb | 5 +- .../SP_SMIB_SynGenTrStab_KundurExample1.ipynb | 6 +- ...bus_SG4thOrder_Fault_PSAT_Validation.ipynb | 3 + ...9bus_SGTrStab_Switch_PSAT_Validation.ipynb | 3 + 14 files changed, 299 insertions(+), 108 deletions(-) diff --git a/examples/Notebooks/Circuits/Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep.ipynb b/examples/Notebooks/Circuits/Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep.ipynb index c1205244e5..feab10e46c 100644 --- a/examples/Notebooks/Circuits/Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep.ipynb +++ b/examples/Notebooks/Circuits/Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep.ipynb @@ -252,11 +252,17 @@ "metadata": {}, "outputs": [], "source": [ + "print('ACCURACY Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep 1', rmse_list[0])\n", "assert(rmse_list[0]<0.32)\n", + "print('ACCURACY Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep 2', rmse_list[1])\n", "assert(rmse_list[1]<0.54)\n", + "print('ACCURACY Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep 3', rmse_list[2])\n", "assert(rmse_list[2]<0.31)\n", + "print('ACCURACY Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep 4', rmse_list[3])\n", "assert(rmse_list[3]<0.07)\n", + "print('ACCURACY Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep 5', rmse_list[4])\n", "assert(rmse_list[4]<0.003)\n", + "print('ACCURACY Compare_DP_SMIB_ReducedOrderSG_VBR_TPM_LoadStep 6', rmse_list[5])\n", "assert(rmse_list[5]<2.4e-5)" ] }, diff --git a/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_EMT_SynGenVBR_SMIB_Fault.ipynb b/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_EMT_SynGenVBR_SMIB_Fault.ipynb index 32432e084c..60b89e389e 100644 --- a/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_EMT_SynGenVBR_SMIB_Fault.ipynb +++ b/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_EMT_SynGenVBR_SMIB_Fault.ipynb @@ -328,10 +328,12 @@ "for name in ['v_gen_0', 'v_gen_1', 'v_gen_2']:\n", " diff[name] = ts_dcim[name].rmse(ts_dcim[name], ts_vbr[name])/np.max(ts_dcim[name].values)\n", " print(name + ': ' + str(diff[name]))\n", + " print('ACCURACY Compare_EMT_SynGenDQ7odTrapez_EMT_SynGenVBR_SMIB_Fault', name, diff[name])\n", " assert(diff[name]) < 1e-5\n", "for name in ['i_gen_0', 'i_gen_1', 'i_gen_2']:\n", " diff[name] = ts_dcim[name].rmse(ts_dcim[name], ts_vbr[name])/np.max(ts_dcim[name].values)\n", " print(name + ': ' + str(diff[name]))\n", + " print('ACCURACY Compare_EMT_SynGenDQ7odTrapez_EMT_SynGenVBR_SMIB_Fault', name, diff[name])\n", " assert(diff[name]) < 1e-3" ] }, @@ -345,7 +347,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -359,7 +361,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.10" + "version": "3.9.13" }, "tests": { "skip": false diff --git a/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb b/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb index 9d8bb9bb82..29f77482ab 100644 --- a/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb +++ b/examples/Notebooks/Circuits/Compare_EMT_SynGenDQ7odTrapez_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb @@ -109,13 +109,14 @@ "metadata": {}, "outputs": [], "source": [ + "print('ACCURACY Compare_EMT_SynGenDQ7odTrapez_OperationalParams_Vs_FundamentalParams_SMIB_Fault 1', np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]-ts_operational[name + '_0'].values[begin_idx:end_idx])/np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]))\n", "assert(np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]-ts_operational[name + '_0'].values[begin_idx:end_idx])/np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]) < 1e-3)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -129,7 +130,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.7" + "version": "3.9.13" }, "tests": { "skip": false diff --git a/examples/Notebooks/Circuits/Compare_EMT_SynGenVBR_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb b/examples/Notebooks/Circuits/Compare_EMT_SynGenVBR_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb index fc28812993..afcd0286d8 100644 --- a/examples/Notebooks/Circuits/Compare_EMT_SynGenVBR_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb +++ b/examples/Notebooks/Circuits/Compare_EMT_SynGenVBR_OperationalParams_Vs_FundamentalParams_SMIB_Fault.ipynb @@ -109,13 +109,14 @@ "metadata": {}, "outputs": [], "source": [ + "print('ACCURACY Compare_EMT_SynGenVBR_OperationalParams_Vs_FundamentalParams_SMIB_Fault 1', np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]-ts_operational[name + '_0'].values[begin_idx:end_idx])/np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]))\n", "assert(np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]-ts_operational[name + '_0'].values[begin_idx:end_idx])/np.max(ts_fundamental[name + '_0'].values[begin_idx:end_idx]) < 1e-3)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -129,7 +130,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.7" + "version": "3.9.13" }, "tests": { "skip": false diff --git a/examples/Notebooks/Circuits/Compare_EMT_WSCC_9bus_IdealVS_DP_WSCC_9bus_IdealVS.ipynb b/examples/Notebooks/Circuits/Compare_EMT_WSCC_9bus_IdealVS_DP_WSCC_9bus_IdealVS.ipynb index eb31a868aa..8be8f88c7f 100644 --- a/examples/Notebooks/Circuits/Compare_EMT_WSCC_9bus_IdealVS_DP_WSCC_9bus_IdealVS.ipynb +++ b/examples/Notebooks/Circuits/Compare_EMT_WSCC_9bus_IdealVS_DP_WSCC_9bus_IdealVS.ipynb @@ -146,6 +146,7 @@ " ts_emt_rms3ph[name+'_0'].values = PEAK1PH_TO_RMS3PH*ts_emt_rms3ph[name+'_0'].values\n", " rmse_rel[name] = ts_dpsim_dp[name].rmse(ts_emt_rms3ph[name+'_0'], ts_dpsim_dp[name].interpolate(timestep).frequency_shift(60))/np.max(ts_dpsim_dp[name].abs().values)\n", " print('Rel. RMSE for {}: {}'.format(name, rmse_rel[name]))\n", + " print('ACCURACY Compare_EMT_WSCC_9bus_IdealVS_DP_WSCC_9bus_IdealVS', name, rmse_rel[name])\n", " assert(rmse_rel[name]<1e-5)" ] }, @@ -210,6 +211,7 @@ " ts_emt_rms3ph[name+'_0'].values = PEAK1PH_TO_RMS3PH*ts_emt_rms3ph[name+'_0'].values\n", " rmse_rel[name] = ts_dpsim_dp[name].rmse(ts_emt_rms3ph[name+'_0'], ts_dpsim_dp[name].interpolate(timestep).frequency_shift(60))/np.max(ts_dpsim_dp[name].abs().values)\n", " print('Rel. RMSE for {}: {}'.format(name, rmse_rel[name]))\n", + " print('ACCURACY Compare_EMT_WSCC_9bus_IdealVS_DP_WSCC_9bus_IdealVS', name, rmse_rel[name])\n", " assert(rmse_rel[name]<1e-2)" ] }, @@ -237,7 +239,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.9.13" }, "tests": { "skip": false diff --git a/examples/Notebooks/Circuits/DP_EMT_Validation_ReducedOrderSG_VBR_Load_Fault.ipynb b/examples/Notebooks/Circuits/DP_EMT_Validation_ReducedOrderSG_VBR_Load_Fault.ipynb index 89cc767c57..df4a58f96d 100644 --- a/examples/Notebooks/Circuits/DP_EMT_Validation_ReducedOrderSG_VBR_Load_Fault.ipynb +++ b/examples/Notebooks/Circuits/DP_EMT_Validation_ReducedOrderSG_VBR_Load_Fault.ipynb @@ -277,13 +277,21 @@ "source": [ "tol = 0.001 # %\n", "\n", + "print('ACCURACY DP_EMT_Validation_ReducedOrderSG_VBR_Load_Fault 1', rmse_emt_3order)\n", "assert(rmse_emt_3order