Equilibria and stability analysis Michael Kopp 11 May 2011 Introduction Models in ecology and evolutionary biology often look at how variables such as population size or allele frequencies change over time. Mathematically speaking, such models are called dynamical systems. In an ideal world, one would like to know the value of each variable at all times. However, this requires obtaining a general solution, which usually is not possible. Nevertheless, a lot can be learned by focusing on the equilibria of a system and their stability. The following summary of stability analysis is largely based on the book by Otto and Day 1. We will distinguish four cases: One- vs. multi-variable models, and discrete vs. continuous time. Equilibria and stability A system at equilibrium does not change over time. In single-variable models, a particular value of the variable is an equilibrium value if the variable, when started at this value, does not change. In multi-variable models, the equilibrium is given by a set of values (one for each variable) which, together, cause the system to remain unchanged. An equilibrium is locally stable (or locally attracting) if a system near the equilibrium approaches it. 1 A biologist s guide to mathematical modeling in ecology and evolution, Princeton University Press, 2007 1
An equilibrium is globally stable if a system approaches it from all initial conditions. An equilibrium is unstable (or repelling) if a system near the equilibrium moves away from it. The set of initial conditions leading to a particular equilibrium is called its domain (or basin) of attraction. A globally stable equilibrium Two locally stable equilibria, separated by an unstable equ. The techniques reviewed here are only concerned with local stability. They are based on the fact that, close to an equilibrium, any model can be approximated by a so-called linear model, whose behavior can be readily analyzed (so-called local or linear stability analysis). In generally, performing a local stability analysis involves the following steps: 1. Find all equilibria of the system. Note that non-linear models can have more than one equilibrium. 2. Check under what conditions the equilibria are biologically relevant (e.g., population sizes must be non-negative, allele frequencies must be between 0 and 1). 3. Determine the local stability of each equilibrium. This is done by calculating a a quantity λ, which is called the dominant eigenvalue of the system. In one-variable models, λ is simply the derivative of the update rule evaluated at the equilibrium. In multi-variable models, it is calculated from the so-called Jacobian matrix, which collects all possible derivatives of the update rules for each variable). Case 1: One variable, discrete time A discrete-time one-variable model can be formulated as a recursion x t+1 = f(x t ) 2
or a difference equation n = n t+1 n t = f(n t ). Consider first a recursion. For stability analysis, perform the following steps: 1. Find the equilibria ˆn by setting n t+1 = n t = ˆn and solving for ˆn (either by hand or using a software such as Mathematica). 2. Check whether and when the equilibria are biologically meaningful. 3. Differentiate f(n t ) with respect to n t. 4. Evaluate the derivative at an equilibrium ˆn, that is, replace n t by ˆn. The resulting value is the eigenvalue λ for this equilibrium, i.e., λ = f (ˆn) = (df/dn) n=ˆn 5. Evaulate the stability of the equilibrium according to the following rules: λ < 1: ˆn is unstable (oscillatory) 1 < λ < 0: ˆn is stable (oscillatory) 0 < λ < 1: ˆn is stable (nonoscillatory) λ > 1: ˆn is unstable (nonoscillatory) Nonoscillatory implies that the population remains on the same side of the equilibrium over time. Oscillatory means that the population alternates from side to side of the equilibrium. 6. Repeat the previous two steps for each equilibrium of interest. If the model is formulated as a difference equation, the procedure is the same, with two exceptions: Equilibria are found by replacing n t with ˆn and setting n = f(ˆn) = 0. The definition of λ changes to λ = f (ˆn) 1 = (df/dn) n=ˆn 1. 3
x(t+1) λ >1 0 < λ < 1 x(t+1) 1 < λ < 0 x(t) λ < -1 x(t) From Otto and Day 2007 4
Example: The discrete logistic The discrete logistic equation, N t+1 = N t + r d N t (1 N t /K) has two equilibria, N = 0 ( trivial equilibrium ) and N = K. To calculate stability, we need the derivative of the right-hand-side with respect to N t dn t+1 dn t = 1 + r d 2r d K N t For N = 0, we get λ = 1 + r d, that is, the equilibrium is unstable whenever r d > 0. For N = K, we get λ = 1 r d. For 0 < r d < 1, the equilibrium is stable and approached without oscillations. For 1 < r d < 2, the equilibrium is stable and approached in with damped oscillations. For r d > 2, the equilibrium is unstable and the population shows cyclic or more complex behavior. Case 2: One variable, continuous time A continuous-time one-variable model is given by a differential equation dn dt = f(n). Stability analysis requires the following steps: 1. Find the equilibria by replacing n with ˆn, setting dn/dt = f(ˆn) = 0 and solving for ˆn. 2. Check whether and when the equilibria are biologically meaningful. 3. Differentiate f(n) with respect to n. 4. Evaluate the derivative at an equilibrium ˆn, that is, replace n by ˆn. The resulting value is the eigenvalue λ for this equilibrium, i.e., λ = f (ˆn) = (df/dn) n=ˆn 5
5. Evaulate the stability of the equilibrium according to the following rules: λ < 0: ˆn is stable. λ > 0: ˆn is unstable. Unlike the discrete-time models, a one-variable continuous-time model (i.e., a single differential equation) never shows oscillations. 6. Repeat the previous two steps for each equilibrium of interest. From Otto and Day 2007 Example: The discrete logistic The continuous logistic equation, dn/dt = r c N(1 N/K) has two equilibria, N = 0 ( trivial equilibrium ) and N = K. The derivative of the right-hand-side with respect to N is d(dn/dt) dn = r c 2r c K N t 6
For N = 0, we get λ = r c, that is, the equilibrium is stable for r c < 0 and unstable otherwise. For N = K, we get λ = r c, and the stability properties are the opposite of those for N = 0. Case 3: Multiple variables, discrete time A general (non-linear) discrete-time model with n dynamics variables x 1,..., x n is a system of recursions x 1 (t + 1) = f 1 (x 1 (t),..., x n (t)) x 2 (t + 1) = f 2 (x 1 (t),..., x n (t)). x n (t + 1) = f n (x 1 (t),..., x n (t)) Equilibria are found by determining the values of the variables that cause all of the variables to be the same in the next time step, i.e. f 1 (ˆx 1,..., ˆx n ) = ˆx 1 f n (ˆx 1,..., ˆx n ) = ˆx n Solving such a system of equations may be difficult (or even impossible). Often, it will be helpful to use a software such as Mathematica. Multivariate stability analysis makes use of the Jacobian matrix f 1 f x 1 (x 1,..., x n ) 1 f x 2 (x 1,..., x n )... 1 x n (x 1,..., x n ) f 2 f x J = 1 (x 1,..., x n ) 2 f x 2 (x 1,..., x n )... 2 x n (x 1,..., x n )...... f n f x 1 (x 1,..., x n ) n f x 2 (x 1,..., x n )... n x n (x 1,..., x n ) where f i x j (x 1,..., x n ) is the partial derivative of f i with respect to x j (a partial derivative is just a normal derivative with respect to one variable if the function has several. 7
variables). Thus, the Jacobian collects all the possible first-order derivatives (of all functions with respect to all variables). Stability is then determined as follows: 1. Find the equilibria. 2. Determine whether and when they are biologically meaningful. 3. Calculate the Jacobian. 4. Evaluate the Jacobian at an equilibrium of interest, that is, replace x 1,..., x n in the Jacobian with ˆx 1,..., ˆx n. This can be written as Ĵ = J x1 =ˆx 1,...,x n=ˆx n, and the result is sometimes called the local stability matrix. 5. Calculate the eigenvalues of Ĵ. Usually, you ll want to use Mathematica for that, but in principal, the eigenvalues λ 1,..., λ n are given by the n solutions ( roots ) of the characteristic polynomial det(ĵ λi) = 0 when solved for λ (where I is the identity matrix). (Of course, writing out the determinant and solving the resulting nth-order equation is also something you don t want to do by hand for anything larger than a 2 2-matrix.) 6. The equilibrium will be locally stable if the absolute values of all n eigenvalues are less than one. For real eigenvalues, this simply menas 1 < λ < 1. For complex eigenvalues (of the form λ = a ± bi), the absolute value is defined as (a 2 + b 2 ). Instead of talking about the absolute value of all eigenvalues, people often just refer to the absolute value of the leading or dominant eigenvalue (which is defined as the eigenvalue with the largest absolute value). (If the leading eigenvalue equals one exactly, the local stability analysis is inconclusive.) 7. Whether the eigenvalues are real or complex provides information about the behavior near the equilibrium. If they are complex, then the system will spiral around the equilibrium along some axes. 8. Instead of calculating the eigenvalues, it is often easier to use the Jury test, which provides information about the size of the absolute value of the leading eigenvalue without requiring its precise formula. For systems with two-variables, the absolute value of the leading eigenvalue is less 8
than one (i.e., the equilibrium is stable) if 1 tr(ĵ) + det(ĵ) > 0 det(ĵ) < 1 1 + tr(ĵ) + det(ĵ) > 0. Here tr(ĵ) is the trace and det(ĵ) the determinant of Ĵ, which, for Ĵ of the form Ĵ = ( a c d b ) are defined as tr(ĵ) = a + d det(ĵ) = ad bc. Furthermore, the eigenvalues are complex if tr 2 (Ĵ) < 4 det(ĵ). 9. Repeat the steps 4 to 8 for all equilibria of interest. 9
Case 4: Multiple variables, continuous time A general (non-linear) continuous-time model with n dynamic variables x 1,..., x n is a system of differential equations dx 1 /dt = f 1 (x 1, x 2,..., x n ) dx 2 /dt = f 2 (x 1, x 2,..., x n ). dx n /dt = f n (x 1, x 2,..., x n )) Equilibria are found by determining the values of the variables that cause all of the variables to remain constant, i.e. f 1 (ˆx 1,..., ˆx n ) = 0 f n (ˆx 1,..., ˆx n ) = 0 Again, there may be multiple equilibria, and finding them may be difficult. Stability analysis works like this: 1. Find all equilibria. 2. Determine whether and when they are biologically meaningful. 3. Calculate the Jacobian. 4. Evaluate the Jacobian at an equilibrium of interest, that is, replace x 1,..., x n in the Jacobian with ˆx 1,..., ˆx n. This yields the local stability matrix Ĵ = J x1 =ˆx 1,...,x n=ˆx n. 5. Calculate the eigenvalues of the Ĵ. Again, these are the roots of the characteristic polynomial det(ĵ λi) = 0, but usually, you ll want to use Mathematica. 6. The equilibrium is locally stable is the real parts of all eigenvalues are negative. Equivalently, the real part of the leading eigenvalue (i.e. the eigenvalue with the largest real part) must be negative. If the real part of the leading eigenvalue is exactly zero, the analysis is inconclusive. 7. If the eigenvalues are complex, the system will spiral around the equilibrium along some axes.. 10
8. Instead of actually calculating the eigenvalues, one can use the Routh- Hurwitz criteria. For a model with two variables and a Jacobian Ĵ = ), the equilibrium is stable if ( a b c d det(ĵ) = ad bc > 0 tr(ĵ) = a + d < 0. Furthermore, the eigenvalues are complex if tr 2 (Ĵ) < 4 det(ĵ). 9. Repeat steps 4 to 8 for all equilibria of interest. 11
12