<<

School of Engineering Department of Electrical and Computer Engineering

332:221 Principles of I Fall 2012 Differential Equations + Euler + Christopher Rose

ABSTRACT

You have a network of resistors, capacitors and inductors. They are driven by voltage and current sources. You are asked to find a given output. You are freaking out because unlike resistive networks, everything is TIME VARYING!

1. Get a paper bag and place it over your head to stop hyperventilating.

2. Chill out because they’re only linear constant coefficient differential equations and those are EASY to solve if you understand the trick.

This writeup is about that trick. We also (re)introduce the Euler expansion in the service of talking about sinusoidal steady state response and phasors.

1 LCC Differential Equations

A linear constant coefficient is of the form

N X (k) akX = V (t) k=0

where X(k) is the kth of X and V (t) is a “drive term” (something you apply to the “system” which the differential equations describe. As you already know from class (and from the book), all of those circuits with inductors and capacitors result in such differential equations. N is AT MOST the number of capacitors and inductors in the circuit (but it could be fewer depending on the arrangement of those elements – inductors in series act like a single inductor, for instance).

1.1 The Basics So, how to solve the beast?!!? It starts with a theorem that I’ll not prove.

Theorem 1 Picard’s Theorem Any solution to an Nth order linear constant coefficient differential equation is composed of two parts:

1 • The Particular solution – ANY Xp(t) that satisfies

N X (k) akXp = V (t) k=0 and

• The Homogeneous solutions – ANY set of N “linearly independent” Xh(t) that satisfy

N X (k) akXh = 0 k=0 h = 1, 2, ...N

The term linear independence simply means that you can never find a set of coefficients {ch} such that N X chXh(t) = 0 k=0 Put another way, if a set of functions is linearly independent, you can’t “build” any one of the functions by linearly combining the other functions. Now let’s get cute. In class (and here) we’re going go GUESS the homogeneous solutions by snt saying they must be of the form Ane where An is some constant (possibly complex) and sn is a (possibly complex) number. For later convenience we’ll say

sn = σn + jωn √ where σn and ωn are real and j = −1. So with that guess, we proceed just like in class to recognize that dkA esnt n = A sk est dtk n n snt So, using the solution Ane in our homogeneous (unforced – i.e., V (t) = 0) equation we have

N " N # X k snt snt X k akAnsne = Ane aksn = 0 k=0 k=0

snt Since we can’t guarantee that An and e are zero ∀t, our only recourse is to find {sn} such that the bracketed POLYNOMIAL in sn is zero. That polynomial is called the characteristic equation and the satisfying sn are called its roots. You’ll see these again and again and again and again and again in your ECE lives – and beyond. snt This means that there are N homogeneous solutions, {Ane }, n = 1, 2, ...N, to our differen- tial equation. Thus, the general solution is

N X snt X(t) = Xp(t) + Ane n=1 (And yes, Virginia, there can be repeated roots, but we’re going to ignore that case for now :) Well ... if you MUST know, if you have Nm repeated roots sm, then the Nm homogeneous solutions are proportional to tNm−1esmt – try it if you’re really curious. :) )

2 The last thing we need to do is determine those constants {An}. We can get these from “initial conditions.” For instance, in a circuit, perhaps the inductor has current through it and capacitors charge on them at t = 0 and we want the solution for t > 0. For an Nth order differential equation, we’ll need N initial conditions to determine those {An}. Interested in learning more? Too bad. Why? Read on. :)

1.2 Short Shrift for Transient Response Because most of you have not already HAD a differential equations course, we’re NOT going to worry TOO much about these homogeneous solutions except to say that for all the circuits we’ll consider, all of those homogeneous solutions will have sn with NEGATIVE REAL PARTS. What does that mean? It means that as time goes, on all the esnt → 0. Formally,

