public void Calc(int mode) { Nodes.Clear(); ILRetArray<double> vecX = ILNumerics.ILMath.vec<double>(0, this.dL, this.x).ToArray(); ILRetArray<double> vecY = ILNumerics.ILMath.vec<double>(0, this.dL, this.y).ToArray(); this.shape = new int[2] { vecX.Count(), vecY.Count() }; double sqrt2 = Math.Sqrt(2.0); this.lambda0 = this.c / this.f0; this.tal0 = this.lambda0 / this.c; this.tc = (5 * this.tal0) / 2; this.dT = this.dL / (sqrt2 * this.c); this.Vlt = sqrt2 * this.c; this.Zlt = (mode == 0) ? sqrt2 * this.Z0 : this.Z0 / sqrt2; this.Ylt = 1 / this.Zlt; foreach (var x in vecX) { int j = vecX.ToList().IndexOf(x); foreach (var y in vecY) { int i = vecY.ToList().IndexOf(y); //bool input = j == 0; bool input = false; Node newNode = new Node(i, j, this.material, this.dL, this.Ylt, this.N, this.mode, input); Nodes.Add(newNode); } } }
void EvokeTrackNode(Node n) { if (TrackNode != null) this.TrackNode(n, null); }
public void Transmit(Node node, int k) { node.Vi.P1[k] = node.j < shape[0] - 1 ? GetNode(node.i, node.j + 1).Vr.P3[k - 1] : this.boundaries.Right * node.Vr.P1[k - 1]; node.Vi.P2[k] = node.i > 0 ? GetNode(node.i - 1, node.j).Vr.P4[k - 1] : this.boundaries.Top * node.Vr.P2[k - 1]; node.Vi.P3[k] = node.j > 0 ? GetNode(node.i, node.j - 1).Vr.P1[k - 1] : this.boundaries.Left * node.Vr.P3[k - 1]; node.Vi.P4[k] = node.i < shape[1] - 1 ? GetNode(node.i + 1, node.j).Vr.P2[k - 1] : this.boundaries.Bottom * node.Vr.P4[k - 1]; node.Vi.P5[k] = node.Vr.P5[k - 1]; }
public double GetEx(Node node, int k) { double Ex = -(node.Vi.P2[k] + node.Vi.P4[k]) / dL; return Ex; }
public double GetEy(Node node, int k) { double Ey = -(node.Vi.P1[k] + node.Vi.P3[k]) / dL; return Ey; }
public double GetHx(Node node, int k) { double Hx = (node.Vi.P4[k] - node.Vi.P2[k]) / (dL * (1 / Ylt)); return Hx; }
public double GetHy(Node node, int k) { double Hy = (node.Vi.P1[k] - node.Vi.P3[k]) / (dL * (1 / Ylt)); return Hy; }