Well, let's see. Can I get an extra? Is there an extra? Or the big one? So the big one is actually a first chapter in... I don't have it posted on the web. It's actually the first chapter in the book you can see on the last page. So that's kind of the starting place. There's the English translation of the book. But I made a copy of the first chapter just so you can, you know, if you're interested to read a little bit more about, you know, is that one cheat sheet expanded if you want? And also the page 22, if you turn to page 22, you'll see example five. It's basically the example we did last time with that x double dot equals u. u is constrained to positive and negative one. And then you see this combination of the two face portraits, right? One for equals positive one, one for equals negative one. And also, well, it gives a solution to that. And also example on the page 26 is actually the one I was trying to plot in class last time and I wasn't very successful with the circles. So kind of the harmonic oscillator that's controlled.  One is centered on one zero, one is centered on negative one zero. So the trick is how do you actually combine the two face portraits, right? So that's why I was saying it's a little bit complicated to do it by hand because I'll just, let's see, if you look on page 38, I'm just kind of skipping a lot of stuff here. But you see on page 38, you kind of see the type of switches that are maybe needed when you swing that pendulum, right? When you force that swinging pendulum and you have to hop basically on different, you know, maybe equals positive one, then maybe equals negative one. So it's kind of, you're trying to bring it to a full stop in the least amount of time. So you may need to do a bunch of maneuvers basically, okay? Depending on how big the initial momentum if you want or displacement, okay? And I only copied chapter one because chapter two starts with the proof of this principle. And it's not the most, well, that's kind of when it all started, but in the meantime there's been more, well, simpler quote-unquote proofs of this maximum principle. And we won't be actually talking about any of that. The switching is every time at each point of this exactly. So because if you look at these arches, these are arches of circles centered at plus one or minus one if you, it's hard to see, isn't it? But the centers are, it's kind of when you take a circle and you kind of move it, you stay on the same circle, but at the center of the circle you move it to plus or minus one, okay?   And to see how it's actually gets controlled. And the next time you swing a child on a swing, although they seem to have disappeared from the parks, I don't know why. Anybody knows? Lots of parks don't have no swings anymore. And trash cans, trash bins, right? We knew that, okay, so it's probably related. But next time you push somebody on a swing and if you try to stop that from swinging, you'll see that it's actually going to be exactly, you know, to do it, you almost do it, you know how to do it.  Right after it's reached sort of a, it passed the, you know, the vertical, right? But not just then, but just a little bit past that. So these little circles are, the switch times is kind of, you're mimicking that without realizing it. That's one. But I don't know, maybe one of these days I'll make a movie of that. Okay, so that's, so again I said that there's going to be, the proof is not going to be one of our concerns here because that's a clause in its own. I have a handout that I usually give it kind of early when one talks about Lagrange multipliers, but probably it's more appropriate now to give it. So this is the other like one page, two pages, in which I kind of say a few words about this whole field of calculus of variations that probably if you do classical mechanics, you're familiar with, but also in geometry there's a lot of this stuff. You're trying to find paths of least distance on surfaces, for instance. And then you end up with cost functionals. So functions of the paths, right? Or the trajectories. So here I think I give you an example of how do you find the shortest path between two points, right? So again I'm not kind of going to talk too much about this, but there is kind of some inherent equations that come with this L, which is called the Lagrangian of that problem. Okay, L is the integrand. So there are some so-called Euler Lagrange equations, one for each state variable, right? And if you think about this, this is kind of a second order equation in time. So think about it as Newton's law, right? So in fact, I think that the back of this page you're going to see how this is actually the same as Newton's law of motion, if it is a particle kind of moving in a straight line. Then I talk about how you actually derive this. So if you're interested, you can follow that. But the main point is that instead of treating a second order equation or a system of equations, you can look at a, well, let's say one equation, right? So for each of these equations, which is second order in time, you can split into a system of two first order equations, right? By introducing new variables, right? So these new variables are the momentum variables. Again, it depends on the kind of applications, but... And how you do that, you introduce this Hamiltonian, okay? Do you see a resemblance of what we do now in the maximum principle? You see that the type of, the way the Hamilton is constructed is basically these are the adjoint variables, those shadow variables, size, we call them size, right? Times the rates of change of the variables. These are the right-hand sides of the dynamical system, right? And then minus l, well, this is minimizing function or so to maximize it would be putting minus l. So this is the f naught, right? It's kind of the same construction. The problem here, I mean the only thing that we do different is we have control. So we have an additional variable u that's kind of hidden in the state dynamical system, right? And possibly in the Lagrangian, okay? But the important thing is to realize is that Hamiltonian equations, Hamiltonian system, excuse me, has this, looks like this. So it has, for each of the x1 through xn, there's corresponding psi1 psin, right? So, again, if you look in that, in that sheet sheet of the maximum principle, you recognize the second equation. What was the system satisfied by size? The derivative of psi with respect to time is minus the derivative of the Hamiltonian with respect to the state variables, okay? Now, we don't really see the first equation because, well, because the first equation is just a rephrasing of the state of the dynamical system, right? So for us, the dynamical system, by now you should memorize that cheat sheet, I think. Unfortunately, it's probably the easiest way or just heavy handy. Let me, so again, the, in fact, I actually wrote it here, right? So the deep side, the deep side JDT is minus the partial of h with respect to xj. And why is this happening? Why is the xjDT is partial of h with respect to size? Anybody? You don't sleep with this on your pillow at night yet? What do you think is, I say that? Well, what's the partial of h with respect to each psi? It's psi1, f1, right? Well, that's just saying dx1 dt is f1. So it's just a rephrasing of that original system, right? But again, I think, I mean, there's always this unease of, okay, what is that Hamiltonian? Why is it the way it is? Well, there's a lot of history and, again, a lot of analogies, but mainly it's just kind of a useful restatement, rephrasing of your dynamical system in terms of this new set of variables. Okay. Does it make sense? Probably not. Looks similar, right? Okay, and actually, if you flip the page, you will see an example of, again, kind of the most simplest example of how you can, how you can think of this, your oil and organic equations, well, you think of them as just being Newton's law of motion if it's just one variable, right? And how do you think about the Hamiltonian? Well, it turns out that it's just the total energy. That's the kinetic plus potential energy. All right. But again, it's a stretch to say that if you understand this, you'll understand the intriguing maximum principle, why it works. But I think, as I said, I'd like to focus on how it works rather than why and just be able to work a few concrete problems. And the last thing that I'm going to point out here is there is actually a, well, there's lots of resources kind of recent in the last year or so that kind of automate this thing. So one of them is this, there's a toolbox developed by a group in Slovak Republic, I believe. So you can read a little bit about this, of how it's actually computed. I will tell you that it's not, so this toolbox is not really working the, is not doing the steps that we do in the Pointerian maximum principle. But it's kind of trying to achieve the same goal of finding optimal controls for very similar problems. What I'll do is I'll just show you, once you can download these things to your machine. Let's see here. So it has kind of a long guide, but I just want to point to the type of problems that it can do. Okay, so let's take the simplest of all. So the simplest of all is this one, for instance, okay? So you see the dynamical system that's controlled, okay, by this u variable. You have initial conditions, right? And you have the cost function, okay, I'm not going to say what my reform is, but it's just basically the value of the second state variable at the final time and no integral term, okay? So no integral term. Oh, the integral, the integral is zero, right? So I claim that we can actually do this. I mean, one can do this by hand through the procedures that we can follow on the maximum principle. But if you want to kind of ask the computer to do it, then you can run this code. And again, I think it's not that, well, it's not necessarily that revealing to see the output of this, but I'll just say that it's very much like the linear programming. So it has lots of, well, it kind of searches, okay? It has a smarter way of searching through the various possible strategies for optimal control until it reaches a kind of minimum, I think, in this case, okay? So, right? So there are lots of parameters that one needs to set. It's basically set up that problem in this particular language. And then it has, I don't know how many iterations. I don't think there are too many because I ran this. But I just want to show you the output. Well, the output is actually, it's given here. So it tells you how each function is called, okay? And this is the output. So the output is the value of u versus time, I mean, in time, right? And the value of x1 and x2 in time. And remember, I think the one that was, the objective was to minimize x2 at final time t, right? So basically this value here, so starting with 1 and 0, that's the initial condition, right? You obtain a minimum value for x2 after this one time period. If you choose this kind of, no, this is actually funny here because it's not, I think this is a little bit not true, but I think this is continuous here. But it may not be. You may have a jump, right? So let's see. I think the, okay, so, yeah, see, I mean, there is something happening at some periods of time, but this seems to be continuous, okay? So that's the u, this is the x1, x2, okay? And if you look at the output, you'll actually recognize a little bit of that format of this limb programming. So anyway, this is, then you can extract things. I think you can extract the t, the u, p is the psi, okay? And you get also the parameters. And you can plot basically the, I forgot which one has, oh yeah, I think you can get the value. Okay, f value is like this is the value. That's the minimum value of the objective function, okay? Again, this is not actually an implementation of the maximum principle. But it's, you could actually be a good exercise to take that, take this problem and, you know, just do it by hand. You can do it by hand and figure out what the types of the optimal control look like, okay? So this is just one such code implementation. And now, of course, the other one which I put a link here is this, is that expensive package that actually implements the maximum principle, okay? So remember, what are the key things in the maximum principle, in the steps of the maximum principle? Well, first of all, they have to assemble this Hamiltonian. And you can do that no problem, well, let's say, if you have some sort of symbolic capabilities, right? But I think the more important thing is you have to take partial derivatives of this function with respect to x, right? So to actually write this in a code, what you need is a symbolic differentiation capabilities, right? So that's not always very pleasant. In fact, it may not be actually very efficient. So that's basically where most of the work is in those software to accomplish those steps, okay? And then, of course, minimizing and maximizing is not such a, you know, the key step which is to maximize the Hamiltonian based for a fixed T as a function of U alone. This you can accomplish with a, you don't need to have symbolic capabilities, right? You can do it numerically, of course. But, so let me, any questions or any comments on this? Okay, so let me open this one. So let's talk about, so I want to talk about this homework and then also talk about maybe one or two examples in that handout. So, okay, so let's see. Can you ask the question again? Okay, so there were two problems. The first one being it's a controlled, right? Just a, I mean, just a motion on a straight line. Initially at, let's say at x equals 0, but with some initial velocity. And the function that one wants to minimize is a combination of the distance. And it's not very correct to say it's a distance traveled, right? Because if the object travels back and forth, you know, but it's kind of distance from the origin. And plus another term, which is energy, okay?  It's like a four square integrated, maybe not, right? Okay. Right, so just because for simplicity, one can imagine this as being a penalty term, right? Penalty meaning that the higher the u is, regardless whether it's positive or negative, right? So the higher the force that you apply is, the bigger this term will be, right? So for instance, if u is taken to be 10 for the entire duration of the motion, right? This is going to be a certain positive number, right? The question is, can you lower that? So can you choose a different u to lower it? Well, of course, which u would lower this the most? u equals 0, right? But u equals 0 means no forcing on this. So this means this would go with zero acceleration. So it would be basically the velocity wouldn't decrease, right? So it's likely that this term will actually be quite high, right?  They would make this term lower. And then the combination of the sum of the two would actually be lower than when u is 0, right? So that's kind of the idea. And it's also a good exercise, I think, to, before you start actually solving it, to think about is it feasible? Is this problem feasible? Is it going to have a solution? See, because it's like in the linear programming. Sometimes, if you minimize a function over a simplex, that's kind of infinite, right? And it's infinite in the wrong direction. Then you may not find it optimal, right? For instance, if you want to maximize a function that is feasible set is infinite in the positive quadrant, right? Then you can go as far as you want from the origin and be, I mean, the maximum would be infinite, right? That's what I'm saying. So for instance here, if I were to maximize this, it would not be feasible, right? You would not have a solution because, yeah, you just take u to be big and negative, right? Let's say v0 is positive. So once it passes, it keeps going, right? And the higher you pull it, the farther away it goes. So this quantity is moving, it can be as big as you want, right? But it's not the same with minimizing. Anyway, I'm not saying this is always obvious. It's not always obvious that this problem could have a maximum or a minimum. But, okay, so the key one here is that there are no constraints on the control, okay? And I guess we should talk about what happens if there are constraints. But I'll let you kind of work through this until Wednesday and then we can talk about the solution. Yeah? Well, before spring break. So Friday is the last day, okay? But let me address that right now. So we'll work a problem that's very similar to this. You can see the differences and I mean the similarities and differences. So here's I'm going to hand you the sample midterm exam that I gave last time I taught this. So you can see, well, it's going to give you an idea of how the exam, at least the in-class part will look like. And problem number three, so once you get that handout, problem number three says the following. It's very similar to this one, okay? So let's work that one out. And that should answer your question, hopefully. It says take kind of the opposite. Well, it's a different problem. It says I have an object that I want to, it starts, you know, it starts at zero times zero and velocity zero. And I want to apply a control, call it U, right? So that's the same as before, right? You could be positive or negative. But objective is to maximize over all possible controls the following quantity. Okay, so it's not minimizing, it's maximizing. This is not a penalty term, but it's kind of a, well, wait, no, this is still a penalty if it's all negative, right? So the problem I call it here is maximizing basic accelerating, hold on. Yeah, that's to maximize its speed after a certain amount of time, right? With a minimum effort, energy, quote, unquote, possible, right? So you want to pull it as much, you know, as fast as you, I mean, as hard as you can, right? To be top speed, right? But you're going to have a penalty if you pull it really hard for a long period of time, right? So that may not be the best strategy to keep U as big as possible. And then there's no controls, no control constraints. So in principle, you could apply U to be 500 from time equals zero, right? But would you get, I mean, you will certainly get the maximum possible speed here, right? That's the velocity, by the way, at the final time t. But this will also be rather big, right? So the difference will likely not be maximum. Okay, so now you can see one has to be careful how you phrase this.  U minus U, that's just a matter of convention.  Okay, so can we do this together? Can you do this on an exam? Sure can. I think you can because, look, by the way, you're going to have access to that cheat sheet. That's going to be with you, as I said, day and night. So you can, it's good if you get familiar with it. So what are the state variables? Position and velocity, right? What is the state dynamics? x1 dx1 dt is x2 dx2 dt is U, okay? So what's the Hamiltonian? Well, it's a function of two shadow variables, psi1 psi2 and x1 x2 and U as follows, right? You take psi1 multiplied by the right-hand side of the first state equation, right? Plus psi2 times the second state equation plus what? The integrand that appears in your objective function to be maximized. So our j is to be maximized so we don't have to, we can just read the f0, right? It's minus one-half U squared. So again, this is just a look and identify type problem, right? So this was f1, this was f2, and this was f0, it's minus one-half U squared, right? Can everybody do this? I hope yes. So one can assemble the Hamiltonian, okay? Don't ask what this is. This is a function that's going to be useful in introducing these shadow variables, or adjoint variables, or co-states, whatever you want to call them, so that, right? So I'm going to use this just to remind you that. So this Hamiltonian is U so that dx i dt is partial of h with respect to psi i and d psi i over dt is minus partial of h with respect to x i, i from 1 to 2, okay? Okay. So now we could even postpone writing the system, the adjoint system, and just say let's just maximize h, okay? So it's like a game of plays. Like do I first have to find what psi 1 and psi 2 look like? No, right? I know I'll be able to find it at some point, right? But you can choose what you want to do first, okay? And if you're like me, I want to see first the optimal control, right? In other words, can I maximize this? Well, can we maximize this with respect to you? Keeping everything else fixed. And pretending we know psi 1, we know psi 2, we know x 1, we know x 2, right? Then we can find here, right? So we need to maximize h with respect to U over all U. So this is where it's important to ask yourself, is there any constraint on the control variable or not? And I think we said in the problem that there is no, okay? Now what if the problem would have constraints on the control? What do you think would happen? Right, so it would just be a constraint, one-dimensional optimization problem. Chapter one, section one or two, right? So you would look at this, this is parabolic function, right? Quadratic function. It has a maximum. If that maximum is in your feasible set and the admissible set of controls, fine, right? If not, you're going to just have to go to one of the endpoints. Which one? Well, depends on which one's higher, right? But again, this is not an unconstrained optimization. So what is this? Well, h of U is quadratic in U. So again, look for the vertex of that problem, right? So you take the partial of h with respect to U, so you get psi 2 minus U, right? And set it equal to zero. So here you go. We have found, well, maybe I'm skipping a step here. Maybe we should... This kind of step, we found that U has to be psi 2. Now, what does that actually mean? At each time, T choose the optimal control to be the value of this shadow variable at time T, OK? And now, all we have to see, what is that value? But we've actually went quite far. I mean, we've accomplished quite a bit. That is, we found how to find the value of the optimal control at each time T. Any questions on this? Anyway, your homework problem is very similar. It's just different signs, and you have to just be careful with the signs. But in the end, it's kind of the same steps, right?  Otherwise, you wouldn't find a maximum, right? OK. So now, again, independent of this step, you can do the other step, which is the adjoint system. So one was the state variables, right? And now it's the dynamics of the adjoint variables. So d psi, you can use primes. There's no... You just have to be careful. So I'm going to use d by dt. Psi 1 is minus partial of h with respect to x1. Do we have x1 in our Hamiltonian? No. Is it always like this? No, obviously not, right? Sometimes you will have... I mean, depending on the problem, you'll have different right-hand sides there. Also, the minus sign is important. If you don't put this minus in front of the partial of h with respect to x1 and x2, you're not going to get the correct answer. But psi 2 only appears here. Oh, excuse me. The x2 only appears here. So psi 1, right? And now, as with every dynamical system, you have to basically... Right? We want to find what psi 2 at each time t is, right? So I want to solve for this psi 1 and psi 2. Only psi 2 will play a role. But if we don't specify initial conditions or terminal conditions, right? We won't know for sure. I mean, we'll have to do something else to figure out those constants, right? Because of the problem is a fixed time problem, optimal control. So the capital T is given, right? Control. Our recipe says choose... Let me write it like this. Choose the final time, final terminal conditions for this system to be what? To be exactly the coefficients that appear where in the first part of your optimization problem, of your objective function. Okay? So again, it's kind of a... Take a look and identify those coefficients. Okay? So this is the important ones. These are the coefficients in front. So for our problem, what were they? J was x dot of t plus something, right? So this is indeed 0 times x1. So x dot was x2, right? And 1 times x2. So yes, the coefficients are 0 for psi 1. I mean, 0 and 1. So the terminal conditions will be psi 1 and capital T is 0 and psi 2 and capital T is 1.  You can get... You know, you can get tricked by appearances. So like in your homework, you have to make sure you have the right J, right? That needs to be maximized, not minimized. Stuff like that. And that will give you kind of the correct terminal conditions. Okay? So finally, what do you... You have this system and you have the terminal conditions. So how do you solve it? Just backward in time, right? But forget the backward in time. You just solve this and now you know how to find those constants that appear when you solve the system, right? So psi 1 is obviously constant. Well, what's constant? A terminal time has to be 0. So psi 1 is 0 all the time. And that means psi 2 is constant, right? What constant? 1. 1, because the final time T has to be 1, right? So, I mean, we don't call this a joke because it's not, but... So psi 1 is 0 and psi 2 is 1 by solving psi 1 prime equals 0 and psi 2 prime equals psi 1, right? And again, you solve it whichever way you can. You don't have to write it as a linear system, exponentiate, right? I mean, you could do all of those, but in general, remember you have this piece of mind that your adjoint system is a linear system of psi. So, if the worst comes to worst, you can employ those fancy Jordan conical forms and all that, right? Well, assuming it's autonomous. Actually, it could also be non-autonomous. In which case it's... It still can be solved, but no, it's just explicitly would be a lot harder. Okay, so why did we solve the adjoint system? Because we found out earlier that the optimally U has to take exactly this value that psi 2 takes, and we said psi 2 is 1. So this means that at all times, this is a constant, right? So conclusion is this is going to give you the maximum speed based on that penalty term of effort, of energy, right? I have to tell you that this is actually not the end of the story, because it's like when you try to find the maximum of a function of one variable. You take a derivative, set it equal to zero, and then do you walk away? No, you have to ask yourself, is this really a max, or is it really a min, or is it an inflection point? So this really is not... I mean, you'd have to have a second derivative test for this maximum principle. And the sad news is there exists one, and you really have to go through it to say that this is indeed a minimum, a local minimum, or a global minimum, or excuse me, maximum in this case. But I think one could reach that conclusion even through other means, for instance, right? I mean, how do we reach conclusion in our class when we looked at... You know, with two derivatives, we rarely did the second derivative test, right? With two derivatives, that equals zero, and then we said, hey, that's a maximum. How do we... We drew a picture, right? Okay, if the picture wasn't good enough, then we looked for other clues, right? So many times here it's... There's a similar kind of process, but again, I think it's a little bit beyond what we do. So what's the... Again, this is... I mean, you can say this is very simplistic, and it is. This gives you the optimal control. With the control comes with a trajectory, basically. So if you ask, what is the actual trajectory of the system or dynamics, right? So how about optimal trajectory? Well, by optimal trajectory I mean you have to look at the state variables and say, well, now that I know what do I need to apply, what is going to be x1 and x2, right? So you need to solve, basically, the system, the state system, the dynamical system, right? For the state variables, knowing what u is. So what's the best... Well, in this case, obviously it's just 1, so you just have to solve x double prime equals 1. Notice that I'm not even doing the system. I'm going back to just the original second order equation in this case. And of course, with initial conditions, x of 0, 0 and x dot of 0 is 0. I think this was, right? So x of t is... Is it t square over 2? You have to integrate twice, right? So the outcome of any optimization problem like this should be list the optimal control, u star, optimal trajectory, x star, and what else? We plot it u star versus time, we plot x star versus time. What else would you like to see? The costs. The value of the objective function, right? The maximum value, right? So j, max of j, right? Overall, u is going to be j evaluated at the u star and x star, at the u star and x star. Now, as I said, the optimal may not depend on x or on u explicitly, but in this case, I think it does, right? This is the derivative, okay? So this is what? We didn't compute what is x dot. It's just t, right? So this is capital T minus the integral, one-half integral of u we said is 1, so it's just 1, right? So it's one-half t, okay? Whatever that... Capital T is given, right? So again, this kind of completes that problem, saying choose any other control, your objective will always be below this. One of the two terms will be... Well, either x dot is going to be smaller. I don't know, there's a bound. There's going to be this bound, okay? In your homework, there's not going to be... I mean, this is not going to be the answer, right? Each problem has a different system, different... Okay, but the steps are identical. And that's actually... I'm not contradicting myself right now, saying that the steps are the same, but sometimes you'll be faced with... For different problems, you'll be faced with different challenges, okay? So, and that brings me to the second problem, and I want to talk about that in your homework. So let's kind of clarify here. There was no constraints for the control, right? But imagine we had a constraint for the control. That is, maybe you could not be one. Maybe you could be between zero and a half, okay? The question is, what kind of control would we have? Maybe most likely it's going to be a half, right? Or maybe not, who knows? One has to really go through this and figure out exactly, right? So you could have some extreme values for the control if you have constraint control. So last time we talked about a simple problem, so I guess I want to talk about this problem now, where you have only one state variable, okay? And you have a logistic growth, so that's like the fish population, and then you have a control that's kind of embedded in this harvest rate. Harvest rate is written here kind of obscure here, but it's really proportional to level of effort that you put in the fishing and the fish population, right? I mean, you can put a lot of effort if there's no fish. There's not going to harvest anything. And vice versa, right? So this is, if you think about it as like a predator-prey type model, right? It's how much you put and how much the fish are. I mean, it's kind of, it's proportional to the interaction between the two. Okay, so that's this, okay? And the objective to be maximizes of this form, and we talked about it, that's basically revenue minus cost, right? Profit. But it's some sort of community profit. You integrate it, right? Because your U may actually be time-dependent. So your H is time-dependent, so it's kind of instantaneous profit, right? It's like incremental profit. So for instance, this integrand could be sometimes positive, sometimes negative, right? That's okay, as long as the total balance in your account is maximum possible, right? So it's summed up, okay? Let's see, so what's the most important thing about this? Is that we have constraints on U, okay? And the constraints are, you know, I mean, it has to be positive, but it cannot exceed a certain value, okay? All right. So this problem is actually the same as the one for which you have the handout. So I want to kind of go through this. Now, by the way, remember, these are, I give you four different examples, and the first example, this landing problem ours is very similar to the one we talked about last time. It's just a step up in complication because you have, you know, you have some gravity and you have some friction, right? But other than that, so I'll let you kind of go through this. Insects of optimizer is kind of an interesting problem, but maybe I'll leave it for Wednesday. Ferry problem is actually quite difficult problem of steering basically a ferry across a river to cross a river, right, when you have some current. And again, you want to do it in minimum time possible, I believe, right? No. No, you actually, I think you want to, what is it? Yeah, you want to hit it but in minimum time. You want to reach the other end but not like forever, right?  You have to, right? So you want to point, you basically want to point the angle sort of in the, and the speed, the speed is constant? Yeah, the speed is constant. I mean, yep. That's okay. I don't know. Well, that's, okay, that's the first, I mean, that's complicated enough, right? Exactly. Next thing is, yeah, you have to control not only the angle but also the speed, you're right. Okay, so again, we'll leave this for Wednesday. Okay, so we have 10 minutes, so let's see how much we can do of this. So notice that this is exactly your homework problem, right? So basically, let's see how it's set up. Can everybody see here or no? So what you see is that actually there is something that needs to be done by hand. Just like before, and then at some point something needs to be done on a computer because it's just going to be too hard to grasp everything by hand. So how many state variables do we have? One. So the Hamiltonian is just going to be one shadow variable x and u. And all you have to do is just take this right-hand side, multiply by psi, I think I changed the order, but it's psi times this plus the integrand, right? The integrand, okay? Now, this looks like a mess, but the very next thing is to, I want to maximize that with respect to u, okay? Again, keep everything in the perspective. What you want to do, you want to find out everything as quickly as possible. So I want to find where can I achieve this maximum? Well, it's clearly a function, it's a function of u, it's a function of u is linear, so it will be either increasing or decreasing with respect to u, right? At some point it will be flat, but as you'll see, that's not going to happen, it's just going to be for an instant. So it's not going to, most of the t's is going to be either positive or negative. Who's going to, increasing or decreasing? Who's going to say whether it's increasing or decreasing? The coefficient of u, this expression, right? Now, again, this expression is, well, it looks complicated enough, but q, p, and c are, you know, p is a price per unit, c is a cost per unit, q is proportionality, I mean, constant of, that appears in the harvest rate, right? So these are parameters, I suppose that you know of, right? So the only thing that influences the sign of this coefficient is x and psi, right? At each time t. Well, can we leave with the idea that even though we don't know x and psi, that we'll find them later? And then in the meantime, conclude that u star, the maximum u is going to be, it's going to have to be one of the extremes. Either zero, if this thing is negative, right? Or the maximum that u can possibly be if it's positive, right? So that's what we say here basically, okay? By the way, this kind of control is called bang-bang because it's either one or the other, right? I always like to give this example when you drive a car, take a curve. How do you control your car? Do you do it continuously? Or do you do it discontinuously, right? Why do you do this continuously? I don't know, there's got to be some penalty. I think there's a penalty of your brain needs to work the least amount of time, right? It's always a constant adjustment. Of course, you don't do it all the way around, but it's sort of like this. Okay, so again, realizing that for certain problems you might have to work with the complicated expressions that come from the state system or from your objective function, I think you can move kind of forward and say, here's the system for Cyprom. Okay, so you see this? The answer is almost there. We know how we need to either fish or not fish, but we don't know when to switch, right? So this kind of expression is going to be, I think we call it the switch function, and someone will call it the switch function here, right? So it's a function of the state and the adjoint variable. Okay, well, how do we actually decide on this? Well, here's how you do it. You can just be playing. Okay, so, by the way, I think when you type this in, you should save it so you don't have to type it again. So the first one, go ahead. You can save this, yes. You just go here and say, save the current system. Okay, and then you can load it tomorrow. Okay, so what was Cy? Cy was a little bit more complicated, right? So Cy was minus p times q times u, right? Plus r times 1 minus 2 times x over k minus q times... I believe u. Let me make sure of this. Okay, here it is, right? So one has to type in correctly here. Is that right? Times Cy. Okay, and we have to put the parameters. So we need to put the parameters. q was 10 to the negative fifth, right? What else? p was, I don't know, some values 1. c is, I think we'd take it to be 1. Anything else you see? k, 150,000, right? 250,000. 250,000, thank you. Okay, so that's pretty much it. And of course we need to put... R. Oh, yeah, thank you. R is 205. So now we need to put x min and x max. So see, there's always a challenge. How should we put Cy, right? We don't know how big Cy is. So you can try various things, but in the end, what was that plot? Negative 1 to 1. Okay, so let's proceed here. Whoop. Okay. Oh, yeah, of course, u is the most important one, is the control. So what you have to do is take u to be 0, proceed. Okay, maybe arrows are not always good, so you try lines. Okay, and you get this picture. Okay, what is this picture saying? Well, the picture is saying, if u would be always 0, so no control, no harvesting, right? This is what the fish population would do. Well, and this is what upcy would do, right? But, okay, so... And then you change. So this would be right, right? And again, remember, you don't know anything about Cy, right? All you know is that Cy at final time t has to be that constant, right? That's the coefficient in front of there in the objective function, which is 0, right? So you want that, you know that Cy has to be at final time t equal to 0, right? Well, obviously, you're never going to be able to find Cy to be 0 unless you start with Cy equal to 0, right? But that's the whole point, is that you're going to have u to be also not 0, okay? So the important thing about this is now to do the same for u equals maximum 5,000, right? And then know how to combine the two. How do you combine the two? When do you switch from one to the other? Well, it's when that switch function has switches from being positive to negative. And that's done by going to solution and doing level curves, plot level curves, and just put your function, which was... What was that function again? I'll be done in a second here. What was that function? Oops. Switch function. Qxp minus Cy, Qx times p minus Cy minus c, okay? And you say let p plane decide now. I only want to see where it's actually 0, where it's positive and where it's negative. So you can put negative 1, you can put a vector like MATLAB, okay? So you see what happens? You see basically the regions where Cy is positive and where it's negative, right? It's like plotting a inequality, right? Okay, so now the tricky part is to erase all solutions. And now remember when this is... When is u0? When is the u0 valid? The switch function is negative, right? It's negative above this curve. So how do you get that phase portrait? If you hit here, you see if you hit here, the best thing is to hit it on the curve, but you want to be able to erase, take an eraser, actually erase the one that are not valid, right, below this. So the way I do it, and I don't know if it's the best way, but here's the following. Is I take the solution direction to be forward, okay? Until it hits a certain point, and then I have to do the... Well, of course, here is... There's no issue here, right? But there's going to be a certain value where I have to do backward. That, okay? It's really a bad tool. From that perspective, it's really a bad tool. So you have to be able to know which direction you should go so that you stay in the valid region for this, right? Same thing with the other one. The last thing is, how do you decide which one goes where? And I'm out of time. So I'll just display this, and if you need to leave, leave. Basically, what you need to do is you need to follow the... Start with initial condition. That was 150,000, right? Initial condition, initial population. And see if you can start with 150,000 on the X so that at final time, T, you reach cycle zero. It's kind of a game you can play to some extent using the face portraits, the combination of the face portraits. But we'll continue on Wednesday on this, okay? But you can kind of try to reproduce this at least because your homework is to take this but change the initial condition instead of 150,000 to 50,000 and 200,000. So do some sort of sensitivity. Then change the price and then change the cost. All of this will actually change the conclusions. The question is how much? Thank you.


