Skip to content

Commit 743417b

Browse files
committed
quality factor as a vector
1 parent 0f1cb69 commit 743417b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

examples/examples_stl/transformer_air/run_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _show_matrix(matrix):
6969
with LOGGER.BlockIndent():
7070
LOGGER.info("k_R_mat = %s %%" % (1e2 * matrix["k_R_mat"]).tolist())
7171
LOGGER.info("k_L_mat = %s %%" % (1e2 * matrix["k_L_mat"]).tolist())
72-
LOGGER.info("Q_mat = %s p.u." % (1e0 * matrix["Q_mat"]).tolist())
72+
LOGGER.info("Q_vec = %s p.u." % (1e0 * matrix["Q_vec"]).tolist())
7373

7474

7575
if __name__ == "__main__":

pypeec/utils/matrix.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ def _get_matrix_parse(n_winding, n_solution, freq, Z_mat):
155155
else:
156156
L_mat = np.imag(Z_mat) / w
157157

158-
# # get the quality factor
158+
# get the quality factor
159159
Q_mat = (w * L_mat) / R_mat
160+
Q_vec = np.diagonal(Q_mat)
160161

161162
# get the coupling
162163
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):
172173
"L_mat": L_mat,
173174
"k_R_mat": k_R_mat,
174175
"k_L_mat": k_L_mat,
175-
"Q_mat": Q_mat,
176+
"Q_vec": Q_vec,
176177
}
177178

178179
return matrix

0 commit comments

Comments
 (0)