Leslie Kaelbling: 6.01 Lecture 05

Search transcript...

PROFESSOR KAELBLING: So, I'm impressed with you, who managed to come. Because it's A, an hour earlier, and B, there is an exam tomorrow. So sometimes that's a recipe for lack of attendance. So good for you for coming.

We're about to start a new section of the course. And it's going to be about circuits. And what we're going to do in lab is actually make these cool-- you've probably seen us messing around with them up at the front of the room-- we're going to make these cool robot heads and some circuitry that will control them. So that, for instance, they can track a light. And eventually so that the robot can follow you around like a pet. So that's kind of what we're up to.

But what's sort of the more important thing underneath that? So we're building those things as an illustration of circuits as really-- it's good to know about circuits. But also they're really interesting because they're a very different kind of system of primitives and methods of combination, and abstraction, and common patterns and so on.

So in computer programs, and in LTI systems-- which we saw were really just sort of a subclass of state machines-- machines have the property-- or procedures in your Python program have the property that when you write a procedure, it does what it does. And the input/output relationship of your procedure is always exactly what it is. And no matter, for instance, who calls your procedure or what you do with its results, it's always going to do the same thing.

So there's a very, very strong modularity in procedures. There's a strong modularity in LTI systems. So what you connect them to downstream doesn't affect how they work.

In circuits, we'll find that that's not true. We'll find that, although there are some interesting ways of abstracting and so on in circuits, it's not going to be the case that if you take a circuit and you understand very well what it does, that then hooking it to something else leaves it unchanged. In fact, what's going to happen is if you hook it to some other part of a circuit, in general that will change the part that you just studied. It'll change what happens. At least it'll change not the underlying relationships, but it'll change particular values, voltages, and things in the circuits.

What we're going to do next week is look at a way actually of building some walls in circuits so that we can connect things together and that they don't change one another. But the basic sort of circuit arrangement is that when you connect things together, they might change the way those things work.

OK. So there's a new set of readings posted. The next chapter is there, so you can read about circuits.

So the basic sort of view is that a circuit is a kind of a network of components. So we're going to have these boxes here which represent, abstractly, weak components we can put in the circuit. And we have wires connecting them.

And, for each one of the components, we really care about two quantities. We care about the current that flows through the component. So each of these-- we're assuming that everybody's had some exposure to circuits somewhere along the way, and you know roughly about current and voltage and so on so. So we're not going to start all the way from scratch. But we'll just kind of teach you our vocabulary for talking and thinking about these things.

OK. So, each components has got a current that flows through it, and a voltage across it. Right, so there's typically a voltage difference here. So we're interested in the current through, and the voltage across. And every single component has those ideas. And then we can hook them up in a network like this.

OK. And so why do we care about circuits? So there's two really interestingly different reasons to care about circuits. One is because they're useful in and of themselves. Right? So all the way from the giant power grids that get electricity to your house, to everything inside your cell phone, is built on these fundamental principles of what goes on in a circuit. So that makes it really important as an electrical sort of way of designing and thinking about electricity and electronic artifacts.

Another reason that circuits are important is actually as kind of a model or a metaphor. So there are lots of models, let's say, in medicine, of circuits as describing the way neurons work. Or the way the brain works more generally. Or various other kinds of systems. Because fundamentally, really circuits give us a way of talking about individual components and the constraints they exert on the way the whole system works together.

So it gives us a way of talking about how individual components work together to cause behavior of a bigger system, using constraints. So circuits have been incredibly useful. They've gotten bigger and bigger and bigger, and smaller and smaller, if you get my drift. Right? More and more components, smaller and smaller.

We're going to think about circuits that are kind of, oh, somewhere over here in complexity, right? Just a handful of things. But as you look at one of our circuit examples and say, boy, this is complicated, just add nine or ten more zeroes to the number of components and then you can be thinking about what's going on in your computer. Denny, you could talk to him later sometime. He thinks about using circuits as models for hearing and all kinds of other things in medical applications.

So, OK. So what's the theory of circuits? So there's a mathematics that goes with circuits. And it's a way that we can characterize what goes on. And just like we thought about environment diagrams and programs and that provided sort of the semantics for our program. We said, if we understand how all that environment diagram stuff works we can understand any program.

Similarly here, there's a few very simple principles. And if we understand those principles we can understand any circuit. It's just a matter of scale, and persistence, and patience. But no new ideas.

So the number of ideas is actually small. They're powerful but very small. So, OK. So first of all let's go back and think about, again, the currents that flow through the components in the circuit. So let's talk about the flow of current. So you guys have all seen circuits like this. We've got a little battery and a switch and that, in case you don't know, is a light bulb. So battery and switch and light bulb.

If you close the switch then the current-- we all kind of understand the idea of current flowing through the circuit. And the important thing about current is that it flows in loops. If the loop is interrupted, there is no current flowing. Nothing happens. So unless there's flow, then there's no interesting thing that's happening inside the circuit. And the same amount of current flows all around the loop.

So the first really fundamental principle that we all have to remember-- there's going to be two things that govern the way all circuits work no matter what the components are in them. And the first one is Kirchhoff's Current Law, KCL. And it says, colloquially, what goes in must come out. If you think of a node in a circuit, a place where multiple wires meet, what has to happen is that the sum of the currents at that point, basically the sum of the currents at any point in your circuit, has to be zero.

So current doesn't appear or disappear. Anywhere you look, the flow all balances out to zero. It doesn't pile up anywhere.

So we'll talk about nodes. Actually, I'll do some examples on the board. And we'll get a better idea of what a node is. But basically if we want to think about several currents meeting in a place we have to say, well, those all add up to zero. And I'll deal with the wires in a minute.

So here's a node. Here's the notion of a node. The notion of a node is actually confusing, I think, to a lot of people. In fact, let me just do a slightly more complicated example on the board so that you see it.

