34 mutualx::mutualx () : circuit () {
46 matrix ty =
stoy (ts);
52 matrix
y = matrix (inductors * 2);
54 for (r = 0; r < inductors; r++) {
55 for (c = 0; c < inductors; c++) {
56 y.set (2 * r + 0, 2 * c + 0, +ty (r, c));
57 y.set (2 * r + 1, 2 * c + 1, +ty (r, c));
58 y.set (2 * r + 0, 2 * c + 1, -ty (r, c));
59 y.set (2 * r + 1, 2 * c + 0, -ty (r, c));
70 nr_double_t o = 2 *
M_PI * frequency;
71 matrix z = matrix (inductors);
74 for (state = 0, r = 0; r < inductors; r++) {
75 for (c = 0; c < inductors; c++, state++) {
76 nr_double_t l1 =
real (L->
get (r));
77 nr_double_t l2 =
real (L->
get (c));
94 nr_double_t o = 2 *
M_PI * frequency;
97 for (state = 0, r = 0; r < inductors; r++) {
98 for (c = 0; c < inductors; c++, state++) {
99 nr_double_t l1 =
real (L->
get (r));
100 nr_double_t l2 =
real (L->
get (c));
108 int inductors =
getSize () / 2;
112 for (
int i = 0;
i < inductors;
i++)
117 int inductors =
getSize () / 2;
123 int inductors =
getSize () / 2;
128 nr_double_t * veq =
new nr_double_t[inductors * inductors];
129 nr_double_t * req =
new nr_double_t[inductors * inductors];
132 for (state = 0, r = 0; r < inductors; r++) {
133 for (c = 0; c < inductors; c++, state++) {
134 nr_double_t l1 =
real (L->
get (r));
135 nr_double_t l2 =
real (L->
get (c));
139 integrate (2 * state, k, req[state], veq[state]);
144 for (state = 0, r = 0; r < inductors; r++) {
146 for (c = 0; c < inductors; c++, state++) {
std::complex< nr_double_t > nr_complex_t
matrix ytos(matrix y, qucs::vector z0)
Admittance matrix to scattering parameters.
matrix real(matrix a)
Real part matrix.
void integrate(int, nr_double_t, nr_double_t &, nr_double_t &)
qucs::matrix calcMatrixZ(nr_double_t)
void setD(int, int, nr_complex_t)
qucs::matrix calcMatrixY(nr_double_t)
void setVoltageSources(int)
int getSize(void)
Get the number of ports the circuit element has.
vector * getPropertyVector(const char *)
nr_complex_t sqrt(const nr_complex_t z)
Compute principal value of square root.
matrix stoy(matrix s, qucs::vector z0)
Scattering parameters to admittance matrix.
nr_double_t getJ(int, nr_double_t)
matrix ztos(matrix z, qucs::vector z0)
Convert impedance matrix scattering parameters.
void setE(int, nr_complex_t)
#define M_PI
Archimedes' constant ( )
void allocMatrixMNA(void)
void setVariableSized(bool v)
void voltageSource(int, int, int, nr_double_t value=0.0)
void setState(int, state_type_t, int n=0)
matrix ztoy(matrix z)
impedance matrix to admittance matrix.
#define PROP_NO_SUBSTRATE