0% found this document useful (0 votes)
226 views

Using Complex Numbers in Circuit Analysis Review of The Algebra of Complex Numbers

1) Complex numbers are useful for representing oscillating quantities like voltage and current that have both magnitude and phase. They allow calculations with these quantities to be simpler compared to using trigonometric functions. 2) A complex number z can be represented in either Cartesian form z = x + jy or polar form z = r * e^jφ. Conversions between the two forms are possible using trigonometric identities. 3) Basic algebraic operations like addition, subtraction, and multiplication can be performed easily on complex numbers using their Cartesian or polar representations. Division requires multiplying the numerator and denominator by the complex conjugate of the denominator. 4) Representing voltages and currents as complex numbers allows circuit analysis with capacitors and

Uploaded by

fmendes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views

Using Complex Numbers in Circuit Analysis Review of The Algebra of Complex Numbers

1) Complex numbers are useful for representing oscillating quantities like voltage and current that have both magnitude and phase. They allow calculations with these quantities to be simpler compared to using trigonometric functions. 2) A complex number z can be represented in either Cartesian form z = x + jy or polar form z = r * e^jφ. Conversions between the two forms are possible using trigonometric identities. 3) Basic algebraic operations like addition, subtraction, and multiplication can be performed easily on complex numbers using their Cartesian or polar representations. Division requires multiplying the numerator and denominator by the complex conjugate of the denominator. 4) Representing voltages and currents as complex numbers allows circuit analysis with capacitors and

Uploaded by

fmendes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Physics 160 R.P.

Johnson Spring 2006

Using Complex Numbers in Circuit Analysis


Review of the Algebra of Complex Numbers
Complex numbers are commonly used in electrical engineering, as well as in
physics. In general they are used when some quantity has a phase as well as a
magnitude. Such a situation occurs when one deals with sinusoidal oscillating voltage
and current (other examples in physics include optics, where wave interference is
important, and quantum mechanical wave functions). I want to emphasize that complex
numbers are used to make calculations easier! Do not be intimidated by trying to
imagine what an imaginary number is. There is no need for that. Instead, realize that
there is nothing imaginary about the phase of a voltage waveform, and there is nothing
particularly complex about working with complex numbers. Just look at them for now as
a useful tool that you may as well start getting used to.1
You may also refer to Appendix B of Horowitz and Hill for a review of complex
numbers.

Representations of Complex Numbers


Let the symbol z represent a complex number, while x and y are its real and
imaginary parts: z = x + jy , where j ≡ − 1 .2 The complex conjugate of z is
z * = x − jy . In general, to change a complex number into its complex conjugate, simply
change j to − j everywhere. Then all of the normal rules of algebra apply, with the
understanding that j 2 = −1 :
z 2 = ( x + jy ) 2 = x 2 − y 2 + j 2 xy
2
z ≡ z ⋅ z * = ( x + jy ) ⋅ ( x − jy ) = x 2 + y 2
z1 + z 2 = ( x1 + jy1 ) + ( x2 + jy 2 ) = ( x1 + x2 ) + j ( y1 + y 2 )
Since we want to use complex
numbers to represent phases of
waveforms, it is essential to understand the
polar, as well as Cartesian, form of a
complex number. This is no different
from conversions between rectangular and
plane polar coordinates, except that
instead of labeling the axes x and y we
label them Re and Im. Think of the
complex number as a 2-dimensional vector
in a plane. Addition of two complex
numbers looks exactly like vector Figure 1. A complex number z shown in the
addition, either graphically or complex plane. x is the real part of z, y is the
imaginary part of z, r is the magnitude of z, and φ
is the phase of z.
1
If you haven’t already, then later you can study the beautiful and seemingly magical mathematics of
functions of complex variables, but there is no need for that in this course.
2
Electrical engineers, and our textbook, use this notation, but physicists and physics textbooks (and
mathematicians) generally use the symbol i instead of j.
Physics 160 Spring 2006

algebraically (as in the addition example above). And z = r = x 2 + y 2 is just the


length of the vector. Looking at Figure 1, you can see that
x = r cos φ
y = r sin φ
so we can write our complex number as
z = r cos φ + j ⋅ r sin φ = r ⋅ (cos φ + j ⋅ sin φ ) = re jφ

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).

Basic Algebra with Complex Numbers


Addition and subtraction of complex numbers are most easily done using the
Cartesian (rectangular) form, for the same reason that vectors are most easily added and
subtracted in Cartesian components.
z1 + z 2 = ( x1 + x2 ) + j ⋅ ( y1 + y 2 )
z1 − z 2 = ( x1 − x2 ) + j ⋅ ( y1 − y 2 )

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

Nevertheless, multiplication in the rectangular form is straightforward:


z1 ⋅ z 2 = ( x1 + jy1 ) ⋅ ( x2 + jy2 ) = ( x1 x2 − y1 y 2 ) + j ⋅ ( x1 y 2 + x2 y1 ) .

2
Physics 160 Spring 2006

Division can be accomplished either by converting numerator and denominator to the


polar form and using the equations above, or by multiplying the numerator and
denominator by the complex conjugate of the denominator. This is an exercise that is
frequently required in circuit analysis:
z1 x + jy1 x2 − jy 2 ( x1 x2 + y1 y 2 ) + j ⋅ ( x2 y1 − x1 y 2 )
= 1 ⋅ =
z 2 x2 + jy 2 x2 − jy 2 x22 + y 22
In this way we can separate the real and imaginary parts of the ratio, from which we can
calculate the magnitude and phase, if necessary. Do not try to memorize such a formula!
It is the simple technique of multiplying the numerator and denominator by the complex
conjugate of the denominator that you should remember. Executing this technique
always guarantees that the resulting denominator will be real, with the imaginary number
j appearing only in the numerator.