I have this-- I want to label it. I did a cool mini-lecture in the middle of the night last night with colors. I like it a lot. You can look at it.

But here, let me just draw a more complicated example. And let's just kind of imagine we have this thing set up like this. OK. So there's a circuit.

And so what are the nodes in this circuit? What are the nodes in the circuit? The nodes in the circuit are essentially pieces of wire that are all connected together.

So you can think of this, all of this, as a node. It's just one kind of connected piece of wire. And let's call that node one.

Here's another node. Let's see, where's another node? Another node is all this. I should have brought colors.

OK, there's another node. We'll call that-- I called that node three in my picture-- we'll call it node three. And here's one more. OK. Node-- must be two. OK good. So those are the nodes.

So you can only really have-- We'll talk about relative voltages, but there's really only three different voltages that you can have. So those are the nodes. Those are the nodes. Now each of these components has a current. Right? So we're talking about the current that flows through components. So each of these components has a current.

I1-- I'm going to name them. i2, i3, i4, a snake, i4, i5. Is that is? Yeah. OK good. One for each component. So those are the currents.

Now, I've drawn arrows in this picture. And I've said there's a current here, i1, and I gave it a direction. I said, i1 is the current that flows in this direction through that component.

I haven't even told you what these components are. Do I have any idea actually what the signs of these currents are? Which way they're really flowing in some sense? No. I have no idea at all. And it won't matter for the mathematics of what we're going to do.

OK. So as we start labeling these diagrams, before we really know what the components are, before we really know what's going on, we just pick a direction and we say, I'm going to call the current that goes this way i1. That might turn out to be positive amps or negative amps. I don't know yet how that's going to come out. But whatever it is, this thing going this way is called i1. OK.

So don't worry about getting these arrows pointing in the right direction. You can point them in any direction you want to. One per component. Point them in any direction you want to. Just, having placed them and pointed them in a direction, then we have to treat them consistently ever after. OK?

All right. So now what does KCL tell us? So KCL tells us that the sum of the currents at each node is zero. So we can write down the KCL equation actually for this circuit. So how does that go?

So here's a node. OK, now we have another sort of choice to make. The sum is equal to zero.

So I'm going to treat ones that go out of the node as positive when I write my equations down, and ones that go in as negative. Again, you don't have to do that that way either. You just have to pick a way. OK. So I'm going to say i1 plus i2 plus i3 is equal to zero. Yep?

STUDENT: So wouldn't there be two nodes instead of just one?

PROFESSOR KAELBLING: Wouldn't there be-- oh, OK. Good. So there's two places where the wires connect, but if you wanted to, I could have done that. I mean, it's all a question of how big your solder blob is, really. Right?

That's all one thing. OK? So it's a big old solder blob down there. They're all connected together. Yeah, good.

So i1 plus i2 plus i3 equals 0. I could have written minus i1 minus i2 minus i3 equals 0. That would have come out the same way. Right? So you just have to treat the directions in a uniform way. So that's the KCL constraint for that node.

For this node, let's see what it is. So going out we have i4 and i5. So I have i4 plus i5. And coming in, we have a current coming into this node to, right? It's i2, it's flowing through this component. So I have i4 plus i5 minus i2 is equal to 0.

I got one more down here. What's that one? Does anyone want to tell me? What's the KCL equation for this bottom node, for N3? No? Seriously? Alright, yep.

STUDENT: Minus i4 minus i5 plus i1 plus i3?

PROFESSOR KAELBLING: OK. Almost. And you get enormous points for answering.

These guys are actually all flowing in, right? i1 in, i4 in, i5 in, i3 in. Those are all coming the same direction. So they all have to have the same sign. So i4 minus i5 minus i1 minus i2 equals 0.

Oh, i3, thank you. Good. I need a correction process. OK.

So that's one set of things that we know from the structure of this circuit, no matter what the components are. So for any circuit now, you ought to be able to write down this set of KCL constraints, or equations. Right?

Find the nodes, say all the currents into a node and out of a node add up to zero. Good? Good.

OK. So that was the currents. There was some talk about currents.

Let's talk about voltages now. So we can also, for each of these components, talk about the voltage drop across-- well let me not say drop, let me say difference, the voltage difference-- across the component. So what's the difference between the voltage here and the voltage here?

So for every single component, we can talk about these voltage differences. So we have v1 is the voltage difference across this component. v2, v3, v5-- I'm going backwards. Like that. OK.

And we have another important law-- Kirchhoff was busy-- which is Kirchhoff's Voltage Law. So we have the current law before, now we have the voltage law. And the voltage law says that the sum of the voltages as you traverse any loop in the circuit, any loop at all, is zero.

OK. So let's see, how does this work? So this is a picture of a battery and a light bulb again. So imagine this is a one and a half volt battery.

And you might say, well gosh, I don't know, it looks like maybe the sum as I go around this loop is 3. But that's not right because you have to take account of the orientations of the voltages. So that's why we carefully wrote those pluses and minuses. They go along with the directions of the currents that we wrote down.

OK. Those pluses and minuses have to go along with the directions of the currents. So, if we go here we say, well this plus and this minus, that means that this terminal is 1.5 volts higher than this one.

So as we're going this way, we've kind of got a plus 1.5, but now as we go this way we're going the other way through this one and so this is a minus 1.5. We're losing 1.5 as we come down here. So that equals out to zero. Right? So gaining 1.5, losing 1.5. Gaining 1.5, losing 1.5.

Over here, if we stack up two batteries together, two 1/2 volt batteries, from here we gain 1.5, and we keep going in this direction we gain another 1.5. Then we come over here through the light bulb, pfsshh, we lose three. So this has to all equal out to zero. So any loop, you go around it, the sum is zero volts.

