In this optional lecture, I'm going to briefly summarize the math behind averaging. So in the last lecture, we talked about the average equation of the inductor in which L times the derivative of the average inductor current, was taken to be equal to the average inductor voltage. This actually follows directly from the direct, the definition of averaging and from the defining equation of the inductor. And we can see that as follows. Here we'll start with the equation of the inductor, by definition l d i d t, is the inductor voltage with no averaging applied. And so, let's then consider, what is the derivitive of the average inductor current. Where we define the average inductor current as in the previous lecture. So the derivative of the average inductor current can be written like this, where inside the brackets is our definition of how we average. And so let's take the derivative. Now we have the derivative of an integral here. we're allowed to interchange the order of differentiation and integration under a certain, certain set of conditions, that the mathematicians tell us. First the, the function we're integrating, namely the inductor current, needs to be a continuous function so that we can take it's derivative. And second, the derivative of the current is allowed to be discontinuous, but it can only have a finite number of discontinuities over one switching period. While the derivative of the current is the inductor voltage over L, this is in general a switched wave form in our converters, so it has discontinuities. But, if we don't switch too many times per switching period, then we can certainly, or at least if we switch a finite number of times per switching period, then we satisfy the second requirement. And so we're allowed to, reverse the orders of integration and differentiation. So that's what we get in this bottom equation then, where we have the integral of the derivative of, of the current. Okay now, for the for the derivative of I what we will do is take this defining equation of the inductor and divide by L. So the DIDT is the inductor voltage over L, and we can substitute that in here for the derivative. So that's what I've done here. Okay now we can just rearrange terms. actually just take this L and put it over here to get LDIT. And on the right hand side, what we have, is in fact the average value of the inductor voltage. So we integrate over one period and divide by the period, and we get the inte, the average voltage like this. So what we've shown then is that, the averages obey the inductor equation as well. now you might say, well that's obvious, but in fact, it isn't, we have to show it. We don't have any extra terms, and the actual value of L is unchanged by averaging. you can apply the same arguments to the capacitors. And so for capacitor with the same arguments we get a similar kind of equation. Okay. So let's look at the mechanics then of actually doing, computing this average formally. the first thing I should say is that this definition of the average is not synchronized with the beginning of the switching period in general. this is a, this moving average is a function of time that doesn't hop from one switching period to the next. So what I've drawn is an inductor voltage wave form VL of T, where the switching period is starting right here. And then this is drawn at some arbitrary time T, that doesn't coincide with the switching period, and is right there. And so our averaging inner volt in, extends one half switching period, before and after this time T. Okay? So this is the interval that we have to average over, to compute the average value of the inductor voltage at this time, T. To compute this average, if we include the ripple then we ha, you know the computation gets more complex. And so what we do is apply the small ripple approximation. And what that small ripple approximation effectively says, or what we will assume, is that the values of quantity, of continuous quantities are taken to be constant over this interval. That the change over this small switching period is taken to be small. So the inductor voltage during the first interval is the input voltage VG. If it has ripple we're going to ignore it, and we're going to replace this VG of T with its average, average VG. Okay, so the D interval Is, is this one right here. The D prime interval is the rest of the switching period. Which, and there's some of it over on the left side, and there's some more on the right. [COUGH] So, during the D prime interval, we also assume that the inductor voltage during that, those two intervals, is the same. so during the second interval, the inductor voltage is the output voltage V, and we will take it to be it's average, or average V, which is the same value here, as it is here. And that's the assumption that is made with a small ripple approximation. Here's the same, same diagram. With that assumption then, the average inductor voltage is D times this, average VG for the D interval. Plus D prime times the average V, both there and there, add up to a total net time of D prime TS. And so we get D prime times the average V for the second interval. And, and therefore L times the derivative of the average inductor current, is d times the average VG plus D prime times the average V. A little more about this business of averaging. We can view averaging, or this, this way that it, it's been defined here as an operator. And this is an operator that removes the ripple, but preserves the underlying low frequency components of the wave form. And it's an important thing to do because it makes our equations tractable and simple. So we get a simple set of equations of our AC equations for the converters. And it's removing the, the switching frequency components, while preserving the magnitude in phase of the low frequency components of the wave forms. So really we can think of this averaging operation as being a type of low pass filtering. Where we're removing the switching harmonics of the waveform, and preserving the low frequency components. And we can actually take the Laplace transform of this averaging operator to see what it does in the frequency domain. So we'll do that in a second, but first to just plot it. These are computer generated plots, which I've shown two lectures ago, but they're real simulations of a, buck-boost convertor. the top waveform, or top axis are the gate drive showing the duty cycle changing from a lower value to a higher value. The middle and lower wave forms are the resulting inductor current and capacitor voltage wave form for the converter. The wave, the dark wave forms that have ripple in them are the actual simulated current in voltage including the ripple. And then the underlying thinner, smooth curves are what is calculated by the computer applying this definition of averaging. So what, what I've done for real, actually here is to take the wave forms with ripple, apply the averaging operator to them with the computer simulation, and plot the result. And you can see that the, the average quantity really does go through right, you know, right through the middle of the, the ripple, and it is in fact the correct way to, to calculate this moving average. One other small point I'll make is that if you change the interval of integration, so instead of say, integrating from T minus TS of, over 2, suppose we just integrate from T to T plus TS. What you're effectively doing is just shifting the answer in time. And it would shift the average forward or backwards in time, depending on the interval of integration that you choose. So centering the interval of integration right at time T is the correct one, that adds no phase shift to the waveform. And gives us, a waveform that actually go, goes through the middle of the the ripple. If you're, up on your Laplace transforms, you can, take the Laplace transform of this averaging function. and actually here's the answer. we have the 1 over TS term out in front that is this. Integration in the Laplace domain is dividing by S which gives us this S in the denominator. And then the 2 exponentials in the numerator are what make the would take care of the limits of integration, and make the integration period go from TS over 2 in the past, to TS over 2 in the future. Okay. You can let S equal J omega, and turn this into a transfer function, and plot it as a bode plot. We're going to talk about bode plots next week. But for now, you, I guess if your not familiar with that, you'll have to take my word for it. when we do that, we find that this G halve of S transfer function with S equals J omega, turns out to be this. It's a purely real number. There is no, no imaginary part, so there is zero phase shift in this operator. And it has a magnitude whose plot looks like this. So here I've plotted the magnitude in decibels versus frequency on a logarithmic scale, like in a bode plot. And, what you can see, is that at low frequency, say, for example at one tenth of the switching frequency, the magnitude is 0 db, or basically 1. And there's 0 phase shift, so the signal passes through this averaging operator unchanged. At the switching frequency, the magnitude of this quantity turns out to be zero. so it's like a notch filter that completely removes components at the switching frequency, and therefore it removes the switching ripple. It also removes harmonics of the switching frequencies. So at twice and three times the switching frequencies and so on, the magnitude is 0. So switching harmonics are completely removed. So this is really what we want. And this averaging operator then, preserves a low frequency components, even at half the switching frequency here Magnitude is a little less than one. So, there is some change, but it's not that great. But when we get past half the switching frequency there's a big change in the wave forms and in particular the switching harmonics are removed. So, you can debate whether we want to say that the, operator doesn't change the result at half the switching frequency or not. But certainly at sufficiently lower frequencies this averaging operator does not change the components of the waveform. Okay, we can apply the same arguments to the capacitor then. What I've drawn here though, is not the capacitor wave format some arbitrary time t, that I've simply started at the beginning of one switching period and, and drawn the wave form over one complete switching period. and this is what was done in the last lecture. So, if you like you can draw the wave forms as I did previously for the inductor at some arbitrary time T in the middle of the switching period. But the answer that you get for the convertors and cases that we're considering in this course is unchanged. You get the same answer if you just talk about what is the average over one switching period, and it's simpler to do. And so from now on, that's what we're going to do. What I, what I would caution you is to say that for some cases that are more advanced, but that we're not going to consider in this course. It is important to carefully derive the average as we did for the inductor wave form. And in particular, I'm thinking about current mode control. so for those of you who know what current mode control is, to get an up to date and accurate model in current mode control, we do have to carefully draw the wave forms at an arbitrary time T like this. But that's beyond the scope of this course. So the process of averaging is indeed well founded mathematically. and it works very well for the continous conduction mode.