Skip to content

Commit

Permalink
Add TRAN model for COAX device
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Sep 4, 2024
1 parent 010485b commit f169643
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/components/coaxline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,45 @@ void coaxline::calcNoiseAC (nr_double_t) {
setMatrixN (4 * celsius2kelvin (T) / T0 * real (getMatrixY ()));
}

void coaxline::initTR (void) {
nr_double_t l = getPropertyDouble ("L");
nr_double_t er = getPropertyDouble ("er");
nr_double_t mur = getPropertyDouble ("mur");

calcPropagation(0.0);

deleteHistory ();
if (l > 0.0) {
setVoltageSources (2);
allocMatrixMNA ();
setHistory (true);
initHistory (l * qucs::sqrt(er * mur) / 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, -zl); setD (VSRC_2, VSRC_2, -zl);
} else {
setVoltageSources (1);
allocMatrixMNA ();
voltageSource (VSRC_1, NODE_1, NODE_2);
}
}

void coaxline::calcTR (nr_double_t t) {
nr_double_t l = getPropertyDouble ("L");
nr_double_t er = getPropertyDouble ("er");
nr_double_t mur = getPropertyDouble ("mur");
nr_double_t T = l * qucs::sqrt(er * mur) / C0;
nr_double_t a = alpha;
if (T > 0.0) {
T = t - T;
a = std::exp (-a / 2 * l);
setE (VSRC_1, a * (getV (NODE_2, T) + zl * getJ (VSRC_2, T)));
setE (VSRC_2, a * (getV (NODE_1, T) + zl * getJ (VSRC_1, T)));
}
}



// properties
PROP_REQ [] = {
{ "D", PROP_REAL, { 2.95e-3, PROP_NO_STR }, PROP_POS_RANGEX },
Expand Down
2 changes: 2 additions & 0 deletions src/components/coaxline.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class coaxline : public qucs::circuit
void calcAC (nr_double_t);
void calcNoiseAC (nr_double_t);
void saveCharacteristics (nr_double_t);
void initTR();
void calcTR(nr_double_t);

private:
void calcPropagation (nr_double_t);
Expand Down

0 comments on commit f169643

Please sign in to comment.