OK. Now it's a little bit harder to-- so one of the things that's kind of cool and handy about KCL is that there's one KCL constraint that you can write down for every node. It's easy to see kind of what to do. With KVL, even in a circuit as simple as this one, there's a lot of loops.

And if you write down all the equations for every single loop-- and you can imagine, as the circuits get more complicated the number of loops goes like crazy in general-- if you write down the KVL equations for every single loop, you end up with a whole bunch of equations that are sort of redundant with one another. There are a lot of them that are linearly dependent. So we're going to develop a system for dealing with voltages which isn't exactly the sort of analogous thing. We're not going to write down all the KVL rules. We're going to treat it slightly differently.

But just to give you an example of a KVL here, let's think about a particular loop. So I might think about the loop that goes up through v1 and over here, and here, and through here, and around like that. So there's a loop.

So if I think about that loop, what does it tell me? It tells me that-- I'll have to draw a line here. It tells me that v1-- so I'm kind of gaining as I go through v1, minus v2 minus v5 has to equal 0. So that's just what we did with the batteries and the light bulb.

Does that make sense to everybody? This is a recap of stuff I'm sure that you've seen before. But it's establishing our way of talking to one another. OK. I'm going to come back at the end and talk about the node voltage stuff.

OK. So what we saw so far is a way of talking about how the wiring of a circuit exerts some fundamental constraints on the currents and the voltages. And we talked about that totally independent of what those boxes were, what the components actually were. So now we can do is establish a kind of library of components. And each component will have a little bit of rule to add, which explains how the component works.

And if we take the equations that come from the wiring and the equations that come from the way the components work, and put them together, that will be a complete specification of actually what goes on in the circuit. So today we're going to look at three components. During the course of this class we're really only going to look at four kinds of components. So we're going to do three today and a complicated one next time.

We're not going to consider components that will give our circuits dynamics. So you may have studied capacitors or inductors or other things like that. We're not going to do that in this class. We're just going to look at components that basically allow us to treat the state of the circuit as something that, maybe when we just kind of turn it on or close the switch, it takes a minute to settle down. But then it's going to have a static set of voltages.

So that's just the subset of circuits that we're going to look at here. That's a tiny subset of circuits, but it's a very useful one. So it's going to give us a way to study [? PCAP ?] in circuits and also to make some cool things on the robot.

OK. So let's see, so what can we say about components? Well, what we have to say about components is that each component, as we saw, has a current through it and a voltage across it. And the way we can characterize how a component works is by stating a relationship between the current through the voltage across. So that's the job of a component. It doesn't have anything to say about everybody else. Just for me, what is the relationship that I exert on the component-- on the current and the voltage.

So everybody knows Ohm's Law. So for a resistor, right, a resistor, one of those boxes could be resistor. If the box was a resistor, a resistor with resistance R, R ohm. So we would say that the relationship that this resistor exerts between i and v is the following, v is equal to i R. OK?

R is a constant. Right? You think of R as a constant.

You know, you go to Radio Shack and you buy a resistor, and that's a resistor, that's R. That's not going to change during the lifetime of your circuit. But the v and the I are variables. Right?

What v and i turn out to be is a complicated product of how you've got that resistor connected into everybody else. So R is a constant, v and i are variables. Yeah?

OK. Next component is a voltage source. We're going to a voltage source with a little circle here with a plus up here and a minus down there. And just like a resistor, just like every other component, there's a current going through it and a voltage across it.

The requirement that a voltage source exerts on the relationship between i and v is the following, it says, V has to be V0 So I'm a voltage source-- this is an o, I think, not a 0. It's like the output voltage, Vo

This is a constant. So again, I go to Radio Shack, I buy a voltage source, and it has some particular number of volts that it's supposed to supply. So that's a constant, Vo, that's the voltage of this voltage source.

And what we're saying is the variable v, that is to say this, the voltage across this particular component has to be Vo. And the current can be anything it wants to be. So you think of the job of the voltage source of keeping the voltages at these two different points, Vo apart.

I learned from a previous 601 instructor the analogy of a strong man. So the voltage source is going to provide whatever current it needs to provide in order to keep these two voltages apart. So that's what a voltage source does.

There is a current. There's definitely a current. It's not that there's no current. It's just that the voltage source doesn't have an opinion about the current.

OK. A real voltage source in real life has an opinion about current, and if it gets too big things start to get hot and smoky and stuff. But sort of in the mathematical world, voltage source has no opinion about the current. There is one, but it's not going to constrain it. We'll see how that works out.

Similarly there's a current source.

PROFESSOR KAELBLING: The dual of a voltage source, a current source we draw with this little arrow. We say that it provides some current, Io. And so there's a current going through this current source.

This figure, it's-- I don't know. It's one I think I inherited from my colleague Denny. And it's probably some standard electrical engineer thing to do, but we are drawing this component, we're thinking about this component, and here's this component.

I've got it. And I put it in my circuit, and I said it didn't matter which way we labelled the currents that go through the components. So I stuck this arrow up here going down. But in fact, I've put my current source in here and the current source actually provides current, hm, in this direction.

So what constraint does this thing supply to my circuit? It says current, the variable i has to be equal to minus Io. Now if I had just rotated that thing and put it in then the constraint would be that i was equal to Io. So I guess the message here is, we just have to be consistent. So and the current source, again, it provides the current. It doesn't care about the voltage. There is a voltage difference but it doesn't constrain it.

OK so those are our three components. We've got resistors, voltage sources, and current sources. And any of those boxes in that diagram can be any of those things. You can have three current sources and four voltage sources in a resistor, if you want.

Some combinations of current sources, or some combination of voltage sources, actually won't make sense. We can maybe talk about that later. But in general, you can have any components in any boxes that you want.

OK. Again, I'm skipping something until the end. We'll see how much time we have for it.

