 Okay, good morning everyone. Speaking about disease spreading last week, I've managed to catch one. So I apologize in advance if today is not going to be the best performance ever, but fortunately the lecture is somehow easy to follow, so So there's not going to be too much Hand-waving and stuff. All right, so this is the 10th lecture. No, what? No, this is the 8th lecture. It's the 10th of November Question to you, what did we do so far? Let's say last lecture. What did we do in last lecture? Does anybody remember? Modeling, yeah, I mean we've been modeling already three lectures back. We've been modeling disease spreading That's why I got one. We looked at technology adoption the S curves And we tried to model the technology adoption and we used We used this famous model of disease spreading susceptible the SIR framework susceptible infected and Recovered We I mean, okay, sorry have to move here this idea of modeling technology adoption is basically applied to market growth and to Yeah, any kind of product or anything that penetrates a market for instance We also looked at the inventory Model this was two lectures ago And for all these models we investigated how small changes in whatever parameters We talked about control parameters what they could be And how these small parameters can influence the dynamics, but today we're going to be To introduce more formally what we mean by Varying a parameter and and see and then observing a change so far We did it kind of heuristically right we change a parameter and you see in Vensim Okay, some amplitude increases or two things become suddenly uncorrelated But today we're going to be looking kind of mathematically What happens when you vary control parameters on the systems behavior will define exactly what systems behavior is and This is going to be also an introduction to chaos Okay, so before we go on Can I ask you what is your opinion? What do you think chaos is? It's not a question which has a right or wrong answer. I just want to get an idea what you think right now What is what is chaos? This is kind of close Can you put some timeframes? Like cannot be predicted and we need a time frame here in the short term in the long term Never Okay, yes This is this is one of the components It's a necessary but not sufficient component of chaos, but it's true. So we'll look at chaos. What exactly it is There is a strict definition kind of of what chaos is from a mathematical point of view It's not the same as you see in popular books or movies You know butterfly effect and stuff like that All right So let's let's get down to it roll of control parameters I Will introduce a few basic notions first about what is a dynamical system and What kind of things we're interested in in a dynamical system what we're interested in is this basically This is the equation that governs the evolution of a dynamical system I mean why is it called dynamical in the first place? Right, I mean because we're interested in its dynamics in its rate of change This is the first derivative basically how it changes over time And we assume for all the systems that we saw so far We assume that the way that the system changes over time Depends in some non-linear way on its current state and Some control parameter Now this is this is our control parameter Of course, I mean this this could be a vector of control parameters It doesn't have to be one could be many but things get more complicated especially if you try to plot the face plot the the face space of a system with I Mean three control parameters. You can't do it. You need four-dimensional picture all right and When you when you have a figure like this right so this is the current state of the system and That is the way that the system changes and let's say this is the non-linear function. All right What are the points of interest if you look at this this figure? What are the points of interest? for non-linear dynamics The points of interest are the points where the system is stationary so it doesn't change anymore When would the system stop changing? Well, obviously when the first derivative is zero when its rate of change is zero So this point here This point here and this point here this call this points are called stationary points ST this this here. It's not stable. It's stationary or it's also called equilibrium points Mind you, we make no no Statements about the stability of these equilibrium points We'll investigate how to how to find that out but for now these are equilibrium points and The number of equilibrium points and Their stability depend on the control parameter Okay So you can immediately see where we're getting to by varying the control parameter you in this case or vector of control parameters We expect Something to change with these equilibrium points and this is the change in the system that we observe The system behavior that I talked about right something is going to happen to these equilibrium points before that let me Let me give you a few notion of stability even without introducing any mathematical Treatment for finding stability. Let's look at this point here If we're at that point the system is static it doesn't change anymore, but imagine there is a little shock to our system so Random shock and suddenly we jump here. Whoa We jump right here, okay What happens then what would happen in the next few time periods? We're here Which means that the rate of change is negative, right? This is below the zero Which means that x So x here Would decrease in the next time period Right, so we will be kind of pushed here But because of these dynamics will go back to our original position at zero The same thing if we're pushed up there The rate of the rate of change is positive Which means that x your state variable x would increase in the next time period So we'll be pushed again back to zero So even you know by by looking at the the way that the nonlinear function f crosses The x-axis you can kind of intuitively guess whether the point is stable or not and this is actually what? How stability is defined small random shocks die out? There don't get amplified it die out and this is what happens here We'll go back here and as an exercise for you even now You can apply the same logic to that point Not to that point because we don't know what happens here, but to that point And you find out that it's actually unstable because any small random shock would completely drive us away from this equilibrium point All right How can we model such systems or how can we kind of represent these systems? How many of you physicists here? mathematicians has anyone heard of the gradient system? No, okay. Well, you don't need to the point is the following We assume let's go back here We assume that something that something could be a person a ball doesn't matter something moves along This this function right let's say we put a ball here And we let it go and then what the ball will do It will slide down and this can be formalized with this notion of gradient meaning that You have a potential This is the potential here whose derivative Equals your function f right we have an example in the next slide But this is the intuition we have a certain potential. I think of it as as a landscape. Let's say mountains right and then you put a ball or Something on top of the mountain you push it a little bit to the left or to the right and then it will fall down and it will It will settle at the basin and This basically tells you to follow the direction of steepest increase so here It's a one-dimensional system the direction of steepest decrease is Is just one but if you imagine a two-dimensional surface and you plot the surface you may have Let's see if I can do it You may have Something like this for instance therefore the direction of steepest increase will have to be calculated by a Vector sum right so you have x and y direction you calculate the steepest increase in the x direction The steepest increase in the y direction you sum up the two vectors and you get the direction that you actually go to so this is the The whole idea behind gradient system you follow the direction of steepest increase Decrease sorry Okay What we're interested in Let me go back here as I said our equilibrium points and And we can find the equilibrium points by just looking at the potential looking at the landscape that our object moves moves on and If we have a minimum of the landscape, so imagine a mountain and like we have like this This is the mountain and here down there. We have a basin This is the minimum local minimum of our potential that would be a stable point The maximum of our potential would be very unstable again unstable Doesn't mean that you will always that you will never stay at this point. No, you will stay at this point forever But if you're randomly perturbed You will drift away from that point all right and This is the idea now when you vary the control parameter Just a little bit continuously. That's important. You vary the control parameter continuously What you get Often is that the number of equilibrium equilibrium points changes So from three you suddenly and suddenly really means suddenly It's discontinuous process suddenly you get one for instance or you get five also The number of equilibrium points may remain the same, but their stability may change Suddenly again, and this is what is referred to as the Catastrophe theory introduced by this guy Elena Tom So basically he looked at this process as a kind of a catastrophe that occurs in our system new stable states are generated suddenly or Destroyed suddenly and their stability also changes in this way and of course Catastrophe is not in the you know popular meaning of catastrophe He thought that you know, this is a very drastic very aggressive change in the system And he called it catastrophe. But of course, it's not it's not what we what most of us understand About catastrophe this is And this is in fact I'll show you a slide. It's what we call bifurcations of forking New stable points are generated or destroyed. So let's look at an example About this gradient system and moving on a potential we have a potential function, which is this one All right Now if you plot it if you plot this if you plot this function assuming that you two is zero So your second control parameter for now is zero What you get is this this is the red dashed line and This is plotted. I believe for you one Equal to minus 50. So this is you one equal to minus 50 This is the next one is yes, you want equal to 50 Okay, so this is how your potential looks like for two different values of you one But let's concentrate on the negative value first minus 50 this one So without looking at the equations think what happens if you put a ball here It will start following the direction of steepest decrease. So it will immediately slide down And it will settle here The same thing from that point Right. So this is the minimum of our potential function and it's a stable point The maximum or local maximum of our potential is here And you can imagine that if we have a ball here and we just push it a little bit to the left or to the right It will immediately move away from that point. So this is an unstable point and The speed of the ball It's just given by by this by differentiating the potential and minus the different the derivative, of course Okay, but now let's see what happens So right we have one two stable points and One unstable. So we have three Equilibrium points or stationary points two of which are stable One of which is unstable. All right, and now we plot the same thing for you one equal to 50 So we vary our parameter to 50. It's all a continuous change as I mentioned It's kind of a sudden change. We immediately Change its value from minus 50 to 50, but what happens is this? All right Now suddenly we only have one stationary point Right where the the derivative is zero here And it's a stable point because this is a local. It's in fact a global minimum for the potential So you see what happened from three stationary points to stable one unstable We ended up with one station one stable stationary point and that is What essentially is meant by bifurcation or catastrophe? We're going to work a lot with these kind of diagrams. Are they familiar to you? Has anybody seen such a diagram before? one two All right three. So okay, this needs some explanation What we're interested in in fact is to categorize What happens to the system precisely as we vary the control parameter? Okay, what happens to the stationary points as we vary the control parameters So naturally you might think well, we have to plot the control parameter versus The stationary points and this is what's point. What's what's plotted here? This is Minus you one. All right. It's minus you want to make things more interesting basically, so that this can look like a pitchfork you you see You see why I mean it looks like a pitchfork really so minus you one So you this this case here when you want is 50 minus 50 you want is minus 50 Would be here all right This is the point When you want is minus 50 No, minus you want is 50. Therefore you want is minus 50. You see this is minus you want on the x-axis This is Exactly Yeah So that this can look like a pitchfork if you if you if you in if you plot it normally If you plot it like normally then that thing would be reversed you can still call it a pitchfork bifurcation, but it would be kind of a not how it's typically Displayed in textbooks Or also to make things kind of more interesting so You know you play with the mapping of numbers in your head All right, so this is 50. Well, what is it? No, this is you want minus 50 This is yeah thing of it is yeah, it's inverted. So this is you want 50 Now let's see what happens when you want is 50 meaning positive. We have only one stable stable stationary point Which is zero and we display this so on the y-axis we have The number of stationary points So the sorry the value of the stationary point and The width of the line Shows you their stability. So if it's a solid line, this means that the stationary point. This means that the Equilibrium point is stable If it's a dotted line It means that the equilibrium equilibrium point is unstable in the sense that I explained already small random shocks get amplified So, let's see what happens. We're here. We have one stationary stable point at zero And we start increasing you one Sorry, we start decreasing you one from 50 40 30 20 one Nothing changes. Of course the shape of this thing would change Right, but the stable stationary point is still going to be at zero suddenly At you one equal to zero Something happens to the system. Look, this is a discontinued discontinuous process three more or two more Equilibrium points are generated and Our pointed zero our stationary pointed zero now becomes unstable It was stable before it now it becomes unstable just as I explained is as I explained here and this is a sudden change in the system all right and How how you look at it is the following well if you one is minus 50 We have one stable stationary point here, which is given by Something close to minus five another one here, which is something close to five and Unstable one at zero at which one we end up This is important at which point we end up depends on the initial conditions, right? If I start the ball here, it will end up at this table point if I start the ball here it ends up at this table point so We don't claim anything about which of these would occur more frequently it depends entirely on the initial conditions and of course You can calculate You can calculate this these stationary points and in the In case you're wondering why it looks like like this right like this the reason is Is very simple in fact So if you look at our equation minus four x three Minus two you one X and then you two is zero for now so we disregard it. We want this to be equal to zero Okay, this gives you three solutions already x Equal to zero Which is the unstable stationary point and you have two more which are given by so x one two Actually two three These would be is it minus by this and it should be plus minus Right, it's simply you solve the this equation x is one root equal to zero the other one is Plus minus should be here right so one of them is Valid when you one is positive the other one when you one is negative And the point is that this shape is a square root and that's why the stable points look like a square root Okay, this is a bifurcation diagram because simply because it shows the bifurcations and What what do you see at this point is The system transition from one single stable point or mono stability in a sense to buy stability Meaning you have to stable points now and this is in kind of an elementary type of bifurcation It's one of the most basic types and it's called a pitch fork bifurcation because it looks the shape looks like a pitch fork there are the Very interesting shapes like saddle not bifurcation which looks like a saddle for a for a horse So yeah, it's it's quite Quite basic now. This is also an interesting point the application to decision processes So Imagine for instance you have you you control parameter you one is let's say the size of the population the size of some population So if the size is small It's very easy for the population to reach consensus. So one stable point But as you increase the size of the population What actually what you observe what people have observed in real life is that? Suddenly there is a polarization of opinions right to left or right fraction or conservative liberal doesn't matter what to opposing opinions emerge and People have hypothesized that this the process like this is behind that with you being the Control parameter the size of the population No, sorry for that Yeah, so if you think about it's the same system by the way an important thing here and here We have the same system does the same dynamical equation, but the behavior and the on the outside. It looks completely different Now this is a little bit more Intuition about what a bifurcation is it's simply a forking one solution into two and in this figure You have one stable solution being forked into two stable solutions Okay, and Yes, and important thing to mention is that all these solutions are real. We're not concerned with imaginary solutions All right Most of the things yes, so most of the things I've already mentioned One thing to remember from all these slides so far small changes in you in the control parameter They caused this kind of huge people call them qualitative changes in the system because kind of the quality of the system changes Now let's make things a little bit more interesting We assume that the second control parameter was zero, but what if it's not zero then we come into another bifurcation type interesting more interesting First of all what happens when you two is not zero Well, our potential is not this symmetric curve anymore. It's not this nice symmetric curve, but it becomes asymmetric which means that One of these kind of wells is removed or shifted and Here we've plotted you one again 50 or minus 50. So this is The red one is you one minus 50 and you two is positive. What is the value? It's 200 So you two is positive here at 200 here you one is positive 50 but you two is negative minus 200 and We're interested so we fix you one let's say What is it fixed to oh? No, sorry. Sorry. I was confused you one is minus 50 in both cases here and here We fix one control parameter and we start to vary the second one which is you too So what happens don't look at the bifurcation diagram yet? Let's say we start from this point All right, so we have This kind of a potential like here we have We have this kind of Well, which is almost destroyed and here we have our normal basin when you start to vary you to to increase it what happens is Right, so you start with Okay, you start with 200 you start to decrease it at zero you get the symmetric potential and When it when you two gets negative the the wells basically change So one of them becomes right so look this one becomes now a proper well proper basin and this one gets almost destroyed All right, and you can imagine here if we keep increasing you too We don't start decreasing it, but we keep increasing it eventually this kind of stationary point Will slowly completely lose its stability right it this will just become like a line There would be no well anymore. So the stable point will be destroyed the same thing here and The bifurcation diagram is very interesting So you too, let's let's start with you to minus minus 200, which is basically the red curve What it tells you is that we have only one stable stationary point at I don't know seven point something Which is this one you do to do Okay, so we are looking at the at the black curve Right minus 200 we have this stable point. This is stable point. This is not Right we destroyed it Now if you put a bow here it will start rolling it will not stop here. You know, there is no well anymore If we keep increasing You too for minus 200 we slowly keep increasing it. What happens is the system moves along this line So we still have one stationary point one stationary point stable stationary point at this point we have three so as soon as you too crosses the minus 100 I Know 70 something We have one two stable stationary points and one unstable it Yeah, give them at this value. So what happens is We start here and we Start increasing you too. So we have no well here. We destroyed it. We have a well here When we keep increasing you too will form will slowly form a well At this point this thing will get a little bit destroyed the other one, but it would still be kind of a Well, right so it could still be stable If you plot, I mean if you plot this function with minus hundred for instance, you would see that You have two wells. One of them is bigger than the other one certainly, but there's still wells stable points and at zero We have unstable point Right. So here as we keep increasing you too. Now, this is the funny thing which happens Imagine we're at this point Right, we keep increasing you too. We have one stable point one one one three Equilibrium points three three three three and suddenly the system jumps from here here and Moves in this direction. So from three here. We have three at this particular point where the solid line and the dashed line Kind of touching each other These two points annihilate each other so that solution This well and the zero kind of annihilate annihilate each other and they disappear and we're left with only one stable stationary point here Now the interesting thing comes now. What happens if we start from this point? Remember we varied you to and we go we went like this Here and then we jumped here if we start if we start varying you too From here and we start decreasing it. We move like this at this point. You would expect to jump back here Right because when we swept the whole thing from left to right we did it But when we when you sweep it from right to left you don't jump back Here, but you keep going in the same way and then jump back here and This is called a hysteresis effect Right because going from left to right is not the same as going from right to left and you can imagine so there is this book Given in the notes by Eric Yanj. It's a very nice book the self-organizing universe and It's really a pity that it's almost out of print because it's I got it from the library, but it's a very Intuitive book I would say there is not Incredible amounts of mathematics there, but what he says is well that this hysteresis effect could be Could model the so-called hawk and doff populations what this means is the following we have Well, let's let me first give you another analogy the angry dog analogy So you have a dog and you try to stress the dog So I'm not saying I did it. You probably should never do it also but in case Yeah, just think about it. So you start stressing the dog somehow right, let's say here and You start stressing the dog the dog. Maybe it doesn't respond too Aggressively it kind of barks a little bit backs backs into into a corner, but nothing particularly happens to the dog So you start stressing it stressing it stressing it and it and here at this point So after the stress that you apply to the dog Passes a certain boundary and this boundary is given here then the dog goes completely berserk Goes crazy, right? So it's kind of a the dog jumps from here to here. So the behavior completely changes And now if you start decreasing the stress, it is not the case that when you decrease the stress here So imagine you increase the stress up to here and the dog is really crazy now you start decreasing the stress It's not the case that when you go back to that value the dog would become calm again. No, you have to decrease the stress more Here in order for the dog to become calm. This is the hysteresis effect or the memory effect the dog somehow remembers Has some kind of residual memory so that you need to To do more work in order to eliminate this memory and go back to the calm state and the whole doff Example is similar In the sense that we have a country which for whatever reasons wants to invade another country We had this happening at least in my lifetime couple of times and Imagine the population is split in two fractions hawk and doffs and doffs basically the hawks they want to attack National security issues all this kind of stuff weapons of mass destruction doesn't matter and the doffs They just want to you know have won't have peace. They don't want any war Right, so imagine this state for instance corresponds to a population where you have a lot of doffs and Just a few hawks, right? So the country is a whole will not go to war because most people don't want to but then due to some external influence may be Media effects may be propaganda from the government. Who knows? The population of doffs start to slowly decrease and the population of hawks start to increase at this point when the amount of Let's say media propaganda has become too high suddenly The country goes to war suddenly what happens is the population of hawks Just Explode so they become a lot and the doffs they become very little Now if you start decreasing the media Influence again as in the case with the angry doc It's not the case that coming back to that point would bring the things to normal So hawks would decrease doffs would increase now you have to decrease The influence a lot more so that your population returns in a calm state as before the idea is memory effect So these systems have memory You apply certain force from one direction from left to right in this case But then when you start removing this force the system remembers there is a residual force left into the system which you have to Basically counteract we even with with more Counterforce that's the whole idea and this happened only when we allowed for two control parameters So now a very simple system This in fact is called Cusp bifurcation and in three dimensions it looks like this Right. So these are the two control parameters And these are the stable points. So see here. We have just one stable point here But this is exactly This thing is exactly what I showed you here. So now imagine we put a ball on top And you push it a little bit to start rolling actually don't even need to push it a bit because this is This is not a equilibrium point What the ball will do it will start sliding sliding and then suddenly jump here Right, just as I told you like the both slides slides and then jumps here This is the cusp bifurcation. You see by varying the u1 now we can decrease this range right we can decrease this This this range so this thing that the the dotted line becomes compressed more compressed and compressed and in fact here We almost have a singularity and beyond that it disappears this effect So this is another very famous bifurcation. It's called the cusp bifurcation And this is the only two bifurcations that we'll be dealing with All right now So far so good Can you tell me how much time is left until the break because this display is broken five minutes? All right, so we'll have time for for one more slide I have a question for you now So far we've only seen systems in continuous time Right, this was a x dot the dynamics was given in continuous time The s-curve Technology adoption from last time it was again continuous time But of course in real life most systems are What what are they? Yes, they are discreet. Why did you answer? because intuitively because there's only so much there's only a Finite amount of kind of separations that you can split a human being into for instance. You cannot have half a person for instance Right, or you cannot have 0.0000001 percent market share All right So basically yes in most in most cases the real life systems are discreet and now I'd like to investigate the Population dynamics system that we saw it was given in continuous time remember it was this The the Population growth x dot is equal to the net birth rate and then there was some crowding effect But this was a continuous time system in real life. Of course, this would be discreet time system You know you cannot have half a rabbit and Then we'll see that Amazingly when you go from continuous to discrete time new things can happen to the system new things in the sense of critical points or equilibrium points and in the End of the lecture you'll find out that chaos Can occur in a discrete system, but not in its continuous counterpart which is a Curious thing to know because depending on how you model your problem You know if you model your problem in a continuous way You lose an important ingredient and in fact when you write Especially in academia when you write papers and you propose models people are very sensitive to Why you chose to model continuous system and not discrete system because you lose Important things and you'll see what we lose. All right quick Introduction to discretization how we discretize some continuous system Well, we start with the ordinary differential equation which is given by this, you know x dot Changes according to some non-linear function f And now what what do we do we? Let's start from here. We define a time step, right? so continuous means in theory continuous means that it Infinitly small time steps the system is defined But of course we cannot have infinitely small time steps. We have a finitely small time step There's only so much you can split the time. All right, so let's discretize the time Let's say t0 is the first time step that our system is defined t1 is the next smallest Time step that we can define Let's say t1 and t1 t1 would be equal to t0 plus Yes, one times delta t and delta t is your time step if for some reason you believe that in the universe time Can only be split in time steps not lower than 0.1 Then 0.1 would be your time step delta t What you do now is the following The value of your system in the next time step t plus delta t is The value of the system in the previous time step plus how much it changed well How much it change how much it change is given by? the first derivative Here Yeah, we'll continue after the break then But I think all right So I was going to show you how to discretize a continuous system and I'll remember we have the What we interested in is this value. What is the value of our state variable in the next time step t plus delta t? so if you do Something which is called Taylor series expansion Taylor series expansion meaning you simply linearly approximate the function or not the function but this value You linearly approximate it in the vicinity of that of that value, right? So we this you we approximate well actually I have to draw it So imagine you have this function For instance if you're interested in the value at that point At that particular point the Taylor expansion Allows you to linearly approximate That value by using the first derivative of the function. So if you draw the first derivative Here at that particular point You can use the first derivative as a very crude Method of approximating that value now if you want to calculate that value You cannot use this of course because look the first derivative is here And this is your value. You need to again use the first derivative here now Again, this is a this would work relatively well if the function is smooth, you know, it's well It's well behaved. You take the first derivative and it's more or less Looks quite quite good Of course if it's not if it's very rugged like I don't know Something like this then at that point It's kind of difficult But for now we assume that the function is sufficiently well behaved So we approximate this x of t plus delta t We expand it in other words. We do the Taylor series expansion around t around this point t right, so let's Let's keep let's keep our picture If this is t this is our t We interested what happens at t plus delta t and delta t is very small. Let's say here This is delta t You can't see it probably Right delta t is here. So you can say well I can still use this first derivative at point t to approximate That point here, right? It won't be very accurate But for a sufficiently well behaved function like this one, it's kind of closed. You see The actual value and the first derivative are kind of close to each other So we can use this And The Taylor series expansion is basically equal to You can look it up how it's computed but If you can put it if you compute it it depends on the value of the function At the point around which you're expanding it t Plus the first derivative so this thing Times delta t and then here we have Higher order terms. So if you want to take higher derivatives Not just the first but maybe the second and so on You can do it to make it more accurate approximation But if delta t is sufficiently small then delta t squared would be even smaller So we can safely ignore that term the error would not be that big But what is this It's basically now if you assume that delta t is one We have that x of t plus one in the next time period is equal to x of t plus The first derivative and this is called the Euler integration method If you numerically integrate this Using the Euler method. This is the Euler method It doesn't work for exponential functions. So don't use it if you have an exponential function. So If you have this Then the other method doesn't work it will work If you have very very very small time step like very small 0.001 for instance Because the error is just too big you only take the first derivative and you know the exponential grows really fast right so if you Right the exponential grows really fast. So we want it to be here t. This is t Delta t is probably here t plus delta t sorry But since this is an exponential these two points would be very different You know how the exponential is right you increase the x by a little bit and then the value of the exponential changes significantly So these two points would not be that close as you think Which means that either this distance has to be very small meaning delta t has to be very small or you have to use a different integration method Runge Kutta for instance is a good one But this is how we discretize a continuous system. It's very simple What happens in the next time step is the sum of what happened in the previous time step Plus the derivative plus how it changed right this is Where I was in the past plus what I did to get from the past to the future. All right, and as I mentioned Doing this discretization even if you do it properly Can introduce new behavior? In particular chaos. We'll look at that Sorry now, let's look at the population growth from Fifth lecture, I believe Remember By the way, this is end dot. Please mark it in your slides and dot So the rate of change of the population The rate of change of the population. Oh, I think it was the rabbits at that point There is a birth rate Right and there is a crowding effect. You remember this I Think the the parameters were named differently, but the idea is still the same. We have some birth rate but eventually the influence of the finite the finite environment would generate this kind of s or Saturation behavior. So this was how our rabbits grew and and here is let's say the number of rabbits for instance All right And now you know how to actually calculate stationary points, right? We did it for the rabbits. It was either zero or K over M, but now you know how to do it, right? You just set this to zero This is when the population doesn't change anymore and obviously n equal to zero is one solution The other one since this is a Quadratic equation the other one would be K over M We haven't said anything about how these solutions are reached, right? Whether we reach the solution like this linearly or it's kind of a saturation or oscillations And then we reach the solutions. That's not so important the stable points. That's not so important. These are the stationary points okay, and We also use something like this to generate an S curve This is called the logistics growth the logistics growth and In fact, this is how Yeah, okay, you'll see that in the next few slides, but this is how bacteria grow it can be shown that this is how bacteria bacteria grow Well, let's discretize it now So we we just do some change of variables t is now n and we define xn to be this We also so what we want to do is to eliminate these parameters k m and n Because if you think about it, this is three control parameters. We just want one to simplify things So by just redefining the variables We define right so Let's let me show you how how do we get this? This is it obvious to everyone how we got this Remember n of t plus one was equal to n of t Plus the first derivative, but the first derivative is k Times n of t Minus m times n of t squared Okay, which is simply equal to K plus one Times n of t Minus this Okay, it's simply applying what what we saw before This is how we we arrive to that equation. We define our k plus one to be equal to R Just to make the notation simpler so we have one control parameter we define xn to be this and finally This is our equation in discreet form Right, it's also called a recurrence equation or yeah, so Does this look familiar has anybody seen something like this before Well in in fact, this is what people call the logistics map From the logistics growth. We discretize the logistics growth and we got the logistics map and this Look, it's all simple. It looks very simple. It can generate amazingly complex patterns, and I'll show you this now Right so logistics map is given here If you just look at how Two subsequent values of x are related while they're related in a by in a quadratic way, right? So this is xn squared Right, so if you plot xn versus xn plus one you see that xn plus one reaches so the next value Reaches its maximum When xn is one half, right? So if this is one half, this is one half Times one half one fourth are over four. So the maximum value is given by our over four and And If we increase xn the subsequent values is lower actually So this is just how xn is related to xn plus one more interesting is this picture here Let me explain you how we do it this basically Gives you an graphical intuition or graphical way of how that System would develop over time how the xn would develop over time So we start with some random x zero some initial condition. I don't know X zero from x zero we calculate x one Okay, by this formula we calculate x one from x one We calculate x two From x two we calculate x three From x three we calculate x four from x four we calculate x five and so on So you see that if you look at this progression of the x It eventually reaches a stable point which is given by x xs Sorry stationary point xs Here if you start from a different initial condition or your r is different I don't remember exactly what r is this here But if your initial condition is different in r is also different Then you would get a different dynamics. You won't get this. This is a very nice Stable behavior right the system converges to a value eventually, but this need not be the case and you'll see that All right, let's investigate now the role of the control parameter r. We only have one control parameter So if r is between zero and one what what would that mean r is between zero and one remember We had k plus one is equal to r Just without calculating any math Just intuitively k plus one equals to r if r is between zero and one This means that case negative, but case was your birth rate. So if the birth rate is negative the population dies out and nothing happens and that's why The stationary state is zero There are no rabbits in our population You don't need to plot anything If r is between one and three This is the stationary state The stationary state is given by this value. So we slowly converge there and this is a picture How we convert so ours 2.8 is between one and three and we start with this initial condition zero points, I don't know Some initial condition We have some oscillations until we finally converge To our value one minus one over r Is it clear how we calculated this? Wait a second. Yeah, this is the slide. Why why is that the stationary state one minus one over r? Hmm. Let's see now. Yes. So go to To that side. So what does it mean for a stationary state? What does a stationary state mean well, it means that if we have no random shocks We don't push the system. It will stay there Which means that xn plus one Was it end the index? Yes would be equal to xn Okay, you can even say this xn plus two Would be equal to xn plus one to xn To xn minus one and so on right because the system will always stay at this stationary state forever unless you You shock it somehow So we start with this but xn plus one Is also Calculated by our recurrence equation r times xn one minus xn Okay, so we simply We simply make these two things equal. So r times x xn one minus xn Is equal to xn xn cancels and You're left with the stationary state is there Okay, that's how we calculate the stationary state If r is between one and three now why between one and three There is it can be shown but let's not Let's not concern ourselves with this. It's not so important when r is between three and four We have oscillations and this is for our 3.3 you see we start with some I think it's the same initial condition and After some kind of time where oscillations grow we have stable oscillations. So what you have is Xn and xn plus one oscillates like this all the time and this is also called a Two-period cycle right because the cycle has a period of two right one two One two the same cycle. Let's move on If our is 3.5 We suddenly have again oscillations But the period is now of length four. It's a so-called four period cycle And it's a stable cycle right so unless you shock the system. It will always oscillate like this Look at this one two three four one two three four one two three four is the same cycle all over again Which means that if you know that you don't need to compute the values for n For n200 for instance You can immediately say well, it's a four period cycle. So it must be one of these four values So look what happened from a two-period cycle for 3.3. We went to Four-period cycle for 3.5. This is called the period doubling Right when you increase r you double the period of the cycle and it can be shown That as you increase the value of r You double the cycle the period of the cycle in this way at three we have a period of two at 3449 period of four eight so on and so forth and This is interesting at our value 3.569 infinite period what what does that mean any Intuition yes No on the contrary there are oscillations, but the period of these oscillations is infinite. What does that mean? Yes Yes, that is true I Yes, that that's how it would look like but for reasons that will come apparent in the next two slides I would not like to call them stochastic Simply because look this dynamics is completely deterministic There is no stochastic influence anywhere along the dynamics And this isn't the amazing thing actually this is a completely deterministic dynamics and yet you get infinite cycle of infinite length so This is actually what we refer to as as chaos Right, so this was it. Yes, so three point nine When are is bigger than three point fifty seven Yes, so We have this kind of infinite period cycle of infinite length, but Yeah windows in the chaos I Have to show you the bifurcation diagram for you to understand that for now don't think about the windows in the chaos just just Think of this this is our three point nine this is an infinite period of infinite length so The cycle is infinite length There is no period basically you can't find a pattern here When are is equal to four and Larger is it larger? Yes Then you have fully developed chaos will find out what fully developed chaos means basically we distinguish between fully developed chaos and chaos with windows and It's becomes more apparent when I show you the bifurcation diagram, but for now Look at this so this is a cycle of infinite length and If you remember that very nice picture that I showed in the beginning We start with some value here and We basically move randomly around this map Right, there is no fixed pattern now. This is the bifurcation diagram This is our and this is X It's slightly different from the bifurcation diagram that I showed you before and At least when I was When I came across this it confused me a lot because remember the bifurcation diagram shows you the stationary points All right, if you remember Our nice bifurcation diagram One stable point one stable point the system Can never be at these two stable points at the same time It can only be at one and it depends on the initial condition at which one we end up but here When we have oscillations The system actually oscillates between two stable points for instance And this is how we illustrate it. We have two stable points for instance here and here But it's not like before where only one of them can be the system can be at only one of them at any given time No, we oscillate around these two points And that's why this is not X stationary, but it's just X So this is oscillations between this point and this point forever But let's start from the beginning when ours between zero and one birth rate is negative everybody dies out zero when R is between one and And three I believe this is three. Yes, it should be three again. We only have one stable point And it's this one How we reach this point we don't know maybe we reach it through dying oscillations Maybe we just go to it as an asymptote. I don't know But this is one stable point and for each particular value of R We can calculate it funny thing happens at R equal to three if you remember We double or we generate the cycle of length of period two. So this is a cycle now The system would oscillate here and here here and here At R equal to one or three point something it's written in the slides We double the cycle so we have a period of four So the system oscillates between this value that value that value and that value forever and Now what happens is if We increase R beyond this value. It's again given in the slides or beyond this value Look at what our system does. I Mean I cannot show you but Let's let's let's be here, you know, so the system would just go randomly to basically any value on the zero one interval That it's not nice oscillation like here, but any of these values can be chosen and This is a zoomed-in picture from three point sixty two to three point 65 This is chaos Okay here Now so basically X n and X n plus one would be completely random no patterns at all But suddenly as you keep increasing R The picture changes again, so from chaotic regime We get to something which is one two three four five. It's a period of five Right, so it's an oscillation and there are five period a five stable points this one that one that one that one that one So the system would oscillate between five values This is called a window in a cat in chaos, so we have a chaos and then we have kind of it looks like a window, right? As we keep increasing R we go back to chaotic regime where any value on the zero one interval can be chosen Here we have another window Very small, but yet another window with one two three Or is it four five six seven eight? Period of eight and beyond that value We only have chaos or in other words fully developed chaos. This was the meaning of a fully developed chaos There are no windows anymore All right well people have studied the logistics map for good 30 years and It can somehow be shown mathematically even analytically I mean You don't need to compute forever. That's that's the point All right By the way, if you look at the book it's given in the notes Slight 11 It's the straw guts book. It's it's really good. It has a lot of explanations about logistics map, but This is yeah, this is the meaning of chaos with windows and fully developed chaos now I Am still a little bit hand waving here about chaos Probably Still you don't have any idea what chaos is. Yes, we have no pattern emerging but An important thing is that If you look at this trajectory for instance We start with X. Let's say we start with some X zero some initial value and Then for r equal to three point sixty four You end up here. I mean you can calculate this actually if you start calculating calculate and are equal to here You know, there is no actually chaos at all if you compute your system Everything is fine. You will know exactly what will happen in the long term for r equal to 64 Let's say after 100 time steps you calculate it no problem But what happens if your initial condition is slightly off If there is a little uncertainty in your initial condition So instead of X zero equal to zero point one. Let's say you have X zero zero point one zero zero one for instance You will not end up here as you have calculated before you will end up at a completely different point maybe here Okay, and this is the notion of divergent trajectories nearby trajectories diverge so nearby initial values infinitely close to each other They would result in completely divergent long-term values And the only way that you can now be sure what your value is is to calculate again Right, you cannot make predictions. That's the point as you mentioned in the beginning You cannot make long-term predictions because given a very small amount of uncertainty in the beginning You end up at a completely different state and this is the idea of divergent trajectories here Right. You start with very close initial conditions And I mean in real life you can never be a hundred percent sure about anything So you always have some uncertainty, especially in your initial conditions. You end up at a completely different states And that yeah, that's the idea of Of divergent trajectories and this is yet another definition Ingredient of chaos and now what actually chaos is we have all the components to create the working definition It's not a mathematically strict definition, but it's good enough for us first. We have a Periodic long-term behavior as we saw cycle is of length the period is of length infinity Right, you have no pattern, but that's not not that's not enough The system generating this behavior must be deterministic Okay, like in our logistics map. There are no there's no random input No noise nothing. It's completely deterministic and Divergent trajectories meaning sensitivity to initial conditions two very close initial conditions end up at a completely different points and Now the question is well, how do we? How do we know that a given sequence of numbers for instance is chaotic, right? It may be just that the period is of length 128 It's too periodic the period length is very high But it's not chaotic It may look like chaos, but it's not and there's an actually mathematical kind of approach to this We calculate the so-called Lyapunov exponent. Have you ever heard of this? One all right, it's very simple The idea is the following let's see what happens if We introduce a little bit of uncertainty in our initial conditions, so we don't start at x zero But we start at x zero plus delta zero Right, so delta zero is the amount of if you'd like the amount of shock that you give the system So you push your initial condition to the left or to the right by the amount of delta zero And then and that delta zero is very small What you're interested in to know is what happens to this initial? Fluctuation to this initial shock does it grow or Does it die out if it dies out then we say it's there's no chaos here if it grows indefinitely then we say that it's chaos and Remember what I told you exponential divergence of trajectories We simply define that we want the trajectories for chaos to be exponential divergent. We define this Not linearly, but exponentially so we say okay our initial fluctuation After n time steps Would develop like this exponentially so if I'll if lambda is positive then our initial fluctuation Would have grown exponentially Right so the final deviation Delta n would be exponentially bigger than the original one and if lambda is negative Then the initial fluctuation would die out and the lambda is called the Lyapunov exponent right, so You have well here So if you apply the function f All right, let's start from here No, let's just go here. We want to know what happens to the final fluctuation At time at time step M. Well, it's simply equal to So what this notation means that you apply your map f or your function f you apply it n times to the initial condition Right you start with x0 you apply this function once you apply it twice Three times four times five times right so you apply we start with this x0 plus delta zero remember we have this small fluctuation we apply our logistics map and times And this is where we end up At the end we subtract from this The value where we weren't supposed to be without any fluctuations So just started x0 no fluctuations end up somewhere And we look at the difference if that difference Delta n basically is very big So first let's let's compute it before talking about big or small. Let's compute this What is the difference delta n? well if you If you take the logarithm of these two things you get that alpha is equal to one over n natural look of this Now you substitute delta n to be equal to this There are a few steps. They're not shown. I Hope you have time to show it So now We won't have time I won't have time to show you this It's just two lines which are missing but in fact what happens is you substitute delta n this value You substitute it here and then this Imagine this you divide by delta zero and if delta zero goes to zero. This is simply the derivative of F at x Of xn Yes Yeah, I have to show you this so that you can understand but let's let's leave this for Either after the lecture or during the self study because we don't have time now and don't worry This is not an exam material. It's just to give you an idea This is how we calculate the lambda and now this if that thing is positive. We have chaos if it's negative We don't have chaos Why is this interesting? Well, this is your time series Right, you have your time series x i from zero to n You can compute you know how they changed what the dynamic is between x zero and x one or x one and x two So you can compute these things You compute this value if it's positive you have chaos if it's negative you don't have chaos It's a very simple way to to do this and This is the same picture as we saw before The logistics map is chaotic here. You see the Laponoff exponent is positive Windows in the chaos Laponoff exponent gets very negative again chaos Laponoff exponent Laponoff exponent is positive Another window negative All right now application Is it true that we have one minute? left Five okay, that's good. That's good So we have a manufacturing system. This is an example of chaos in a manufacturing system I Talked about this in the in the beginning of the course We have a manufacturing system and it exhibits chaotic behavior. So unpredictable behavior In I don't know utilization of some machine for instance Whose fault is it? Is it the manager who is not creating the proper processes or is it just the property of the system itself? this is an example now in the to the end of the lecture where We'll see that it is appropriate could be the property of the system itself So we model our manufacturing system in the following way. By the way, I forgot to print these slides So I have to I don't have a handout. We model the manufacturing system in the following way We Create the notion of a buffer here, oh Which is basically? Things that get filled or emptied Over time right you can model a lot of manufacturing real manufacturing entities Like this for instance some manufacturing line Which on which some parts flow you can model this as a buffer, which is which needs to be full at all times right The manufacturing line has to be full or occupied the whole time. Otherwise, it's underutilized So we kind of abstract a real manufacturing system With the notion of this kind of buffers, right? So we have buffers. They could be emptied or filled and they could be Empty to a field just by one entity. So we cannot empty or fill them in parallel together but we Just one entity has to go to each buffer and empty it for instance, right? so one person has to go to each line and Do something and this is our setup We have these buffers We don't want our buffers to get over filled over full or to be empty So you don't want parts to be falling off from your production line because it's too full But you also don't want this line to be empty And the question is what is the optimal strategy for someone a person for instance who goes around and Services each buffer each line That this is not important This well, so this is These are two different ways to look into the problem. I mean that slight is simply explanation of these pictures We can have these buffers which are filled by some Dependently by rates of lambda one lambda two and so on but they're emptied by one person in this case in this Example, it's not a person obviously It's kind of a machine which goes to each buffer and empties it when it gets full We don't want the buffers to be to be overflowing And this is the so-called server this this thing is the server which goes around each buffer and empties them and the analogous Situation is When the buffers are emptied By themselves say they have a little hole in your some container has a little hole So it's emptied at a given rate and you don't want Containers to be empty so a server would now go to each Buffer and fill them when they get empty. So this is called the switched arrival system. This is called the switched server system We'll be considering we'll be considering the switched server system Now what are the rules according to which that server has to visit each buffer and emptied? These are the rules here, but okay. This is the picture right? We have a real manufacturing system and we abstract it Into this so-called buffers buffer buffer buffer and we have a server here This server is like a machine which goes and visits each buffer Again, we're concerned with the server system. The arrival system is completely the same The server system if a tank So remember the server system empties the tanks or the buffers. They're filled by themselves by someone So if a tank gets filled to the maximum Then obviously the server has to go and service it however, if The currently served tank so here if the currently served buffer So while you're emptying the buffer Some other buffer Gets gets full. You have to stop emptying this buffer and move to the to the other tank however If while you're emptying your buffer nothing gets full Then you empty it until the end zero And if still nothing is full yet, then you simply move to the next one Into in the sequence so from buffer one you move to buffer two Right, and this is what it says here in a cyclical order Right. So while you're emptying something If something else gets full you immediately go there and start emptying it if not When you're done you just move to the next to the next buffer Yes, let's keep that Okay, I Forgot to mention that we have a Capacity B of our buffers. So this is the size of Liquid or machines or parts whatever that our buffers can support so two three more minutes So bees our control parameter. We have only one control parameter in the system be These are equations telling you how The level of the liquid in your buffer changes depending on whether it's being serviced by the server or not It's it's very simple, but the interesting point is is Is here? So we have three servers in this example, sorry three buffers in this example one two and three or X one X two and X three If we start at this point, what is this point X one is relatively full X three and X two are relatively empty. So the server is here The server starts emptying tank buffer one Right it empties is empty empty empty empty and finally we end up here X one is completely empty X two has got full a little bit full in the meantime and X three Also got a little bit full in the meantime, right? We were just emptying the first buffer, but the other two were being filled with these rates with these rates 0.5 and 0.4 so we end up here if we start from that point X one is yeah, I'm somehow full X three is also kind of full X two is empty So we start emptying X one X three and X two would get full or fuller All right, so you see what this diagram means This is the server movement Now what happens? We started one We're emptying buffer one now. We're here buffer two is kind of am kind of full buffer two is kind of full Buffer three is Not empty, but not as full and buffer one is empty. So now we're emptying buffer two Now we're emptying buffer two. We start emptying buffer two Buffer one and three will get full, right? We move here So buffer one is now a little bit full. It was zero before now. It's a little bit full, but buffer three is even more full and Now the logic is that now the server starts emptying Buffer three because it's almost full So if you look at the dynamics of the movement of the server it moves like this I Empty buffer I empty buffer one here buffer two buffer three buffer one two three one two three It's very nice predictable sequence of how your server moves and how your buffers the liquid or the Fooness of your buffers develop. This is if the capacity is one of your buffers If you decrease the capacity to 0.5 Just decreasing the capacity keeping the same rules Look what the server does. It's completely crazy, right? You start emptying two three one two two one three No, this is the chaos that we're talking about you the movement of the server is completely unpredictable It's not nice. It's here And these are the bifurcation diagrams This is your control parameter B the capacity. This is the level of the liquid in Each of the three buffers. So if the capacity is one The first buffer would start getting empty emptied when it's liquid level of liquid is 0.1 This buffer would start getting emptied when the liquid in its in in it is 0.6 and this is 0.7 or something This is nice But here The buffers can start getting emptied at any point of time. It's completely unpredictable Yes, so in the beginning of the next lecture I will go back a little bit in more details to these slides especially these equations in case You find them confusing But this is the I hope you got the idea of the chaos which emerges Thank you