Well, when you talk about ember months, you talk about traveling to the village, traveling to wherever your family is, traveling to where you haven't been for a very long time. That's the attitude of a Nigerian. You travel to your place of origin when it is time for Christmas and other festivities. Reason being that at that time almost everybody is traveling back. So you get to see your friends, you get to see your family members who maybe one thing or the other have taken out of that village. So people like to travel. In the east we have august meeting, we have all sorts of things happening in the south and all that. But now traveling seems to be a luxury that a lot of people cannot afford. Just two years ago what used to be airfare, transportation to go by air from Lagos to Abuja or from Lagos to Oweri for instance is now not even enough to take you by bus to your destination and it is very worrisome. So we're looking at transport fairs going up by almost three times in the last 12 months and that's being very modest, saying just three times in the last 12 months. Because just imagine from Lagos to Kalaba in two years ago used to be like 21,000 to 25,000 Naira. Now to go to Kalaba is from 30,000 upwards, especially at this time it's about 35,000. So you can just imagine by bus that's what I'm saying now, but the other one was by air. So we don't know what is going on in the country. Well Dr. Laume 4 maybe has some answers for us. Dr. Laume 4 is a political analyst and he's joining us this morning. Dr. Laume 4, good morning and welcome to the program. Yeah, thank you. Thank you for hosting me. I can hear your litany of lamentations and that is what the economy has become. Excuse me, you know the situation we have found ourselves in has been predictable. Since the unleashing of the two major headwinds on the economy, I call the headwinds because of the tsunami impact they have had on the economy. The Naira flotation and the unplanned and all-regulated removal of the first subsidy. That's just the truth. And what has impacted the most on the transportation cost is a further subsidy removal. Because if you recall, December 2022, we were buying a fuel at 197 Naira per litre. And now you can't get it anywhere for less than 620. You know, in Abu Dhabi here, at both 660 and consistently 640, so you can see. And here is Abu Dhabi, if you move to, if you move further north, it's even much more the same. And it's the cost of fuel. So the transporters cannot help it. They just have to adjust the price of the transport fare to enable them to be able to buy fuel at the prevailing price. And then they'll be able to have something to show for the journey. So that's where we are. And for me, essentially, we need to pay attention to what we advised the government much earlier. We told the government you cannot remove fuel subsidy without putting certain things in place. And some of the eight months down the line, nothing has been put on ground by government. A little they did, they called a palliative, gave some state governments some money to do this and do that. And that is not what will cushion the effect.  It has been a standing tourism, an internal tourism arrangement that Nigerians have made for themselves.  There are reasons everybody plans to travel. Most lands are Christians. It's not even a Christian celebration alone.  Some families, you know, a significant number of families have their members outside Nigeria. And they all walk towards the coming home to catch up again, review what they have done in the year gone by, and then take some important family decisions. Do what you may call cost stock taking, they take stock, see members of the family that needed to be supported, see setting up noted family issues that needed to be resolved. There are certain things you cannot resolve until people really come together. And December is just it. Everybody walks towards December. So, you know, you can see that there is no measure in place to really mitigate the impact. I had expected that even some state governments ought to have tried to use them, you know, do some kind of intervention to help the transporters that will be bringing people to their states, cut down on the cost. But for you to do that, you need to offset, you have to provide some money for these transporters. Because the charge they are bringing on, it is mostly a justice time. And even those, you know, some of them also hike is the trend. Actually, every Christmas, they top up. Look at it, look at the FA now. If you, you can go online to go to one hour travel, particularly from Lagos, from Abuja to the eastern part, they retort to get this about half a million now. You know, half a million, five hundred thousand retort to get if you want to move from Lagos to anywhere in the east, move to Lagos, move to Abuja from anywhere in the east, or move from Abuja to Lagos, advise us. The cost is as high as 250,000 one way. So if you double it, you know, you do demand. You see that we're talking about half a million.  It's more than three times over what it used to be. You know, initially, we were struggling between the 75,000 to 1,000 100,000 for a one hour flight. But now from that 100,000, we are not talking about the 250,000. I think it is too high. It's really too high. And I believe that the aviation sector also have actually, you know, we did it into this. I really don't know why, you know, people are allowed to profit here in the economy. I believe that should be a law that will be able to stay in the camp for the for the masses. You have what you call a consumer regulatory agency here. You know, what is their job? Can they really negotiate on behalf of Nigerians? I want to believe that that is why that agency is put in place by government. You know, prices should not be arbitrary. It's very wrong. It's not done anywhere. You know, and it's because government, it has not really played its role. Government has not been able to stand there for the masses. That is why you have government. You have government because there should be law and order. So why should people be allowed to profit here from the misery of Nigerians? Because that is what I call it. They are worse than the misery. And because they know most Nigerians are under pressure to travel, even those who do not want to travel, they have very serious reasons why they must travel. So the entire cities they have will go into transportation. When they get there, the celebration will not be as many as it ought to be. And then you also add this. There is also a bigger problem of, you know, beyond the government's not standing in the gap for the people. There is a bigger problem of a pollution we see here. In regards to when government agencies that ought to regulate, you know, their job is regulation and they fail to regulate, you will see pollution in the mix. You will see that they are actually, you know, colluding with the service providers.  So I blame the government here. Look at the highways. There is no palliative measure because when you say you can travel by air, then the alternative is to travel by road. The highways, you know, the highways, most of them are impossible. Most of them around the country. You know, so even security is not there. So people are condemned to travel by road. A journey that would take perhaps five hours would take 10, 12, 15 hours. That's the situation now because the roads are bad. And you are doing so. You are traveling by road. Also looking at the insecurity kidnappers and the orders that await the road users in Nigeria. So even from government intervening in the area of ensuring that there is fair pricing, you don't have that security on the highways. You don't have that. The roads are not maintained. You know, you don't need to reconstruct the roads at moments like this. But you can make them possible. You know, they fill the potholes. Just simply fill the potholes. You know, you don't need to reconstruct immediately. You will fill the potholes so that the roads will be fairly motorized. But it's not done. So what is Nigerian government actually offering Nigerians? I don't see anything because the reason why you have government? Two things. It's the security of their lives and their property. And of course, for the welfare of the people. So security is lacking. You know, welfare of the people is lacking. So what is the justification for government in Nigeria? That's the question that is begging for answer. And nobody is coming up to tell us whether we really have any reason to say that we have a government. Because they are not on top of their game. They are not living up to the expectations of Nigerians. And the Nigerians are not happy with the situation at all. I do not know whether some of these agencies need to be scrapped or something because if you have mentioned that there are agencies that are responsible and they're not working, what is the need, spending money on them? Even when we're talking about regulation in some other climes, in some other countries, even housing is being regulated, you know, rent. When you're renting a house, there are some laws that are put in place. But in Nigeria, the landlord can wake up tomorrow morning and tell you that he is up to the rent by 300% or more and tell you that if you don't want, you can get out. And it gives you maybe one month notice and that's the end of it. Nobody does anything about it. So we're just left here. That's my point, precisely my point. You know, you have government to regulate our lives. That is why you see, ordinarily there will be no government. Why you have government is to ensure law and order, is to ensure fairness, is to ensure security, is to ensure, you know, what we may call fair deal for the weakest segments of the society. There are people that can take care of themselves.  If you go to the airport, they will be falling over themselves. But that is not the normal society. In a normal society, government will be there to ensure fairness and we have the statutory organizations, bodies, agencies. Nigeria doesn't lack laws. Nigeria doesn't lack agencies. What you lack is committed patrols, professionals that will run these agencies. Run around the agencies to regulate and ensure a better society. They appropriate the platforms for their personal gain. That's what you get. So when you find the service providers, the heavy anyhow they like, is because those who should regulate them are colluding with them. That is where this whole nonsense is coming from. If you go to, I talked about the consumer regulatory agency, the consumer regulatory agency is the one, particularly empowered by law, is a statutory agency that should stand in the gap for the people where it comes to pricing delivery of goods and services. It takes like standard organization of Nigeria, NAVDAC, and so on and so forth. Their job is not pricing. Their job is to ensure that what to be called integrity of the goods, of the services, and so on. But to ensure fair pricing is consumer protection agency. And they don't do this. You can't find any, in fact, you can't even tell who is their DJ. Somebody knows him or her, nobody knows whether he's a man or a woman, because they're practically not there. They're not doing anything. At moments like this, they ought to wade into what has happened in aviation. Organize private transporters. They ought to be negotiating with them to understand what should be fair pricing. Well, federal government has promised us palliative in the form of buses. They even said it at COP 28 that they are going to give, sometimes in the future, 100 buses to Nigeria to 220 million people to ply. 100 buses that are not even enough for Lagos state will be given to Nigeria. That's it. So you can say that it's all, government is simply not there. That's just a possibility. And this is not rocket science. It's not rocket science. And that is why I keep blaming NLC. In a situation like this, NLC ought not to have allowed the government to remove some city without putting certain things on the ground. But they allowed it. And you see, in a rebel land, we say that when you hold a strong ban down, is the time to collect the budget. It's not where he stands up. If he stands up, you lose all the advantage. Because he says he's a strong man and he's also armed. Government is like that. And you allow government to remove subsidy. And you're not coming to call for strike and all that. You can see how ineffective the Judah, Nigeria and NLC has become. It's because they did not insist on certain things when they should. And, you know, you cannot say that you are moving from subsidy when you have not done anything about the CNG-compliant buses. If you have CNG-compliant buses, you don't see a few of them in Nigeria. You don't even have the places to convert your vehicle to a CNG. A few of them you have. You may have to spend as much as $500,000 on that to do that. Where does that leave the Nigerian masses? You know, so the worry some of us have is that what ought to be the fair deal for Nigeria and their masses is to be guaranteed by government.  That is where you have organized labor come in. NLC. You don't have NLC. You don't have opposition political parties. You don't have even Nigeria and their students union. NAMS. NAMS has NAMS, the government power startup. So you don't have Nigerian buses as simply not organized in any way to be able to even raise their voice. There's no platform left anywhere. I remember when we were in the late 80s and early 90s, NAMS, National Association of Nigerian Students, was very, very vibrant. We stood up to the military. And today, NAMS is a government power startup. As we speak now, we have two presidents of NAMS. The other day I saw the other one driving a gym. A student driving SUV. You and I know he didn't purchase it. Who did? Whoever came in that gym will tell him what he should be doing as NAMS president. So the whole thing has collapsed. It's a total mess we have found ourselves in. And I don't even know what to recommend anymore. Because, like I said, you don't have opposition political parties that should be the ones even fighting and shouting. There is no BDP. There is no labor. There is no strong leaders. I think it's not one. Obvious, not one. So you don't have, you really don't, we don't really have democracy. The situation is so dire that Nigerians are really, Nigerians are not just, you know, on the short end of this take, they have, Nigerians are lost in the shuffles. They are forced to provide your house, your road, your school, your hospital. You are, you know, Nigerians are compared to construct roads. If you go to my town in Anambra State, all the roads in my town, if you have, if you have 30 third roads in my town in Anambra State, 27 of them were constructed by indigenous of the town. Where is government in all this? Well, we do hope that we will eventually have that government. But what you have mentioned about not having democracy, what you have mentioned about democracy should be a topic that we should still be look, we should start looking at very seriously to define what kind of democracy we have in Nigeria and what kind of democracy we need in Nigeria. But unfortunately, this is where we have to draw the curtain for today, doctor. Thank you so much for being a part of the program. Thank you. Like I said, let the agencies sit up. Particularly, the consumer regulatory agency must wait in and ensure fair pricing for Nigerians. That is why they are set up. They should do their job of its craft. Thank you. It's simple. Thank you very much. Thank you. Okay. We've been talking with Dr. Lome for political analyst, and we were looking at the fact that the prices of the transport phase have gone up at least 300 percent. And that is a very worrisome thing. If you travel to somewhere and you want to come back after the end of the year to meet your family, then you cannot do that anymore. Even when you're staying within Lagos and if you have, for instance, you're staying in Oba and you have a fiance who is in Badagri, that's a very distant relationship. And it might even end that relationship because of the situation that is happening right now. Moving from one point to the other has become a problem. Maybe that's why people are resorting to bicycles. If you come to the island here, you find a lot of people riding bicycles. At least Lagos state government has not banned motorcycles. But if they had not banned bicycles, if motorcycles were still something that people could use at this time, I'm sure the road would have been littered with motorcycles and everybody trying to at least get a motorbike that will consume less fuel and can take you from place to place. But now in Lagos state, no motorcycles are allowed, so people are resorting to bicycles. So that's the situation we are in. If you cannot trek, then you buy a bicycle. That's how we are right now because you have to work, you have to put food on your table and all that. Well, let's take a short break and when we return we'll be looking at another very turning issue in our polity. Stay with us.


