예제 #1
0
파일: tline.cpp 프로젝트: Freecore/qucs
void tline::initAC (void) {
  nr_double_t l = getPropertyDouble ("L");
  if (l != 0.0) {
    setVoltageSources (0);
    allocMatrixMNA ();
  } else {
    setVoltageSources (1);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
void twistedpair::initAC (void) {
  calcLength ();
  if (len != 0.0) {
    setVoltageSources (0);
    allocMatrixMNA ();
  } else {
    setVoltageSources (2);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
    voltageSource (VSRC_2, NODE_3, NODE_4);
  }
}
예제 #3
0
파일: hybrid.cpp 프로젝트: Mehanik/qucs
void hybrid::initAC (void) {
  nr_double_t  k = 2.0 * M_SQRT2;
  nr_complex_t p = polar (1.0, rad (getPropertyDouble ("phi")));
  nr_complex_t d = 2.0 * p * (p - 4.0) - 1.0;
  nr_complex_t y;

  setVoltageSources (0);
  allocMatrixMNA ();
  d *= getPropertyDouble ("Zref");

  y = (-6.0*p*p + 8.0*p - 1.0) / d;
  setY (NODE_1, NODE_1, y); setY (NODE_3, NODE_3, y);

  y = (-2.0*p*p + 8.0*p - 5.0) / d;
  setY (NODE_2, NODE_2, y); setY (NODE_4, NODE_4, y);

  y = 2.0*k * (p * (p - 1.0) - 0.5) / d;
  setY (NODE_1, NODE_3, y); setY (NODE_3, NODE_1, y);

  y = k * (p - 2.0) / d;
  setY (NODE_2, NODE_4, y); setY (NODE_4, NODE_2, y);

  y = k * (-2.0*p + 1.0) / d;
  setY (NODE_1, NODE_4, y); setY (NODE_4, NODE_1, y);
  setY (NODE_2, NODE_3, y); setY (NODE_3, NODE_2, y);

  y = (4.0*p + 4.0) / d;
  setY (NODE_1, NODE_2, y); setY (NODE_2, NODE_1, y);
  setY (NODE_3, NODE_4, y); setY (NODE_4, NODE_3, y);
}
예제 #4
0
void strafo::initAC (void) {
  nr_double_t t1 = getPropertyDouble ("T1");
  nr_double_t t2 = getPropertyDouble ("T2");

  setVoltageSources (2);
  allocMatrixMNA ();

  setB (NODE_1, VSRC_1, -1.0); setB (NODE_2, VSRC_1, + t1);
  setB (NODE_3, VSRC_1, - t1); setB (NODE_4, VSRC_1, +0.0);
  setB (NODE_5, VSRC_1, +0.0); setB (NODE_6, VSRC_1, +1.0);
  setB (NODE_1, VSRC_2, +0.0); setB (NODE_2, VSRC_2, + t2);
  setB (NODE_3, VSRC_2, - t2); setB (NODE_4, VSRC_2, +1.0);
  setB (NODE_5, VSRC_2, -1.0); setB (NODE_6, VSRC_2, +0.0);

  setC (VSRC_1, NODE_1, +1.0); setC (VSRC_1, NODE_2, - t1);
  setC (VSRC_1, NODE_3, + t1); setC (VSRC_1, NODE_4, +0.0);
  setC (VSRC_1, NODE_5, +0.0); setC (VSRC_1, NODE_6, -1.0);
  setC (VSRC_2, NODE_1, +0.0); setC (VSRC_2, NODE_2, - t2);
  setC (VSRC_2, NODE_3, + t2); setC (VSRC_2, NODE_4, -1.0);
  setC (VSRC_2, NODE_5, +1.0); setC (VSRC_2, NODE_6, +0.0);

  setD (VSRC_1, VSRC_1, 0); setD (VSRC_2, VSRC_2, 0);
  setD (VSRC_1, VSRC_2, 0); setD (VSRC_2, VSRC_1, 0);
  setE (VSRC_1, 0.0);
  setE (VSRC_2, 0.0);
}
예제 #5
0
void strafo::initDC (void) {
  setVoltageSources (3);
  allocMatrixMNA ();
  voltageSource (VSRC_1, NODE_1, NODE_6);
  voltageSource (VSRC_2, NODE_5, NODE_4);
  voltageSource (VSRC_3, NODE_2, NODE_3);
}
예제 #6
0
파일: digital.cpp 프로젝트: Freecore/qucs
// Constructor.
digital::digital () : circuit () {
  setVoltageSources (1);
  g = NULL;
  Vout = 0;
  Tdelay = 0;
  delay = false;
}
예제 #7
0
파일: hybrid.cpp 프로젝트: Mehanik/qucs
void hybrid::initDC (void) {
  setVoltageSources (2);
  setInternalVoltageSource (1);
  allocMatrixMNA ();
  voltageSource (VSRC_1, NODE_1, NODE_3);
  voltageSource (VSRC_2, NODE_2, NODE_4);
}
예제 #8
0
void msmbend::initDC (void) {
  // a DC short (voltage source V = 0 volts)
  setVoltageSources (1);
  setInternalVoltageSource (1);
  allocMatrixMNA ();
  clearY ();
  voltageSource (VSRC_1, NODE_1, NODE_2);
}
예제 #9
0
파일: pac.cpp 프로젝트: Freecore/qucs
void pac::initHB (void) {
  setVoltageSources (1);
  allocMatrixMNA ();
  voltageSource (VSRC_1, NODE_1, NODE_2);
  nr_double_t g = 1.0 / getPropertyDouble ("Z");
  setY (NODE_1, NODE_1, +g); setY (NODE_2, NODE_2, +g);
  setY (NODE_1, NODE_2, -g); setY (NODE_2, NODE_1, -g);
}
예제 #10
0
void biastee::initAC (void) {
  setISource (false);
  setVoltageSources (1);
  allocMatrixMNA ();
  clearB ();
  clearC ();
  voltageSource (VSRC_1, NODE_2, NODE_1);
}
예제 #11
0
파일: tline.cpp 프로젝트: Freecore/qucs
void tline::initTR (void) {
  nr_double_t l = getPropertyDouble ("L");
  nr_double_t z = getPropertyDouble ("Z");
  deleteHistory ();
  if (l > 0.0) {
    setVoltageSources (2);
    allocMatrixMNA ();
    setHistory (true);
    initHistory (l / C0);
    setB (NODE_1, VSRC_1, +1); setB (NODE_2, VSRC_2, +1);
    setC (VSRC_1, NODE_1, +1); setC (VSRC_2, NODE_2, +1);
    setD (VSRC_1, VSRC_1, -z); setD (VSRC_2, VSRC_2, -z); 
  } else {
    setVoltageSources (1);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
예제 #12
0
파일: resistor.cpp 프로젝트: Freecore/qucs
// Initialize computation of MNA matrix entries for HB.
void resistor::initHB (void) {
  initModel ();
  nr_double_t r = getScaledProperty ("R");
  setVoltageSources (1);
  setInternalVoltageSource (1);
  allocMatrixMNA ();
  voltageSource (VSRC_1, NODE_1, NODE_2);
  setD (VSRC_1, VSRC_1, -r);
}
예제 #13
0
파일: mscross.cpp 프로젝트: Freecore/qucs
void mscross::initDC (void) {
  initModel ();
  setVoltageSources (5);
  allocMatrixMNA ();
  voltageSource (VSRC_1, NODE_1, NODE_5);
  voltageSource (VSRC_2, NODE_3, NODE_5);
  voltageSource (VSRC_3, NODE_2, NODE_6);
  voltageSource (VSRC_4, NODE_4, NODE_6);
  voltageSource (VSRC_5, NODE_5, NODE_6);
}
예제 #14
0
파일: tline.cpp 프로젝트: Freecore/qucs
void tline::initDC (void) {
  nr_double_t z = getPropertyDouble ("Z");
  nr_double_t a = getPropertyDouble ("Alpha");
  nr_double_t l = getPropertyDouble ("L");
  a = log (a) / 2;
  if (a * l != 0.0) {
    setVoltageSources (0);
    allocMatrixMNA ();
    a = exp (a * l);
    nr_double_t f = 1 / z / (a - 1);
    nr_double_t y11 = +f * (a + 1);
    nr_double_t y21 = -f * 2 * sqrt (a);
    setY (NODE_1, NODE_1, y11); setY (NODE_2, NODE_2, y11);
    setY (NODE_1, NODE_2, y21); setY (NODE_2, NODE_1, y21);
  } else {
    setVoltageSources (1);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
예제 #15
0
void cpwstep::initAC (void) {
  setVoltageSources (2);
  setInternalVoltageSource (true);
  allocMatrixMNA ();
  setB (NODE_1, VSRC_1, +1.0); setB (NODE_1, VSRC_2, +0.0);
  setB (NODE_2, VSRC_1, +0.0); setB (NODE_2, VSRC_2, +1.0);
  setC (VSRC_1, NODE_1, -1.0); setC (VSRC_1, NODE_2, +0.0);
  setC (VSRC_2, NODE_1, +0.0); setC (VSRC_2, NODE_2, -1.0);
  setE (VSRC_1, +0.0); setE (VSRC_2, +0.0);
  checkProperties ();
}
예제 #16
0
파일: msvia.cpp 프로젝트: Freecore/qucs
void msvia::initDC (void) {
  nr_double_t r = calcResistance ();

  // for non-zero resistances usual MNA entries
  if (r != 0.0) {
    nr_double_t g = 1.0 / r;
    setVoltageSources (0);
    allocMatrixMNA ();
    setY (NODE_1, NODE_1, +g); setY (NODE_2, NODE_2, +g);
    setY (NODE_1, NODE_2, -g); setY (NODE_2, NODE_1, -g);
  }
  // for zero resistances create a zero voltage source
  else {
    setVoltageSources (1);
    setInternalVoltageSource (1);
    allocMatrixMNA ();
    clearY ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
예제 #17
0
파일: resistor.cpp 프로젝트: Freecore/qucs
void resistor::initDC (void) {
  initModel ();
  nr_double_t r = getScaledProperty ("R");

  // for non-zero resistances usual MNA entries
  if (r != 0.0) {
    nr_double_t g = 1.0 / r;
    setVoltageSources (0);
    allocMatrixMNA ();
    setY (NODE_1, NODE_1, +g); setY (NODE_2, NODE_2, +g);
    setY (NODE_1, NODE_2, -g); setY (NODE_2, NODE_1, -g);
  }
  // for zero resistances create a zero voltage source
  else {
    setVoltageSources (1);
    setInternalVoltageSource (1);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
예제 #18
0
파일: coaxline.cpp 프로젝트: Freecore/qucs
void coaxline::initDC (void) {
  nr_double_t l   = getPropertyDouble ("L");
  nr_double_t d   = getPropertyDouble ("d");
  nr_double_t rho = getPropertyDouble ("rho");

  if (d != 0.0 && rho != 0.0 && l != 0.0) {
    // a tiny resistance
    nr_double_t g = M_PI * sqr (d / 2) / rho / l;
    setVoltageSources (0);
    allocMatrixMNA ();
    setY (NODE_1, NODE_1, +g); setY (NODE_2, NODE_2, +g);
    setY (NODE_1, NODE_2, -g); setY (NODE_2, NODE_1, -g);
  }
  else {
    // a DC short
    setVoltageSources (1);
    setInternalVoltageSource (1);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
예제 #19
0
/*! DC model initialization.
 *! DC model of a bondwire is a resistance.
 */
void bondwire::initDC (void) {
  nr_double_t g;

  getProperties ();

  /* for non-zero resistances usual MNA entries */
  if (rho != 0.0) {
    g = 1.0 / resistance (0);
    setVoltageSources (0);
    allocMatrixMNA ();
    setY (NODE_1, NODE_1, +g); setY (NODE_2, NODE_2, +g);
    setY (NODE_1, NODE_2, -g); setY (NODE_2, NODE_1, -g);
  }
  /* for zero resistances create a zero voltage source */
  else {
    setVoltageSources (1);
    setInternalVoltageSource (1);
    allocMatrixMNA ();
    clearY ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
  }
}
예제 #20
0
void inductor::initAC (void) {
  nr_double_t l = getPropertyDouble ("L");

  // for non-zero inductance usual MNA entries
  if (l != 0.0) {
    setVoltageSources (0);
    allocMatrixMNA ();
  }
  // for zero inductance create a zero voltage source
  else {
    initDC ();
    calcDC ();
  }
}
예제 #21
0
파일: isolator.cpp 프로젝트: Freecore/qucs
void isolator::initDC (void) {
  nr_double_t z1 = getPropertyDouble ("Z1");
  nr_double_t z2 = getPropertyDouble ("Z2");
#if AUGMENTED
  nr_double_t z21 = 2 * sqrt (z1 * z2);
  setVoltageSources (2);
  allocMatrixMNA ();
  setB (NODE_1, VSRC_1, +1.0); setB (NODE_1, VSRC_2, +0.0);
  setB (NODE_2, VSRC_1, +0.0); setB (NODE_2, VSRC_2, +1.0);
  setC (VSRC_1, NODE_1, -1.0); setC (VSRC_1, NODE_2, +0.0);
  setC (VSRC_2, NODE_1, +0.0); setC (VSRC_2, NODE_2, -1.0); 
  setD (VSRC_1, VSRC_1,  +z1); setD (VSRC_2, VSRC_2,  +z2);
  setD (VSRC_1, VSRC_2, +0.0); setD (VSRC_2, VSRC_1, +z21);
  setE (VSRC_1, +0.0); setE (VSRC_2, +0.0);
#else
  setVoltageSources (0);
  allocMatrixMNA ();
  setY (NODE_1, NODE_1, 1 / z1);
  setY (NODE_1, NODE_2, 0);
  setY (NODE_2, NODE_1, -2 / sqrt (z1 * z2));
  setY (NODE_2, NODE_2, 1 / z2);
#endif
}
void twistedpair::initDC (void) {
  nr_double_t d   = getPropertyDouble ("d");
  nr_double_t rho = getPropertyDouble ("rho");
  calcLength ();

  if (d != 0.0 && rho != 0.0 && len != 0.0) {
    // tiny resistances
    nr_double_t g1 = M_PI * sqr (d / 2) / rho / len;
    nr_double_t g2 = g1;
    setVoltageSources (0);
    allocMatrixMNA ();
    setY (NODE_1, NODE_1, +g1); setY (NODE_2, NODE_2, +g1);
    setY (NODE_1, NODE_2, -g1); setY (NODE_2, NODE_1, -g1);
    setY (NODE_3, NODE_3, +g2); setY (NODE_4, NODE_4, +g2);
    setY (NODE_3, NODE_4, -g2); setY (NODE_4, NODE_3, -g2);
  }
  else {
    // DC shorts
    setVoltageSources (2);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
    voltageSource (VSRC_2, NODE_3, NODE_4);
  }
}
예제 #23
0
void phaseshifter::initAC (void) {
  nr_double_t p = rad (getPropertyDouble ("phi"));

  if (p == 0.0) { // no phase shift, thus a short
    initDC ();
  }
  else { // compute Y-parameters directly
    setVoltageSources (0);
    allocMatrixMNA ();
    nr_double_t z = getPropertyDouble ("Zref");
    nr_double_t y11 =  1 / z / tan (p);
    nr_double_t y21 = -1 / z / sin (p);
    setY (NODE_1, NODE_1, rect (0, y11)); setY (NODE_2, NODE_2, rect (0, y11));
    setY (NODE_1, NODE_2, rect (0, y21)); setY (NODE_2, NODE_1, rect (0, y21));
  }
}
예제 #24
0
파일: vac.cpp 프로젝트: Freecore/qucs
void vac::initHB (void) {
  setVoltageSources (1);
  allocMatrixMNA ();
  voltageSource (VSRC_1, NODE_1, NODE_2);
}
예제 #25
0
void ctline::initDC (void) {
    setVoltageSources (2);
    allocMatrixMNA ();
    voltageSource (VSRC_1, NODE_1, NODE_2);
    voltageSource (VSRC_2, NODE_3, NODE_4);
}
예제 #26
0
vcvs::vcvs () : circuit (4) {
  type = CIR_VCVS;
  setVoltageSources (1);
}
예제 #27
0
void phaseshifter::initDC (void) {
  setVoltageSources (1);
  allocMatrixMNA ();
  clearY ();
  voltageSource (VSRC_1, NODE_1, NODE_2);
}
예제 #28
0
파일: coaxline.cpp 프로젝트: Freecore/qucs
void coaxline::initAC (void) {
  setVoltageSources (0);
  allocMatrixMNA ();
  initCheck ();
}
예제 #29
0
iprobe::iprobe () : circuit (2) {
  type = CIR_IPROBE;
  setVSource (true);
  setVoltageSources (1);
}
예제 #30
0
/*! Initialize AC simulation. */
void bondwire::initAC (void) {
  getProperties (); 
  setVoltageSources (0);
  allocMatrixMNA ();
}