So let's talk about some simple circuits. Because we can do simple circuits without the complicated method. So simple circuits. You've probably done a lot of these, or some of these, before in your life, I don't know.

So here's a simple circuit. It's got a voltage source and a resistor. And we might be interested in knowing, for instance, something about what's going on in the circuit.

So what's the voltage across this resistor? What's it going to be?

STUDENT: One.

PROFESSOR LESLIE KAELBLING: One volt? It's going to be one volt. Does it matter how many ohms the resistor is? Is that going to affect this voltage?

STUDENT: No.

PROFESSOR LESLIE KAELBLING: No. Because the voltage has to sum to zero as we go around. And we got one volt going up in this direction. So we got to get one volt coming down in that direction.

OK. Current. So what's the value of this current? It's one amp. And we know that because of the v equals iR relationship of the resistor. Right?

We proved to ourselves that this voltage had to be one volt. And then we have v equals iR, and these things are all one, so i has to be one amp. OK, that was pretty easy. Pretty funny. I don't know.

OK, good. If we put a current source here-- a current source, one amp-- what's this current have to be? One amp.

OK, good. Alright? Because we have one amp flowing in here, one amp flowing out here, we've got to have one amp all the way around because they have to balance at each of the nodes. Alright, how many nodes are in the circuit? Let's just practice that.

STUDENT: Two.

PROFESSOR KAELBLING: This is a node up here. This is a node down there. Good. OK. This has one amp coming in, one amp going out. This has one amp coming in, one amp going out. OK. So i is one amp. The resistance is one ohm, so the voltage is? One volt. OK.

So here's a problem. You can think about this one on your own. So I'm interested in knowing the value of this current, i. There's something slightly funny-- at least, you might think it's funny, about the circuit. But it's fine. It's not going to blow up or anything.

OK. So how many people-- so here are the answers, one through five. Put up the number of fingers for the answer that you think is the answer.

I see two. I see one. I see something indeterminate. Some twos, some twos, some ones. I see ones and twos.

OK. So it's either one amp or two amps. So let's see if we can figure that one out.

So let's see what KVL has to tell us about what's going on here. So KVL says that the voltage drops around a loop-- the voltage differences around a loop-- have to sum to zero, right? So if I'm gaining one volt as I come up here, I'm losing one volt as I come down here. So V has to be what? One.

OK. V has to be one. So V has to be one, and the resistance is one, so what does the current have to be? One.

OK. Now does that perturb us? OK, it perturbs us that that's one. Well let's try to see if we could get at the source of the perturberation.

So why does it bother us? It's this current source over here, maybe, is somehow causing some concern. So let's think about this current source.

The current source, his job is to say that there has to be one amp going through-- the current going through me is one amp. And let's see, so what do we know? So that means that we have to have one amp.

So there's a node up here. We have one amp coming in this way. We have one amp going down that way. OK, so what is the current through this guy have to be?

STUDENT: Zero.

PROFESSOR LESLIE KAELBLING: Zero. Is that OK?

STUDENT: Sure.

PROFESSOR KAELBLING: It's OK. The voltage source said, I don't care what the current is-- one way or the other, it's fine with me. I don't really care.

So we got one amp coming here, one amp going down here, one amp coming up here, one amp going down here. Is the voltage source doing any job for us here in the circuit? No, not really. So this circuit is totally self-consistent. There's no problem.

This guy says one amp has to be going through. That one amp going through means that we have to have a voltage of one volt, and this guy says, voltage of one volt, OK. All good. Voltage of one volt, I don't have to do any work.

So those two sources, they don't necessarily add up. Right? They both have an opinion. But there's a solution that makes them both happy. That's OK. So the answer's one amp.

So have I relieved that people were perturbed? OK. Maybe. Temporarily. You can think about and ask more later if you want to.

OK. So now what we're going to do-- the way we're going to think about circuits and looking at circuits and understanding them and so on, is in two different ways. So one thing is to study some simple common patterns of arrangements of components in particular resistors, and just see what they mean and understand quite quickly how to analyze what's going on. And then we'll look at a more sort of systematic way to deal with very complicated circuits. So let's start by looking at some common patterns that are not too complicated.

So let's look at resistors in parallel. And I actually want to do this more slowly on the board. Actually, I can just throw this board up.

[ROLLERS CREAKING]

We only have one screen today, but that actually makes things a little better I think. OK. So resistors in series. We've got these resistors here. This guy has some resistance, R1, and this guy has some resistance, R2.

And let's see, so we learned that we're going to think about these things, we're going to label stuff. So we know that there's some current coming in here, we'll call it i 1, and some current coming in here, we'll call it i2. And there's a voltage difference here, V1 and a voltage difference here, V2.

And now what we're interested in doing is actually thinking about whether there is a way to summarize or characterize what's going on. If we were to draw a box around this could we come up with a simpler characterization of this more complicated thing. So you can think of this as a way of abstracting a somewhat complicated circuit into a somewhat less complicated circuit.

So there's an i up there. And a voltage difference across the whole thing. If we were going to think about this now as one, kind of, component. Current coming in, voltage difference here. So first of all let's think about the currents. What do we know about the currents here?

STUDENT: [INAUDIBLE]

PROFESSOR LESLIE KAELBLING: What do-- excuse me?

STUDENT: They're the same!

PROFESSOR KAELBLING: They're the same. Yay! Good. Currents are the same. So i is equal to i1 is equal to i2, right? We know that. KCL tells us so. So i1, i2, i, all the same. OK, that was good.

Voltages on the other hand, well, they're not all the same. But we know a relationship between the voltages. Right? Because they add up as we go around.

We know that V is equal to V1 plus V2. Yeah? OK. And V1-- let's see, what do we know? How can we talk about V1? What does the resistor rule tell us about R1?

