 So, there are still people in the waiting room, so let's wait a few seconds to start. So, has the live stream started? Okay, yes. Great. So, well, this second day of lectures has a program that is very similar to the one of yesterday, so we'll start with Leonardo Pacciani-Mori, who is giving the second part of the tutorial on nonlinear dynamics. So without saying anything further, please, Leonardo, you can share the screen. Okay. So you can see my slides, right? Yes. So hi everyone, welcome back. So before I get started on the second part of this tutorial, are there any questions about what I showed yesterday? Please again, if you have any questions, please raise the end with the Zoom feature. You have to go on participants, there are three dots, and then you can raise them. No one is doing that, so I think you can... Okay, perfect. I will start right where we stopped yesterday. So yesterday, we were talking about liapunov functions. So in general, we were talking about how to study the stability of equilibria in nonlinear systems, and I was introducing the use of liapunov functions as a tool to do that. In particular, let me just repeat liapunov second theorem so that we get on the same page we were yesterday. So if you remember, I told you that if we have a generic nonlinear differential equation with x star and equilibrium. And we suppose that in a neighborhood of x star, we can define a function w such that this function here has a minimum on the equilibrium. Then the stability of the equilibrium can be studied by looking at how this function w behaves along the trajectories of the system. So for example, if we find out that the time derivative of this function along the trajectory is zero. So if this function is constant along the trajectories of the system, then x star will be an equilibrium stable at all times. On the other hand, if the time derivative is non positive, so either negative or equal to zero, the equilibrium is simply stable. If the time derivative is strictly strictly negative. So if the function is decreasing along the trajectories, the equilibrium is asymptotically stable. And if the time derivative is strictly positive, so if the function is increasing along the trajectories, the equilibrium is unstable. And then any function w defined with this property here is called liapunov function for the equilibrium. Is everything clear? Okay, so we talked about this a little bit already yesterday, but I just want to highlight the pros and the cons of using this approach. Now you see that this is actually a very powerful approach because it can basically give us an almost complete information about an equilibrium. And it gives conditions for stability that are sufficient but not necessary, meaning that of course we can have that an equilibrium is stable or unstable or anything else without necessarily having a defined liapunov function. So finding liapunov function is not necessary for determining the stability of an equilibrium, but it's sufficient. The price that we have to pay for having such a powerful tool, unfortunately, is that we can't use it always. So it's not easy to find liapunov functions in general in nonlinear systems with, as I told you yesterday, the notable exception of conserved quantities. So if we have a system, if we know that a system has a conserved quantity, generally that quantity is a good first choice for that liapunov function, sorry for the ambulance in the background. But if we don't know if the system has a conserved quantity, we can't, I mean, we have to use our intuition to find a liapunov function. So let me show you a concrete example to see how we can use the liapunov functions. And I want to show that using the Lotka-Volterra equations. Now Professor Weitz yesterday in his lecture mentioned that the liapunov, sorry, the Lotka-Volterra equations actually have a conserved quantity. So let me show you how we can find it. So these are the equations of our system. Again, I'm going to do some very simple computations, but they are very non-rigorous. So again, I'm sorry if you're a mathematician, but what we can do here is basically let's try dividing the first equation for the second. So we get dx over dy, and notice that this is not a general method. So what I'm doing here is just trying something and then see if I can find a conserved quantity. This is not like a general technique that can be used always. But in this case, we can rewrite the equations in this way. So here I'm just factorizing x and y. So now that we have written this, we can separate the variables. So I bring on one side everything that depends on x and on the other everything that depends on y. So you see that we can write the x times delta x minus gamma over x equal to dy alpha minus beta y over y. Okay, so we simply rewrite this as follows. So we divide by x or y on the two sides. So we have delta minus gamma over x equal to dy alpha over y minus beta. But these are very simple functions that we can integrate very easily because integrating this constant here we get delta x plus a constant. This here gives minus gamma times the logarithm of x. This here plus a constant, of course. This here gives the alpha logarithm of y plus a constant. And this here gives minus beta y. Basically, we have that delta x minus gamma logarithm of x plus beta y minus alpha logarithm of y, which we call w is a constant. So indeed, we have found a conserved quantity for the Lodka-Volterra system. So sorry, let me just jump here. Again, this is not a general technique. Every time we have to see how our system behaves and do some trial and error, but in this case we are lucky. So we have a conserved quantity. Can we use it as a liapunov function to study the stability of the two equilibria that we know the Lodka-Volterra system has? So let's see. Let me write this down again, sorry. Okay. The w is delta x minus gamma logarithm of x plus beta y minus alpha logarithm of y. Okay, so in order to see if this is a liapunov, we can use this function as a liapunov function. We first have to see if the two equilibria that we know the Lodka-Volterra system has, which are this one that I'm writing here, are actually a minima of this function. So let's compute the partial derivatives of this function here. You see that they are very easy to compute. And so for example, the partial derivative with respect to x will be delta minus gamma over x and the partial derivative with respect to y will be beta minus alpha over y. So the first thing that you can see is that these derivatives are not defined in the origin in this equilibrium here, because of course they diverge for x and y equal to zero. So the first thing that we can see is that we cannot use w as a liapunov function for the origin in this case. However, you can see very easily that if we substitute the coordinates of this equilibrium here, in both cases we get zero. This non-trivial equilibrium is indeed an extremum, let's say, for this function. But then you see that if we compute the second derivatives of this function, we get functions that are always positive. So we are sure that this non-trivial equilibrium is not only a minimum of the function but a global minimum because it's the only one. So we can use, sorry, we can use this function, we can try to use this function as a liapunov function for the non-trivial equilibrium. So what we have to do now is compute the time derivative of the function along the trajectories. So simply if we compute the time derivative of this function, again, I can just write it down here. You see it's very easy that in this case we have delta x dot, x dot over x gamma, y dot and alpha y dot over y. So in order to see how this behaves along the trajectories of the Lotka-Volterra system, we just have to substitute the expression of y dot and x dot from the Lotka-Volterra system. Now, this is a very simple computation. So you see that if we substitute here we have delta x alpha minus delta beta xy minus here we have gamma alpha plus gamma beta y plus beta delta xy minus beta gamma and then we have minus alpha delta x. Yes, sorry, I'm for plus alpha gamma. I'm probably forgetting something, of course. No, okay, that's everything. So you see that for example, this term here and this term here cancel out, then this term here and this term here cancel out, this term and this term cancel out, and then this term and this term, sorry, here I forgot to remove a y. This term and this term cancel out. And this quantity is equal to zero. Now, we could have guessed that from the fact that we know that W is a conserved quantity of the system, but still we have computed this explicitly. So if we look at the definitions that even before in the Lyapunov theorem, what we have now is that the non-trivial equilibrium of the Lotka-Volterra system is actually stable at all times. While again remember that we can't say anything in this case on the origin because this function here is not defined for x and y equal to zero. Is everything clear for now? Are there any questions? I think we can take the silences. Okay. Okay, so let's go on. Now, Professor Weitz yesterday showed us how the trajectories of the Lotka-Volterra look like, but I just want you to show that again. So for this particular choice of the parameters, you see that indeed we have these solutions oscillating anticlockwise around this stable equilibrium here. And this is just an example of the oscillations that we've seen also yesterday where you see that the prey population peaks before the predator population. Okay, so this is more or less how we can use the Apunov functions to come to study the stability of equilibrium in a linear system. The other tool that I've told you we can use in this sense is spectral analysis. Now spectral analysis is actually a simpler tools and basically consists in linearizing a non-linear system around an equilibrium. The basic idea that is behind spectral analysis is the fact that we can approximate a non-linear system with a linear one if we restrict to, let's say, an ability of an equilibrium. So what we would like to do in general is given our non-linear system, we tailor expand this function f around an equilibrium. So we will have this term here, which is of course equal to zero because x star is an equilibrium. And then we will have a linear term, a quadratic term, and then all other source of terms. And what we would like to do is basically approximate our non-linear system with the linearized, the linear one where this j here is called the Jacobian matrix. And it's basically the matrix of the partial derivatives of this function computed in the equilibrium. So if we are considering a system in more than one dimension, but if we have just, if we have that x is just a simple one dimensional variable, this is just the partial derivative of the function. Basically, how this approach works is basically by studying the eigenvalues of this matrix because if we know this matrix then its eigenvalues can give us some information about the stability of the equilibrium. In particular, what we can do in this case is given by the so-called Leopunov's first theorem, which basically states the following. If again we have a generic non-linear system and x star is an equilibrium, then if all the eigenvalues of these Jacobian matrix have negative real part, the equilibrium is asymptotically stable. On the other hand, if at least one of them has a positive real part, then the equilibrium is unstable. Is that clear? I mean, I'm going to explain. There is a question. By one man who asks if this concept is similar to PCA principle. I mean, yes, PCA in general is something that you do with rectangular matrices, so matrices which doesn't don't have the same number of rows and columns. This however, you always have square matrices because I mean if x is a vector of dimension n, of course also f will have to be a dimension in, sorry, a function in n dimensions. And so this will be an n times n matrix. And so in this case we use directly eigenvalues because we know that eigenvalues and eigenvectors are defined for rectangular matrices, sorry, for square matrices. So this is something that we do in return with rectangular matrices, but this is just not this case. Is that clear? So you see that compared to using the optimal functions. This approach is actually much simpler because it can be applied to any non linear system. So as long as we know explicitly, how is this function is defined, we can always apply this approach. This theorem actually is quite powerful in the sense that it tells us that the stability properties of the equilibrium of a non linear system, sorry, are exactly the same of the linearized system. So we can use this approach to study equilibria in non linear system. The price that we have to pay for having an approach that is simpler and easier to apply is that it doesn't necessarily always give us all the information on an equilibrium. Now, you see already that it can only tell us if an equilibrium is either asymptotically stable or unstable. But there are also cases where these approach can tell us anything about an equilibrium, because you see that if we have at least one eigenvalue with no real part and all other eigenvalues with strictly negative real part, we are neither in these two cases. So we cannot say anything in this case. What we can do in this situation is just, for example, using other tools, drawing stream plots, or seeing how the equation behaves at higher orders and try to guess something about this equilibrium. Now, I want to introduce another type of stability that we can find in dynamical system and that is also relevant sometimes in ecology, which is marginal stability. Now, in general, an equilibrium is defined as marginally stable. If it is neither asymptotically stable, neither unstable, but in particular, it is marginally stable when all the eigenvalues of these Jacobian matrix here are purely imaginary. So it is a particular case of an equilibrium being neither asymptotically stable nor unstable, because you see that the case in this third point here is one of these cases. But in this case, we can say anything on the on the equilibrium. If on the other hand, all the eigenvalues are purely imaginary, the equilibrium is marginally stable. Okay, if there are no questions. Okay, so let's move on. And let's see a couple of. Okay. Can you give an example of marginally stable? Yes, I will. I will give you an example in a few slides. Okay, thank you. So let's see first a couple of concrete examples. This is another question from the chat. Okay. Actually, two. So one is asked by one. So it's saying whether this approach cannot say whether an equilibrium stable at all times. Okay. Actually, no, the only thing that this, that this approach can say if is an equilibrium is asymptotically stable. This is the only the only thing that you can say. And Miguel is asking what's the advantage of spectral analysis over stream plots. The advantage of spectral analysis is just that it seemed, I mean, you just have to compute the derivatives and evaluate them. So it's something that you can always do very easily even in very complicated system and in very, very high number of dimensions with very complicated functions stream plots. I mean, are not always easy to draw because if you go above three dimension, I mean, I don't know how to draw in four dimensions. So it's not, it wouldn't be easy to draw the stream plot on a system in more than three dimensions. So this is the advantage of spectral analysis. Yes. Okay. Okay. Hello. So my question is from the third point, if we get the case that when one eigenvalue is zero and all others are negative so can you suggest any method that we can consider. Sorry, I didn't hear correctly I have some problem with all this can you repeat the question please. So question is regarding to the third point pros and cons. Okay, when one one eigenvalue has non real part, and all others are negative real part. So if we arise to a system which shows this kind of nature, then do you know, can you suggest that what will be the next step. Well, it actually depends on the system I'm going to give you an example again in a few slides where we are actually in in this case here. Okay. Okay, so thank you. No problem. So, if there are no other questions. Okay. Okay, so let's see. Does a linear stability implies stability of non linear. Yeah, I mean the the the result I mean the main message of this theorem is exactly this, I mean that if you have that the linearized version of a system close to an equilibrium is stable then also the real system let's say the equilibrium in the non linear system is stable. This theorem is the same is that, as long as we are close to an equilibrium we can use the, I mean, we can use the linear stability to induce stability non linear systems. And the same is true also for instability. Okay, okay, so let's see a couple of practical examples so I first want to show you again the very first example I've given you yesterday. The linear system with this cubic function and just to remind ourselves this is what we did when we drew the stream plot of the system so now I want to show you what spectral analysis would say in this case. So now we are we are in a one dimensional system so the Jacobian in this case is simply the derivative so we simply have to derive this cubic function so we get a parabola in general. We have to evaluate this parabola in these three points here so you see that if we evaluate this derivative in minus one and into we get positive values, while if we evaluate evaluated in zero we get a negative value. So in this case we can conclude by using spectral analysis that zero is an asymptotically stable equilibrium, while minus one and two are unstable. Okay, because this is what the theorem says and in this case, since we are in one dimension, the Jacobian is simply the derivative and the value of the derivative is the eigen the only eigen value basically of the system in this case. Okay, if there are no other question, I go on with other examples. So this is another interesting example so we have a system in two dimensions x dot equal minus x and y dot equal k y to the third with k a positive parameter. So this is the function that we have to start. Now you see that the only equilibrium of the system is the origin, because this is the only point where both the first and the second components here are equal to zero. Now, let's use spectrum spectral analysis. Now, let me write this down x minus x and k y to the third. Now spectral analysis tells us tells us let's compute the Jacobian matrix so the Jacobian matrix. In this case, if we call these components F one and F two, the Jacobian matrix looks like this y F one. Sorry, the X F two and the Y F two. So this is the matrix of all the partial derivatives of the components of this function. So in this case, this matrix looks like minus one zero zero and three k y squared. Okay, so you see that this component here. I mean does and doesn't depend on x while this component does depend on one. If we compute this matrix in the only equilibrium of the system so the origin, you see that we get this matrix here, which is basically a diagonal matrix with minus one and zero on the diagonal. So in this case, the two again values of the system are minus one and zero. So you see that we are exactly in the third case that I've shown you before in which this system cannot tell us anything about this equilibrium because one eigenvalue has a strictly negative real part and the other one has zero real part. So what can we do in this case? Let's try using some tools that we have already seen. So let's try drawing the stream plot of the system. So in this case, the state space of the system is the whole bidimensional plane. And here we have our equilibrium the origin. So let's try for example to see what happens to the trajectories on the axis here. So let me write this down. So you see that let me rewrite the equations. Let me write the equations x and k y to the third. Okay, so you see for example that if we if we start with x zero equal to zero. So if we start on the y axis, let me write this here so that it is a little bit more clear. So if we start from the y axis, basically our system becomes x dot y dot equal to zero k y to the third. So basically if we start on the y axis the system will always move on the y axis. And you see that y dot will be positive when y is positive and negative when y is negative because k we are assuming that k is positive. So the solutions on the y axis will move in this direction. Okay, similarly, if we start on the x axis. So if y zero in in the initial condition is zero, our system will become x dot y dot equal minus x zero. So if we start on the x axis, the solutions will move on the x axis and in particular x dot will be negative when x is positive. So the solutions will move in this way. And it will be positive when x is negative. So in this case, the solutions will move like this. So you see that on the axis the stream plot look like this. So from this we can see that actually the origin is unstable equilibrium. So here the solutions are moving away from this point. Now, if we want to do something a little bit more, we can do exactly the same thing that I've shown you yesterday when we drew the stream plot of the Lotka-Volterra system. So we can look at when this function here and this function here is positive so that we know basically the general direction of the solutions of the system. We don't know exactly with this approach how these curves here move, but we know that the point in this direction to show you that what I am doing here actually makes sense. This is basically the aspect of the stream plot of the system computed numerically. So this is a numerical computation of the stream. We can see that indeed in this direction we have that the solutions are going toward the origin. In this direction here they are moving away and so the origin is unstable. And in the four quadrants you see that the solutions are moving along these curves, but they are pointing in the right directions. In this case the origin is also called a saddle point because when it happens that an equilibrium is, let's say asymptotically stable along a direction but unstable in the other, often it is called a saddle point. So is everything clear here? Okay. So let's go on with other examples. Let's see now for example. Okay, sorry. An interesting exercise that I invite you to do or maybe if we have enough time at the end of this lecture I can show you is see what happens to this equilibrium where k is negative or equal to zero. Equal to zero is a little bit less interesting case, but at least what happens to this system with k becomes negative. So let's see now what can spectrum analysis tell us when we study the logistic equation and the log-cable-terrain system. So in particular if we take the logistic equation we have a very simple unidimensional system so if we want to use spectrum analysis we first have to compute the derivative of the function. For example, if we compute this derivative in the non-trivial equilibrium, so k, you see that we get minus r, which is negative because remember that these two parameters r and k are always positive. And so looking at the theorem that I've shown you before, this means that the non-trivial equilibrium k is asymptotically stable. On the other hand, if we compute this derivative in zero, which is the other equilibrium of the logistic equation, we get r which is positive. And so we can again conclude that zero in this case is an unstable equilibrium. On the other hand, let's see what we can say for the log-cable-terrain equation. So this again is our system. We do exactly what we did before, so we compute the matrix of the partial derivatives of these functions with respect to the two variables. So this is the partial derivative of the first component with respect to x. This is the first derivative of the first component with respect to y, etc. Now, if we complete this matrix in the trivial, let's say, equilibrium of the log-cable-terrain system, so no prey and no predators, you see that we get this matrix here. So again, a diagonal matrix with alpha and minus gamma on the diagonal. So the eigenvalues in this case are alpha and minus gamma. And since alpha is a positive parameter, we have that one of the eigenvalues is positive. So spectral analysis in this case tells us that the origin is unstable. And if you remember yesterday when we have drawn the stream plot of the log-cable-terrain system, we saw that along the x-axis, the solutions were actually moving in this direction. And so we, I mean, we already saw yesterday that this was an unstable equilibrium. So let's see what's happened, what happens in the non-trivial equilibrium. So again, we have the same matrix here, but this time we have to compute it in this non-trivial point. And if we substitute this, we get this matrix. Now, this is a very easy matrix. So let's see, let's compute the eigenvalues. No, let me just write it down, beta gamma over delta and delta alpha over beta. Okay, so just to remind ourselves, the eigenvalues of a squared matrix are computed by setting to zero the determinant of the matrix minus lambda times the identity matrix. So let's do this. We have to compute the determinant of minus lambda, minus beta gamma over delta, delta alpha over beta, minus lambda. Which is lambda squared minus delta alpha over beta times minus beta gamma over delta. So you see that here we have delta and beta that cancel out. And this must be equal to zero. So in the end we have lambda squared equal minus gamma alpha. So lambda will be plus minus the imaginary unit time gamma alpha. So basically this means that the Jacobian matrix of the Lotka-Volterra equations in the non-trivial equilibrium has only purely imaginary eigenvalue. So this means that if you look at what I've told you before, that this equilibrium here is actually marginally stable. Is everything clear here? Okay, perfect. So let's move on. Another example. In particular, I want to show you this example here. So now we have, again, a cubic function, but a slightly different one. So if you apply also what we seen yesterday, you see that the equilibria of this function of the system are three and are zero and plus minus one. Now, let's use spectral analysis. Well, let's first draw the stream plot of this system. So if we draw the stream plot, you see that we get something. Okay. Yeah, there is a question by Pablo Lechon. Is marginally stable or asymptotically stable or is it just a different category? Is either a stable or asymptotically stable? Okay, yeah. I mean, they are two different kinds of stability. I mean, they are similar but not equal because asymptotic stability. Let me, let me draw this here. So if we are, for example, in a unidimensional system and this is our equilibrium asymptotic stability means that we know that the solutions are actually moving towards the equilibrium. For example, at how the solution behave over time, like this, for example, here we have x star. So if x star is an asymptotic, asymptotically stable equilibrium, we know it means that we know that the solutions are doing something like this. So they are actually going towards this value. But if we just, if you are just saying that x star is a stable equilibrium, this is not necessarily true and we just need the solutions remain close to the equilibrium. So for example, if we see that something like this happens, then x, and we see that the solution never goes away. So it never does something like this, for example, then we know that the equilibrium is stable. So asymptotically stable is just a particular case of stable. Yeah, and I was asking about marginally. Oh, sorry. Marginally stable in this case basically means that there are, in the definitions that I've given you before, means that there are oscillations, because from linear theory, you may know that if the Jacobian matrix of a linear system has all purely imaginary eigenvalue, this means that the solution is doing something like this. Without actually tending towards the value. So, for example, if we had like damped oscillations, so something like this, this would be an asymptotically stable equilibrium. Well, if we had the sustained oscillations that never damped, never get dumped, then the equilibrium is marginally stable. Thank you. No problem. So, okay. So in this case, if we draw the stream plot, you see, again, just to remind ourselves, for example, in this interval, the function f is positive. So the solutions will be increasing x will be increasing in the solutions. On the other hand, in this interval, the function is negative, the function f here is negative. And so the x in the solutions will be decreasing. You see that the stream plot suggests that this equilibrium here is unstable, where this and this here are actually stable. Now, let's see what we can say with spectrum analysis. So here we have a cubic function. So we just have to derive this function and compute it in these three points. So you see that in zero, the derivative is positive and in plus minus one, the function is negative. In this case, we have one unstable equilibrium and two asymptotically stable equilibrium. This is a very dissimplest case in which a system can exhibit the stability. Now we have seen an example of by stability yesterday with the lecture of professor stuff. Similarly, we can we say that a system is by stable or even multi stable if it has two or more alternative stable states. Let me show you how we can reinterpret this this problem with, I mean, and this will probably make things a little bit more clear. So let's rewrite the same system as a particle in a potential. In this case, we will have an equation of motion like this so that the acceleration of X is minus the derivative of a given potential. And we choose this potential simply because it's the one that once derived and the sign is changed gives us the function that we were using before. So in this case it means that our system is a particle moving in this energy potential. So you see that the equilibria are the minimum of potential and there are two alternative stable states. Now the interesting thing about by stable or multi stable systems as we saw yesterday is that external perturbations can move the system from one equilibrium to the other. So for example, if we again are considering the particle in the potential suppose for example that the particle is in minus one. If we give it enough kinetic energy and by enough, I mean at least the difference between this value and this value here. What happens is that our particle will go in this direction will override this will go over this potential world and then it will fall back in this other stable equilibrium. So if we do that in the other direction of course the same happens so you see that external perturbations can switch the stable state in which the system lies and this, for example, we have seen a concrete example yesterday with the savanna and forest switch in the patch of of lands. So this is something that can happen and anytime we have more than one alternative stable equilibrium. So I'm going to be clear the question. Okay. So, okay. Yeah, tell me this potential function for the system. So is the potential. Yes, in this case in this case we can use the potential as a liapunov function but only for these two equilibria because you see that in a neighborhood of these two points indeed we have that this function has a. A minima in this point but this is not true so we cannot use this potential as a liapunov function for this equilibrium here because the function has a maximum. Or again, we could do that if we do the trick that we talked about yesterday so if you remember there was a question yesterday that asked what if we define a liapunov function that instead of having a minimum in an equilibrium has a maximum. And then in this case we have to be careful that the definition of stability and instability are switched. So in this case, for example, if we find out that the function is decreasing along the trajectories then the equilibrium will be a stable but in general yes since this is an energy potential for example we assume that we are in a friction less system with no dissipation. And so this quantity is conserved, we can use it as a function. There is a follow up question so if this is not a strict function what is the liapunov function for the system. It depends I mean it depends in this case I mean for these two equally if equilibrium we can use the function as a liapunov function in this case we cannot and so we have to use other tools so we can use spectral analysis we can try to draw the stream plot. Perhaps it's not fully clear that one can cannot always construct a liapunov function. Yeah exactly this is not true in general I mean this is a particular case because we know that there is a conserved quantity. If I write any random let's say nonlinear function with the strange function, it's not always possible to find a conserved quantity and not even a liapunov function. So that's the I mean that's the big downside of using the function they can tell us a lot about an equilibrium, but they are not always easy to find is useful if you can find it. If you can't you shouldn't lose your sleep on finding a liapunov function. Okay, okay. So, the last topic I would like to talk about goes a little bit beyond studying the stability of equilibria, and it's called time scale separation now this is basically a tool that can be used often to simplify the study of nonlinear systems. Now let me show you in abstract in a general case what I mean, and then I will show you two concrete examples to show you how we can use this time scale separation. So, this approach can be used when a linear system can be described by two different sets of variables, Xi and yj, not necessarily of the same number so they can be of different number and each one of them has their own nonlinear function which can be different for these two. Sorry. Sorry. I think it was not a question. Okay, so we have a we can have different nonlinear functions here. Now, what happens often, not only say this depends on our knowledge on the system is that we can say for example that the time scale of these variables is very different from the time scales of this one. For example, if we are describing a large ecosystem where X is the population of elephants and why is the population of rats, for example. You know, for example that the production of production time of rats is much, much faster than the production time of elephants. So we, we can distinguish basically between slow variables and fast variables in the system. Again, I'm going to give you a couple of concrete examples afterwards. Now, if we can do this, so if we can distinguish between slow and fast variables, for example, let's assume in this general case that Xi are the slow variables and yj are the fast ones. So what we can do in this case is, I mean, what happens in this case is that the fast variables so the yj in this case will reach their stationary values very quickly. Since they are the fast variables, of course. So what we can do in this case is assuming that yj is always equal to zero. Again, let me repeat that in case it is not clear. If we assume that we can distinguish the system between the slow variables, the X and fast variables, the Y. This means that as the system changes, the Y variables will almost instantly reach the stationary values. So we can assume we can approximate the behavior of these variables by assuming that Y dot is always equal to zero. Is that clear? Okay, so what we can do in this case is basically setting this equation equal to zero. So you see that here we can now invert these functions g here to write the fast variables as a function of the slow variables. If we then plug this expression into the equation for the slow variables, we basically have reduced, let's say the number of variables so that we can describe our system only through the slow variables. Okay. There is a question. Yes. Yes, hi. Thanks. Are you feeling that the yj's have a stable equilibrium or something like that? Like if the yj is oscillating. I am not assuming anything about the equilibrium right now. I am just assuming something on the speed, let's say, on which this variable change. So it is sufficient that these, for example, set of variables are faster than the other. I'm not assuming anything on the stability or on the existence even of equilibrium. I guess I'm wondering if the yj's don't have a stationary value. In other words, if they're oscillatory on their own. Yeah, that is a case in which you probably can do, in which you can't apply this approach, I would say. Okay, but you might be able to use some mean values. Yeah, you can, you probably can use some mean value particularly for example if these oscillations are not particularly wide, then you can, you can, you can use them. Sorry. I should always say that I don't think I said anything. I don't think I have understood if that was a question or not. Okay. Okay, so, again, let me repeat that this is an approximation that cannot be done always in any case but it depends on our knowledge of the system so in the example I've given you before of rats and elephants. I mean we have to know already that rats reproduce much faster than than elephants on in any case we need some phenomenological knowledge on the system to justify this approximation. So let me show you two examples, practical examples in which this happens. Now one class of nonlinear system with these approximation is actually done quite often are chemical reactions. For example, let me introduce this nonlinear system, this is called Gierer and Meinhardt activator inhibitor equations. These are nonlinear systems, nonlinear equations, as you can say, and these basically describe the abundance of two chemical substances X and Y, which are an activator and an inhibitor. For example, to make some practical example, X and Y could be two proteins that either activate or inhibit a particular metabolic pathway or a particular metabolic reaction. So let's assume for example that we can tell that the activator is much faster than the inhibitor. For example, let's assume that we know how these molecules are made, and we can tell we know that for example if we raise the temperature of the system, then the activity of this molecule is much larger than the activity of the inhibitor. So we have that X, the activator becomes much faster than the inhibitor. Then what we can do in this case is set X dot equal to zero so that here we can use this equation to write X square as a function of Y. Then we plug this into the equation for Y dot and we obtain this which basically becomes let's say the approximated equation of the system for high temperatures, because in this case these variables are the slow one and so we can describe the system to this equation, this variable solving. On the other hand, let's assume that we know that the inhibitor is much faster than the activator. For example, we know how the, again, we know how these molecules are made, and we know that if for example we lower the temperature than the inhibitor, the activity of the inhibitor molecule because much larger than that of the activator. Then in this case we can set Y dot equal to zero here. So we can write Y as a function of X square like this, we plug it back into this equation and we get in this hypothetical example, the approximated equation of our system for lower temperatures. Is that clear? Okay. The other example which is actually more relevant for ecology that I wanted to show you is the so-called Meccartur consumer resource model. Now, this model basically describes a system of microbiota species competing for some common resources. In particular, this year is a schematic representation of the model. We have a set of resources, we have a set of species. We assume for now, I mean, it's not mandatory, but for simplicity now, we assume that the resources are supplied with constant rates. So this SI here are the supply rates of the resources and that these species here can only uptake these resources. So we are not modeling any other kind of interaction between the species. In microbiota communities, there are lots of phenomena that can happen. We can have biological warfare, so species producing antibiotics for other species or species producing actually resources. So excreting metabolic byproducts that can be used by other species. So we are excluding all these cases and we are only describing a system where the species can only uptake the resources and grow. Now, if we build the system, it's not necessary for what I want to show you, but if you want, if we have time, I can show you how this model is built. But in the end, the equations of this model look like this, where this here is the set of equation that describes the dynamics of the species population. And this here, on the other hand, is the set of equations that describes the resource, the dynamics of the resources concentrations. Here I have just called Ri this nonlinear function. So you see that these are indeed coupled nonlinear differential equations. Now, what people often do, but I mean, this is not something that people always do, is assuming that the dynamics of the resources is actually much faster than the dynamics of the microbiota populations. This generally is justified by the fact that, for example, the molecular dynamics that underlies the uptake and the metabolization of resources, which takes place generally in fractions of seconds or few seconds. Each actually much faster than the timescale over which the species grow because microbiota species take at least several minutes if not hours or days to grow. So in this case, you see that we know from experiments, for example, that we can define this as the fast variables of our system, and this as the slow variables. So if we can do that, we can set ci dot equal to zero here, and we can write, as you can see this function Ri as a function of a sum of all the populations. If we plug it back to the first set of couple differential equations, you see that in the end we can describe the system by only using the species populations without considering the resources concentrations. Now an interesting case is basically this model that I mean there is an interesting case if we consider the same model in a slightly different setting. In particular, these here are the consumer resource equations with two differences with respect to before. Here I am not writing the nonlinear function Ri that I was using before but I am just using ci. But on the other hand, the resources now are not be supplied with constant rate but I have written, as you can see, a logistic term, a logistic equation for the growth. So if we do this, so for example, I mean one case in which this could be a good description of the system could be for example a system with phytoplankton where the resources would be phytoplankton and the populations here would be zooplankton. Of course, we still have to be sure that the other assumptions of the model are true so the zooplankton are only eating the phytoplankton and not eating other species, but as long as these assumptions are true, we can use this model. If we now assume for example that in a particular system we know that phytoplankton is growing much faster than zooplankton so we can assume that the ci here again are the first variable. We can set ci.equal to zero and write ci as a function of all the rest. If we now plug this back into this equation and do some rearranging, I mean I'm not going to show you just because it's just very boring computations and we have only five minutes left. But in the end we get these equations here where here I'm showing you the definitions of these parameters. This is actually an interesting result because these equations here are called generalized lot-cavulterra equations. These are basically a generalized version of the lot-cavulterra equations for system with more than one species. We can see that by doing this time scale separation approximation and not considering the equations for the resources, we can actually simplify this model basically to the generalized lot-cavulterra equations. Okay, with that I have finished all the things that I wanted to tell you in this tutorial so I will be happy to take questions in this last few minutes. Yes, so we have a few minutes for questions for you to ask Leonardo any doubt you might have. Please raise your hand with the Zoom feature. I hope this means that I was clear. I will take that as a proof of that as evidence of that. Oh, there is a question, perhaps. Okay, great. Your volume is very low. Yeah, your volume is very low. I cannot hear you. I can maybe if you write in the chat because I really cannot hear what you're saying. Perhaps while Muhammad is writing the question, there is another question by Pablo, so please ask your question and then we'll go back to Muhammad. So I did understand very well why, so if the resources are fast, how can you make the derivative equal to zero? Wouldn't that mean that the resource dynamics are slow compared to the population? And therefore the derivative equals zero? Not necessarily. I mean what would that mean basically? I mean, let me draw this here. Probably this is going to be clearer. So in general, if we didn't make this assumption, let me write, okay, we would have a solution for the populations and a solution for the resources. So in general, we would have that here, I don't know, we would have a general behavior. Let's assume that the populations at a certain point converge to a value. And even here, we would have something like that. So some oscillation, some strange behavior, and then these functions here tend to a stationary value. And setting ci dot equal to zero in that case means basically assuming that these variables here are so fast that since the beginning they are already equal to their stationary values. So in this sense, they would be, they would not change, but they are already in the stationary values. I mean, it can seem like a strange approximation. The most case can be a strange approximation, but there can be cases in which this actually is a good approximation. So again, this depends on our knowledge of the system and what we know about it. It's not something that we can do in general. Okay, thank you, thank you. No problem. So there is a question. When do we have to deal with the opponent of exponents? Again, probably it's not going to be a satisfactory answer, but it depends on the system. I mean, if, if you see that you have a system where you can easily find a function with all the property that the function must have. That is a case where you can deal with the with the opponent functions, but if you see that you can't and you don't find an easy way to look for the opponent functions. And I'm sorry, I mean, it's not my fault, but this is purely driven by intuition. I mean, in that case, it's better to just use other tools, use linear stability, draw the stream plots, make some numerical simulations, so any kind of other tools that we can use that can help us understand something about the stability of the equilibrium. I hope this was clear. There is another question by Danny. Yes, sir. I just want to clarify my understanding. So basically we just, we can use time scale separation. Hopefully then we can get to a lot of alter equations and then after which we can just use the second theorem of Lyapunov to study the stability. Yeah, yeah, if we are in one in one of the cases where the time scale separation approximation actually makes sense. Yes, we can do that. And I mean, this is something that people something do, they start from a consumer reduce model, then they assume the separation of timescale, and then they work with a lot of alter equations. I mean, if you want to this can also give you on a different interpretation of this generalized lot of alter equations because they basically come from a competitive system. So, I mean, you can also interpret them in a different light, but yes, I mean, this is something that can be done, of course, and so if I continue to repeat myself, if we know that we are in a case where we can do this time scale separation. And again, this depends only on the knowledge that we have of the system. So if we have some empirical some experimental knowledge that these two set of sets of variable are actually very fast or very low, or if we have any other kind of intuition that can justify us to do so. Does that answer your question? Yes sir, thank you. No problem. There is another question in the chat from some us. So she's asking again about the separation. So without the timescale difference is impossible to find a single equation for a system. Yes, if you don't I mean, for sure there will be cases particular cases in which you can do that but in general, if you are in the in the situation where you can describe the system with two sets of variables you can't justify the timescale separation. You just have to study the equations with all the variables together. Again, there can be particular cases that I am not aware of in which this could happen but the general rule is, is this, I hope this answers the question. Okay, there is a question by Davos. So, I just want to know that what is the broader sense of applying timescale separation so suppose my system I know that it can go through the, it has slow and fast variables, but what is the output I will be expecting after applying this method. Simply a simplification of the system. So assume, for example, that in, in, let's consider this case. So assume that we have a system with 80 species and 50 resources. There are large numbers but if you compare them with what you can see in natural microbial communities. These are not so large numbers. So if we have 80 equations here and 50 equation here without timescale separation you would have to solve 130 different nonlinear differential equations. If you can apply timescale separation, you reduce this number basically to back to 80 because you are eliminating the more or less you are reducing the number of equations for 130 to 80. So the advantage in this sense is simply the fact that you are simplifying a very complicated model, a very complicated system. Okay, thank you so much. No problem. So, is there any other question? We have in principle five minutes. Yes, there is another one. Yeah. Thank you for the talk. It's wonderful. Thank you. I have one small question in this time scale dynamics. So how this what is that we can take normal resource consumer system and we assume initially one, one is faster, another one is slower and repeat reverse it, can we get some boundedness or this solutions? I wouldn't know in general, probably again, I am sorry if again this is not a satisfactory answer but I think that you would have to go on a case by case approach in this case. So, looking at actually for example how the parameter how large or how small the parameters are, and see if you can get intuitively any bound in this case. Instead of solving the original system, can we get a bone for the original system or something like that by using timescale? I think that would be possible but again, I wouldn't say always. Again, sorry, sorry again if this is not a satisfactory answer. No, thank you. No linear dynamics is full of questions that don't have a satisfactory answer. Yeah, exactly. So, is there any other question? Great. So, I think we can go and take a break for three, four minutes.