Exemple #1
0
 public override void Analyze(Analysis Mna)
 {
     Mna.PushContext(Name, Nodes);
     foreach (Component c in Components)
         c.Analyze(Mna);
     Mna.PopContext();
 }
Exemple #2
0
 public override void Analyze(Analysis Mna)
 {
     Mna.PushContext(Name, Nodes);
     foreach (Component c in Components)
     {
         c.Analyze(Mna);
     }
     Mna.PopContext();
 }
Exemple #3
0
 public Analysis Analyze()
 {
     Analysis mna = new Analysis();
     mna.PushContext(null, Nodes);
     foreach (Component c in Components)
         c.Analyze(mna);
     mna.PopContext();
     return mna;
 }
Exemple #4
0
        public Analysis Analyze()
        {
            Analysis mna = new Analysis();

            mna.PushContext(null, Nodes);
            foreach (Component c in Components)
            {
                c.Analyze(mna);
            }
            mna.PopContext();
            return(mna);
        }
Exemple #5
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();
        }
Exemple #6
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();
        }