It's i1 R1, right? So V1 is i1 R1. I'm going to write it out really slowly. And V2 is i2 R2. And that's just because the Is are the same. Right? It's i times R1 plus R2.

So now what we have here is a relationship which is the ohms law relationship between the voltage and the current of this big box with resistance R1 and R2. So what that tells us is that we can-- if we ever see two resistors in series like this we can just abstract a way to a new version of that box where we have a resistor with resistance R1 plus R2. And that's an equivalent thing to this. Good?

OK. Series is easy. Let's try parallel. So let's imagine now that we have this arrangement. Turns out that I like the board better than slides. OK. And I drew the picture differently, but too bad.

OK. So let's imagine that we have this set up. This picture is the same as that picture, right?

So actually, one year there was some in the class who kind of-- what we neglected to tell you, what I neglected to tell you in the beginning of this lecture is that, when we draw a picture of a circuit the only thing that matters is the connectivity. It doesn't matter if it's rotated or if the resistors are all pushed up or down. What matters is the nodes and the components and the way they are connected, the pattern that they're connected together in.

So this circuit is exactly the same as the circuit drawn up there on the slide. So this is R1, this is R2. And I can talk about, let's see, we can talk about a current, i, coming in here.

Again, I'm going to think about this as a big box. And we'll call this i1, this i2. We have a voltage difference, V1, V2. Big voltage difference. So there's our labeled picture. All right.

So now, again, we want to see if there's a simpler way to characterize the relationship between V and i for this guy. So what do we know now? Let's see. Well, somebody was really helpful about the currents on this picture. What do we know about all the voltages, V and V1 and V2?

STUDENT: [INAUDIBLE]

PROFESSOR KAELBLING: They're equal. Right? The voltage difference here, here, here. Why? Because there's only two nodes here, right?

There's a node up here and a node down there. The voltage difference between those nodes is the same. So we know that V is equal to V1 is equal to V2.

Can you see what I'm writing or is it occluded by the screen? You can see? Good? Yeah, OK. I'm not that tall, huh?

All right what do we know about the currents? What do we know about how i and i1 and i2 relate?

STUDENT: [INAUDIBLE]

PROFESSOR KAELBLING: Good. I is equal to i1 plus i2. What flows in has to flow out. The sum of those currents has to be zero. So you think of i coming in and i1 and i2 going out. Those have to match.

OK. And now let's see, I know the usual kind of component laws for the resistors. So let's write-- let's take this i and kind of expand that out.

So what's another name for i1? So another name for i1 is V1 over i1, right? Just using Ohm's Law. And another name for i2 is V2 over i2. Do you buy that?

And the Vs are the same. Right? So I can write this as-- so this is a V and that's a V, but if we want to get them together over the same fraction then we end up with V times R1 plus R2 over R1 times R2. Does that look OK to everybody?

So we're not quite there yet. This is not quite the usual way we write Ohm's law, all right? We've written i equals V something or another. That something or another is about the resistance, right? The resistance is the reciprocal.

So if I really want to turn this back into an Ohm's law thing, I have to write V is equal to i, times R1 R2 over R1 plus R2. And now we have something that's in the form of V equals iR for some value of R. And that means that an equivalent contraption to that is a single resistor that has value R1 R2 over R1 plus R2.

OK. So does that make sense to everybody? So let me ask you the following question. Is the resistance of this whole thing bigger or smaller than R1?

Bigger, right? It's harder to go through this combination of things. The resistance of this whole thing, is it bigger or smaller than R1?

STUDENT: Smaller.

PROFESSOR KAELBLING: Smaller. OK, good. So I always, like pretty much always, forget whether the multiplication goes on the top or the sum. Like I remember I don't have to re-derive this every time. I usually at least remember that it's either this over this or that over that.

And the way I check myself to be sure that I haven't screwed it up yet again, is to remember that this has to be smaller than R1 and smaller than R2. So if you need to check that's an important one. Your intuition should help you here.

Usually, we have two strategies. We have intuition and algebra and for most of us we're prone to make mistakes of one type or the other. You just have to hope they don't make mistakes of both types that line up in the same way so that they reinforce each other. Usually the hope is they-- so if I'm making algebra mistakes, I try to use my intuition.

My intuition says, well, it's easier to go through this thing. Right? The current has sort of more ways to go. So there's less resistance here. So whatever my answer is that comes out here should be smaller. OK. Good? Good.

So here's a problem. Think about that. Use what we know about series and parallel resistances to figure out the resistance of this circuit.

OK, let me just say what I mean by the question. What's the equivalent resistance of the circuit? What that means is, if I were to take that whole box and replace it with one resistor, what value would it have? That's the question.

I'm going to let you think about that one for a minute. It's worth thinking about. Bunny ears. I see one bunny ears. I see several bunny earses. OK, the bunnies are winning.

Excellent. It's like Fibonacci. They multiply. OK, let's see how this goes.

So first of all, we might notice that-- OK, so common patterns. We're going to use common patterns here by actually looking at our circuit to see if we can find something that we know how to cope with.

So if we look at this circuit we can say, oh look 1 and 1 in parallel-- or 1 and 1 in series. That's great. I know what to do with that. 1 and 1 in series, that's 2.

So I can take this circuit and turn it into that one. So I've done that replacement. So I've made 1 and 1 into 2 so there's 2. OK, that's good.

Now, this is my favorite example of resistors in parallel, because it doesn't matter whether you get it right or wrong, if it's the upstairs and the downstairs. Anyway, OK. So this is two resistors in parallel.

So you take 4-- 2 times 2 over 2 plus 2. That's 4 over 4. So the equivalent resistance of this piece of the circuit, these two guys in parallel, that's 1. And then now we've got 1 and 1 in series again. Woohoo, that's a 2.

[LAUGHTER]

