35 using namespace qucs::eqn;
38 rfedd::rfedd () : circuit () {
56 if (!strcmp (dc,
"short")) {
67 else if (!strcmp (dc,
"open")) {
73 else if (!strcmp (dc,
"zerofrequency")) {
87 #define A(a) ((assignment *) (a))
96 char * txt = (
char *) malloc (strlen (str) + strlen (base) + 4);
98 sprintf (txt,
"%s.%s%d%d", str, base, r, c);
100 sprintf (txt,
"%s%d%d", base, r, c);
111 char * txt = (
char *) malloc (strlen (str) + strlen (base) + 2);
113 sprintf (txt,
"%s.%s", str, base);
115 sprintf (txt,
"%s", base);
136 return A(eqn)->getResultComplex ();
142 char *
type, * pn, * sn, * snold, * fn, * fnold, * vr;
162 for (k = 0, i = 0; i < ports; i++) {
163 for (j = 0; j < ports; j++, k++) {
170 "RFEDD `%s'\n", type, vr,
getName ());
174 pvalue->replace (snold, sn);
175 pvalue->replace (fnold, fn);
177 A(pvalue)->evalType ();
223 for (i = 0; i < ports; i++)
setC (i, i, -1);
224 for (i = 0; i < ports; i++)
setB (i, i, +1);
229 for (i = 0; i < ports; i++)
setB (i, i, +1);
265 for (r = 0; r < ports; r++)
266 for (c = 0; c < ports; c++)
267 setD (r, c, p (r, c));
270 for (r = 0; r < ports; r++)
271 for (c = 0; c < ports; c++) {
273 setC (r, c, p (r, c) - 1.0);
274 setD (r, c,
z0 * (p (r, c) + 1.0));
277 setC (r, c, p (r, c));
278 setD (r, c,
z0 * p (r, c));
283 setY (1, 1, p (1, 1));
setB (1, 0, p (1, 0));
284 setC (0, 1, p (0, 1));
setD (0, 0, p (0, 0));
287 setY (0, 0, p (0, 0));
setB (0, 0, p (0, 1));
288 setC (0, 0, p (1, 0));
setD (0, 0, p (1, 1));
291 setY (0, 1, p (1, 0));
setB (0, 0, p (1, 1));
292 setC (0, 1, p (0, 0));
setD (0, 0, p (0, 1));
295 setC (0, 1, p (0, 1) + p (0, 0));
296 setC (1, 1, p (1, 1) + p (1, 0));
299 setD (0, 1,
z0 * (p (0, 1) - p (0, 0)));
300 setD (1, 1,
z0 * (p (1, 1) - p (1, 0)));
325 for (k = 0, i = 0; i < ports; i++) {
326 for (j = 0; j < ports; j++, k++) {
384 PROP_RNG_STR4 (
"open",
"short",
"unspecified",
"zerofrequency") },
std::complex< nr_double_t > nr_complex_t
matrix ytos(matrix y, qucs::vector z0)
Admittance matrix to scattering parameters.
char * getPropertyReference(const char *)
void setD(int, int, nr_complex_t)
qucs::matrix calcMatrix(nr_double_t)
eqn::checker * getChecker(void)
void setVoltageSources(int)
matrix twoport(matrix m, char in, char out)
Generic conversion matrix.
void initSP(void)
placehoder for S-Parameter initialisation function
void setB(int, int, nr_complex_t)
char * createVariable(const char *, int, int, bool prefix=true)
static const nr_double_t z0
int equationSolver(dataset *)
int getSize(void)
Get the number of ports the circuit element has.
matrix ztos(matrix z, qucs::vector z0)
Convert impedance matrix scattering parameters.
environment * getEnv(void)
#define M_PI
Archimedes' constant ( )
#define PROP_RNG_STR4(s1, s2, s3, s4)
void setY(int, int, nr_complex_t)
void allocMatrixMNA(void)
nr_complex_t getResult(void *)
void setVariableSized(bool v)
The environment class definition.
void voltageSource(int, int, int, nr_double_t value=0.0)
#define PROP_RNG_STR7(s1, s2, s3, s4, s5, s6, s7)
void updateLocals(nr_double_t)
void setC(int, int, nr_complex_t)
void calcMNA(nr_double_t)
char * getPropertyString(const char *)
void logprint(int level, const char *format,...)
void setResult(void *, nr_double_t)
#define PROP_NO_SUBSTRATE