32 mutualx::mutualx () :
circuit () {
41 matrix mutualx::calcMatrixY (nr_double_t frequency) {
52 for (r = 0; r < inductors; r++) {
53 for (c = 0; c < inductors; c++) {
54 y.
set (2 * r + 0, 2 * c + 0, +ty (r, c));
55 y.
set (2 * r + 1, 2 * c + 1, +ty (r, c));
56 y.
set (2 * r + 0, 2 * c + 1, -ty (r, c));
57 y.
set (2 * r + 1, 2 * c + 0, -ty (r, c));
63 matrix mutualx::calcMatrixZ (nr_double_t frequency) {
68 nr_double_t o = 2 *
M_PI * frequency;
72 for (state = 0, r = 0; r < inductors; r++) {
73 for (c = 0; c < inductors; c++, state++) {
74 nr_double_t l1 =
real (L->
get (r));
75 nr_double_t l2 =
real (L->
get (c));
76 nr_double_t k =
real (C->
get (state)) *
sqrt (l1 * l2);
77 z.
set (r, c,
rect (0.0, k * o));
92 nr_double_t o = 2 *
M_PI * frequency;
95 for (state = 0, r = 0; r < inductors; r++) {
96 for (c = 0; c < inductors; c++, state++) {
97 nr_double_t l1 =
real (L->
get (r));
98 nr_double_t l2 =
real (L->
get (c));
99 nr_double_t k =
real (C->
get (state)) *
sqrt (l1 * l2);
106 int inductors =
getSize () / 2;
110 for (
int i = 0;
i < inductors;
i++)
115 int inductors =
getSize () / 2;
121 int inductors =
getSize () / 2;
126 nr_double_t * veq =
new nr_double_t[inductors * inductors];
127 nr_double_t * req =
new nr_double_t[inductors * inductors];
130 for (state = 0, r = 0; r < inductors; r++) {
131 for (c = 0; c < inductors; c++, state++) {
132 nr_double_t l1 =
real (L->
get (r));
133 nr_double_t l2 =
real (L->
get (c));
135 nr_double_t k =
real (C->
get (state)) *
sqrt (l1 * l2);
137 integrate (2 * state, k, req[state], veq[state]);
142 for (state = 0, r = 0; r < inductors; r++) {
144 for (c = 0; c < inductors; c++, state++) {