See? Somebody out there's happy too about that. OK good. Does this make sense to everybody, what we just did? OK, good.

So one way to approach a big, hairy network of resistors is to go and look for series and parallel combinations and do this. Now not every network to susceptible to this method, but lots of them are. And when you see it, you can do it. OK. So good, we got that one.

All right. Now here's another common pattern that we're going to actually use a lot when we design things. So we have, so far, kind of taken the perspective of somebody who's analyzing a circuit, right? I give you a circuit and I ask you a question, like, what's the current through this component? What's the voltage across that component?

But what we're going to be doing in lab is actually synthesizing circuits. We're going to be designing circuits. We're going to be saying, I need a circuit to do a following job for me.

So one kind of a job that you might want the circuit to do for you is like make a particular voltage. We're going to have a voltage source that gives us 10 volts, but maybe we need 4.2 volts. So if you have a voltage source that gives you 10 volts and you want 4.2, what do you do?

OK. So we're going to look at some ways of making voltages out of other voltages by using resistors. OK. So dividers. Let's talk about voltage dividers. If I set up two resistors in series, then I can think about-- I might be interested in the voltage across one of these components.

OK, so let me just label it in the usual way. We'll call this V1. Resistance R1, resistance R2. I'm just now going to call this current i, and now we're all sophisticated enough to know it's the same current all the way through, so we don't need so many Is It's a shortcut, but I think we can take it.

OK. So what do we know? Well we know that V, the V that reaches from here to here, we know is that V is i, times R1 plus R2. Oops, little i. We know that because we just did resistors in series.

And so we know that i is V, over R1 plus R2. So that's i. Now what is V1?

So let's say I wanted to know the voltage drop just across the first resistor. That's maybe what I'm interested in knowing. The difference in the voltages across the first resistor.

So I'll get V1-- what's V1? V1 is R1 times i. Right? That's just Ohm's Law for that resistor.

And now I have i here, and I can combine these things. And what I'll get is that V1 is equal to V. Oh, I didn't need that. V1 is equal to V times R1, over R1 plus R2. Similarly, V2-- you can get it in the same way as R2 over R1 plus R2.

OK, so cool. So that means the voltage drops as we go through here, the voltage differences, are proportional to the resistances. So if I wanted this voltage, V1 to be oh, I don't know, 2/3 of 10, what would I do? So consider this circuit, right? Consider something that looks like 5 ohms, 10 ohms,

PROFESSOR KAELBLING: I just made it equal to 1/3. Well, OK, 1/3. 1/3. So imagine that I have a voltage, V across here. Then the voltage difference here is going to be 1/3 V. And the voltage difference here is going to be 2/3 of V. Does that make sense? It's nice, it's handy. It says if you have a voltage, you can divide it up any way you want to just by picking the resistors in the right ratio. Yep?

STUDENT: Shouldn't the V2 there be V times R2--?

PROFESSOR KAELBLING: Yes, it should indeed. Thank you. Any questions about that? OK. So that's voltage divider. You can guess the pattern.

Now we're going to make a current divider. Now a current divider is what you get when you look at resistors in parallel. So-- now I'm drawing my picture the other way. I guess I should've asked my slides too. There's a current divider picture. We'll do it over here. Current divider. In fact, maybe this time I won't go through the algebra. I'm going to believe that you can read the slide and understand the algebra. And so what happens here with the current divider is that-- so we have some current, i, coming in here. We'll call this i1, call this i2. R1, R2.

We know the voltages are the same across the whole contraption, and across the individual pieces. But now what happens is that those resistors divide the voltage up. And the way they divide it up is proportionally, but in the opposite way. So, in fact, what I'm going to do is label this with numbers instead of R1 and R2. And we'll just go to a concrete example.

So imagine that this is 5 ohms and this is 10 ohms. And that i is 10 amps. OK. So intuitively, without looking at the algebra, do you think more current goes this way or that way? Does more current go through the 5 ohms?

STUDENT: Yes.

PROFESSOR KAELBLING: Yes, why? Less resistance. OK cool.

And how much current goes through the 5 ohms? Well, it's going to be 2/3 of V. Oh, 2/3 of i, excuse me.

And this is going to be 1/3 of i. So 6.66 amps and 3.33 amps. So if you have current and you have a current source of some sort, and it's giving you a certain amount of current but you want a different amount of current, you can make a current divider. So those are tools you can start to use to synthesize circuits.

OK. So we have two more topics. We'll take a deep breath.

The next topic-- oh, did we want to do this? Nah. No. You can do that later on. I want to be sure I kind of get to the things I wanted to talk about.

So this topic, this is like the lesson that we want to learn from this part of the course. And we're going to keep hitting you in the head with it until you get it. And it's really that modularity in circuits doesn't work out in the way that you might hope or expect. So I said that at the beginning, so now let's look at a particular concrete example of that.

So imagine that I make this contraption. I have a light bulb-- two light bulbs, excuse me-- in series, and a battery. And I plug it in and there, my light bulbs glow. And let's imagine the light bulbs have the same amount of resistance so that they glow the same amount. OK.

So now, what happens if we add a third light bulb? OK. So what are the choices? Well, I don't know, there's lots of choices. But let's say we add a third light bulb, so we close that switch.

So it might make bulb one brighter. It might make bulb two dimmer. It might do both of those things. It might leave them all equally bright. They're all the same light bulb, maybe they're all the same amount of brightness. Maybe it does something else entirely.

OK, let's have votes on this one. I see three, one, some th-- th-- meh-- three, one, I see this, I don't know how many that is. Face plant. Three. OK, good.