Working with Complex Impedance


Voltage and current are always real, observable quantities. In a linear A/C circuit
with a sinusoidal stimulus, they will always have a form like V (t ) = V0 cos(ωt + φ ) . The
algebraic complexities come in when we introduce capacitors and inductors, which
produce ± 90D changes in phase. Adding sines and cosines with differing phases is
algebraically painful, requiring expertise with trig identities. However, if the circuit is
described by linear differential equations, then we can simplify life by adding an
imaginary part to the voltage or current:
V (t ) = V0 cos(ωt + φ ) + j ⋅ V0 sin(ωt + φ ) = V0 e j ⋅(ωt +φ )
with the understanding that the observed voltage is just the real part of this expression.
Now, when you do your circuit analysis you get to deal with the simple properties of the
exponential function instead of nasty trig identities. When done, just take the real part of
the final result, and that is your answer. As you will see, what this procedure will do for
you is turn a set of linear differential equations into a set of linear algebraic equations.3
This works only because the circuit is a linear circuit, described by linear
differential equations. Since linear equations do not involve any squares, square roots,
and so forth of the voltage or current, or multiplication of one voltage or current by
another, the real and imaginary parts don’t get mixed up. Take a look at the equations in
the previous section. The addition and subtraction equations do not mix up the real and
imaginary parts, but the equations for multiplication and division do. Multiplying a
complex number by a real constant also obviously does not mix up the real and imaginary
parts. Essentially, a linear equation is one that will not mix up the real and imaginary
parts of the voltages and currents. From a practical standpoint, a linear circuit is one that
includes only passive components (resistors, capacitors, and inductors) plus voltage
and/or current sources. No diodes, transistors, vacuum tubes, etc. are allowed.

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

Figure 2. LRC series circuit.


The recipe for obtaining the steady-state4 harmonic response of a linear circuit is
straightforward. Write each non-static voltage or current source as a complex number:
V0 e jφ or I 0 e jφ
where the phase φ can be taken to be zero if there is only one source. Otherwise the
relative phases of the sources must be taken into account. Then treat each passive
component as an impedance:
Resistor: Z = R
1
Capacitor: Z =
jωC
Inductor: Z = jωC
Use Kirchhoff’s laws to write a set of linear equations for the currents and voltage in the
circuit, exactly as you would do for a circuit made up of batteries and resistors. The only
difference is that some of the “resistances” are imaginary, so what you end up with is a
set of complex linear equations. Solve the equations for the currents and voltages. This
is tedious to do by hand, but keep in mind that a computer can solve an amazingly large
set of complex linear equations in an instant, using standard “canned” programs. Many
scientific calculators also have built-in functions for solving sets of linear complex
equations. Finally, express the resulting voltages and/or currents in polar form, from
which you can read off the amplitude and phase of each current or voltage.
As an example not included in Horowitz and Hill, let’s analyze the standard series
LRC circuit (Figure 2) which has a voltage oscillator in series with a resistor, capacitor,
and inductor. The differential equation for this circuit follows from adding up the voltage
changes around the loop:
dI Q
V0 e jωt − IR − L − = 0 ,
dt C
jωt
where V0 e is the driving voltage, expressed as a complex quantity as suggested
above, with an assumed phase φ = 0 . Using Q = ∫ Idt , we get an equation for the
current:
dI 1
Idt + RI = V0 e jωt .
dt C ∫
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

Figure 4. Example of a 4-loop linear circuit.

6
Physics 160 Spring 2006

400 F

i4
1 1

i3
V i1 1 i2
0.4mH

Figure 5. The circuit redrawn with loop currents.


beyond the complexity that you will see in homework, but I throw it in as a
demonstration that the analysis is straightforward and can be formulated in a manner that
makes a solution by computer fairly easy.
I prefer to work with the concept of “loop currents,” in order to avoid having to
write down the node equations. To understand this concept, look at the circuit as redrawn
in Figure 5. The four loops are evident, and each is associated with a loop current. The
current through the capacitor is clearly i4 , the current through the voltage source is i1 ,
and the current through the 2-ohm resistor is i3 . However, each of the other 4
components has two currents flowing through it. For example, the current flowing
upward through the inductor is i3 − i2 , and the current flowing downward through the
leftmost resistor is i1 − i2 . Now, let’s apply Kirchhoff’s loop law to loop #1, starting at
the lower left corner and proceeding upwards through the voltage source, in the direction
of loop current i1 :
10 − (i1 − i2 ) ⋅ 1 = 0
Do the same for loop #2, starting in the lower left hand corner and proceeding upwards
through the 1-ohm resistor, in the direction of the loop current i2 :
− (i2 − i1 ) ⋅ 1 − (i2 − i4 ) ⋅ 1 − (i2 − i3 ) ⋅ 4 j = 0
The other two equations, for loops 3 and 4 respectively, are
− (i3 − i2 ) ⋅ 4 j − (i3 − i4 ) ⋅ 1 − i3 ⋅ 2 = 0
i4 ⋅ 0.25 j − (i4 − i3 ) ⋅ 1 − (i4 − i2 ) ⋅ 1 = 0
Such equations are easiest to deal with if organized in matrix notation:
1 −1 0 0   i1  10 
     
1 − 2 − 4 j 4j 1   i2   0 
0 4j − 3− 4 j 1  × i  =  0 
   3   
0 1 1 − 2 + 0.25 j   i4   0 
Solving these equations by hand would be tedious and annoying, but doing it by
computer with a program like Mathcad, Mathematica, or Matlab couldn’t be easier. For
example, in Mathcad let’s call the matrix Z , so the equation looks like
Z ⋅ I =V

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.

You might also like