Using Complex Numbers in Circuit Analysis Review of The Algebra of Complex Numbers
Using Complex Numbers in Circuit Analysis Review of The Algebra of Complex Numbers
where the last step makes use of Euler’s formula: e jφ = cos φ + j ⋅ sin φ .
This essential relation points directly to the reason why complex numbers make
circuit analysis easier. Instead of representing a sinusoidal voltage or current as a sine or
cosine function, we can represent it as an exponential. Exponentials are much easier to
work with algebraically! Unless you love dealing with complicated trig identities, choose
the complex exponential over the sine and cosine functions!
Here is a summary of the two representations of a complex number:
z = x + jy x = r cos φ y = r sin φ
z = re jφ r = x2 + y2 φ = arctan ( y x )
Keep in mind when calculating the phase φ that there is in general an ambiguity of ± π
radians, which you have to resolve by looking at the signs of both y and x . The arctan
function on your calculator will always return an angle in the range − π → + π . You can
2 2
avoid this ambiguity if you use the special function on your calculator for transforming
between rectangular and polar coordinates. Also, computer languages usually include an
inverse tangent function with two separate arguments for y and x , which will return the
correct value of φ in the range 0 → 2π or − π → +π (e.g. ATAN2 in FORTRAN).
However, multiplication and division are most easily done using the polar form,
making use of the properties of the exponential function:
z1 ⋅ z 2 = r1 ⋅ r2 ⋅ e j (φ1 +φ2 )
z1 r1 j (φ1 −φ2 )
= ⋅e
z2 r2
2
Physics 160 Spring 2006
3
This procedure works for voltage and current sources that are sinusoidal (harmonic). However, a non-
sinusoidal periodic source can be written as a Fourier series of sines and cosines. Each term in the series
can be treated by the method described here. Since the circuit is linear, the response is just the linear
superposition of the responses to the individual harmonic Fourier components.
3
Physics 160 Spring 2006
V I L
4
By steady-state, I mean turn all the switches on and then wait long enough for the transient behavior to
dampen out and disappear. Usually the wait is very short, less than a blink of the eye.
4
Physics 160 Spring 2006
This is readily solved by making the substitution I = I 0 e j (ωt +φ ) , which turns the
differential equation into an algebraic equation:
1
jωL + + R ⋅ I 0 e jφ = V0 .
jωC
The quantity in parentheses is exactly the “impedance” that one would get by using the
impedance rules listed above for resistors, capacitors, and inductors, plus the rule that
impedances in series simply add up. So, from now on do not bother to write down the
differential equation! Just assume the rules for complex impedance and immediately
write down the algebraic equation.
To analyze the series LRC circuit without writing any differential equation, we
start with “Ohm’s Law” for a reactive circuit:
V 1
I = 0 with Z = R + + jωL .
Z jωC
To do the division, I convert the impedance to polar form:
2
1 2 1 jφ
Z = R + j ⋅ ωL − = R + ωL − ⋅e Z
ωC ωC
1
ωL −
ωC = arctan ω − ω0 and ω ≡ 1 and γ ≡ R .
2 2
with φZ = arctan 0
R γω LC L
So the current is given by
ω
V0 ⋅
V0
I= ⋅ e − jφ Z = L ⋅ e jφ
R 2 + ωL −
1
2
(
γ 2ω 2 + ω 2 − ω02 )2
ωC
ω 2 − ω02
with φ = − arctan for the phase of the current.
γω
This result exhibits a resonance, with ω0 , the natural frequency of the circuit,
being the frequency at which the impedance is minimum (and equal simply to R) and the
current is maximum, with a phase shift of zero relative to the voltage. Also, γ is a
measure of the amount of damping in the circuit and, thus, the width of the resonance
curve. This resonance behavior is illustrated in Figure 3.
5
Physics 160 Spring 2006
Figure 3. Resonance curves for an LRC series circuit, with R=10 Ohms, C=2µF, and
L=4mH.
A more complicated looking example is shown in Figure 4, where the driving
voltage is the real part of V (t ) = 10e iωt volts, with angular frequency ω = 10 4 radians/s.
The impedance of the inductor is jωL = 4 j ohms, and the impedance of the capacitor is
1 jωC = −0.25 j ohms. The objective is to find all the currents in the circuit and the
equivalent impedance of the overall circuit, as seen by the voltage source. In this case
there are 4 loops, so we will have 4 loop equations and 3 node equations. This goes
6
Physics 160 Spring 2006
400 F
i4
1 1
i3
V i1 1 i2
0.4mH
7
Physics 160 Spring 2006
Fill the 16 values into the matrix Z and the 4 values into V, and then type
I = Z −1 ⋅ V
and you’re done!5 The result is
15.457 − 1.787 j
5.457 − 1.787 j
I =
4.990 + 0.652 j
5.213 + 0.084 j
Here is how to interpret the result. For example, the current i1 can be written in
polar form as i1 = 15.56e − j 0.037π , so the current as a function of time is
i1 (t ) = 15.56 ⋅ cos(ωt − 0.037π ) .
That is, the current passing through the source lags behind the voltage by 0.037π
radians, or about 7 degrees. Figure 6 shows how the current and voltage would look if
displayed on an oscilloscope. The equivalent impedance of the circuit, as seen by the
source, can be calculated from the ratio of the voltage and current of the source:
V 10
Z eq = = ⋅ e + j 0.037π .
i1 15.56
Thus at this frequency, the circuit looks slightly inductive to the source.
Figure 6. Plots of the voltage and current of the voltage supply as a function of time for a
supply frequency of 104 radians/s. The current lags behind the voltage by several
degrees.
Nonlinear Circuits
We have seen how complex numbers can make quick work of linear circuits, by
turning a set of coupled linear differential equations into a set of linear algebraic
5
This is not the most efficient way to solve 4 linear equations, but for this purpose, who cares? The
computer will finish the calculation before you can say “go”!
8
Physics 160 Spring 2006
equations that are easily solved with some help from a computer. But what about non-
linear circuits? Well, one generally has to analyze a non-linear circuit by making a linear
approximation around some initial guess (or around the actual bias point if that is already
known). That may give a crummy result at first, but usually by iterating this procedure
many times one can arrive at a good approximation to the solution. In any case, the
analysis generally boils down to solving (perhaps many times) a set of linear equations,
something that computers are very good at doing.6
The Spice program uses such a procedure. It uses various mathematical models
of the nonlinear devices and treats the linear devices much as we have here (except that it
can get more sophisticated and include imperfections such as leakage current in
capacitors). First it calculates a “bias point,” with the time dependence of all of the
sources turned off. To do so, it starts with an initial guess for the DC currents
everywhere and makes a linear approximation of all of the models around that guess.
Then it solves the complete set of complex linear equations to get an improved set of
currents. Then it makes a new linear approximation around those currents and solves the
set of equations again. Eventually, with some luck, it finds that from one iteration to the
next nothing changes much, at which point it assumes that the procedure has converged
to the physical solution.
With the bias point in hand, Spice can then very quickly do an “AC” analysis. In
such an analysis, the sources are assumed to be sinusoidal and have very small
amplitudes. Spice makes a linear approximation to the circuit around the bias point and
calculates the response at each of a large set of frequencies, without doing any iteration.
This can very quickly give you information on the frequency response of your circuit.
A more involved analysis is the “transient analysis.” In this case, the sources are
given whatever time dependence and amplitude you are interested in (square wave,
triangle wave, or whatever). The amplitude is no longer assumed small, so Spice cannot
get by with a linear approximation with a single iteration. Instead, it must take small time
steps, such that in each step the voltages and currents don’t change by very much. Then a
few iterations can find a new convergence point after each step. Spice will vary the size
of the step depending on how fast your source is changing. As you can imagine, it has to
go very slowly in small steps when you feed it the edge of a square wave. For a large
circuit this can take an enormous amount of computer time, but if you have the CPU
cycles, it is worth it, because it will give you a very good idea of how your circuit will
work before you build it. This is especially important if you are making integrated
circuits, where after every new screw-up in your design you would have to wait 3 or 4
months, and spend at least several tens of thousands of dollars, to find out that it still
doesn’t work!
6
Be aware that in the case of a nonlinear circuit this process may not converge. That is never an issue with
a linear circuit, for which just one iteration always gives the final solution.