From 743417b2c5c838c42d9fb5707e10e5e1692dedb8 Mon Sep 17 00:00:00 2001 From: Thomas Guillod Date: Mon, 6 Jan 2025 23:45:42 -0500 Subject: [PATCH] quality factor as a vector --- examples/examples_stl/transformer_air/run_matrix.py | 2 +- pypeec/utils/matrix.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/examples_stl/transformer_air/run_matrix.py b/examples/examples_stl/transformer_air/run_matrix.py index 6cfc10c2..77b8eeb7 100644 --- a/examples/examples_stl/transformer_air/run_matrix.py +++ b/examples/examples_stl/transformer_air/run_matrix.py @@ -69,7 +69,7 @@ def _show_matrix(matrix): with LOGGER.BlockIndent(): LOGGER.info("k_R_mat = %s %%" % (1e2 * matrix["k_R_mat"]).tolist()) LOGGER.info("k_L_mat = %s %%" % (1e2 * matrix["k_L_mat"]).tolist()) - LOGGER.info("Q_mat = %s p.u." % (1e0 * matrix["Q_mat"]).tolist()) + LOGGER.info("Q_vec = %s p.u." % (1e0 * matrix["Q_vec"]).tolist()) if __name__ == "__main__": diff --git a/pypeec/utils/matrix.py b/pypeec/utils/matrix.py index 93cba541..b4af655e 100644 --- a/pypeec/utils/matrix.py +++ b/pypeec/utils/matrix.py @@ -155,8 +155,9 @@ def _get_matrix_parse(n_winding, n_solution, freq, Z_mat): else: L_mat = np.imag(Z_mat) / w - # # get the quality factor + # get the quality factor Q_mat = (w * L_mat) / R_mat + Q_vec = np.diagonal(Q_mat) # get the coupling k_R_mat = _get_matrix_coupling(n_winding, R_mat) @@ -172,7 +173,7 @@ def _get_matrix_parse(n_winding, n_solution, freq, Z_mat): "L_mat": L_mat, "k_R_mat": k_R_mat, "k_L_mat": k_L_mat, - "Q_mat": Q_mat, + "Q_vec": Q_vec, } return matrix