In circuit analysis we are often interested in the circuit's response when all excitations are sinusoidal signals of the same frequency. Beside sinusoidal excitations we also allow DC excitations. The circuit's response to such stimulus is composed of a transient response and a periodic signal. In stable circuits the transient response eventually dies off and we are left with a periodic signal superimposed on a DC component. If the magnitudes of the sinusoidal excitation signals are small the circuit's response (excluding the DC component) is sinusoidal even if the circuit is nonlinear. We refer to the sinusoidal part of this response as small-signal sinusoidal response. The magnitudes and phases of the response signals provide us with many valuable insights into circuit's behavior.
In unstable circuits we cannot observe the small-signal sinusoidal response because the transient response never dies off. We can, however, compute it with a simulator. Again, the computed response can provide many valuable insights into circuit's behavior (like frequency response, stability, etc.).
Fig. 1: Three sinusoidal signals in time domain (left) and their complex representations (right).
Let us assume a sinusoidal signal with magnitude A and phase Φ.
We can express it in terms of complex numbers as
where j denotes the imaginary unit. We can see that, assuming the frequency ω is known, the signal is uniquely defined by complex number X. The absolute value of X is equal to the magnitude of the signal while the argument of X is equal to the phase of the signal. Fig. 1 depicts 3 sinusoidal signals and the corresponding complex numbers as vectors in complex plane. We refer to complex numbers that represent sinusoidal signals as complexors.
By assuming all unknowns are sinusoidal signals of same frequency we effectively moved our analysis to the frequency domain. Unknowns become complex numbers representing magnitudes and phases of sinusoidal signals. Now what do we gain from this? Take, for instance, the constitutive relation of a linear capacitor (Fig. 2, left).
Fig. 2: Linear capacitor (left) and inductor (right).
Now suppose the voltage in time domain is given by
The corresponding complexor is given by
The capacitor current can be expressed as
The complexor representing the capacitor current is
where I and U are complexors representing the current and the voltage of a capacitor. The implications of this simple relation are quite deep. The differential equation relating current to voltage was transformed to a much more simple complex algebraic relation valid for sinusoidal signals. This relation is given in so-called frequency domain. Similarly, for an inductor (Fig. 2, right) with constitutive relation
we have
Fig. 3: Coupled inductors. When a current is flowing into the pin marked with a dot it is considered positive.
Another element to consider is the coupling between two inductors. Suppose inductors L1 and L2 are coupled with a coupling factor |k|<1. The constitutive relations of the two inductors are extended with an additional term representing the magnetic coupling.
where
In the frequency domain the constitutive relations become
The assumption that all signals in the circuit are sinusoidal greatly simplifies circuit analysis. The constitutive relations of capacitors and inductors become algebraic equations. Instead of solving a system of differential equations we are confronted with a system of linear equations. The unknowns and the coefficients are now complex. Capacitors and inductors are described in a manner equivalent to ordinary resistors, i.e. the current is proportional to the voltage. The coefficient of proportionality is complex and depends on the frequency (ω). With this in mind we can immediately derive the element footprint of a capacitor (Fig. 2, left) in the coefficient matrix.
Handling of inductors is somewhat more complicated. For a single inductor we could easily express the current with the voltage. But for coupled inductors this would require inverting a matrix. Furthermore, expressing the current explicitly with voltage in time-domain would require solving a system of differential equations. Therefore most simulators choose to take a different path. Instead of explicitly expressing the device current they introduce a new unknown for every inductor - its current. This way inductors are handled in a manner similar to voltage sources. The constitutive relation of an inductor becomes the additional equation that makes the system fully determined.
The element footprint of an inductor (Fig. 2, right) is
For coupled inductors (Fig. 3) the coupling appears in the constitutive relations of the two inductors, but not in the KCL part of the circuit equations.
The element footprint of a pair of coupled inductors is
Coupled inductors do not contribute to the right-hand side vector. We can see that the element footprint is identical to the element footprint of the two inductors with the addition of the jωM12 term to both constitutive relations.
Fig. 4: Model of a non-ideal transformer. The coupling factor between the two inductors is given by k.
Let us illustrate the frequency-domain analysis of a linear circuit with an example (Fig. 4). The circuit is a model of a non-ideal transformer with imperfect magnetic coupling k<1, winding resistance, and winding capacitance. Two input signals are generated by the two current sources. The circuit has 5 nodes. Due to this the list of unknowns contains 4 nodal voltages. Additionally, two currents are introduced into the list of unknowns by the two inductors in the circuit. With our knowledge of element footprints we can write the system of equations by inspection.
Up to now all capacitors and inductors in this chapter were linear. Now we are going to introduce nonlinear capacitors and inductors. The former ones model charge storage in semiconductor devices, while the latter ones can be used for modelling coils with nonlinear cores.
Fig. 5: A linear capacitor (left), a nonlinear capacitor (center), and the linearized model of a nonlinear capacitor (right).
A capacitor stores charge (Fig. 5, left). The plate connected to the node with the higher potential holds positive charge (q), while the opposite plate holds equally large negative charge (-q). For linear capacitors the charge is proportional to the voltage across the capacitor.
For nonlinear capacitors this relation is nonlinear. With respect to modelling there are two kinds of nonlinear capacitors. The ones where the charge can be expressed as a univariate function of the voltage (voltage-dependent capacitors) and the ones where the voltage can be expressed as a univariate function of charge (charge-dependent capacitors). Because in most real-world cases the nonlinear function is a bijective map (and thus its inverse exists) both approaches are feasible for most real-world nonlinear capacitors. We are going to focus on voltage-dependent nonlinear capacitors because this approach fits well with the modified nodal analysis. For a voltage-dependent nonlinear capacitor (Fig. 5, center) we can writeFor both linear and nonlinear capacitors the charge conservation must be honored and therefore we can express the current flowing through a capacitor as
If we assume the stored charge depends only on the voltage (but not on time itself) we can write
Here c(uC) denotes the differential capacitance which is voltage-dependent. For a linear capacitor the differential capacitance is equal to the capacitor's total capacitance (i.e. stored charge divided by the capacitor voltage). For a nonlinear capacitor it does not make sense to define the total capacitance because the charge is not proportional to the voltage. Charge storage and differential capacitance in a linear and a nonlinear capacitor are illustrated in Fig. 6.
Fig. 6: The dependence of charge (top) and differential capacitance (bottom) on the capacitor voltage for a linear capacitor (left) and a nonlinear capacitor (right). The charge stored in a capacitor at voltage UC is equal to the integral of the differential capacitance from 0 to UC.
Now suppose we slightly perturb the voltage of a nonlinear capacitor from UC to UC+ΔuC. How much does the charge change?
Because the first term on the left-hand side cancels out the first term on the right-hand side we have
We can see that a nonlinear capacitor behaves as a linear capacitor if we consider only the small changes in voltage and charge. Now suppose the voltage is composed of a DC component UC and a small sinusoidal component given by complexor Uc. Because for small perturbations the nonlinear capacitor behaves as a linear capacitor with capacitance equal to the differential capacitance at UC the small-signal model of a nonlinear capacitor is a linear capacitor in Fig. 5 (right). A small sinusoidal voltage results in a small sinusoidal current flowing through a nonlinear capacitor which can be expressed as
Fig. 7: A semiconductor diode (left), its operating point (center), and its linearized model (right).
An example of a nonlinear capacitor is the charge storage of a semiconductor diode (Fig. 7, left). Its operating point (Fig. 7, center) is given by voltage UD which drives a DC current ID through the diode. The differential conductance of a diode (gD) depends on the operating point and was computed in one of the previous lectures. The differential capacitance of a diode also depends on the voltage. The differential capacitance of a diode consists of three components: depletion capacitance which is dominant for reverse polarization (UD<0), diffusion capacitance which dominates when the diode starts to conduct significant currents, and linear capacitance due to overlap effects. The depletion capacitance can be expressed with the voltage as
where C0, M, and VJ are diode model parameters. The diffusion capacitance, on the other hand, depends on the resistive current flowing through the diode.
IS and τ are diode model parameters, and VT is the thermal voltage.
Fig. 8: Differential capacitance (full line), depletion capacitance (dotted line), and diffusion capacitance (dashed line) of a semiconductor diode with respect to operating point voltage in linear (top) and logarithmic (bottom) scale.
The differential capacitance of a diode (Fig. 8) is
where the last term (Covl) represents the overlap capacitance (which in turn is independent of the operating point and therefore linear).
Nonlinear inductances can be handled in a similar manner. Two kinds of nonlinear inductors exist with respect to the modelling approach. For current-dependent inductors the magnetic flux (Φ) can be expressed as a univariate function of the current. For flux-dependent inductors the current can be expressed as a univariate function of the magnetic flux. Again, in most practical cases both approaches can be applied as the mapping between flux and current is a bijective one. Here we are going to introduce the former one, where the magnetic flux is a nonlinear function of the current.
The voltage across an inductor can then be expressed as
Assuming the flux depends only on current, but not on time itself we can write
By introducing differential inductance (l), which in turn depends on the operating point, we arrive at the small-signal model of a nonlinear inductor which is a linear inductor with inductance equal to the differential inductance l(IL) where IL is the operating point current flowing through the nonlinear inductor. We leave the rest of the derivation to the interested user, as nonlinear inductors are not common in modern integrated circuits.
Within this framework for a nonlinear inductor we can handle a linear inductor by expressing
Modified nodal analysis of circuits that comprise nonlinear capacitors results in a nonlinear system of equations of the form
Here nonlinear vector-valued function g and vector y represent the resistive part of the circuit and its excitations (we became familiar with these two in the previous two lectures), while q is a vector valued function expressing the total charge stored by the capacitors connected to a particular node in the circuit. Note that in the most general case every component of q is a nonlinear function of the circuit's unknowns. One migh object to such a definition because at the first glance it does not guarantee the electrical neutrality of the circuit. Note, however, that nothing is required for the charge storage at the ground node. Therefore the charge at the ground node can balance out the sum of the charges stored at the remaining nodes of the circuit thus guaranteeing the circuit's electrical neutrality. This definition also allows the stored charge in a capacitor to depend not only on the branch voltage of that particular capacitor, but also on other branch voltages. This gives rise to transcapacitances which are required for modelling charge storage in devices like MOSFET transistors.
Within the framework of this equation we can also handle nonlinear inductors for which the magnetic flux is expressed as a function of the inductor's current. The inductor's current must be one of the circuit's unknowns. This current appears as a term in the corresponding KCL equations. The constitutive relation of the nonlinear inductor appears as an additional nonlinear equation in vector valued function q relating the inductor's flux via a nonlinear expression to the inductor's current (which is now an unknown).
Fig. 9: A nonlinear circuit.
Let us illustrate this by writing down the nonlinear equations of a circuit comprising nonlinear resistive and capacitive elements in Fig. 9. The diode current consists of two components: a resistive one and a capacitive one.
The circuit has 3 nodes which result in 2 KCL equations. The independent voltage source and the inductor add two more unknowns to the system of equations (i1 and i2). With the knowledge we gathered in previous lectures the two KCL equations can be written down by inspection.
Two more equations are obtained from the constitutive relations of the independent voltage source and inductor.
Note that the third term in the second equation originates from the resistive part of the diode (i.e. its nonlinear I/V characteristic) while the fourth term represents the current flowing into the diode's nonlinear capacitance. After gathering the resitive terms (terms that do not include derivatives with respect to time) and the reactive terms (the ones that include derivatives with respect to time) in two vectors we obtain the following system of equations.
The first term on the left-hand side corresponds to the nonlinear resistive part of the circuit (vector-valued function g) while the second term represents the nonlinear reactive part of the circuit (vector-valued function q). The right-hand side represents the circuit's excitation (vector y). Note that the last component of q represents the negative of the inductor's magnetic flux because we are modelling inductors by adding new unknowns (inductor currents) and expressing their constitutive relations in the same manner as we did with capacitors.
Suppose the circuit's excitations are composed of a DC component and a small sinusoidal component. Therefore we can write
Complex vector yAC comprises complexors representing small sinusoidal excitations superimposed on the DC excitations specified by vector yDC. Because the sinusoidal excitations are small we can linearize the circuit and assume its response is of the form
where the magnitudes of components in complex vector xAC are small. We already know how to linearize the resistive part of the circuit.
Matrix G is the Jacobian of the vector valued function g.
Now let us linearize the reactive part.
Matrix C is the Jacobian of the vector valued function q.
It contains the differential capacitances of reactive elements. Computing the derivative with respect to time eliminates the first term yielding
By taking into account both linearizations the system of equations becomes
This equation consists of two kinds of terms: time-independent DC terms (the first term on the LHS and the first term on the RHS) and time-dependent sinusoidal AC terms. Due to this the equation can be split into two equations.
The first equation determines the circuit's operating point. Once we solve it by means of the NR algorithm a useful byproduct of the algorithm is the Jacobian matrix of g at the circuit's operating point. The obtained operating point is then used for computing the Jacobian of the circuit's reactive part (q). Both Jacobians are used in the process of solving the second equation at the given frequency ω. The second equation must be satisfied for all times (t) so we conclude
The solution of this equation is the AC part of the circuit's response at given frequency ω. Solving the circuit for multiple frequencies is cheap because we are solving a linear system of equations (NR algorithm is not needed). Furthermore, the two Jacobians do not have to be recomputed (they depend only on the operating point).
To illustrate the small signal analysis of a nonlinear circuit let us write down the system of equations for circuit in Fig. 9. First, let us compute the Jacobians of the resistive and the reactive part. The former is
Because gD is the differential conductance of the diode, which is a nonlinear element, it depends on the operating point. Let V1DC, V2DC, I1DC, and I2DC define the operating point of the circuit. Then gD can be computed as
The Jacobian of the reactive part of the circuit is
The differential capacitance of the diode depends on the operating point and can be obtained as
We assume the excitation provided by the voltage source consists of a DC component U1DC and a small sinusoidal signal represented by complexor U1ac. Similarly, all signals representing the response also consist of a DC component (i.e. the operating point of the circuit given by V1DC, V2DC, I1DC, and I2DC) and a small sinusoidal component represented by a complexor (V1ac, V2ac, I1ac, and I2ac).
The operating point can be computed by solving the nonlinear system of equations where the term representing the reactive part of the circuit is removed. This means that in operating point analysis capacitors are removed and inductors are replaced with short circuits.
After the operating point is obtained the differential capacitances of the nonlinear elements can be computed and matrix C built. Matrix G is obtained (as we noted earlier) as a byproduct of the operating point analysis. Note that the entries in matrices G and C corresponding to linear elements do not depend on the operating point. Now we can build the system of equations for small signal analysis.
We can construct the system of equations for the small-signal frequency-domain analysis of a nonlinear circuit by replacing all nonlinear elements with their respective small-signal models. From the excitations generated by the independent sources we keep only the sinusoidal (AC) parts and represent them with the corresponding complexors. For the circuit in Fig. 9 we get the small-signal model depicted in Fig. 10.
Fig. 10: Small-signal frequency-domain model of the nonlinear circuit in Fig. 9.
The values of the differential conductances and capacitances (i.e. in our example gD and cD) can be computed from the results of the operating point analysis. The end result is the following system of equations which can be constructed by inspection (i.e. by using element footprints) from the schematic in Fig. 10.
A bipolar junction transistor (BJT) stores charge via the same mechanism as a semiconductor diode. It has two p-n junctions.
Fig. 11: Small-signal frequency-domain model of a NPN BJT. The voltages and the currents in the small-signal model are complexors representing sinusoidal signals.
In the active region of operation the base-emitter junction is foward polarized (for an NPN transistor uBE≥0) while the base-collector junction is reverse polarized (for an NPN transistor uBC=uBE-uCE≤0). In the active region the two differential capacitances of an NPN BJT can be expressed as
where UBC=UBE-UCE and IC represent the operating point of the transistor.
The small-signal frequency-domain model of an N-type MOSFET is somewhat more complicated (Fig. 12).
Fig. 12: Small-signal frequency-domain model (right) of a N-type MOSFET (left). The voltages and the currents in the small-signal model are complexors representing sinusoidal signals.
In the saturation region (uGS≥0 and uDS≥uGS-UT) the capacitances according to the simplest model of charge storage (level 1 model in SPICE) are
Capacitances cgso, cgdo, and cdso are linear overlap capacitances. The first term in cgs is a nonlinear capacitance which in this simple model is equal to 2/3 of the gate-to-bulk capacitance given by
W and L are the gate width and length, tox is the thickness of the insulator below the gate, ε0 is the vacuum permitivitty, and εr is the relative permitivitty of the insulator (3.9 for Silicon dioxide).
Fig. 13: A simple MOSFET-based amplifier.
Suppose we have the nonlinear circuit in Fig. 13. After its operating point is computed and the differential conductances and capacitances are evaluated we arrive at the small-signal model of the circuit in Fig. 14.
Fig. 14: Small-signal frequency-domain model of the amplifier in Fig. 13.
From the small-signal model we can write down (using element footprints) the equations for computing the small-signal frequency-domain response of the circuit. We assume that both independent sources provide a sinusoidal excitation to the circuit. In most practical cases Udd=0.
In SPICE the small-signal frequency-domain analysis is called AC analysis. At invocation the frequency range and step must be specified. The magnitudes and optional phases of sinusoidal excitations are specified in the circuit description by passing the ac parameter to independent sources. Note that the ac value is used only in small-signal frequency-domain analysis.
The simulator first computes the operating point of the circuit. In this computation all reactive elements are disabled (capacitors are removed and inductors replaced with short circuits). The operating point is used for computing the Jacobians of the resistive and the reactive part of the circuit. The approach via element footprints is used for quickly assembling these two matrices. The right-hand side of the system of equations for small-signal frequency-domain analysis is assembled based on the values of the ac parameter passed to the independent sources (again with the element footprint approach). The system of equations is then solved for all frequencies specified by the range and the step parameters at analysis invocation. The linearized models are computed only once because the equations differ between two frequency points only in the value of ω.
AC analysis is quite fast. It requires only one LU decomposition per frequency point. For a moderate number of frequency points a large part of the time spent by the analysis is used for computing the operating point.