What is the answer? Well let's think about that. So in the first case we can just very easily see that what we have here-- we have a voltage divider. You can think of this thing as a voltage divider. We know that if these guys have the same resistances-- if you think of a light bulb as a resistor, basically it is, it gives off some heat and light. The light bulb is a resistor, then the voltage drop across the first light bulb is the same as the voltage drop across the second light bulb, and so the voltage in particular between here and here, between these two nodes, is a half of the voltage that's supplied by the voltage source.

Is that OK with everybody? How many nodes are in this circuit? This one?

STUDENT: Three.

PROFESSOR KAELBLING: Three. Three nodes, right? One here, one here, one here. Good. And the voltage here is the same as the sum of the voltages down here. We've been through that before. OK. So voltage across here is a half of the voltage supplied by the voltage source.

Now, when we add this guy, what happens? Well, we're interested maybe still in the voltage across these guys, because we know that the voltage across these guys is going to be the same. First of all, how many nodes are there in this circuit? We added a resistor.

How many nodes are in the circuit? Three. Same number of nodes, so adding components doesn't necessarily add nodes. OK. three nodes.

So we're still interested in this voltage, let's say, the voltage across these two light bulbs now down here. And so the question is, what's that voltage? Well, we can see this as a parallel combination of two R's, right? And what do we know even before we think very hard about it? A parallel combination of these two R's?

What's the resistance of this whole arrangement here? It's less than R. Yeah? So the resistance of these guys in parallel is less than R.

So the voltage drop across here, is it bigger or smaller than the voltage drop across here? Smaller. Right? Because by the rule of resistor dividers, voltage dividers, if we have a smaller resistance down here and a bigger resistance up here, then this voltage difference is going to be smaller than this voltage difference. Yeah?

So these guys are going to burn less brightly. And this guy's going to have more voltage across it. So it will burn more brightly.

So the top bulb gets a bigger voltage than it had before, it gets a bigger share, it's going to be more bright. These guys are both going to be dimmer. Does that make sense?

So we used to have one perfectly nice, beautifully balanced arrangement of lights in our room. Then we decided to add one more, and then not only did these guys get dimmer, but they actually went out of balance. This guy actually got brighter.

So this is a thing that we're going to see a lot. It's really important to get it. OK so the answer is one and two, which just happens to be three.

So in LTI systems, we didn't have this problem, right? Just to kind of remind you why this is weird, in LTI systems when we said, oh, good. I have this H1.

It describes the relationship between x and y-- don't get all ready to go. I'm going to go back and do something. I skipped some stuff. I just put it at the end. OK. I hear that paper business.

OK, good. So we have this relationship, x to y, we set it up, we worked hard to make it, and then we can attach something else downstream of y. And that's cool, but no matter what we put here for H2, it's not going to change what H1 does. But in circuits we don't have this kind of exact input/output relationship in the same way, right? When we add something new it adds a new constraint to the system and it just changes the solution, possibly everywhere.

OK. What we're going to see next time is a way of interposing some special gadgets called buffers which will actually let us create a voltage and then use it to do something later. OK. Now I'm going to buzz back up here. I should have rearrange this. I just decided this morning to do it in a different order.

OK. What I want to do is show you a method for solving every single circuit in the whole world that's made up of these kind of static components. So you might have a circuit that looks like this one, where there's no obvious series parallel kind of simplifications to do. And so you might say, huh, I don't know how to understand this circuit because it seems kind of complicated and I can't get a handle on it using any of the simple reductions that we looked at.

So we're going to introduce a new idea and then an algorithm. And again, the algorithm is so stupid that you can program a computer to do it. So you can do it, with algebra errors.

Usually, when I do it , I make algebra errors. But it's just a really easy linear algebra. And it's so easy that it's actually not that hard to program a computer to do either. So we'll get the computer to do this for us.

OK. So, so far we've been talking about voltage as we've been talking about the voltage across a component, right? So each individual component has this little v next to it, and that's the voltage difference above and below the component, where above and below are defined by the direction that the current's flowing.

So that view makes it quite clear that voltages are just relative, right? We're always talking about voltage differences. I can't say just, well what's the voltage here? That's not really a sensible question. Because voltages are all about a potential difference.

But what I'm going to do is actually make a move and that's the following thing. I'm going to pick some node in my circuit, any node. It could be any node I want. And I'm going to arbitrarily call it ground. gnd stands for ground.

And I'm going to attach this little symbol which means I'm driving a stake into the bedrock. That's what that is, that's a stake into the bedrock. It's grounding my circuit. I'm going to say that's zero.

OK. It's not really zero. Zero doesn't mean anything. It's just a reference point. I could pick any node and call it ground.

It's convenient if you happen to have a circuit with one voltage source, to nail the negative terminal of that voltage source to zero. Some things get easier if you do that, but it is not required. Any node can be the ground node.

OK. So I give you a circuit, you pick some node and say, that's ground. I'm going to say that it has voltage zero.

What does it mean to have voltage zero? What it means to have voltage zero is to say that the difference between the voltage at this node and the voltage at the ground node is zero. Well, that's got to be true for the ground node.

Now, every other node can be spoken of as having a voltage. What it means for this node to have a voltage is to say that the voltage at this node-- the difference between the voltage at this node and the voltage at the ground node-- that's what we're going to say is the voltage at this node. So we can now define voltages at nodes by really thinking about the difference between them and the voltage at ground.

So we're going to change our idea of voltages. I mean, the old component voltages still exist. But it's easier to think of node voltages. Especially when you're trying to solve a big circuit. So when we think about node voltages-- so we've called something ground and then every other nodes has a voltage, which is its voltage with respect to ground. OK?

OK. So now I want to teach this method for solving circuits. And I'm going to do it on a circuit that we could have solved in an easier way, just because it's simple and it fits on the board. But we'll do more complicated ones later.

So let's consider this. So I have a voltage source. So there's a circuit. And let's say that this is 1 ohm and 3 ohms and 2 ohms, at 10 volts.