So we're here at Craigivet and Fire Station, where the Premier has just announced the reform, restructure of the fire services across Victoria. My message is to CFA people. Our first message is that I think we have some of the most professional, some of the best firefighters, that's career and volunteer firefighters in the world. And I quite confidently say that, that doesn't change. We, I, need to assure our community, our Victorian community that the professional service that we provide yesterday, today will continue to be provided tomorrow. I think our focus needs to be on supporting our people. That's our career staff and our volunteers. And we'll get out and about to talk to people as much as we can. It's a fairly big announcement and there's a lot of detail and a lot of questions I think I have and I think we all have. And we need to work through that through a process over a period of time. But the priority at the moment, the sure communities that will be there and make sure we're supporting both our career staff as a transition, our volunteers, particularly integrated stations, and an understanding that it looks like the rest of it, as CFA says in place, which is good news. But let's have a look at it in a bit more detail, but let's make sure we provide our people the support along the journey and our communities the confidence that will be there. I'll try and keep you posted as we go along. Thanks. Thank you.


Hello and welcome to the next lecture in the course on introduction to computer and network performance analysis using queuing systems. I am Professor Varshaapte and I am a faculty member in the department of computer science and engineering IoT Bombay. So today we are going to start something new which is closed queuing systems. So far we have been learning open queuing systems. What does that mean? That the source as to like where does the request come from really and where is it going? This is not explicitly modeled. All we care about is that there is some kind of a rate of arrival, some lambda rate into the server, there is some service rate and then we have various metrics based on these, this kind of focus of the system. But in some cases it is actually important to model the sources of where a request is coming from.  And there is one more very interesting example as to in a, let us say in a computer this is just representing a computer there is a CPU, suppose this represents a CPU and I am just going to draw something like this for threads, these are threads. So this is CPU let us say there is also of course IO in the computer, there is some secondary storage and there is network, there is some network happening. So if this is some sort of a thread pool of a web server for example, these threads what they are going to be doing is they are going to be in a kind of a loop where they use the CPU for some time. Then they are done then they make an IO call either to the network or to the disk and then they basically have to wait for IO, they have to wait for IO. So means use a different color here. So this thread will be here for some time then it will go away from the CPU and be here or be here, be here meaning it is going to stay of course just in the computer but it is going to be waiting for an IO request or waiting for a disk IO request or waiting for a network IO request it will be leaving the CPU and then it will again finish this and come back to the CPU. So there is a fixed number of threads often in a web server there is a fixed number of threads and they are going to be in this sort of a CPU burst and wait for IO loop and here also you can this also you can think of as a system where you are modeling the source, the source of requests coming to CPU is this is a thread pool, this is a source and in the sync also where does the request go after it leaves the CPU it also goes back to the thread pool in a state where it is either doing IO or disk IO or network IO. So whenever there is a fixed number of requests that come to a certain resource use that resource for some time then leave the resource and then are idle or doing something else but are going to come back to that resource. This system is considered closed, the reason it is called closed is because if you think of it as if you think of this whole thing we represent it like this with this kind of picture, this is the source and actually in a way it is a sync also this is where the requests come from this to the server and this is where the request go back and why is it the source and the sync because these are basically the clients. In the examples that I gave here, this is either a student student 1 to student m or it is an agent 1 to agent m or lastly it can be thread 1 to thread m, these are just examples the generic view is this that there is a server, the server part is identical to what we have seen in open queuing system, there is a buffer, there is a number of servers, there is a service time, there is C number of servers. Only thing we actually assume in closed systems that the buffer size can always be sized to be greater than the number of these so called clients because if this is known, if this is fixed then why would you make the buffer size less than this. You can of course, advanced models will have some kind of a can allow for the buffer size being smaller than m, but in our course here we will only be studying systems which make the simplifying assumption where the buffer size is assumed to be greater than m. So this is the basic structure that there are these, there is this station, there is a client station and this is the server station or we can call it the client node or the server node. At the client station, it models basically the users, often they are actually human users who are issuing the request. So if it is a student or an agent they may be having, they may at their client they probably have a browser on which they are clicking on the link and when that click on the link happens then the request goes to the server, then the server fulfills the request and then the response goes back to the user. If it is a thread then whenever the thread actually is done with its IO or its wait for IO that is when it goes and uses the CPU and then comes back and sits in the thread pool basically. So this is basically either modeling the set of students or agents or a thread pool and then there can of course be various examples where this sort of a scenario is done, we will be looking at examples. So again the source and sync of requests which is the users are explicitly modeled. The users are in a think, then request and response loop with the server. What is the think? These times where after a response is received and the time when the user or the agent or the student or the agent or the thread is in a way idle before they send the next request that is called think time because it is actually not an idle time. In the example of let us say a student interacting with the course website or the call center agents interacting with the complaints website what is actually happening is you are processing a response, you process in your mind or you can say read or think about the response. So if I click on the website some page comes to me I am going to spend some time reading that page before I click on the next link that reading time is called think time. You can say that it may not really be think time it may be representing a read time in case of threads actually obviously threads are not people. So they are not thinking what they are doing is they are actually somewhere else they are waiting for some IO with some network or disk IO. So they are with respect to the CPU they are doing something else that is all they are just not issuing a request or they are not actually waiting for the waiting to use the CPU they are preoccupied with something else the same thing when the student or a call center agent gets a response they are preoccupied with reading it when they finish reading it they will issue the next request. So this is very important the users are in a think request response loop with the server meaning at the end of your thinking period you issue a request then you get a then the server takes its time to send back the response once the response comes you again send go into a think mode meaning you are reading the response and then you send the request. So if you think of a user timeline let us draw a user timeline here the user let us say which starts with sending a request when it sends a request then there is going to be this let us say this much time in getting the response this is the time that the server needs to send the response then the user is going to think the user may think for a longer time. Then again issue the request request is issued here the request issuing activity is not assumed to be taking any time you just click on the link that is the issuing of the request that is considered sort of instantaneous and then again you wait for the response and this loop continues. Some important assumptions for our sort of simple model is that we only issue one request at a time this may not be very realistic because when you are browsing a website we often click on many links at the same time we open many tabs. So those are of course advanced models for the purpose of a simple model to study in this course we assume that the only one request is issued at a time. So this is the basic model the parameters of this model are basically the number of clients then that is usually we denote by m so that is this then there is a think time we denote by h the other parameters are like I said at the server side the parameters are the same we have C servers we have the tau is the service time mu is equal to 1 over tau and here we have explicitly shown that the arrival rate is no longer a parameter for a closed queuing system and we are also not considering a buffer size we can consider a buffer size for advanced models but in our examples of the models that we study in this course we are not considering that. So for this system again we ask a question as to what are going to be the matrix in the matrix case again there is basically no difference you are again going to be interested in the same things what is the response time that is the most important what are the user you know when the user clicks on the link when is the user going to get a response then waiting time how much did the request spend in the queue waiting what is the throughput of the server these two are going to be important to the user the throughput is going to be important to the server system owner similarly the server utilization is going to be it is a system metric which is important to the system owner of course number of customers in the queue and the queue length these are related matrix that the system owner is going to be interested in. One clarification of also of one assumption is that although there seems to be some kind of a travel here of this response back to the queuing station here and the request going from here to here in reality there might be a network on which this request travels but in our again the simplistic models that we are going to study in this course we do not assume any network bottleneck or any network delay. Whenever the server finishes the request basically in 0 time it goes back to the user. So, this is some of the matrix and the assumptions this is summarizing the matrix as usual we have number of jobs in the system that is going to be this part and here queue will be over here just this part waiting time we know response time has usual definitions throughput server utilization R cycle is a new metric for closed systems R cycle is actually the time for a request to do a whole cycle. So, we can pick any point we can say the point at which request was issued request issued. So, this will include response time and then since this time is 0 it includes response time and then there will have to be think time. So, basically the cycle time is always going to be equal to response time plus think time. Again, I have explicitly shown that since we are not a modeling limited buffer we are not considering blocking probability or loss probability at the buffer. So, the question is how do we calculate this? So, we are going to take a simple example because it is always easy to understand things in terms of an example. Suppose a single threaded server it could be a web server or something is running on a one core CPU. So, we have a single. So, basically this is just to make it a single server system and suppose there are 180 clients again this could be students in a computer lab. This could be some kind of a course management server. So, the student there are 180 students in the lab, they click on the link and then the web server does some processing for that processing let us say the service time is 5 milliseconds and sends back a response. Once a response comes let us assume whatever it is that the students are doing they need only one second to read the response and then they send the next request again. So, this depends on the setting what is the realistic think time sometimes you might need many seconds or minutes to read and process the response in your mind. Sometimes you could just be doing something routine and you are just clicking on the link waiting for the page to load and then you just click on the link again. So, this is just the example and we want to find all our usual metrics the throughput, CPU utilization, waiting time, response time, Q length at server and number at server. So, remember the various laws we have at our disposal. We know utilization law, we know little's law. These are the two main laws we have. Question is how do we use, how do we reason about it here? We do not know there is no such thing as an arrival rate because the arrival rate now is no longer fixed. The arrival rate here depends on how many users are thinking versus how many users are at the server either waiting or being serviced. For example, out of these 180 clients suppose a server currently is some this service time is just an average length. This service time is just an average suppose lot of requests with the large service times are have ended up getting queued here and so out of 180 almost 100 requests are queued here and only 80 clients are thinking. So, if 80 clients are thinking the rate at which in that time that we can expect requests to be coming here will be very different as opposed to suppose only 20 requests were here. Only 20 requests were here and 160 clients were here. So, if there are 160 clients about to finish thinking and send a request that expected arrival rate will be much higher. So, the point is that the arrival rate is not constant. So, the standard tools that we had where we could write that utilization law is equal to throughput multiplied by tau and then for an open system we could just write it as arrival rate multiplied by tau. This basically this method is not available to us because we do not know what is small lambda. So, a completely different trick and very interesting approach is used to model closed systems and show this. So, what is done is as follows, there is a very innovative definition of little slaw region. So, the little slaw region is drawn like this where you are drawing this kind of a funny shape where you just make a little gap here, this is a shape here and just draw it over in this shape again. This is the shape and you are doing like this here. So, that there is a bit of a gap here and what this represents is that a request that leaves the server briefly leaves the system and almost instantaneously enters again, instantaneously exits and enters the system. So, this is because you want to have some kind of throughput defined if you want to apply little slaw. For little slaw you need some region in which something is coming and something is going but if you look at this whole region out of the 180 clients they are either thinking or they are at the server. So, it sort of looks like nothing leaves and nothing enters unless you make some kind of an artificial boundary. So, this is a trick that is used and you will see how it becomes very useful. Remember that this is kind of a instantaneous entry and exit. So, you do not expect anything to be here in this region which is not inside this boundary for any particular amount of time. But the flow through this region is going to be the throughput. The flow through this region, the request rate through this region is going to be the throughput. So, now for this little slaw region this is the throughput we have the think time here and we have the response time here. So, if you have to apply remember it is I will write it in a different color here the n is equal to lambda r. So, the r here has to be the time through the region. In this case what is the n and what is the lambda and what is the r let us think about it. If this is the boundary then the number inside this region, the number inside this region is always going to be 180. The clients or the requests are either at the client station in the think mode or they are at the server getting serviced. One way or the other there are going to be 180 requests inside the system. Remember that this is supposed to be sort of a zero time transit, instantaneous exit and entry. So, always inside this region we know there are 180 requests. Now, this 180 is going to be equal to this throughput whatever it is we do not know the throughput. But we know that this throughput is the same as this server throughput because that is the picture tells you that that the server throughput is the throughput through this region. So, that is lambda and what is the time through the region? The time through the region is actually response time plus think time. We do not know the response time yet. So, we are just going to call it r and but we know the think time, the think time is given in this example as 1 second.  We get 180 is equal to throughput through this region multiplied by response time plus think time. So, this is just summarizing this the number of requests in the little slow region is 180. The throughput through the region is some lambda we do not know that yet. The time through the region is response time plus think time. And according to little slow the number has to be throughput multiplied by time through the region.  And you can rearrange it and write it as throughput is equal to 180 divided by r plus 1. But we still do not know lambda and r as usual whenever we use little slow often we end up not really knowing throughput or response time but we can relate it. So, in this case let us try to first find the asymptotes maybe we can actually find the values of throughput and response time for the asymptotes. So, let us start with response time. So, this is m equal to 1 that is only one user. So, if there is only one user remember there is one CPU service time is 5 milliseconds think time is 1 second. So, response time with only one user obviously there is never going to be any queue. So, the response time is going to be equal to the service time and this is going to be equal to 5 milliseconds. Now, we have response time we know the think time. So, we can write the throughput. So, throughput is going to be equal to 180 divided by we can write it as 0.005 plus 1. This is request per second. Now, we have throughput we have. So, waiting time of course is going to be 0. There is only one user there is no queue waiting time is 0 queue length at the server is also going to be 0 never going to be any queue there. CPU utilization basically we know it should be throughput multiplied by tau that is utilization law always applies we know the throughput it is 180 divided by 1.005 multiplied by it will be multiplied by 0.005 that is the utilization. Number at server we can get by little slaw little slaw applied to this region remember that we got these sum of the values by applying little slaw to this region shown in the red. But if you apply little slaw just to the server then we can get the number at the server. So, that will be equal to throughput multiplied by response time through the server only through this part and that is R. So, this is equal to 180 divided by 1.005 in this case again multiplied by service time itself just written in seconds. So, this is basically the these are the low load asymptotes we were able to get values for everything. Now, let us check the high load asymptotes. What will happen when the number of users keeps increasing? One thing we can say no is that throughput is going to go to mu as usual we know that this should go to the maximum. If the number of users keeps on increasing the maximum that the server can do is whatever its capacity is which is 1 over tau this is 1 over 0.005 milliseconds that is seconds requests per second 1 over 0.005 requests per second and that is 200 requests per second. CPU utilization clearly when the server is going at its full capacity this is going to go to 1. What is response time number at server which of these can be right? Again let us now use the little slaw as applied to the whole region. So, we know that inside this region there are going to be m clients they are going to be large number but let us use the number m. We know that the number m is always going to be inside this region and this is going to be equal to the throughput multiplied by r plus 1. So, but we know here that the throughput is going to go to 200. So, one thing we can write this as r plus 1 is equal to m by lambda which is equal to m by 200 and this implies that r is equal to m by 200 minus 1. So, we are not able to get an exact number and because clearly as m goes to infinity r is actually going to infinity there is no doubt about that there is not a limited buffer. So, r is going to go to infinity. So, that is not a that is not in question as m goes to infinity r goes to infinity. But we know a little bit more about how it goes to infinity. Think about it a little bit when you can see that the function of r as a function of m is like this what does that imply that implies this is linear with slope 1 over 200 seconds. So, this is a very nice result we get that we can actually express r in terms of m with a very in a very simple relation.  So, that we can just substitute that and get in this case is going to be m divided by 200 minus 1 minus 0.005 to just convert it to seconds. A number at server again we can get by throughput multiplied by r. So, that is going to be equal to 200 multiplied by r. So, again here we can get one or the other. We do not really know exactly sorry. So, 200 multiplied by r which is equal to we can multiply this this is going to be m minus 200. So, again we can see that the number of if m is going to go to infinity then the number that is queued at the server will also of course go to infinity. So, it but we know the way that it is going to go to infinity just like r we know the know a little bit more about how it goes to infinity similarly we know about the throughput also. So, this is just summarizing everything that we just learned the throughput for the low load asymptotes 1 over 1 plus 0.05 you can go over all of this we just derived all of these things just now and then the as m goes to infinity all of the values that the matrix take the response time is m divided by 200 minus 1 we just derived that number at server will be this r multiplied by throughput and so on. So, we will just take a pause here and we will continue this analysis for general values of m and we will also discuss a very important metric for closed systems called saturation number. Thank you.