lim esnt = lim eσnt+jωnt = 0, n = 1, 2, ··· ,N t→∞ t→∞ because we assume all the σn < 0. So in the STEADY STATE, we won’t worry about the “tran- sients” because they’ll all “die out” with time. That said, I MIGHT give you a problem on a quiz where the transients DO NOT die out – and if you’re currently awake you’ll imediately realize that any such circuit will either have to have NO resistors (which dissipate energy) or have to have an active element (like a transistor or an op amp) in it since passive circuits with resistors, capacitors and inductors cannot have undying transients (the resistors eventually turn the initial condition energies into heat and the corresponding circuit state variables to zero). Now, let’s look at some useful math.

2 USEFUL MATH

2.1 The Euler Expansion

The Euler expansion is a cute identity that you should tatoo on your retinas: ejx = cos x + j sin x It comes from Taylor series (well, McLauren series actually). From your calculus days you should remember that ∞ X xk ex = k! k=0 You should also remember that

∞ k X k x cos x = (−1) 2 k! k=0,even and ∞ k X k−1 x sin x = (−1) 2 k! k=1,odd

3 So, if we replace x by jx we have

∞ k ∞ k ∞ k jx X k x X k x X k−1 x e = j = (−1) 2 + j (−1) 2 k! k! k! k=0 k=0,even k=1,odd The first series you’ll recognize as

∞ k X k x cos x = (−1) 2 k! k=0,even and the second one is ∞ k X k−1 x j sin x = j (−1) 2 k! k=1,odd So, once again, with feeling, ejx = cos x + j sin x

It’s also useful to note here that the complex conjugate (inverting the sign of the imaginary portion of a ) of ejx is

ejx∗ = (cos x + j sin x)∗ = cos x − j sin x = e−jx where the ∗ notation implies complex conjugation. The euler expansion will be really important because we’re going to quickly start using it to represent sinusoids as in ejx + e−jx cos x = 2 cos x = <{ejx} and ejx − e−jx sin x = 2j sin x = ={ejx} Also note that

sin ωt = cos(ωt − π/2) = < e−jπ/2+jωt = < e−jπ/2ejωt = < −jejωt

Yes, that’s a subtle hint that you need to be facile deriving/understanding/memorizing things like

j = ejπ/2 and the like. :)

4 2.2 Complex Numbers and Phasors In a previous version of these notes, I directed you to the text section on phasors – thinking you folks already knew ALL about complex numbers from some other course (in high school or col- lege). Woe to us all (and to quizlettes 8&9 AND the last part of problem 1 on Quiz II!) the moment I made that assumption! So this next bit is a SHORT attempt to lay phasors all out in a way that will allow you to see the equivalence between phasors and complex numbers. First off, I KNOW you all know what a complex number is

C = a + bj √ where j = −1 (again, mathematicians step off! i/I is reserved for CURRENT). The righthand side of the definition is often called “standard form.” Now, what’s interesting about C is that it has two “orthogonal” components – a real (<) part and an imaginary (=) part. This allows us to think of C in the “” as in FIGURE 1 That C is a with magnitude |C| and angle

b |C| C θ a

Figure 1: Complex number vector (phasor) representation.

θ.

Combined with euler’s expansion, FIGURE 1 has ALL THE THINGS YOU NEED TO UNDERSTAND PHASORS AND COMPLEX NUMBERS!!!!!

First, as soon as we draw C in the complex plane as a point (a, b), we√ can see that the associated vector (nose at (a, b) and tail at the origin) has magnitude |C| = a2 + b2 and angle 6 C = arctan(a, b). Now, here’s√ where it gets COOLIO!√ (passe though he is :) ). Look at the figure. Obviously cos θ = a/ a2 + b2 and sin θ = b/ a2 + b2. However, here’s where the MAGIC happens √ a + bj = a2 + b2ejθ

5 Why? ejθ = cos θ + j sin θ as you know from Euler’s expansion. But looky here! We then have

√ √  a b  a2 + b2ejθ = a2 + b2 √ + j √ = a + bj a2 + b2 a2 + b2 √ So, the equivalence between a + bj and a2 + b2ejθ is EXACT!!!! This latter representation is called phasor notation. Now, some basic mechanics are useful too. For instance, we define the COMPLEX CONJU- GATE of a complex number as C∗ = (a + bj)∗ = a − bj That is, we just multiply the imaginary part by −1 to get the complex conjugate. What does this mean with phasors? h√ i∗ √ √ √ C∗ = a2 + b2ejθ = a2 + b2 [cos θ + j sin θ]∗ = a2 + b2 [cos θ − j sin θ] = a2 + b2e−jθ

