36 tswitch::tswitch () : circuit (2) {
38 setVoltageSources (1);
42 char * init = getPropertyString (
"init");
43 bool on = !strcmp (init,
"on");
44 return on ? getPropertyDouble (
"Ron") : getPropertyDouble (
"Roff");
48 nr_double_t
r = initState ();
57 nr_double_t T = getPropertyDouble (
"Temp");
58 nr_double_t
r = initState ();
59 nr_double_t f =
kelvin (T) * 4.0 * r * z0 /
sqr (2.0 * z0 + r) /
T0;
65 nr_double_t
r = initState ();
66 if (r > 0.0 || r < 0.0) {
67 nr_double_t T = getPropertyDouble (
"Temp");
68 nr_double_t f =
kelvin (T) /
T0 * 4.0 /
r;
75 nr_double_t
r = initState ();
91 repeat = (values->
getSize () % 2) == 0 ?
true :
false;
95 nr_double_t maxduration = getPropertyDouble(
"MaxDuration");
96 duration = std::min ( std::max (10*NR_TINY, values->
minimum() / 100),
103 char * init = getPropertyString (
"init");
104 nr_double_t ron = getPropertyDouble (
"Ron");
105 nr_double_t roff = getPropertyDouble (
"Roff");
107 nr_double_t rdiff = 0;
111 bool on = !strcmp (init,
"on");
124 nr_double_t ts = t - duration;
129 for (
int i = 0;
i < values->
getSize ();
i++) {
149 nr_double_t tdiff = std::max(NR_TINY, t - ts);
154 if (tdiff > duration) {
167 s_i = (rdiff) / (duration);
175 s_i = (rdiff) / (duration);
179 r = r_0 + ((3. * s_i *
qucs::pow (tdiff,2.0)) / (duration))
matrix real(matrix a)
Real part matrix.
#define T0
standard temperature
#define PROP_RNG_STR2(s1, s2)
nr_complex_t pow(const nr_complex_t z, const nr_double_t d)
Compute power function with real exponent.
#define K
Absolute 0 in centigrade.
void initSP(void)
placehoder for S-Parameter initialisation function
nr_double_t initState(void)
nr_complex_t sqr(const nr_complex_t z)
Square of complex number.
nr_complex_t floor(const nr_complex_t z)
Complex floor.
void calcNoiseAC(nr_double_t)
void calcNoiseSP(nr_double_t)
nr_double_t minimum(void)
#define PROP_NO_SUBSTRATE