Now that we know how to model and predict the outcome of a simple ecological system, let’s turn back to darwinian evolution. Do you remember how giraffes' necks got longer over time? Well, we’ll do exactly the same thing with bacteria! Meet our first strain of bacteria:
Here, we colored the DNA a certain color to represent the strain of bacteria. Two bacteria with the same DNA color will have the same trait (for our giraffes, the trait was the length of their necks). We won’t go into the details of the traits just yet, and just assume that two bacterial populations with different traits will have different efficiency in gathering resource and growing, and will compete for the same resource.
Invaders 👾
Now that the stage is set, let’s bring in the invaders. Just as one day, a giraffe was born with a slightly longer neck, here one division ended with a single bacterial cell having a slightly different trait. We’ll call it the mutant population:
When the mutant arrives, we assume that the resident population is at its ecological equilibrium: this means that it had enough time to reach a stable state before the invasion occurs. We will see that this is an important hypothesis to make later in this article.
If we assume that both the resident population and the mutant population consume the same resource, but with different efficiencies, we can apply what we call the competitive exclusion principle and assume that one population will drive the other to extinction. The population remaining is then deemed ‘fitter’ than its competitor.
And if we model the system the way we learned last time, we can see that we were right!
And now, the roles have changed: since the resident population has gone to extinction and the mutant has thrived, we can say that now, the mutant population has become the new resident.
Determining the outcome of an invasion beforehand
Thanks to the deterministic nature of our simplified model, we will be able to predict the outcome of any invasion event. Remember, by dealing with large populations, we were able to smooth out the randomness of our initial model, which will allow us to unfold the events of an invasion without simulating the system.
Let’s focus on the equilibrium points of a system comprised of two populations, the residents and the mutants. For the sake of clarity, we’ll treat the resource implicitely. Let’s try and list the potential equilibrium states:
 We could think of an equilibrium where both populations are extinct. While this equilibrium is possible, it is also not very interesting, as we know that our system can at least sustain one population. We can show easily that no normal system will evolve towards this equilibrium on its own.
 There is an equilibrium where the resident population is at a steady state, and the mutant is extinct. We know for sure that this equilibrium exists, since it was the state of the system before the inclusion of the mutant.
 Since the resident and mutant populations are phenotypically close, by symmetry there should be an equilibrium with the mutant at a steady state and the resident at extinction.
Since we work under the competitive exclusion principle, we can rule out an equilibrium where both populations are at a steady state. We can thus represent the different equilibrium points on a graph on which the xaxis represents the density of the resident population and the yaxis the density of the mutant population.
This graph will prove to be useful to visualize the dynamical evolution of our system.
Let’s now put ourselves at the beginning of the invasion, when the population of residents is at ecological equilibrium and the mutant population very small compared to that. That means that we are very close to equilibrium 2, as we can see:
Now, we want to know the equilibrium point towards which the whole system will evolve. First things first, we need to figure out whether the resident population will initially increase, decrease or stay the same, and do the same with the mutant population.
At the initial state of the system, the mutant density is assumed so small compared to the resident that it will not immediatly disturb it from its equilibrium state. That means that we only need to focus on the direction of evolution of the mutant population, whether it will grow or decline and focus on the following cases:
We will see that this initial growth rate (which can be negative if the population initially decline) of our mutant population is enough to determine the fate of the whole system. To prove this, let’s focus individually on both cases. The key thing to remember here is that we know that our system will evolve towards an equilibrium state eventually.
Let’s first see what happens if the mutant population initially declines. Since we have established that no system will evolve naturally towards mutual extinction, the only other possible state it can evolve towards is equilibrium 2, where the resident is at its steady state and the mutant is extinct^{1}.
We can then be sure that the system will evolve in the following manner, regaining its original state. The resident is in this case fitter than the mutant.
Let’s now study the second case, where the mutant population initially thrives. This case is a little bit trickier, as we don’t have an immediate equilibrium point to go to, and the beginning of the trajectory of the system could look something like this:
What next? Well, since we know that the system must evolve towards a steadystate, we can just list the ones we know and see if the system can evolve towards them.
 We established earlier that this equilibrium point repels any trajectory, so we can immediatly rule this one out.
 If our system left this equilibrium point, we can assume it was for a good reason! We can rule out this steady state as the endpoint of our system^{2}.
 This leaves us with the equilibrium point in which the resident population is extinct.
And as simple as that, we can conclude that our system will evolve in the following manner, without any calculation!
Let’s take a moment to think about what we have just showed. By looking at the initial growth rate of the mutant population, we were able to determine the fate of our whole system. If this growth rate is negative, the resident population stays at equilibrium and the mutant goes extinct, and viceversa.
This initial growth rate for the mutant population is what we call the invasion fitness, and it is the cornerstone of adaptive dynamics. We usually write it $S$, with $S(\tau_\text{mut},\tau_\text{res})$ being the invasion fitness of mutant population with trait $\tau_\text{mut}$ over the resident population with trait $\tau_\text{res}$.
Taking a step back
Now that we know how to resolve the event of one invasion, we can rinse and repeat. Indeed, just as we saw with the giraffes, nothing stops us from imagining another mutant appearing and taking over, leading to a gradual evolution in the population phenotype until a stable phenotype appears that can’t be invaded.
This seems to fit perfectly the modelling philosophy we followed until now, and let me reassure you, that is exactly what we’re going to do eventually. But doing this hides a major assumption, just as important as the one we made when we started working with large populations. Indeed, without even thinking about it, we separated the ecological timescale from the evolutionary timescale.
In practice, it means that we assumed that mutations occured very rarely, and that each invasion had plenty of time to unfold before the next mutation appears, essentially making it instantaneous compared to the evolutionary timescale. This allows us to consider that between two invasions, the population is monomorphic (i.e. has only one trait). While in practice this is of course not the case, it is a reasonable enough assumption for studying the general evolution of population on long timescales, which is exactly the case with climate change. On the other hand, since we have at every time step a monomorphic population, it is impossible to study the diversity of phenotypes under this framework.
To have a concrete idea of the scope of the assumption we’re making, let’s compare an actual simulation we ran with individual cells to what the outcome of the system under our two assumptions (big populations and separation of timescales):
As you can see, it is a pretty big change! But don’t worry, it’s still sufficient for plenty of studies. Indeed, for instance our assumptions are enough to calculate the value of the evolutionary stable strategy $\tau^*$, and we’ll see that this is enough to evaluate the influence of climate change on the nutrient cycles in the ocean.
If you want to go further
 Nicolas Champagnat, Régis Ferrière, Sylvie Méléard, Unifying evolutionary dynamics: From individual stochastic processes to macroscopic models, Theoretical Population Biology, Volume 69, Issue 3, 2006, Pages 297321, ISSN 00405809, https://doi.org/10.1016/j.tpb.2005.10.004.
 Sylvie Méléard, Modèles aléatoires en Ecologie et Evolution, Springer Berlin Heidelberg, 2016, https://doi.org/10.1007/9783662494554

You might tell me “but aren’t there fringe cases in which the mutant initially declines, but eventually turns around and beats the resident?”, and that would be a good remark. The key to understanding why that can’t be the case is the fact that since we’re talking about resident populations infinitely big, the gap between the intial state and the xaxis is infinitesimally small. So to speak, this turn of event has no ‘room’ to occur. ↩︎

Though one could theoretically find systems in which the trajectory curves and comes back to the equilibrium point it left, it is a fringe case, and in the simple system we study, we can show that this does not happen. ↩︎