And wait, there’s MORE! We also notice that

a2 + b2 = (a + bj)(a − bj) = CC∗ = |C|2

As the last little piece, consider that as circuits types, we gotta be able to do KVL/KCL no matter WHAT type of source is pumping our circuit including a sinusoidal steady state source. That means we need to be able to add phasor voltages. Well, that’s as easy as can be:

C = A + B

can be thought of as a VECTOR ADDITION. Why? Obvious!

C = |A|ejθ + |B|ejφ = |A| cos θ + |B| cos φ + j (|A| sin θ + |B| sin φ)

and then look at FIGURE 2. There are also a few other simple but useful things to remember (and you should be able to prove these yourself given the above information):

A |A| = B |B|

A AB∗  1 < = < = < {AB∗} B |B|2 |B|2 and the corresponding operation if you want to find the imaginary portion. To be basically competent with the course material, you’ll need to be facile with the two complex number notations and know how to move things around algebraically. Everything above should demystify phasor notation – and if not, ASK ME QUESTIONS!!!! :) Here are some quickie questions to test your understanding:

• What is 1 in phasor notation?

• What is ejπ/2 in “standard form”?

6 C

B φ A θ

Figure 2:

• What is ejπ/2 + e−π/2? √ • What is 2ejπ/6 − 3?

• What is the angle of a + bj c + dj ?

3 Solving Differential Equations and the Transfer Function

What’ll become obvious rather quickly is that linear constant coefficient differential equations LOVE to be driven with sinusoids (like ejωt) because the solution will be proportional to ejωt!!!! (there are caveats, but we’ll avoid those in this course, at least mostly :) ).

3.1 Sinusoid In, Sinusoid Out Details? Consider finding the particular solution to

N X (k) jωt akX = Γe k=0 where Γ is some (possibly complex) constant. Remember that all we need is ONE particular solution for X given the drive term Γejωt. ANY particular solution will do since to that we’ll add our N homogeneous solutions to obtain the general solution. Oh, but wait, WE HAVE ASSUMED THAT THE HOMOGENEOUS SOLUTOINS DIE OUT! So if any guess we propose works, that is THE solution to the differential equation! WOOHOO! So once again, let’s guess that X(t) = ΓH(jω)ejωt where H() is some function we don’t yet know.

7 Substituting in for our guessed solution we have

N X k jωt jωt akΓH(jω)(jω) e = Γe k=0 which we rearrange as " N # jωt X k jωt e H(jω) ak(jω) = e k=0 so that we must have 1 H(jω) = (1) PN k k=0 ak(jω) OH MY GOODNESS!!!! Let’s sit back in awe a second. If we “force” the circuit/system with any sinusoid (complex exponential ejωt ), the particular solution is H(jω)ejωt!!!!!!!!!!! And how do we determine H(jω)? From the coefficients of the differential equation as in equation (1)!! How Cool Is THAT!?!??! But a word of warning:

H(jω) is NOT in general a ratio between TIME WAVEFORMS. Phasors are by definition a “fre- quency domain” construction because we’re assuming a sinusoidal steady state at some frequency ω. The surest way to incur a professors undying wrath is to write

H(jω) = Some function with time in it

The ONLY reason time occurred in our derivation above was because we EXPLICITLY assumed we were driving the system with ejωt.

3.2 The Transfer Function H(jω) has a formal name – it’s called the transfer function from input to output for a cir- cuit/system and it is one of the most simple and powerful pieces of mathematics you’ll learn (and use) as an ECE. But first, let’s generalize it a bit. That is, we’ve only derived (so far) differential equations for circuits that had a single drive term. However, there are situations in which you might have something of the form

