The problem and its solution

In previous lecture we learned how to systematically write down a circuit's equations with a small subset of all possible unknowns. We deemed this approach nodal analysis. The main shortcoming of nodal analysis is that it can't handle independent voltage sources, or any other elements where branch currents cannot be explicitly expressed with branch voltages.

To sidestep this shortcoming most simulators use the following approach. Instead of trying to express the branch current of a voltage source we simply keep the branch current as an unknown. This increases the number of unknowns by one for every independent voltage source in the circuit. Of course, due to additional unknowns we must also supply additional equations. These additional equations are obtained from the constitutive relations of independent voltage sources. Suppose the voltage source with voltage U is connected with its + pin to node 1 and - pin to node 2. The additional equation is then

This approach to writing circuit equations is referred to as modified nodal analysis (MNA). Take, for instance, the circuit in Fig. 1. It has n=4 nodes and one independent voltage source. Let us apply MNA to this circuit and write down its equations.


Fig. 1: A simple linear circuit with an independent voltage source.

Writing down the first n-1=3 equations based on KCL is straightforward. Note that we keep the current flowing through an independent voltage source (iCC) as an unknown.

The additional equation based on the constitutive relation of the voltage source is

Rewriting these four equations in matrix form yields


Fig. 2: Independent voltage source.

Looking at the obtained matrix we can construct the element footprint of an independent voltage source (Fig. 2). Let the unknowns be ordered in such manner that nodal voltages come before branch currents introduced via MNA. Suppose the source is connected between nodes k (+) and l (-). Let i denote the unknown introduced by MNA (i.e. the current flowing into the + pin of the voltage source). A voltage source then contributes the following element footprint to the coefficient matrix

The contribution of an independent voltage source to the RHS vector is

If one of the pins of an independent voltage source is connected to the ground the corresponding rows and columns of the coefficient matrix and RHS vector are omitted from the footprint (i.e. if terminal l is grounded row l and column vl are omitted).

Example of a nonlinear circuit

Now let us revise the first example of the previous lecture (Fig. 3) and construct its modified nodal equations.


Fig. 3: Circuit from first lecture, revisited.

We start with KCL equations.

But this time we are going to keep iCC as an unknown in the system of equations. To keep the system of equations fully determined we add one more equation - the constitutive relation of voltage source UCC.

Finally, we substitute the constitutive relations of resistors and the bipolar transistor and we arrive at the following system of equations

We cannot write this system of equations in matrix form because three of the equations (second, third, and fourth) are nonlinear - they contain nonlinear functions gC and gE.

Other linear controlled sources

In previous chapter we learned how to include voltage-controlled current sources in circuit equations. With MNA we can handle other types controlled sources. Let us limit ourselves for now to linear controlled sources.


Fig. 4: Voltage-controlled voltage source.

A voltage-controlled voltage source (VCVS) connected between nodes k (+) and l (-), controlled by the voltage between nodes kc (+) and lc (-) with gain A (Fig. 4) has the following constitutive relation

Such a source contributes to KCL equations of nodes k and l. Let i denote the unknown corresponding to the current flowing through such source (from node k to node l). The element footprint of a VCVS in the coefficient matrix is

If any of the output pins is connected to the ground the corresponding row and column (k or l) is omitted from the footprint. Similarly if any of the controlling pins is connected to the ground the corresponding column (kc or lc) is omitted from the footprint. VCVS does not contribute to the RHS vector.

We can also handle current-controlled sources. The controlling current must be one of the unknowns in the system of equations (i.e. in our case a current flowing through a voltage source). If no such unknown is available we can add one by inserting a zero-voltage independent voltage source in series with the controlling branch.


Fig. 5: Current-controlled current source.

Suppose we have a current-controlled current source (CCCS) connected between nodes k and l with gain A (Fig. 5). Let iC denote the controlling current. A CCCS contributes a term of the form Ai to KCL equations for nodes k and l. Unlike VCVS it does not add an equation to the system because it does not introduce an additional unknown. CCCS does not contribute to the RHS vector. The element footprint of a CCCS in the coefficient matrix is

If a CCCS is connected with one of its pins to the ground the corresponding row (either k or l) is omitted from the footprint.


Fig. 6: Current-controlled voltage source.

A current-controlled voltage source (CCVS) is a bit more complicated. Suppose it is connected between nodes k (+) and l (-), is controlled by current iC (which in turn must be an unknown in the system of equations), and its transimpedance is r (Fig. 6). A CCVS introduces an additional unknown into the system because it is a voltage source. Let i denote this unknown. The constitutive relation of a CCVS is

A CCVS does not contribute to the RHS vector. Its element footprint in the coefficient matrix is

If a CCVS is connected with one of its pins to the ground the corresponding row (either k or l) and column (either vk or vl) is omitted from the footprint.

Inverting amplifier built with a real opamp

In this example we are going to write down the equations of an inverting amplifier which is obtained if we add two resistors to an opamp (Fig. 7, left). The opamp has finite gain (A). Therefore we can model it as a linear VCVS (Fig. 7, right).

      
Fig. 7: Inverting amplifier (left) and its model (right).

The circuit has 4 nodes and thwo voltage sources. Two additional unknowns are added to the system of equations (i and iA) which comprises 3 KCL equations and the constitutive relations of the independent voltage source and the VCVS.

After rearranging these equations we can write them in matrix form.

Ideal opamp with negative feedback

An ideal opamp with negative feedback (Fig. 8, left) is connected to three nodes. Nodes k and l represent the non-inverting and the inverting input, while node m is its output. The current flowing into the input terminals is zero. The output of an opamp behaves as a controlled voltage source connected between node m and ground (Fig. 8, right).

      
Fig. 8: Ideal opamp with negative feedback (left) and its model (right).

The controlling voltage is the voltage between the non-inverting and the inverting input. In an ideal opamp the gain is infinite. When such an opamp is used in a linear circuit with a negative feedback loop the opamp produces an output voltage that forces the controlling voltage to zero because this is the only way for satisfying the constitutive relation of the opamp without an infinite voltage at its output. Because its output is a controlled voltage source an unknown representing its current is added to the system of equations. The constitutive relation of an ideal opamp with negative feedback is

An ideal opamp with negative feedback does not contribute to the RHS vector. In the matrix of coefficients it contributes one equation (its constitutive relation) and one entry to the KCL equation of node m. Its element footprint in the coefficient matrix is

Ideal transformer

An ideal transformer (Fig. 9, left) has four pins where k1 and l1 represent the terminals of the primary coil and k2 and l2 represent the terminals of the secondary coil. An ideal transformer is obtained from a real transformer when the magnetic coupling is ideal and inductances of the coils are infinite.

      
Fig. 9: Ideal transformer (left) and its model (right).

It can be described with two equations:

where n is the ratio of secondary vs. primary coil windings. We can express the first equation with nodal voltages

Based on these equations we can construct a model (Fig. 9, right) which is the basis for writing down the element footprint of an ideal transformer. The model comprises one VCVS modelling the secondary coil and one CCCS modelling the primary coil. Because we have a voltage source in the model an ideal transformer introduces a new unknown into the system of equations (i2). Due to this we need an additional equation in the system. We obtain it from the first equation describing the transformer (which is actually the constitutive relation of a VCVS). An ideal transformer does not contribute to the RHS vector. The element footprint in the coefficient matrix is

If the primary winding is connected with one of its pins to the ground the corresponding row (either k1 or l1) and column (either vk1 or vl1) are omitted from the footprint. Similarly, if the secondary winding is connected with one of its pins to the ground the corresponding row (either k2 or l2) and column (either vk2 or vl2) are omitted from the footprint.