 the alpha and also I'll pass the link to the lecture notes of the next lecture by Stepan Alvesina in the YouTube chat so you can also get the material there and let's wait for the people on zoom to join back and then we can start okay so I think people are back great so before introduce the next speaker just the usual info about medicaid so if you want to ask a question please either post it in the zoom chat or use the raise end tool on zoom that you can find under participants there are three dots and you can raise hand and when I think stepano will stop every now and then to leave time for questions then I'll sort of give you the possibility to talk or I'll ask the question on the app and another point I saw in the breakout rooms that there are many people that are alone in a room waiting for others to join if you have the version zoom five installed which you can install for free you have the possibility to change room so if you are alone and there is no one to chat with you you can also change room and find someone else to chat with so great so after this I it's my great pleasure to introduce the next lecturer stepano lesina stepano got his phd from the university of parma and after a postdoc at the university of michigan and at nensis he moved to chicago where he's currently a professor in the department of ecology and evolution his most recent research has been focused on the theoretical understanding of large ecological communities and he will give three lectures on the theory of ecological assembly so thank you very much stepano for being with us and yes thank you yakupov good morning good afternoon good evening everybody so my name is stepano i'm broadcasting from the beautiful campus at university of chicago where the weather is nice but a bit cold and yes i have three lectures on a some sort of like theory of assembly of ecological communities these three lectures unfortunately are not exactly the same length so so don't worry if we cannot go through the whole first lecture the other ones are a little shorter so we'll see we'll take it as it comes and so i have very extensive lecture notes that i'm posting on github i actually put the link to the lecture notes and the github repository in the in the chat and the idea is basically that you can build all these lectures on your own computer in fact you can play with all the code that is provided to do that you need to install r and then you you need like these packages that would be needed for the calculations in terms of questions like that yakupov was discussing before i would like maybe divide them in two categories the first category is questions that are really like needed for understanding what's going on so if yakupov that is man in the chat sees anything that means like people are not following and then just interrupt me in fact like somebody already saying i cannot download the the lecture notes so like if you click on this link right that it's provided and then you go here in code and then you say download zip you can download the zip file with all the lecture notes and to see the lecture notes you can just put this address that they put in the chat in your browser and you should be able to follow the lectures i followed these lectures religiously because i wrote them especially for these series of classes and so you should be able to follow precisely what i'm doing then there's other types of questions which are like curiosities or like extensions or things like that those i will try to to keep for for maybe the last five minutes or so all right that said we can get started and i just give a very brief very partial overview of the history of ecological assembly and what is ecological assembly simply like the process by which ecological communities are built so you can imagine that there's a process by which species enter in a certain system right increasing the richness like the number of species in the system and then there's the opposite process which is like extinctions by which some species disappear from the system right so so the interplay between this kind of colonization invasion or like immigration and extinction create like some sort of balance by which we build these ecological communities the the the typical setting actually is something like this right that we have some sort of mainland or like meta community imagine like a bunch of species and here each species is a different like symbol and then every so often we have this immigration event right like the this idea for which like a certain species say these diamond species enter the system here in this island or local habitat or however you want to call it and now these two species for example can start interacting and and what is the outcome of this interaction maybe these two species will coexist in the local habitat slash island or maybe one of the two will go extinct or maybe both of them will go extinct right so so we have different outcomes and then after a while maybe these other species like triangle comes back into the the system and then again we restart the dynamic so so this is basically the idea of this ecological assembly historically this type of a island mainland type of model has been contrasted with other models that these types are based on species traits so so now we're thinking there is a certain environment this environment a certain condition you can imagine like temperature right and so maybe some species will thrive at this temperature because of their traits and some other would not be able to grow and as such what what the environment does is impose a sort of selection on the traits of these species so so these typically these models are more focused on traits of the species rather than their identity and and these process by which the environment selects for certain species and not others is called environmental filtering right and so you can read a lot about environmental filtering and this typically leads to what to the fact that we're selecting for certain traits right so the traits we cluster together something that we call trait under dispersion now of course species can interact with each other right and imagine that we have a community of competitors then these competitors are competing for the share resources and as such they cannot really coexist if they're too similar in their requirement of their resources and this would lead to what to a separation of the traits of the species so the opposite of like these convergence that we were seeing before and this is called over dispersion and again this is like a view of these assembly based on traits rather than in on on species identity these teams went on for basically forever like as long as the discipline of ecology and and in fact like I put here like a book that is like 25 years of discussions on assembly and reading this book I was really like taken by the introduction because the introduction I suggest reading it like maybe without too many prejudice but but but it is a very forceful introduction and somewhat bizarre and in fact that immediately after I found this review by Nico Telly 1999 that again picks up on this introduction saying that the language of the introduction is an embarrassment to the discipline which also tells you that not only this is a very old problem right that of the ecological assembly but it's in fact one of the most debated heatly like heatedly debated problems in ecology if we go back in history as I was saying this is very old history we can find examples in 1899 when when Harry calls actually it was at the University of Chicago and he developed this theory that we call the theory of succession by looking at Indiana dunes which like are basically half an hour south of my office on the shore of Lake Michigan and so you have these sand dunes that you can imagine like start building up and what happens is that some species land on these like sandy dunes and are able to colonize these sandy dunes we call these the pioneer species right and by doing this they stabilize these dunes somewhat and they allow for other species to come in right and so we have this kind of sequence of species coming in and replacing in fact each other to some extent and what is very interesting is that because they there's so much like wind in Lake Michigan every so often these dunes are blown out and so the process restarts and you can basically date the dunes how long is this doing been developing for by looking at the vegetation so what you can really do is some sort of like substitution of space for time right like that by looking at different places I can see dunes of different ages and as such I can basically reconstruct this succession of vegetation along these and calls and in fact like even other people like Clemens held this very strong view that this was somewhat of a regular order deterministic process right like that there is like this sequence that each dune follows pretty much a with some fidelity like the same sequence of vegetation this is in very much of a contrast with like for example the view of Gleason that in 1920s started advocating for a much greater role of chance right so a lot of the debates we will see like a democrat like the big philosopher would be pleased that a lot of these discussions are chance versus necessity right like that a lot of this as this very basic philosophical point at the back another case like of something that created a huge debate in the literature is the work of Jared Diamond who was studying a alien like bird assemblies in island of the coast of New Guinea and what he noticed is that certain combinational species were never observed he called these forbidden combinations and the idea was that these were prevented from happening by competition for example and the idea there is like now if I look at all the islands right and I look at all the possible patterns and I see which one are forbidden maybe I can learn the rules of the game of assembly by reconstructing it like in this inverse way right of looking at all these combinations and then finding what's going on in the background these work needless to say cause an intensive debate like what is called like the new model wars that occupy the colleges for a lot of like the 1980s the 1990s and again are these patterns that we are observing the outcome of some deterministic necessary process or rather they arise by chance and this actually led to a fantastic like development of new models of like what should we expect when we have a certain number of species interacting with which probability are we going to observe these particular like sequence of presences and absences and these work was spearheaded by Dan Simberloss Connor Gotely there are very very good reviews I am for a pointing gear to a book on new models in the college again like transversals necessity if we look at the early 2000s like the work of Steve Hubble on neutral theory right what should we expect these pieces were simply not to interact or were somewhat equivalent in that case like what we observe in terms of pattern for example species of under distribution would be basically driven by stochastic fluctuations right species would take a random walk in this space and then we would end up with some sort of like statistics and sure enough like the statistics that we can observe and measure in nature are somewhat compatible with this assumption of neutrality and again this sparked an immense debate facing like neutrality versus again like necessity is represented here by niche dynamics meaning like these are driven by species interactions like competition like trade like avoidance in character competition to some extent finally I'm just gonna as you can see like here you have like readings for several years of studies another idea that kind of came out of this assembly is the idea of community phylogenetics right we know that we can reconstruct to some extent like the evolutionary history of species and that easy evolutionary history gives us a lot of information on what happens in terms of trades and resource utilization and whatnot in such like what you would think is that you can relate phylogenetic data for example phylogenetic trees with a community college right so this idea of community phylogenetics is exactly centered on this the history of community ecology from like late in the 19th century up to today what I'm gonna do today is actually take like some sort of like an older view this is like models that were developed when I was saying high school you know like or early in my college years and so we will examine some sort of a basic model of ecological assembly and we will try to ask some sort of intelligent questions and for which we can get an answer when we make a certain number of assumptions for our exploration just to keep things simple uh what I would like to use is like what is arguably like the simplest model for for population dynamics which is like the generalized lot of altera model uh maybe you've seen it in a different form let me just write it in component form first so this you it's one of like the six equations that we teach all ecologists in the world right so we're we're following like the density of populations say i a time t and we're following this population in time so we write a differential equation and typically what we write is like x i so the population density itself times our i our i is what like is the intrinsic growth rate you can think of this growth rate as like the the growth rate that this population would have when grown alone at very very low density these in fact can serve as two purposes like a growth rate if this is positive or a death rate if this is negative right if i put lions you know like in a nice field with no animals to eat they will die and then we have the interaction part like we these species interact with all the other species to some extent in the community so we take like the sum over j of a i j and then the density of a species j at time t right so so this is like in component form i rather prefer writing this in matrix form which basically say this is a vector now of growth rate d x d t and d of x here with big d means like a diagonal matrix with x on the diagonal and how come that and then r now will be what like a vector of growth rates of intrinsic growth rates and a is now a matrix of interactions okay and they assume there are n species and like i just labeled the species from one to n in whatever order you prefer so for a single species and maybe you've seen this when you when you've done the tutorial on non-linear dynamics this model can only have very very few outcomes they're not especially interesting so a species by itself can either grow exponentially it can decay exponentially and then grow extinct or it can reach some sort of an equilibrium like some some level at which it stops growing or shrinking when we include two or more or more species we can have like cycles neutral cycles or even like limit cycles that could even be stable like meaning attracting different trajectories to the same limit cycle and with three or more species we can even find chaos like chaotic dynamics so i have code in the repository that you can download to integrate like the dynamics of this model and here i'm just loading a particular example that that i found just like by by searching in which we have a certain matrix of interaction a and a certain growth rate r such that when we integrate the dynamics what you see here is that these species keep cycling for forever like this is a good example of a limit cycle right so the species will not stop the dynamics ever they will oscillate up and down in this fashion for forever okay so this is one of the cases of limit cycle you can find similar cases with like chaotic dynamics which you can think of as like cycles that however never close on themselves right they're non periodic cycle all right one thing that we can do in this model which is in fact the simplest thing that we can do in this model is to look for fixed points right so are there particular densities of the species imagine like a vector of density such that the dynamics at that point are fixed right they they stop like moving and because of the form of the equations right like what do we have let me maybe put an annotation here right so our equation is like v of x times r plus a x and these has to be zero for the dynamics to have stopped and so you can see that there's basically two cases either this part is zero right like the part we multiply something by zero and that it's zero or the the part within the parentheses is zero which is more interesting right because in this case the species might be present at the positive density and so then let's try to find the solution the solution exists when when these metrics a is not singular and I've seen that Zach just thought you like a bit of linear algebra so now you know what I'm talking about and so basically we want to solve a of x plus r is equal to zero which we can write as a of x is equal to minus r and so like what we would like to do is to somewhat divide by these metrics of course you cannot divide by a matrix but what you can do is to multiply by the inverse of these metrics both sides and then you find the solution right you find the solution as long as these metrics is not singular meaning there's no zero eigen value now we get the solution it could be a solution that contains some negative numbers and even for a theoretician I've never seen minus three turtles or like minus seven elephants so so these would not really be a feasible solution to to our system because like species have to have positive or at least non-negative density but if such a point exists right so if we have a solution for the system that these all positive components we call these a feasible equilibrium for the system and it is unique right because we're solving a system of linear equation that has a single a solution as long as a is not a singular in r right you you have code in r to do what to solve like the the system a you know if I want to solve a x is equal to b I can call solve of a comma b right and so we just do that with a and rb is going to be minus r right and so if we do this for for the system above like the one with the limit cycle that we had above what we find is that there is a positive a feasible equilibrium right so these are like the numbers here and in fact if you go in the plot again these horizontal lines that are dashed here this is exactly the solution of this of this thing and you can see like that for example this purple species oscillates up and down and the equilibrium is contained in the range of this oscillation and the same is true for green the same is true for red the same is true for blue okay that kind of gives us some idea of what's going on in fact you can even do a little more I didn't include like the the theorem or the proof here but but you can see how Bauer and Sigmund the pay the book that is referenced here you can show that to have coexistence of a certain number of species in generalized lot of altera you have a to have a feasible equilibrium in the interior right so you have to have a point where all the densities are positive that is an equilibrium for the system now this equilibrium might be stable or unstable and of course like to have for example limit cycles or to have chaos you need like an unstable equilibrium why if you want to have all the dynamics to all the trajectories to converge to this point this point has to be stable so next what should we do we should think about stability so have you covered like local stability analysis it's my question for Jacob or for whoever can answer in the notes or should I go over it like we have I mean it was discussed in one of the tutorials but I think it's always good to I mean very quickly remind the audience right so so just like as a reminder because you already should know about this but but maybe you forgot so we have a fixed point right so we have some point at which like dynamics are stopping and what we want to do is to say okay but our trajectories that start very very close to this point going to converge to this point or rather they're going to spiral away and some species will go extinct right so so if we want to have like coexistence at an equilibrium point it better be attractive right like you you should have like that if you perturb the densities of the species a little bit nothing much is going to happen and the way you do this type of analysis in fact is to take like the system put it at equilibrium and then tailor expand around it right like and if you tailor expand like the dynamics or so imagine that I'm saying just like something like I want to track in time let me just put an annotation I want to track in time what the perturbation say dx d of delta x in time right so imagine this delta x is like my equilibrium plus minus some very small quantity in fact infinitesimally small quantity and then if I if I tailor expand this what do I get like I should first put like my equations right this would be the generalized lot of altera equations evaluated the equilibrium but this is zero and then we would get what like some sort of Jacobian matrix evaluated the equilibrium point times my perturbation and then plus some higher order terms right and let's say that we don't care about the higher order terms because around like an equilibrium if the perturbations are small everything looks like a linear system and so then you can see that we have like this is zero this we removed so we end up with just like this Jacobian matrix and this is a linear system of differential equation which we can solve and what you can show is that this Jacobian matrix at equilibrium has to have all the eigenvalues with negative real part for this equilibrium to be attractive right so so that's the idea of in local asymptotic stability if that's the case provided that we start arbitrarily close to the equilibrium eventually like these trajectories will either converge to the equilibrium or at least not move away from the equilibrium so we're left with the way of writing like this Jacobian matrix and so all f of i you know just like the the lot of altera for species i what what we need to do is to just take like the partial derivative with respect to every other species that's the definition of of a Jacobian and if you do that you find like that we have for the term ij in the Jacobian we will just find aij times xi and then we have a slightly different formulation for the diagonal elements of this Jacobian right now we're we're deriving with respect to xi and so we find like the growth rate for species i the interaction with all the other species j plus another term that comes from the fact that this is really a quadratic equation in i right because we have something on the diagonal multiplied by xi and we have xi outside like the equations and as such we get this quadratic term and this will lead to this extra term aii xi however at equilibrium what do we have that this is in fact what's inside the parenthesis right when we write our our system like that and we're saying this is zero but this is exactly the same term so this whole thing is zero and therefore we end up with something very simple you see like the element ij is aij xi or aii xi which that means what that we just have like the matrix of interaction a and then we multiply each row of these metrics by the corresponding equilibrium when we evaluate these Jacobian and equilibrium which means simply like that we substitute to every xj and xi their equilibrium value so then these a Jacobian is especially simple for for the lot of altera model and we know that these a Jacobian evaluated the equilibrium which is called in ecology the community matrix and has to have eigenvalues with negative real part so now I have a question for you which is what do you think will happen in what would you think will happen to the Jacobian in the case of the limit cycle we seen before right we said like this there has to be an equilibrium point we we actually found that there is a feasible equilibrium point it was sort of in the middle of all these oscillations but if it were really like stable as long as we get like to this cycle close enough to this equilibrium it will converge right and then we would have just like fixed densities from then on right which means what that this equilibrium should be unstable all right and in fact like we can do the same that we were doing here mathematically we take this like x star like my equilibrium to be the solution of the system with a and minus r then we create these metrics and by multiplying a diagonal matrix of x stars times this is like the way r does like matrix multiplication a and then we can look at all the eigenvalues of these metrics and and see whether all of them have negative real part now in ecology we mostly are concerned with what with matrices that have contained real numbers right where all the coefficients are real numbers a matrix with real numbers has only basically two types of eigenvalues these eigenvalues can either be real numbers themselves right so imagine like numbers on the typical number line that you think about or they could be complex numbers but when they are complex numbers they have to be paired right what I mean is that you can just like draw these eigenvalues in the complex plane so imagine that this is like my real part of the eigenvalues this is my imaginary part of the eigenvalues and so every complex number is mapped into this plane and so my eigenvalues could be either be real numbers right which would appear here on this line or if they're complex number and I have a number here I have also to have another here right right so so like they have the same a real part and imaginary part with opposite sign and so let's look at these we have only four eigenvalues here right and so these one for example you can see that there's no imaginary part the imaginary part is zero so these would be a negative eigenvalue that would be somewhat here let's say and then we have two paired complex eigenvalues right that have positive real part here 0.37 and then they have like imaginary part there are couple 2.06 and minus 2.06 and finally we have another real eigenvalue here minus 0.61 are all the real parts of these eigenvalues negative no therefore this equilibrium that we had for the limit cycle is locally unstable right like the if I if I start even close enough to this trajectory it will not go back in fact what will happen is that it will move away from the equilibrium at least initially with a speed that depends on these eigenvalues right the smaller the slowest in the direction that will be the one given by the eigenvector corresponding to this eigenvalue or in case of like complex numbers like there would be two eigenvectors that determine these oscillations away from the equilibrium all right so so just to say this is how we would go about doing local stability analysis and and we will see in a second the way to do even stronger stability analysis but before we go there I just wanted to show that this equilibrium is in fact very important in large involuntary much more so than in other models because when we have dynamics they're not like fixed point dynamics right so imagine that instead of like converging all these trajectories of the densities of the species in time to a point they say oscillate or they have some chaotic dynamics the equilibrium even though it has to be unstable we just saw an example of that it still contains a lot of information on the system and in fact it provides us with like the average density of the species in time right and to do this what what you can do is like just to say let's take the average in time of the density of each species right and we can just write this as the integral and to make things much simpler what we're going to assume is that we're in some sort of cycle right and that we choose like time zero to be when we start like the cycle and time t when do we end the cycle such that you know after a certain time big t we're exactly in the same place where we started right this will make things a lot easier all right and of course we're interested in what in cases in which like this x of t is always positive right species don't go extinct in this cycle because otherwise they would not be part of the cycle and in such we can assume that all these numbers are positive and if all these numbers are positive we can take the log of these numbers right so we can take the logarithm and in fact we can write an equation for the logarithm of xi of t in time right and the way you would do this like this what v of log x dt is simply like dx dt divided by x so so it's very easy so we can divide each equation by xi of t and so what you can see is that this just like gets rid of the part that we had in front of our equation right so so if I write let another way to write this type of equation that is a little more compact is to say x dot is dx dt is v of x times r plus ax right and so now we want to take the log of x in time right like this is going to be a x dot divided by x and the such we get rid of this x right so we get r plus ax okay so that's like very convenient we will use this trick again later alright so that's like our equation in vector form now we can what we can do is to integrate both sides and basically take the average in time of both sides and so we just formally write this thing you can see that here we have dx dt and then multiplied by dt and so here like the equation becomes very simple because then we're just going to have like the logarithm of the species at time dt minus the logarithm of the species at time zero but because we did this assumption that we start and add at the same point these two numbers are the same right so the left hand side of this equation is zero and that's why this trick was useful and now we have to integrate the right hand side and you can see that we're integrating r which is like a vector of constant so we can take that out we can take out also the matrix a because also that does not change in time and so we end up with this right hand side like r plus a times and now wherever we add our species now we have the integral or like the average of the species in time and the way to solve this problem is to do what is to multiply both sides by the inverse of a right in fact minus the inverse of a and so we have that this minus a inverse r is what it's the equilibrium x star right and therefore like the right hand side which like becomes the x star here like here in the first place like where we have r we have a minus x star we bring it on the left side and now these metrics a will be cancelled by the inverse of the matrix and so you recover exactly what you expect like the equilibrium is what is the time average of the species in time so that's why this equilibrium is so important for lotcavolterra not all models will give you like these beautiful results in lotcavolterra you can show that these holes also for chaotic dynamics of course taking like the average of something that is known periodic is a little more difficult but you can think of some sort of long-term average or like the average will converge to this number and now let's take the dynamics of the limit cycle that we had before and then we can discard the first part of the dynamics let me just show you like the figure again so that you can see why are we doing that so you can see that we have some sort of initial dynamics they're a little different from the rest and then it's set to see something that looks a little more regular right that the cycle repeats over and over so this first part we call the transient dynamics right so it's like the way they approach some sort of attractor that could be a point in which case we would have an equilibrium it could be a limit cycle in which case we have something like what's on the board or some chaotic attractor but we always have this initial dynamics so let's discard those and then take the average of each species in time for the remaining part of the time series and if you do that even though like we're only around this model for a certain amount of time you can see that when we take the dynamics remove the initial transient dynamics grouped by species compute the mean density and then print it what we get is the set of numbers which you can see here it's very very very close to the equilibrium that we had computed right so if we were to do this for enough time right for a longer time then you would have exactly convergence to these numbers all right maybe this is a good time to to ask Jacopo if there are any questions on these first basic mathematics of lots of altera yes so there is a question actually about the stability criterion which is asking whether there are stability criteria for community matrices like the one you presented so I guess where you have the matrix multiplied by the density right yes there are things that you can say actually this is a good segue for for the next thing for example so imagine that we have some sort of matrix A right and and what we can ask is whether these matrix A is only eigenvalues that have a negative real time and let's say for example yes they they have right which means what that if I were to choose certain densities imagine that I choose like my B of x star right to be the identity matrix imagine that my equilibrium is all the species are one right then if I multiply the identity matrix here by any matrix I obtain the same matrix and therefore this equilibrium would be stable for for for this choice right if I could choose like for example growth rates such that all the species at equilibrium one of course what happens is that depending on this axis I might or might not have stability right so so the the stability does not only depend on the matrix of interaction it also depends on the equilibrium and therefore implicitly it depends on what the growth rate right of the system is this always the case not quite right like for example if I can take a matrix if my matrix A has this property that A plus the transpose of A right so imagine that now we are taking a matrix summing its transpose but we're going to obtain some sort of symmetric matrix a symmetric matrix we only have a real eigenvalues right because we would not have complex numbers anymore now if these matrix right which is like basically the symmetric part of A has only negative eigenvalues what you can prove is that for any choice of x star that is positive which is only the choice we're interested in these will be stable okay so in those cases even though we can choose the R's however we want and as long as we these R's yield a positive equilibrium then the equilibrium is going to be stable so this is a much stronger form of stability and in fact this is exactly the condition for like having only a equilibrium dynamics and in fact like that's the way we are going to use right now to prove global stability any other question there was a question on the actually on the introductory part and you mentioned the environmental filtering and plate under dispersion and the question is whether these terms are related to natural selection that's a very very good day a very very good question to some extent yes right like what what you have in in evolving population is that they try to adapt like to local conditions right like by by selecting upon like the various that is in the population maybe there are some individuals that have a certain genotype or phenotype or something such that they are more likely to grow in a given environment so that's basically the same mechanism right that would lead to that of course like the timescale would be quite different right if I put a lion here like on campus like unless they eat like the students they will not have time to really evolve you know a new diet based on on something that is here I don't know squirrels right they just would go extinct but but it's exactly the same principle at least and then I see a question that says whether there is a way to to determine whether there is a limit cycle based on eigenvalues and Simon Levy correctly says no unfortunately I would add no right it would be my life would be much easier if that were the case so to prove a limit cycle what you need to do is something a little more complicated which is to basically draw some sort of like a box right around like this point and then prove like that trajectories cannot cross this box and in fact they are reflected back like that is like the way to to show like that these dynamics would be contained in a certain space and then if you draw can draw another little box now around the equilibrium may show that dynamics will always go out of this box now the dynamics are squeezed between two boxes right like so that's the basic idea of how would you go about showing like different type of dynamics all right now let's concentrate for a moment on the simplest type of dynamics which are like equilibrium points right like that we have trajectories and they do whatever they have to do they oscillate up and down and what not and eventually converge to to some sort of an equilibrium and in fact this is connected with the with the question that we had before so so what we're gonna assume is that we can find a certain set of numbers like imagine positive numbers that we put on a on a matrix on the diagonal we call this diagonal c such that c times a plus a transpose times c has only negative eigenvalues right so this is again a positive a a matrix that is a symmetric and the such as only real eigenvalues imagine that all of these eigenvalues are negative right then our equilibrium point if it exists and it's feasible it's automatically stable and in fact it's globally stable meaning we can start the dynamics from any positive densities for all the species and the dynamics eventually will reach this point right and as I was saying like this is a very very strong condition for stability because it says if a stable and this property holds then any multiplication on the left by a diagonal matrix with positive numbers meaning that the equilibrium will not change the stability right this is called the stability right so so how do we do this thing of showing that all the trajectories go to a point that is an interesting and difficult question and in fact there aren't very many methods to tell you the truth because the problem is what we cannot really integrate these dynamics analytically we cannot write the solution for this system of very many equations like that are nonlinear so it's not that I can just say well let's write the solution of these equations x of t for any t and then I just take t very large and show that it converges to the equilibrium because I cannot write the solution so so what we can do is to use what is called the Lyapunov function and the idea of a Lyapunov function is fairly simple right we have a system that we cannot write the solution for what we're going to do is to write some sort of like summary statistics of all these pieces for example imagine I take like the sum of all the species or the variance of the species densities right and if I can write a function such that let me maybe write here let's say if I can write a function v of the dynamics right of x of t like this is my summary statistics and if I have this property that this v is always greater or equal than zero right and then v of x star of the equilibrium is exactly zero and then the derivative with respect to time of x of t is lower or equal than zero let's take lower than zero then what happens we have some positive function right like this number is always positive when we're not at equilibrium it always decreases in time it is here at the equilibrium which means what that we if we wait for long enough these dynamics will reach the equilibrium point so so this is the basic idea behind Lyapunov function now how do we write a Lyapunov function for the generalized Lyapunov altera model one way to do it is like let's write it in component form like we're saying v is what is the sum over all the species i of c of i which is like a constant that we want to determine of the density of species i minus the density of species i at equilibrium at equilibrium minus the density of species i at equilibrium times the logarithm of xi divided by x star right so this part of the equation you can see it's always positive and it's only zero at equilibrium right that's good that's that's nice and therefore if we choose positive numbers here it means that the whole function will be positive right because we're multiplying by a positive constant positive numbers and we're summing them so so we're guaranteed to have this to be a a positive function how do you come up with this equation that's an interesting question like i like this book by Steve Strogatz it has this quote that says that divine inspiration is usually required to be able to write these type of equations this is actually goes back to the work of Volterra and in fact like Goa has a wonderful paper on this in 1977 i can put maybe in the chat or add it to the next lecture for you right so now what what we're left with is to determine whether this derivative with respect to time of b is in fact a negative right and for doing this i think it's convenient just to do easy e matrix form right so so we can write these in matrix form by saying there's like a sum we can put one transpose for that of a diagonal matrix c and then we have like what here we add x so we get like x dot right this would be the right kind of this and then this part is a constant so it goes to zero and then this part here we would get just like minus a diagonal of x star and then a in x dot divided by a diagonal of x let's write let's write log of x okay so now we need to do a little trick which is to say well i want to get rid of the parameter r right so so when i write my equation and i say x dot is equal to d of x r plus ax right but at equilibrium i have that ax is equal to r right ax star is equal to r so so to minus r so so what what i can say right now is that then what the d equation i can write also as d of x a right now imagine that that that i am just writing r like this way right so then i would get a of x minus a of x star right which i get from here because if i change the sign here i get the minus minus x star and so even more compactly i can say d of x ax times delta x right the deviation from the equilibrium okay so with this at hand what we can do is to go on with our derivation and i think that then i'm gonna stop for the day and just take questions great um let me just finish this one second so we have this then we can say one transpose like c and then here we we just have like what a times delta x times d of x and then here we have minus d of x star a a of delta x so you can see now we have like this matrix that is x this matrix that is minus x so we can write this as diagonal of delta x one transpose c and then we have diagonal matrix of delta x of delta x and then a delta x and then diagonal matrices commute so we can swap these two and then we can multiply one transpose by delta x so we get delta x transpose c a delta x so now if this matrix c a delta x were to be negative definite you know that for any negative measure to meet matrix n let's call it right then we have that this is always lower and equal than zero lower or equal than zero and in fact is zero only if delta x is equal to zero which is our equilibrium condition and then when we're doing this thing we're basically summing like these this term right c a component like ij times delta x i delta xj and you can see that therefore like we're always going to sum this delta x i delta xj one time when we're doing the ij component one time where we're doing the ji component and as such only the symmetric part of this matrix will match right we can write the exactly the same equation by saying delta x transpose and then here we put c a plus the transpose of c a which would be a transpose c divided by two delta x and as such if we can find constants such that these metrics these whole metrics let's call it n is negative definite then the equilibrium is stable right so that's how you prove a global stability in this case and that's the derivation that you find here all right i think we we should like wrap up here and then next lecture we will start thinking really about assembly and what makes a ecological assembly difficult or easy to do so let's take some questions great thanks a lot thanks a lot stefano sorry for interrupting you too early so uh yes so we have time for uh for questions so please if you read them just ask them i think simon you want if you want to yes thank you stefano that was a terrific lecture i just wanted to go back as a philosophical question to something you said at the beginning about the neutral theory and i don't disagree but there's two sort of interpretations one and using the neutral theory you're actually assuming that's the nature of the interactions that they're stochastic and the other is you're saying we know that they their details but they don't matter at the higher level the same justification for example for using a diffusion model for for dealing with how animals disperse and it didn't make it doesn't make much difference for what you're talking about but i just think philosophically i'd be interested in your thoughts on that you know i agree that there are different interpretations of what do we mean by neutral because like we could think truly species do not interact that is kind of a difficult philosophical view to to keep like because we see like lions eating gazelles they they're definitely are interacting at least if you ask the gazelle you will get a yes for sure but also like we could have maybe like competitors and to some extent they sorted themselves such that they have very very weak interactions right because they try to partition their resources or in fact like they could have basically no interaction whatsoever so in this case it's not that like they would not have had interactions to begin with it's just that after like all these pieces are sorted you know we we don't really have interactions or another interpretation is like these interactions don't really matter like are much smaller than other processes that that dominate the dynamics right like all of these are philosophically like slightly different interpretation of the same phenomenon right i mean they may matter a lot at fine scales but when you coarse grain they may average out sort of due to law of large numbers yeah yeah in fact like going back on that one thing that i like a lot is what if we now instead of having no interaction we have random interactions yeah then we assemble systems like what you find is that like the statistics look very much like the neutral mode even though it's basically the opposite of a right of a neutral mode which like species have much much stronger interactions but still like a lot of the results that you would arrive look about the same and the other point but the other technical point maybe maybe it's not necessary that i i put in the chat is that you might have a stable limit cycle and the stable and the equilibrium point inside is not necessarily unstable it might be stable with let's say in two dimensions there's some unstable limit cycle that separates them and in higher dimensions some more complicated behaviors that could go on i don't know to what extent that maybe you can comment that's possible in the lot of ulterra equation that would not be possible right because we have like this much much simpler model like for for dynamics but yeah in generic mode that we could have much more complicated like a dynamic such that a certain area goes to some equilibrium some other area goes to a limit cycle or unstable limit cycle shop was like the system between two all sorts of things yeah yeah maybe it gets really interesting and really complicated that's why i wanted to do lot of ulterra because it's just like the same test that you can think of anyway brilliant overview thank you thank you great thanks a lot um any other comment or question uh all right and if you don't have any other like you can ask them like the next lecture and or you can go over the notes again and then maybe some questions will arise and feel free like to even email me and then answer them before i start next time exactly so stefano will give the second lecture of three this friday so you have time to think about ah there is a question actually in the chat so how does a constraint on the total population as seen is in the replicator equation change the stability criterion for a fixed point in other words does the community matrix for a lv system with and without this constraint have the same stability criteria that's a very interesting question it's too bad that i'm not talking a lot i love the replicator equation and i have other lectures on the replicator equation so so the question is what if we put some other constraints for example in the replicator equation is basically the cousin of lot cavolterra the only difference is that now we're tracking proportions of the density of species rather than the densities themselves right so imagine that these proportions always sum to one which means that if one species has to go up somebody else has to go down because they have to sum it to the same number in the replicator equation when you're doing the sort of linearization around an equilibrium point you will always find a direction that is the directional orthogonal to the symptoms right like you have a direction in which instead of like staying such that the proportions have to one now all the proportions have to some larger number or smaller number right that direction that is orthogonal to the simplex you can discard because you don't really care you know that the dynamics keep the the keeps the system in the simplex and the such this direction the extra direction you don't care in fact like i would suggest like maybe i'll put like some sort of like link in the chat there is a beautiful equivalence between replicator equation lot cavolterra so for every lot cavolterra you can write a replicator equation with one more species where species is not a real species anymore and conversely for every replicator equation you can write a lot cavolterra system by ditching one of the species great so well i think if there are other questions you can ask stefano on friday so thanks again stefano for giving this lecture and everybody to participate and we'll see each other again tomorrow at usual time at one fifteen impact on time for the first lecture by marino ga so thank you very much and see you tomorrow