N M X (k) X (`) akX = b`V (t) k=0 `=0

That is, the drive term V (t) might be differentiated and scaled too in our defining differential equation. Well, no problem if V (t) = Γejωt. We do our same guess and end up with (will leave the SIMPLE algebra to you) as PM b (jω)` H(jω) = `=0 ` (2) PN k k=0 ak(jω) Now, make sure you’re sitting down. What does this mean? This means that if you drive a circuit with ejωt, the particular solution will be H(jω)ejωt. And if we wait for the transients to die out, the ONLY solution will be H(jω)ejωt. This is called the sinusoidal steady state.

8 However, we have a small conceptual problem. We drive circuits with REAL voltages and currents and ejωt is complex. However, using our handy dandy euler expansion we can represent ANY sinuosoid using complex exponentials. Specifically,

ejωt+φ + e−jωt−φ ejφejωt + e−jφe−jωt cos (ωt + φ) = = 2 2 So, if we drive a circuit with A cos (ωt + φ) where A is a real constant, then the output in the sinusoidal steady state is

ejφH(jω)ejωt + e−jφH(−jω)e−jωt  X(t) = A 2

Now, if you’re fast on the uptake, you’ll see that this expression is REAL, just like our drive was. Why? Because you’ve summed complex conjugates. However, don’t worry if that’s not immediately obvious because we can do a better simplification. First, we recognize that H(jω) for a√ given ω is in general a complex number. We can write complex numbers as either a + bj or as a2 + b2earctan b/a. Thus, we can write

H(jω) = |H(jω)| ej6 H(jω) where |H(jω)| is the magnitude of the transfer function and 6 H(jω) is its angle. H(jω) is a complex number, so its magnitude is

|H(jω)|2 = H(jω)H∗(jω)

Now, notice that our transfer function H(jω) is the ratio of two polynomials in (jω) and that if we substitute jω → −jω we’ll get H(−jω) = H∗(jω) That is, H(−jω) is the complex conjugate of H(jω). In “magnitude/angle” notation we have

H(−jω) = |H(jω)|e−jω = H∗(jω)

and |H(jω)|2 = H(jω)H(−jω) We can now rewrite X(t) in the sinusoidal steady state (yes, I’m repeating the words so they DRILL INTO YOUR MINDS :) ) as " # |H(jω)| ej6 H(jω)ejφejωt + |H(jω)| e−j6 H(jω)e−jφe−jωt X(t) = A 2

Rearranging terms we have " # ejφ+j6 H(jω)+jωt + e−jφ−j6 H(jω)−jωt X(t) = A |H(jω)| = A |H(jω)| cos (ωt + φ + 6 H(jω)) 2

So, if you have H(jω) you can calculate |H(jω)|, 6 H(jω). And if you drive your circuit with any sinusoid cos (ωt + φ), the output is a SINUSOID AT THE SAME FREQUENCY, scaled by |H(jω)| and -shifted by 6 H(jω). This is worth restating with emphasis:

9 MAJOR LCC DIFFEQ PWNAGE!!!! Input = Aejωt

Output = A |H(jω)| cos (ωt + φ + 6 H(jω))

There is also a more subtle story in here about systems defined by LCC Diffeqs, but that’ll have to wait until you take linear systems. For now, you want to tatoo one more thing on your retinas. For our circuits with linear components we always have: Sinusoid In → Sinusoid Out So, you whistle (which is an amazingly pure-looking sinusoid) into one of our circuits at, say, 60Hz, out pops 60Hz sinusoids all over the circuit. You will NOT get any other frequency out.1

3.3 Phasors Redux This pwnage leads to the “phasor” (not Star Trek phasEr) representation you can read about in the text. If our input is V (t) = A cos (ωt + φ), we rewrite it in phasor form as V = Aejφ (ignoring the time variation because we assume we know ω and we’re in talking about sinusoidal steady state). This V is also called the “complex .” The corresponding complex amplitude output of our circuit is then X = VH(jω) which we now know is shorthand for

X(t) = < VH(jω)ejωt

1unless you stick a nonlinear element in the circuit– like a diode, for instance, but that’s a story for another day.

10