OK. So there's the circuit. And I might be interested, for instance, in knowing I don't know, the voltage across this resistor. Let's say I want to know that.

Now, I know you already know how to do this with the series and parallel tricks, but let's just see another way to do this. And then we can take this method and apply it to the circuit in that picture. But it would take up more boards than I'm willing to fill up right at the moment.

OK. So this thing is called the Node Voltage and Component Current Method. I made up that name. I don't know.

So it's got some steps. First of all, we're going to pick a node to be the ground node. And, as I said, it's convenient-- not required, but convenient-- to pick the negative terminal of a voltage source if you have one to be the ground node. So I'm going to drive a stake in the ground and say that that node is going to be the ground node.

OK. What other nodes do I have in the circuit? So my next job is to label the other nodes. So I've got a node here. That's a node. I'm going to call it N1. And I've got another node here, all this. I'll call that N2. So there's really, besides ground, two nodes in the circuit. So I've got two nodes and I've got three components.

So now I'm going to write down five equations. I'm going to write down an equation for each node that's not the ground node. And I'm going to write down an equation for each component. So I'm going to get a system of five equations, and then I'm going to solve them. And I can figure out anything I want. OK?

Oh, current variables. All right, I have to assign current variables. So let me make this consistent. So i1, i3-- I don't know why I did it this way, but I did-- i2. OK, good. So current variables. Again, I can draw the directions of the currents. Do I know which way the currents are going to flow in this circuit? Well, in this one maybe, but generally speaking no. So I just put those arrows in any old way, doesn't matter. Just draw them and label them. That's all. OK. Every component gets a current variable.

OK. So the next step is KCL equations. KCL equations for all nodes but ground. OK, so I've got two nodes that I have to write KCL equations for. So for this first one, for this node-- oh, this guy didn't get a current.

STUDENT: It's got the minus on it.

PROFESSOR KAELBLING: Yeah, no. But I'm sorry, I want to label it. Because we are being algorithmic. We are being like computers here.

Good. So every node has a current variable. I mean, excuse me, every component has a current variable. So four current variables. Four components, four current variables. I'm making these match up, the example I have on my page, which is the one that I used in the mini lecture, so if you want to go back and see this again, you can.

OK. So KCL for all the nodes but ground. So KCL for this one says that i1 plus i2 is equal to 0. KCL for this node says that i3 plus i4 minus i2 is equal to zero. Yeah? I3 and i4 are going one way, i2 is coming the other way. Good. So that's that. And now I need component equations, one for each component.

All right. My favorite component is the voltage source, here. So now the component equations, remember they tell us about a relationship between the voltage across a component and the current through the component. That's what they all do.

So the voltage across-- so let's talk about this guy. The voltage difference across this component, if this voltage is N1, and this voltage is zero, that voltage difference is N1 minus 0, right? So I'm going to have N1. I'm going to write it out in this sort of very slow way, just so we see. N1 minus 0, that's the voltage difference across that voltage source. What is it? 10.

10 is a constant. 10 is-- you know, we bought the thing at Radio Shack. So we know now, N1 is 10. Yeah? OK.

Now we get equations for each of these other resistors. So these are all resistors. So again, we look at the voltage difference.

So this is going to be N1 minus N2. N1 minus N2 is i2 times 1. Right?

And this is going to be N2 minus 0. N2 minus zero is equal to i3 times 3. And one more. The voltage across here is again N2 minus 0. N2 minus 0 is equal to i4 times 2. All right.

So that is it. Having written down those equations, you can solve them for any quantity that you care about in that circuit. So let's say that we're interested in the voltage too. I just want to show you.

So some people faced with that set of equations, goes, aaagh! Lots of people do. I don't know. Like somehow you used to be able to do those but your brain has been filled up with other, more interesting stuff, and so a system of linear equations is somehow perturbing.

But there's kind of a standard trick which, actually, once you get comfortable with doing this you can take this step immediately. Me? I like a really dumb and plotting procedure because I'm pretty sure I can carry it out. Once I start skipping steps I screw things up. But this is a step usually most people can skip.

And the step is, that really almost right away, instead of writing these equations down in terms of the currents, you can see that we have another name for i3. right? Another name for i3 is N2 over 3. So you can plug that right in.

So what I'm going to do is I'm going to take this equation over here and start plugging in some sort of more useful expressions for each of those currents. So another way to think about i3 is that it's N2 over 3. And i4 is N2 over 2. And i2 is N1 minus N2. And now we're about to make an algebra error. But we had to do minus N1 plus N2 and that's equal to 0.

OK, so now we're pretty much good to go, because we know N1 and now there's only one variable left here. So we'll multiply through by 6. 2 N2 plus 3 N2 minus 10 plus N2-- oh, no, no, no, minus 60-- throw in those algebra errors anyway-- 6 N2 is equal to 0. So 11 N2 is equal to 60. So N2 is equal to 60 over 11.

So you could have, and you should go back and just solve this problem using the series parallel maneuvers that you know about. But the important thing about this method is that for absolutely any circuit in the whole wide world made up of resistors and voltage sources and current sources and later on op-amps, you can just write these equations down and you can solve them no matter what the circuit is.

OK. So some stuff now just about tomorrow, for those of you who have questions about tomorrow. So there is no software lab today or tomorrow. That is an error in the handout. There will be a design lab as usual. Just wait for one minute.

The exam is taking place in two different rooms, tomorrow night, from 7:30 to 9:30. If your last name begins with A through M, go to 26-100. If your last name begins N to Z go to 10-250.

You can bring any printed stuff. You should bring your design lab material. I'm telling you that. You should bring your design lab handouts and what you learned and figured out and did.

You may not use a computer, or a phone, or any other thing that lets you talk to somebody else. Anybody have questions about the exam? OK. Cool. We'll see you tomorrow night.