 The universe is full of electric circuits. Wherever you look in a chemical or a biological or an engineered human-made system, circuits lay at the heart of everything. For after all, a circuit is nothing more than the movement of electric charge from one place to another, and often the storage of energy in the configuration of those electric charges in anticipation of the later release of that energy by reconfiguring the system. We're going to look at circuits that involve both a resistive component and a capacitive component, and in particular, explore one naturally occurring example of this resistor capacitor or RC circuit. What we're going to do today is sort of a capstone issue for circuits. We're going to combine resistors, EMFs, batteries, capacitors all into one circuit and play around with them a little bit. Then I'll begin by motivating why this is an important thing to understand. This is going to be a little tricky. There's a new bit of technology that I'm going to introduce today only briefly and in passing. This is not a course in mathematics, nor do I expect you to do the thing I'm going to mention today. I just expect that you'll be able to use the solution, but I will talk a little bit about differential equations and what they are and the magical way that you solve them, which still to this day I have a student who took this class and she wound up working with me on research afterward, and she had to solve differential equations to do that research, and she was still in denial at the end of her research time that the way that you set up and solve differential equations largely involves a gas. She thought there must be some more rigorous trick to this, and I kept trying to explain to her, no. Basically, once you learn the basic rules of thumb with differential equations, you guess a solution, you try it, and you see if it works. If it works, it's a solution. There might be others that are equally valid, but in many ways, when you learn to set up and solve these things, you're basically learning to guess in an intelligent way. Today we're going to talk about resistor capacitor circuits, ROC circuits, which would normally be a pretty seemingly dry subject, but actually there's some interesting storytelling here that can motivate why it's useful to learn about this stuff. And the storytelling begins with these two individuals. Sir Alan Hodgkin and Sir Andrew Huxley, does anybody know these two people? One of them died very recently, 2012. The other one died when I went to grad school in 19... They got the Nobel Prize in Physiology or Medicine in 1963, and they got it for applying physics to biology. So what they won. They won with another gentleman, Sir John Eccles, in 1963, and the Nobel announcement lists the award as being given for their discoveries concerning the ionic mechanisms involved in excitation and inhibition in the peripheral and central portions of the nerve cell membrane. Basically they figured out how ions move in a nerve cell, which now is the... It's a very fundamental piece of knowledge. I mean current goes in, current goes out. There's a time profile related to that. You have to assess what amount of stimulus is required before a current will flow, things like all this very basic stuff, all this very basic science. But that basic science is now really the foundation of the model of the way in which the brain not only takes in information but learns stores information and transmits information within itself. So this is really important work. And if you go to the Wikipedia article, for instance, for Alan Lloyd Hodgkin, you'll see that it lists that he worked on experimental measurements and developed an action potential theory. So the action potential that you guys learn about in biology comes from the work that these people did, as recently as 1963. So they were doing their work in the two decades prior to getting the prize, but the prize was awarded fairly recently and fairly soon after they did their work. So basically they came up with a way to represent one of the earliest applications of technique and electrophysiology, that is the combination of electricity and magnetism and physiology, known as the voltage clamp, which I'll demonstrate a little bit later. The second critical element of their research was the use of the giant axon of the veined squid. Human neurons are very tiny and at the time that these gentlemen were doing their research, there was no technological way to actually measure what they wanted to measure. They wanted to measure the ionic currents, the potassium flow, the sodium flow and so forth, in and out of the membranes of the neurons, specifically the axon. So what they did was instead of waiting for technology to get sensitive enough and tiny enough that they could do that work on mice or humans or something like that, they sought out an animal that actually had very large neurons and one of those animals is in fact this veined squid. Its neurons are very long, you can go look at pictures of them on the internet if you like, made that very amenable to being measured with the techniques of the time. So they were actually then able to do sort of the first accurate measurements of ionic currents in and out of these cells, which is an impressive feat in and of itself. So as it says here they really weren't able to do this in almost any other neuron because those cells are just too small. So what was it that they were trying to do? Well they were trying to do, you know, we have the benefit of historical perspective now, right? So we have a tremendous amount of technology that's allowed us to look very deeply inside of cells, inside of the brain to see what it's composed of and how those structures function together and this is one of the basic structures of the brain. So you have the dendrites that take in stimulus, the nucleus of the cell here, the cell body for the neuron. Then it's got this long structure called the axon. These little pinching places here are the nodes of Ranveer and then finally you have the axon terminal bundle, which itself then connects into the dendrites of neighboring neurons. And so this functions as part of a larger thing called a neural network. Computational scientists have been using neural networks now for decades to do something called machine learning. Machine learning is when you don't know what the mathematical function is that describes a process in nature. So you do what a human being does. You expose a computer over and over again to the process you want to describe and things that can fake the process that you want to describe. And by doing this you actually, you reweight the little nodes in your computational network and over time, if you do this a thousand times, ten thousand times, these networks can be trained to identify one pattern and reject others. So I mean, you know, you and I take for granted, maybe this is easier, but we look at this and we see stapler, right? We have a word that we associate with this object. We learned it when we were quite young. I also learned when I was quite young, not to put my finger here and hit the stapler. But that's a different story. We learned by stimulus and that stimulus can be pain. That stimulus can be visual information coupled with audio information. There's a whole variety of ways in which our brain is wired into our ears, tongue, eyes, nerve cells in our fingers, toes, and so forth. We take in a tremendous amount of stimulus and that stimulus comes in as electric potential changes to the dendrites, which can induce a current through the resistors and what turn out to be capacitors that are essentially biologically within this structure. Okay? And so the questions that Hodgkin and Huxley were trying to address were, why is it that a minimum threshold is required before you get this change in potential? And how do you model that using something that a human being could understand without knowing the particulars of what's going on inside the cells? Because again, remember, they didn't really have the technology then to look deeply inside of the cells and make precision measurements, even on a large structure like this to know exactly what was going on. So they had to build models to mimic what they saw happening from their measurements. And one of those models won them, in part, the Nobel Prize. Okay, so this is what they were trying to understand. And human beings today are still using basic assumptions about how these structures function to do things like machine learning. And, you know, for instance, I know that companies, some companies like telecommunications companies use these and other advanced techniques for teaching machines to learn to create all kinds of products to suit, you know, your needs. So that when you like search for something online, you know, they have an algorithm that can that uses machine learning to discern what you meant in your search. So some words are the same. Their meaning is distinguished by context, you can train machines to learn what context is, and then give you the right answer. Okay. So physiologically, biologically, what's going on is that the the axon is essentially it's if it's no stimulus is coming in, it's sitting at something called its resting potential. And that is just an electric potential difference across the membrane of the of the cells in the axon that is maintained in the absence of any external stimuli. And so again, a stimulus here from a physics perspective is it is an external change in the voltage across the system. That would be a stimulus. I mean, you know, chemically, electrically, that's what's really going on here. It's not like somebody shouting at the neuron down the line, it's all electrons and ions and stuff. Okay, so it's all basically physics at its heart. The resting potential is is obtained by maintaining a high concentration of potassium inside and a high concentration of sodium outside of the membrane. And the net balance of these positive charges leads you with a slight negative charge inside and a slight positive charge outside. And so you can already see you've got a separation of charge. I've talked about this before. That's essentially a capacitor. So the this cell is maintaining an electric potential difference in the same way that a capacitor maintains an electric potential difference through a separation of charge. Okay, and so charge physically cannot cross the cell membrane until the cell membrane allows it to by opening pumps, ion pumps and ion channels. And so that resting potential is simply held. Now what happens is a stimulus will come into the cell. Now if your neurons responded to every single electrical stimulus, you would be flopping on the ground constantly, you'd have no motor control whatsoever, you'd be drooling, it would be terrible. Okay, that's because we are constantly being stimulated and not just by external things. There's noise in a biological system. There's all kinds of jitter right ions are bouncing around in here due to thermal motion that might accidentally change the voltage across the potential just by thermal motion alone. You wouldn't want you know your brain has maintained a pretty reason pretty narrow temperature range and moving outside that temperature range is extremely deadly. Okay, for a variety of reasons. But you know, from a physics perspective, the last thing you want is a slight change in temperature to suddenly cause your neurons to fire. That would be really pointless. Okay, so biologically, there's a mechanism built in that prevents a stimulus of arbitrarily small size from causing anything to happen in their neuron. You have to so the resting potential is about negative 70 millivolts. If a stimulus comes in that raises the potential to about negative 50, negative 55 millivolts. Okay, so brings it up a bit. It crosses something called the threshold. And at that point, then ion channels will actually open and allow ions to move. And this will allow a current to flow down the axon. So what happens is is that the potential comes in it changes. If it crosses a certain threshold, ion channels will open. At first, what happens is that sodium will move in, and this will move more positive charge inside the cell, depleting the positive charge outside the cell. And you'll create a reverse of the situation that you had before whereas you started at a negative potential difference, you flip the sign of the stored charge. And you now change this to a positive potential difference across the cell membrane. Okay, I'll see I'll show you a graph of this in a minute. But the basic biology of what's going on is ion channels open, they only allow sodium in, they pump it in using electric fields. And now you create a new gradient of charge in the system, creating net positive inside and depleting the positive outside by pulling in the sodium ions. Okay, so this causes part of the axon now to have an opposite potential. And then this will repeat. So these these gates will now open letting in sodium, these will now pump potassium out of the cell, and return this back to its resting potential. And this whole sequence of positive negative charge flipping will repeat down the neuron until finally that stimulus makes it all the way to the axon terminal bundle, where that can then be applied as a new voltage to a new dendrite set on another neuron. And the whole sequence repeats. So you have all kinds of things going on here, you have resistances inside of this network, that means that there will be a loss of current, there will be a loss of charge wasted in loss of energy essentially wasted in overcoming the resistance of the cell system itself. So not all of the signal that comes in is going to make it all the way down here. And you can kind of begin to see where learning might come from at its very most basic level, its most basic biological, chemical and physical level. Learning requires a certain threshold of stimulus to be achieved before you can even propagate signals through the neural network. And even then propagating them isn't enough, they have to be strong enough that they can be transmitted to other parts of the network as well. And so you are, you know, we already we already know, I mean, we can make this analogy, right? It's very hard to learn new things, we really have to be motivated and interested. Physics is a fantastic example of that. So if you don't already love physics, you have to be kind of convinced that man, I'm going to stay awake for the next, you know, hour, rather than taking a nap. Alright. So I you know, I try to be bouncy and jump around and stuff and keep everybody alive and awake. And yeah, see, Catherine, you're raising your hand and asking a question, look at that, you're, you're learning. So the myelin sheath, those are insulators, so how do they move to the nodes of room here? So, so the myelin sheath is an insulator, but the medium inside is not. So ions can move inside the sheath, right? And so actually, one of the ways that this is modeled in sort of a physics way is to say, okay, well, you have an insulator sheath out here, but you also basically you have a conductor that allows charge to move inside the sheath. And in fact, this can be modeled as something called a coaxial cable. A coaxial cable, incidentally, is what brings cable TV into all of your apartments, homes, dorm rooms, whatever. Okay, those little screw in cables that you have to, you know, thread into the back of your TV and then into the wall. They're slowly getting replaced with HDMI, but still when you get the service out of the wall, it usually comes out on a little screw in cable. That's known as a coaxial cable. And it's great because it's two conductors and a lot of insulators. And it's very similar to this system right here. And what's nice about it is it minimizes signal loss. That's what makes coaxial cables so valuable to the cable industry. It is far better than than like these, you know, little cords here, these terrible little braided wire cords that come in, they lose signal like crazy. You've got all kinds of reflections in them. It's a mess in there. But in coaxial cable, you can get very clean transmission of signals down and very little loss along the length of the cable by comparison to other things. Okay, so it doesn't dissipate to the air system. Exactly. Yeah, in fact, you need the mileage sheath in order to keep charge from leaking out or this would never work. And so presumably what happened over, you know, millions and millions of years was that as cells developed and differentiated into different kinds, there was some natural selection advantage to this particular kind of system that then allowed it to stick around and be used for various things. So, you know, this, this structure doesn't only happen in, in neurons, it repeats in other structures and natures as well. It just happens to be the basis of information transmission in a brain. So, all right, so this is the picture of what this learning process looks like. Resting potential of negative 70 millivolts, some stimulus comes in, if you cross the threshold for opening the ion gates, they open, you get a rapid change in potential up to a maximum. Then the, the the sodium channels close, the potassium channels open, the voltage falls again, and it overshoots its original resting potential. Why is this important? Why is this a useful thing in learning? Any ideas? We actually take advantage of this feature in physics to build precision energy measuring devices. Yeah, do you think? Well, over shooting in the nerve system is the possibility to go back in. That's right. But why is it advantageous for learning for that to happen? From a biologic perspective, why, why not evolve that out, right? Why not just have it return right back to its resting potential and sit there? Time to do what? Yeah, time to reset. You need a little time. If another stimulus were to come in right here, and this was back to resting potential, this neuron would fire again immediately. And so neurons would be very sensitive to fire and you'd get jitter in the neuron as a result. This overshoot compensates for any stimulus that comes in just at that moment. So this neuron is still basically occupied and busy. And it returns gently back to its resting potential, giving the system time to reset. And we do this, for instance, we use this when we're shaping signals coming in from the Atlas experiment that I worked on for our big energy measuring device called a calorimeter. It's huge. It's made of liquid argon and electrodes. And we shape the pulses coming out of that to prevent multiple proton-proton collisions, which happen every 40 millionth of a second, every 40 millionth of a second. You get a collision. And we don't want two of those collisions to hyper-stimulate the calorimeter. So we have this overshoot in to prevent signals from getting overlapped and warped by one another. So we take advantage of something that nature takes advantage to make clean signals for a learning system. We do it to read out energy. Nature does it in the brain to prevent over-learning, over-stimulation of the neuron, giving it time to reset. So all of this turns out to be an example of something called a resistor-capacitor circuit. Now I'm going to explore in this lecture a relatively simplified version. But I'll come back to the Huxley-Hutchkin model in a bit before we wrap up the lecture. Okay? So a couple of things I want you to keep in mind. Some very basic toolkit information. Like I said, I'm not going to show you how to solve a differential equation. I'm simply going to utilize the solution. But I will motivate where these things come from, and that it can be useful to know how to solve them. So useful bits of information. First of all, this is going to seem very peripheral for a second. But I want you to dig deep back in time and remember this function, e to the x. Okay? It has a corresponding related function, which is known as the natural logarithm. And it's written as log base e or just l, that's not it, ln for natural log. Okay? But I'm just going to focus on e to the x, because e to the x is really easy to remember. If you have this function and you are told, calculate the derivative of e to the x with respect to x, what's the answer? e to the x. So I love this function. It's so easy to remember. Okay? Basically, if you take the machine that is the derivative and you act on this function of x, it returns the function of x. That's it. So function goes in, function comes out. Now if you have a constant or something up here, you have to use the chain rule to figure out what happens to the constant. So if you have something like d dx of e to the ax where a is a constant, it does not depend on x, then if you apply the chain rule, you wind up with just a e to the ax. So you get the function back times a. Here you've got the function back times one. So it's just a one multiplying this and you just get one back here. So it's easiest to remember that one and then if you remember I have to do the chain rule when you have something in the exponent, then you can very quickly derive the thing I wrote there on the right. So let me get this out of the way. So that nobody thinks that it's part of that equation. Alright, now what about the indefinite integral, that is any arbitrary limits of e to the ax with dx? Okay, Rachel, yeah. You said that's the chain rule or that's like a shortcut or what? Well so this is the shortcut, but the chain rule is that the first thing you do is you take the derivative of e to the ax and that just gives you e to the ax back. But then you have to take the derivative of its exponent and the derivative of ax is a and you multiply that by e to the ax. So it's just chain rule. It's a bit of a fly secretly behind the scenes. Yeah, I'm not going to do that in front of you. What about the indefinite integral of e to the x dx? Not Catherine this time. No. Well what did the derivative do? You put the same thing back and the integral is the anti-derivative. So what's the function that when you take the derivative of it gives you e to the x? e to the x. It's the best function in the universe. I love it. Okay, that's it. It's really easy to remember. As long as there's no thing lurking up in the exponent that multiplies x, it's super easy. So if you're ever looking to, there are problems and these problems are going to the class of things called differential equations. This is a fancy term for solving an equation by looking for the function, not the number, the function that satisfies the equation. Functions can, the algebraically, be plopped into an algebraic equation. And then all that matters is that that function satisfies the equation. That's it. That's all that matters. And so differential equations are just a fancy way of saying an equation whose solution is a function, not a number, a function. Nothing wrong with that mathematically totally allowed. Okay, we're going to run into those, one of those real fast today. But I just want to motivate that sometimes when you're looking for a solution and part of the problem clearly involves a function that when you shove it in, you get the function back, e to the x is a great guess or e to the something times x is a great guess. Okay, the other thing that we need, still broken, fantastic, your tuition, hard at work folks. Okay, capacitors, capacitors, capacitors. Let's go back and remember that symbol. Okay, so the plus side, that's where all the positive charge is accumulating, the minus side, that's where all the negative charge is accumulating. And we're going to start sticking these things in circuits now. So the simplest circuit that I can write down would be a battery. And, well, the really simplest circuit I can write down, we already kind of looked at, is just to shove a capacitor in there with some capacitance c. Okay, so we have some electromotive force calligraphy e and it's applying a constant ideal voltage to anything that's plugged into it. What we plugged into it is a capacitor. The positive terminal of the battery is the one that emits positive charge. Okay, so in a very simple circuit like this, we already know what direction current is going to flow. But let's start thinking about this not as a static situation, but one where time is a factor. Okay, I promise you we would do this at some point and the day of reckoning has come. So, let's think about time very qualitatively for a second. I have a switch. It is preventing current from being pushed out of the positive side of the battery and going over to the capacitor. The capacitor begins uncharged. So, this is just kind of primed and waiting to have the switch thrown and the circuit closed and the loop completed and then current can flow. So, let's do that. Right at time zero, t equals zero, you close the switch. Okay, so what happens right at that little instant of time, that little infinitesimal moment in time after the switch is closed and current can flow. What happens if current can flow? Current flows. Yes, exactly. So, current begins to flow. Current begins to flow. Okay, now it's some later time, t greater than zero, a second or two later. Okay, not a lot of time, a second or two later. What's the current going through the circuit? Is it the same as the current that we started with in that little infinitesimal moment right after the switch was closed? Is it greater, is it less than the current? Any ideas? Okay, same. What's that? Less than. Okay. So, why do you say it's the same? Because the conservation of charge, like it should be the same throughout. So, let me pose a question back to you. Is there a place in the circuit where charge can build up and stop? On the capacitor. All right, so let's think about that. So, right in that instant, right after the switch is closed, we start having a current that flows. Okay, I, and this is a nice simple circuit, it's going to go clockwise through the system. All right, so the battery is pushing out positive charge to the top, it's pushing on negative charge on the bottom side. Okay, the other way you can think about it is positive charge is flowing off the capacitor through the battery and then up to the top. So, we start to build up maybe one little positive charge and one little negative charge just after the switch is closed. Okay, then as time goes on, we start to build up more on the capacitor. What's happening inside the capacitor? What's getting built up inside the capacitor? Charge is on the surface, but what's happening in that space between the plates? Right, potential difference coming from an electric field. We're getting an electric field that's getting built up in here. Okay, now these positive charges, they really want to be here. Okay, they see these negative charges across the gap. Hello, but they can't cross the gap because there's empty space there or some dielectric, some non-conducting medium. Okay, so we're getting now a situation where we have high potential up here from the perspective of positive charges and low potential down here. Again, from the perspective of positive charges. They really want to be here because they see these negative charges and they see all these other positive charges next to them and they don't want to be there. They want to be where the negative charges are. Okay, but they can't cross the gap, so charge is building up. The electric field in here consequently is also building up. We're getting a potential difference here, V that's building up. If enough time passes, what happens to current flow in the circuit? What do you think is going to happen if enough time passes? It'll stop, right? Because what's going to happen is that you're going to get to the point where you push that last positive charge up onto the top. The voltage here is now exactly equal to the voltage from the battery. You run out of energy. That's it. The battery can no longer overcome. The potential difference here and current will stop. So going back to the question again, what's current doing maybe a second or two after the switch is thrown? Is it the same grade or less than where it started? What do you think? You originally said it's the same because current is conserved, but we see current isn't conserved in the circuit, right? It can build up in places. What is the current going to be a few seconds after you throw the switch? The same as when it started out right after you threw the switch? Less than or greater than? Less than. Right, because as the battery starts to push charge here, charge builds up, you get an electric field, V starts to grow. As V starts to grow it opposes the battery. So the battery keeps pushing until it can no longer put enough energy per unit charge into the circuit to move any more positive charge to the top and it stops. So what's less than? The current at some, I'll write it here, so the current is now less than at the beginning. Okay, so at the very beginning, the current is as big as it's ever going to get, but the minute it puts one positive charge on the top plate, you create an electric field that opposes the battery and you keep building up charge and it keeps supposing the battery until eventually the battery just can't put any more charge on the capacitor. As you deplete positive charge from this side and put it over on the other side, there just comes a point where there's not enough energy to deplete more and put it here, because all this positive charge is pushing back against any more positive for saying, no, that's it, you don't have enough energy to get over here anymore. So when you said there's less current, are you saying less current in the whole system? Yes, less current in the whole system. So what happens over time, and I'll demonstrate this in a second with a simple circuit that you can watch, is that the current decreases over time and then at, we can just say, time equals infinity. So a very long time later, okay, no current. Okay, and that's in this simple circuit. So let me, let me, let me demonstrate this with a simulation. Okay, so this is the physics education demonstrator for a, basically an arbitrary simple circuit set. So let me do that and then that. All right. So this is really cool. It's a little job of program. You can fire it up on your Mac, your Windows machine, your Linux machine, which is what I'm running here. And you can build circuits. And so actually the student that I worked with who had been in my class and she did research with me afterward, Holly, she actually used this to model her simple circuit of the neuron. It looks very cartoony, but it builds in all of the basic physics that you'd otherwise have to solve by hand using a very complicated set of equations, which I'll show you one of in a moment. But it's got all the, all the great stuff. You know, it's got batteries. So we can, we can drop in a battery here. All right. So let me do that. So I'll put a battery. Okay. Now this battery has no internal resistance to begin with. So we can drop little wires in. You see it even has little charges in it that are free to move. Drop some wires. There we go. Okay. Drop a little more wire. Very good. Okay. Now I'm going to put a capacitor in. So I'm going to recreate the circuit that I've shown you up on the board. So there's my little capacitor, a couple little parallel plates. All right. And then we'll finish building this out. I'm going to cheat. I'm just going to connect that up. Okay. You see what happened. I plugged that thing into the battery. Boom! Charge just immediately separated. So all the positive charge is now up here. All the negative charge is down here. That's a little too exciting for my tastes. So now if I flip the switch, this is going to happen very fast. Boom! Okay. So you saw a little bit of current flow here, but it was very hard to see. So the way we're going to improve the situation is we're going to add a little resistance into the system. I have dropped in a resistor and by default it sets the resistance to 10 ohms. The battery has a voltage of 9 volts to begin with and the capacitor is still charged from the last time I closed the switch. So let me short-circuit this thing. So there we go. All right. Discharge the capacitor. Now watch when I throw the switch. This hopefully will be a little more slow motion. What's the resistor doing? It's providing opposition to the flow of current. And so less current is going to flow net through the system at first and it will take longer as a result to charge up the capacitor. So let's see if that's the case. So I throw the switch. We see the current moves a little bit and then eventually the positive charge builds up and we are right back to where we were. So let me... All right. So let's watch it again. So there we go. Little current flows but the positive charge builds up. It opposes the positive end of the battery. Current stops. Okay. And you can fuss around with the resistance here. You can make it bigger. You can make the current slower as a result and less charge per unit time thus gets deposited on the capacitor. And so you wind up with a situation where you can watch this current move really slowly to charge up the capacitor. Okay. All right. So now what I'd like to do is put the lights back on. So brace yourselves. Okay. What I'd like to do is I'd like to analyze the circuit I just drew up there using Kirchhoff's laws. Kirchhoff's rules. And for that we need a little piece that we're currently missing. But we almost have it written down. It's right over there. So let me draw that circuit a little bit more neatly in the way I actually put it together. All right. So there is my what's called an RC circuit. And that's any circuit that contains a resistor and a capacitor. So nothing natural about that. Kirchhoff's rules. We have to do a few things to analyze the circuit. Now this one isn't so bad. It's got one loop in it. So this is technically a simple circuit. But it's got a piece in it we've never handled before using Kirchhoff's rules and that's the capacitor. So what's the first step in Kirchhoff's rules? Determining the current. Like picking the direction you want it to be. Picking which direction your current goes. Yeah. Right. So you choose in you pick a loop. There's only one loop in the circuit. So we just pick that one. That's easy. And then you decide which way do you think current is flowing through each piece of the loop. Remembering that current has to be conserved. Because charge has to be conserved. So any current that goes in has to come out at any moment in time that will be true even for the capacitor. Right. So while charge is building up on the capacitor if we were to look at the circuit for just one slice of time at that moment it would be true the current going into the top of the capacitor is equal to the current coming out. Even though over time that in total amount of current is decreasing to zero. Okay. So we have to start by picking a direction. So I'm going to pick the direction which you know because I like current that comes out of the plus side of a battery. So I'm just going to say that current flows up through the left leg to the right through the resistor down through the capacitor and then back around. So I'm going to make my current flow in a clockwise manner. You can pick counterclockwise all that happens is at the end when you solve the problem you get a minus sign for your current. That means if you chose wrong. But it's no big deal. It doesn't change the physics of the situation. So. All right. So what's the next step? I've chosen a direction that current flows. There actually are no nodes in the circuit. So I don't have to worry about conserving current at a branch point. Right. This is just a single loop. So what's the next step? So we've already done current. Check. What's the next thing we do? Walking. Walking. Right. So we have to pick a direction to walk through the circuit and we're going to add up all the voltage changes as we go through the circuit. Okay. So. Well, okay. I keep this simple. So I'm going to walk clockwise through the circuit. So we have to do our walk. Okay. And I'm going to choose clockwise. You don't have to. You can choose counterclockwise. Just do it. Choose it and stick with it. If you make a wrong choice, it's okay as long as you stick with it. You'll get signs out in the end that fix it for you. Okay. All right. So then we have to conserve energy on our walk. So this is where Kirchoff's loop rule comes in. Yeah. Can we just walk that direction of current because the sort of arrows that are showing us what to go? We can. Is there any correlation? Because you don't have to. Okay. I'm just saying you can do whatever you want, but whatever you do, stick with it. Okay. So if you feel like it's morally wrong to walk against the current in Kirchoff's rules, then don't. Okay. Just make sure you stick with it mathematically, apply it consistently. Okay. But those aren't meant to conflict or cause problems. They're meant to keep stuff consistent. Yeah. Whatever your choice is, however wrong it might be, stick with it. Okay. It's a judgment call. But here it's a helpful judgment call. Just make a choice and stick with it. So I'm going to walk clockwise. I happen to also like walking in the direction current flows. That's just conceptually easy for me. All right. So my walk is going to be like this through the circuit. And I'm going to start here. This will be my start position. Okay. Right before the battery. Okay. So we've already learned the rule, the convention for when you go through a battery from negative to positive in the direction of current flow. So how did you know where to start? Okay. It doesn't matter. There is no, there is no, I just show, I happen to like starting with the battery. That's all. It's totally a personal choice. I could have started with the capacitor. But I'm building up to the capacitor. Is there a strategy there or was it like? No. No, no, no. And energy is conserving a loop. Start anywhere in the loop and walk back to where you started. It doesn't matter where you start. Okay. Don't overthink this too much. Just, I know it hurts sometimes to be told, look, just make a decision and stick with it. But that's okay in this case. Just make a decision and stick with it. Everything's going to be all right. Which is a famous line at the beginning of World War Z and I recall everything was not all right at the end of that. But anyway, that's a separate problem. All right. So you just choose where you're going to start. When you go through the battery from negative to positive, that is a positive voltage change. So the voltage of the battery is plus e, whatever it is, maybe it's 12 volts. Okay, we're just going to write that as plus e. We continue our walk. We hit the resistor. Now we are going through the resistor in the direction that current is drawn to be flowing. The resistor opposes the flow of current. And so we're going to experience a drop in potential in the resistor that is negative iR. So it's negative v, but for a resistor v equals iR and we can just put in iR for that. And then finally we hit the capacitor. And we have the plus side up here and the minus side down here. We are going from the high potential side, from the perspective of a positive charge, the high potential side of the capacitor to the low potential side of the capacitor. And so when you do that, you experience a change in voltage across the capacitor negative vc. And then you continue along and you come back to where you started. Okay? Now for a capacitor we have an equation that relates q, v, and c. q equals v times c. So we can actually just put the capacitor equation in here as well. So we have negative iR, negative q divided by the capacitance equals zero. Now I know that doesn't seem like much, but it turns out that we're a hairs breadth away from solving for some basic features of an RC circuit. First of all, we've already looked qualitatively at the RC circuit. We know that right in the instant, like if there was a switch in here, we closed the switch or the minute the battery is hooked into the circuit, current will begin to flow and the most it will ever have is at that moment in time, right after the battery is plugged in or the switch is thrown from the battery, something like that. And then over time that current will lessen, it will wear down. We expect to see the current decline over time. And then at a long enough time, that current will flow, will go to zero. We saw it in the simulation here, it ceases after some long period of time, okay? Now what are we going to do with that? How are we going to figure out how, for instance, charge is changing or how current is changing? This is a nightmare. You've got this voltage, which is constant from the battery, so that's nice, that's a constant. But then i, i is actually best written as a function of time, okay? i is actually some function of time. Time is a hidden variable in here that we haven't even drawn, right? We know that the current is changing with time and oh god, q, q is a function of time because the charge that's building up on the capacitors, it starts out at zero, but then it builds up to some maximum value that eventually in combination with the capacitance opposes the battery through its voltage. So this is a horrible equation at its face, so let me write this in all of its nasty glory. So we have i, which is a function of t times a constant r minus q, which is a function of t divided by c, all of that is equal to zero. There's one more piece of information that we can use here to try to, well, make your life easier is the wrong way to look at it, but to at least be able to solve the problem or find some way to solve this problem. And that is the definition of current. Current is the change in charge with respect to time. So if you focus on a fixed point in the circuit, you count the number of charges going by in some amount of time. The number of charges, the amount of charge that goes by in that unit of time is the current, dq divided by dt. And you can choose very tiny units of time, dt, little differential. So these are a little infinitesimal time slices. This reeks of calculus, and this is infinitesimal charge in that time that goes by. And this is where, now if we just write that into the equation, this is where the differential equation comes from. So we have e minus, I'm going to write r here, r is a constant, i is dq, dt, q is a function of time, minus q over c, q is a function of time. This is what is known as a differential equation. And in order to understand rc systems, one has to set up and solve those. Now I'm not going to make you guys do that, I'm simply going to quote the solutions. But what I want to point out here is that the only, if we've given e and we're given r and we're given c, the only unknown that we have is q. But the problem is that q appears by itself over here, and in here it's entangled inside of a derivative. And that's what makes this a differential equation. You've got a differentiation with respect to time of the charge, and then just the charge over here. And so this is a whole branch of mathematics to set up and solve these problems. These equations appear in population problems. If you're looking at, you know, the effect that a disease has on a population, the rate at which the disease spreads versus the death rate versus the infection rate, all of those things can be entered into a single equation, it might be a very nasty equation, involving rates of change of infection, rates of change of health death rates, things like that. And you can solve, this is how, for instance, the CDC and the World Health Organization made predictions based on certain assumptions about the number of infected people that are possible in December and January and February of next year for the Ebola spread. The Ebola outbreak can be modeled using differential equations. That's where predictions come from. They have a range because there are uncertainties in the predictions. You don't know that there won't be a major medical intervention in December, for instance, stops the spread of the disease in Liberia or Sierra Leone, something like that. You can't predict when that's going to happen and that will change the outcome if you do, but based on what we know now, the CDC and World Health Organization can make a range of predictions. They're using equations complicated ones, but similar conform to this, to solve. We're going to apply these equations to this very overly simple circuit that we've constructed here, resistor, capacitor, and so forth. What you find is that if you go ahead and solve this, let me recoup our qualitative solutions in just a moment. The book goes through this in a little bit of detail and I welcome you to look that over again if you're interested in this. For instance, population analysis, disease analysis, the spread of a technology through a society, all the stuff can be modeled with differential equations. They're really essential tools in understanding the changes in things over time, given pressures on the system. So the solution to this equation for Q is just the capacitance times the voltage from the battery times this thing, 1 minus e to the minus t, there's time divided by the product of R and C. Again, we have the capacitance times the voltage from the battery out in front. Let's think about that for a moment. As time goes to infinity, okay, so let's send t to infinity, all right? As time goes to infinity, e to the minus t, which is equal to 1 over e to the t, goes to what? Zero? Zero. Yep, because t goes to infinity, so you have 1 over a huge number, which is a tiny number, and so eventually add infinity, this goes to zero. So at t equals infinity, the charge on the capacitor is merely given by the capacitance times the battery voltage. Well, we could have predicted that, right? At t equals infinity, the current stops flowing, the voltage on the capacitor must be opposing the battery, and so the must be equal to the voltage of the battery, and the charge will just be given by c times e at time equals infinity, or if you wait a really long time. So, yeah, right? Is the e still our emf, e? Yes, yes, that calligraphy e is chosen on purpose to remind you that that comes from the battery, which is a constant source of potential difference in the system. Okay, now what about t equals zero? Well, at t equals zero, what is e to the minus zero equal to? One. And so consequently, what is charge equal to? You have a one here, and you have one minus one, so you get zero, which is what we expect, right? Right at the moment when that switch is thrown to close the circuit. There is no charge on the capacitor, and there isn't for a moment until after the switch is thrown. Do you think e to the negative zero? Yeah, nothing wrong with that. This is being pedantic. I left the minus sign out there. Yeah. I could have just put e to the zero by the property of negative zero equals zero, but I'm just being pedantic. So, and then at times in between infinity and zero, which is all other times, this is the equation you have to use to figure out what the charge is on the capacitor. And if you plot this out, what you find out is that the charge on the capacitor versus time looks something like this. So it increases and then it levels off at its maximum value. Okay? And you just have to wait a long time, and the time that you have to wait is actually given by this thing up here. So this product of R and C, it has units of seconds. Okay? So if you go back and dust off what are the MKS equivalents of resistance and capacitance? Okay? And you plug all those in, they all cancel out, and what you're left with at the end is just s, seconds. So R times C has units of time. Okay? So this is what is known as the time constant of the circuit. Now, if you plug in T equals RC, okay? Then you wind up with an equation that looks like this. So Q is equal to CE in general, 1 minus E to the minus T over RC. And if you plug in T equals RC, you find out that Q equals CE 1 minus E to the minus 1. Okay? So T equals RC, so you have E to the minus RC divided by RC or E to the minus 1. And you're left with this thing in this form. Okay? This, this thing out in front is the maximum charge that the capacitor will ever carry. The maximum charge the capacitor will ever carry. This is a number whose value is 0.63. So this time constant tells you the time required, the time you have to wait for the capacitor to charge up to 63.63 of its maximum charge. And so the typical rule of thumb is if you wait about 10 times the RC, 10 times the time constant, you've basically reached a situation in a capacitor where it's maximally charged. For all intents and purposes waiting 10 times the time constant is infinitive. All right? So if, if about, you know, 10 RCs have passed, that capacitor is as bad as charged is, is ever going to get. All right? So that's important to know when designing a circuit for specific purposes. So for instance we've talked before about our capacitors can help to smooth out power problems. Recently when we had those bad storms about three weeks ago here, the lights and the computers in this building were flickering like crazy because they couldn't handle the, the building power, couldn't handle the surges that were being placed on it by the fluctuating voltages from power stations outside during that electrical storm. That's when we learned that a very sensitive piece of equipment downstairs was not on a battery backup system nor was it having its power line smooth to prevent noise from possibly damaging it. So luckily no damage occurred but it made us very sensitive to the fact that we need to put a battery backup on that. Battery backups are going to contain capacitors and the capacitors are tuned so that the resistance and the capacitance in the system is such that the power cuts out that capacitor can dump its voltage and current very quickly into the system so that you don't have any dips. It smooths out all the little dips in the system. All right? So let's wrap up by looking at another one of these circuits and let's see here. So let's look at an RC circuit. Please work. Great. All right. Now because I know this thing is not cooperating very well what I'm going to do is I'm going to load an RC circuit that I've already built. It's kind of nice you can save these. Okay? And there we go. So there's our RC circuit. Let me show you. Here's the battery. All right? With potential I've set this to 10 volts. Here's our switch. Hasn't been thrown yet. This is basically a system that could be used to create a battery backup situation. Okay? So you have a loop where current can flow through a resistor and you have another loop where current can build up on a capacitor and I put a light bulb here just for fun so you can see what happens. All right? So if I throw the switch what's going to happen at the beginning is that current is going to flow like mad into the capacitor and very little through the resistor but as the capacitor builds up charge the current's not going to be able to flow over here anymore so instead it's going to prefer to go entirely through the resistor. The bulb will glow only so long as current is moving through the branch with the capacitor. So here watch. You see the current slows down in this branch as the charge builds up on the plates. Okay? And Catherine this goes back to something you were asking before, right? If you just had a resistor in the circuit wouldn't current just flow through it in a steady state and the answer is yep and there it is in fact. So this branch is now closed off to current because the capacitor is full and so the only place charge can go is through this through this resistor here. Okay? Now here's the cool thing let's simulate a power interruption so this is our building okay this is our building with its normal flow of current totally everything's totally fine and then a lightning storm knocks out external voltage here's how a battery backup works. It supplies power for a little bit of time maybe to smooth out the fluctuations the light's flickering means the power is kind of coming and going really short bursts but that's what that provides and so we can just keep you know put the power back on take the power off put the power back on take the power off and if you build the circuit just right you can smooth out all those little fluctuations and prevent your computer your lights from exploding your sensitive scientific equipment from burning out because it's getting no power no power no power no power very bad for electrical equipment so. So things to keep in mind with the resistor capacitor circuit or just that you have all the basic toolkit pieces that you need in order to understand these circuits you can look at the circuit as a series of loops involving electric potential changes through those loops you can use Kirchhoff's rules for current and voltages in loops and it nodes in order to attack these problems and at the end of the day which you get are differential equations and those differential equations are solved by functions not by numbers you can plug in numbers and get results once you have the function but at their heart you have to understand these systems using functions and those functions will change with time. Now if we return for a moment to the Huxley-Hodgkin model of the neuron we can see what it was that they were in part awarded their no-well prize for and that was once they had made measurements of the ion flows in and out of squid axons they were able to then develop a physics model a circuit model of those axons to mimic the data that they saw and what they found is that the data were best described by a resistor capacitor model and that model is sketched here in a very simple form the much more complex form I'll show you in a moment but the basic idea is that the interstitial fluid can be represented as a form of resistance outside of the myelin sheath and the intracellular fluid lies inside of the myelin sheath and that sheath in and of itself is a boundary over which charge has to flow when ion channels open so we can represent the two fluids as resistance outside and resistance inside of the axon and then the nodes of renvier are represented by resistor capacitor pairs and so those are the vertical pairs that you see here and so what happens is a stimulus enters from the left this causes a potential difference across the circuit from the left side that will begin to charge up the capacitor and as the capacitor charges then current can no longer flow through it and current will instead flow through the resistor that's next to it and this whole pattern of voltage building up on the capacitor which then increases the voltage on the next section of the circuit and then the next section of the circuit after that repeats all the way down the length of the axon and so an external stimulus on the left which is an increase in voltage is then repeated as a transmission in that increase in voltage down the length of the axon as the capacitors charge they charge up to the voltage level from the stimulus that then puts a voltage on the next segment of the circuit which puts a voltage on the next segment of the circuit and you get this beautiful description of what's seen with ionic currents flowing into and out of the the the myelin sheath through the the axon length itself you see the voltage the pulse the stimulus is transmitted down the length of the axon by this repeating charge up discharge cycle very much like capacitor resistor circuits and so the much more complicated version of of the Hodgkin-Huxley model is shown here again what you're basically seeing here is rather than a fixed bunch of resistors and a fixed bunch of capacitors you have voltage sources you have the capacitor in the note of Ranvier and you have variable resistances and sources of current and voltage that can change so this is a much more complicated picture but it's still just a circuit diagram basically what we have here is a big RC circuit and that is an excellent representation of physically what's going on with ionic currents inside of the axon so i hope this has been a very entertaining lecture you can see how biology and physics interface interface very neatly in the essential elements that are the foundation of our learning systems the the neurons and their long axons we see how stimulus in the form of a voltage can be transmitted via the RC circuit down the length of the axon to be passed on to the dendrites of the next neuron this is a beautiful process it's what allows us to learn fundamentally it's what allows many other living organisms to learn fundamentally and it's something from which we've learned in developing machine learning which we can now use to mimic some aspects of human learning this is a very complicated area but at its heart deep down inside is essentially the resistor capacitor circuit