Rickland, however, I assume you're going to be taking proxy to mean, takes what foreign policy decisions the US wants, yes, in large part. So I'll use half of NATO for their refusal to get invaded in Iraq, and I'm like, what? So I'll use half of NATO for their refusal to get involved in Iraq and Afghanistan, buying Russian gas to begin with, not outright fileting Israel and only ignoring its crimes. I really don't know why you're making Iran of all countries out to be a moral, peaceable place. This is where they murder homosexuals, remember, and follow a religion that demands they spread it. First of all, according to Islam, anyone that changes their, the Muslims that I've known, anyone that changes their faith is not regarded too kindly, right? As too kindly, really, they're not, from the Muslims I've known. Where you say where they murder homosexuals, that's domestic policy.  What we're talking about is global war, right? Global war, sure. Any country that kills people based on their personal choice, personal lifestyle, personal identity is wrong. There's no doubt about it, right? Canada was persecuting people for choosing bodily autonomy, okay? In the United States and Canada, they were giving people lobotomies in 19, all the way up to the 1970s in the United States, right? Okay. So there's domestic policy in every country that is horrendous. The United States has 25% of the world's prison population. Take the whole world, 330 million people here, right? World population, 8 billion and counting, 330 million people and they have 25% of the world's prisoners.  In Russia, what were the numbers? They were, what was it? 300 people that have been put in jail in Russia, Russia that spans 11 time zone, population of 130 million people, I think something around there, right? They've put 300 people in jail, three or 400 people in jail for things they've said online, right? The UK, what's the population in the UK gang? The UK in the same amount of time has put over 3,000 people in jail for saying stuff online. Like really, are we going to look at each country's domestic policy to try to decide if in their geopolitics, geopolitics meaning geography, geopolitics, we should say they morally stand the right side of this year or not. As far as I'm concerned, Yemen is a Muslim country. The people in Yemen have a right to decide their own faith, right? How they want their family structure to be, right? I wouldn't want to live in a Muslim country because well, I have certain personal lifestyle choices that may not be deemed acceptable, right? However, when it comes to geopolitics, Yemen is the most right now morally standing on top of a hill, right? Relative to most other countries because they are resisting genocide, they're actively resisting genocide, right? That's geopolitics. We're not talking about domestic politics, we're talking about geopolitics, right? And geopolitically, as Norman Finkelstein said, if you're going to give the Nobel Peace Prize or Nobel Prize or whatever the prize was, the hero prize in the world, there would be three groups of people you would give it to. One of them would be the doctors that are working in Gaza, okay? Second one would be Ghazans, Palestinians, and the third one would be Yemenis because they are the heroes of the world, right? This is not about domestic politics, this is about geopolitics, okay? This is about geopolitics.