示例#1
0
        public override void Analyze(Analysis Mna)
        {
            Expression P = VariableResistor.AdjustWipe(wipe, sweep);

            Expression R1 = Resistance * P;
            Expression R2 = Resistance * (1 - P);

            Resistor.Analyze(Mna, Cathode, Wiper, R1);
            Resistor.Analyze(Mna, Anode, Wiper, R2);
        }
示例#2
0
        public override void Analyze(Analysis Mna)
        {
            // Implement Voltage gain.
            Node pp1 = new Node()
            {
                Name = "pp1"
            };
            Node np1 = new Node()
            {
                Name = "np1"
            };

            Mna.PushContext(Name, pp1, np1);

            // The input terminals are connected by a resistor Rin.
            Resistor.Analyze(Mna, Negative, Positive, Rin);
            Expression VRin = Negative.V - Positive.V;

            Expression Rp1 = 1000;

            CurrentSource.Analyze(Mna, pp1, np1, VRin * Aol / Rp1);
            Resistor.Analyze(Mna, pp1, np1, Rp1);
            Capacitor.Analyze(Mna, pp1, np1, 1 / (2 * Math.PI * Rp1 * GBP / Aol));
            Ground.Analyze(Mna, np1);

            // Implement voltage limiter.
            if (vcc.IsConnected && vee.IsConnected)
            {
                Node ncc = new Node()
                {
                    Name = "ncc"
                };
                Node nee = new Node()
                {
                    Name = "nee"
                };
                Mna.DeclNodes(ncc, nee);

                VoltageSource.Analyze(Mna, vcc, ncc, 2);
                Diode.Analyze(Mna, pp1, ncc, 8e-16, 1, VT);

                VoltageSource.Analyze(Mna, vee, nee, -2);
                Diode.Analyze(Mna, nee, pp1, 8e-16, 1, VT);
            }

            // Output current is buffered.
            Mna.AddTerminal(Out, (pp1.V - Out.V) / Rout);

            Mna.PopContext();
        }
示例#3
0
        public override void LayoutSymbol(SymbolLayout Sym)
        {
            base.LayoutSymbol(Sym);

            Sym.AddWire(Anode, new Coord(0, 16));
            Sym.AddWire(Cathode, new Coord(0, -16));
            Sym.InBounds(new Coord(-10, 0), new Coord(10, 0));

            Resistor.Draw(Sym, 0, -16, 16, 7);

            Sym.DrawArrow(EdgeType.Black, new Coord(-6, -15), new Coord(6, 15), 0.1);

            Sym.DrawText(() => Resistance.ToString(), new Coord(-7, 0), Alignment.Far, Alignment.Center);
            Sym.DrawText(() => Wipe.ToString("G3"), new Coord(9, 3), Alignment.Near, Alignment.Near);
            Sym.DrawText(() => Name, new Coord(9, -3), Alignment.Near, Alignment.Far);
        }
示例#4
0
        public override sealed void LayoutSymbol(SymbolLayout Sym)
        {
            Sym.InBounds(new Coord(-20, -20), new Coord(10, 20));

            Sym.AddTerminal(Anode, new Coord(-10, 20), new Coord(-10, 16));
            Sym.DrawPositive(EdgeType.Black, new Coord(-16, 16));

            Sym.AddTerminal(Cathode, new Coord(-10, -20), new Coord(-10, -16));
            Sym.DrawNegative(EdgeType.Black, new Coord(-16, -16));

            Sym.AddTerminal(Wiper, new Coord(10, 0));
            Sym.DrawArrow(EdgeType.Black, new Coord(10, 0), new Coord(-6, 0), 0.2);

            Resistor.Draw(Sym, -10, -16, 16, 7);

            Sym.DrawText(() => Resistance.ToString(), new Coord(-17, 0), Alignment.Far, Alignment.Center);
            Sym.DrawText(() => Wipe.ToString("G3"), new Coord(-4, 4), Alignment.Near, Alignment.Near);
            Sym.DrawText(() => Name, new Coord(-4, -4), Alignment.Near, Alignment.Far);
        }
示例#5
0
        public override void Analyze(Analysis Mna)
        {
            Expression P = AdjustWipe(wipe, sweep);

            Resistor.Analyze(Mna, Name, Anode, Cathode, (Expression)Resistance * P);
        }
示例#6
0
 public override void Analyze(Analysis Mna)
 {
     Resistor.Analyze(Mna, Name, Anode, Cathode, Impedance);
 }