Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ed 1011

235 views

Published on

an embarrasingly simple intro to differential equations

  • Be the first to comment

  • Be the first to like this

Ed 1011

  1. 1. Elements of Mathematics: an embarrasignly simple (but practical) introduction to ordinary differential equations Jordi Vill` i Freixa (jordi.villa@upf.edu) a November 23, 2011Contents1 A first example 22 Logistic growth 33 Equilibrium in ODEs 54 The spruce budworm case 6 4.1 Adimensionalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.2 Steady state analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Oscillations and delays 9 5.1 Delay differential equations (DDEs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.2 A simple oscillatory system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.3 Delayed logistic model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Predator-prey model 12 6.1 Phase curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.2 Jacobian matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Numerical integration 15 1
  2. 2. MAT: 2011-31035-T1 MSc Bioinformatics for Health SciencesFigure 1: a) Different possibilities for N (t) = N0 e(b−d)t depending on the birth/death relationship;b) Comparison of human world population and N (t) = N0 e(b−d)t for b − d = 0.00758 Sources of information 16 Check also [1, 2]. Nota de classe recollir nous exemples del llibre de l’Alon1 A first exampleLet us take N (t) as the function determining the population of a species at time t. We can expressits variation as: dN = births − deaths + migrations (1) dtWe typically call this expression population conservation equation. In a Malthussian model we assume there are no migrations and that the rate of increase anddecrease of the population is proportional to the population itself: dN = bN − dN dtwith b and d beint constant and positive with initial population being N0 . We can show that afunction that fullfils this expression is (see Figure 1a): N (t) = N0 e(b−d)t. Figure 1b shows how such a model is not far from what really occurs.DEs 2
  3. 3. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Figure 2: Data from WHO Nota de classe afegir algun altre exemple biolgic a la primera part However, things are not that easy. Figure 2 shows the number of countries with less that 2.1kids per woman on average. This is of course just one of the many factors affecting the form of Eq.1. So, we need to add extra complexity to the problem.2 Logistic growthIt is clear that it is necessary to find a better representation of the function f (N ) in dN = f (N ) dtFollowing Taylor’s approximation up to second order (n = 2) close to f (0) we find, consideringf (0) = 0: f (0) 2 f (N ) ≈ P2 (N ) = f (0) + f (0)N + N 2 =0 lineal term quadratic term The linear term is: f (N ) ≈ f (0)N = rNwhere we have called r the constant f (0), and, thus, r is the intrinsic growth rate, as we saw before.On the other hand, the quadratic term can be written as: f (0) 2 f (0) f (N ) ≈ f (0)N + N = f (0)N 1 + N 2 2f (0)DEs 3
  4. 4. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences dN dt = f (N ) dN dt = bN − dN → N (t) = N0 e(b−d)t rt dN dt = rN 1 − K N → N (t) = K+N0Ke −1) N0 (ert Figure 3: Summary of the exponential and logistic curves By doing r = f (0) and K = − 2f (0) we get the expression for the logistic growth of a population f (0)(Verhulst, 1838): N f (N ) ≈ rN 1 − KThus, following this model, the rate of variation of the size of a population can be expressed as dN N = rN 1− dt Kwhere N = N (t) gives the size of the population at t, while r and K (hosting capacity) are positiveconstant values. Exercise 1Show how, for a logistic curve, the inflection point is right at half the saturation value. N0 Kert N (t) = K + N0 (ert − 1) Exercise 2 A population is characterized by a modified logistic curve that includes the effect of a constantwithdraw of individuals: dX X = rX 1 − −a dt KFind the equilibrium points. What is the maximum value of a to ensure a viable population? Nota de classe The function f (X) is a parabola that is displaced down a units. Thus, the equilibrium pointsare found by X rX 1 − −a=0 K rX − rX 2 /K − a = 0 −r ± r2 − 4ra/K X= 2r/KDEs 4
  5. 5. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Figure 4: a) Shape of the logistic curve; b) equilibrium analysis of the logistic curve in a).It is obvious that depending on the values of the argument of the square root we will have differentsituations, with a possible non viable population for a too big. In particular: r2 − 4ra/K = 0 r(r − 4a/K) = 0which yields that if a > rK/4 the population cannot be viable. Figure 3 summarizes the equations for the exponential and logistic curves. What occurs ifN0 > K/2 or N0 < K/2 (See Figure 4)?3 Equilibrium in ODEs dNEquilibrium: dt = 0. • N ∗ = 0 unstable equilibrium, as f (N ∗ = 0) > 0 • N ∗ = K stable equilibrium, as f (N ∗ ) < 0. Exercise 3Let N (t) be the size of a population at time t. If this population evolves following a logistic curve dN N = 2N 1− dt 100with N ≥ 0, calculate the equilibrium points and analyze their stability.DEs 5
  6. 6. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Figure 5: The worm and its food, and how their populations are linked Exercise 4 In sexually reproductive species, individuals may experience a rate of recruiting that is too low whenthe population density exceeds a given level. This phenomena is known as Allee effect. Extendingthe logistic curve we can capture this effect: dN N = rN (N − a) 1 − dt Kwhere r, a and K are positive constants. Study the equilibrium states for this system for differentvalues of N0 .4 The spruce budworm caseThe case of the spruce budworm C. fumiferana is one of the simplest in which we link the prey (thebudworm), its feeding habits and its predators (Figure 5) [?]. It is simple because we do not dealwith the fluctuations in the predators population, but it is a good example of the expansion of thelogistic curve. It can modelled by: dN N = rB N 1− − p(N ) dt KB births predationDEs 6
  7. 7. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciencesor, more precisely: Nota de classe Trobar cita: Ludwig proposed in 1978[?]: dN N BN 2 = rB N 1− − (2) dt KB A2 + N 2 birthswith A, B > 0 and B = βP (predating efficiency per number of birds). • rB , the natural growth rate, as in the logistic model; • KB , the carrying capacity, as in the logistic model; • B = βP , being β a measure of predation efficiency. If birds are good at catching spruce budworms, this number will be larger than if birds often miss the budworm they are attacking. P is the bird population, considered a constant in this model; • A is called the switching value, more on this soon. N2A2 +N 2 is called a Holling Type III predation function. It measures how intensively the birds willselect spruce budworms for predation. The idea is that birds are lazy, they will go where food densityis high allowing them to consume much while expending minimal energy. If the spruce budwormdensity is low, birds will opt for some other prey which most likely lives in other parts of the trees.For example, if birds decide that beetles are abundant, they will congregate around tree trunksand branches where beetles can be found, leaving the spruce budworms unmolested. On the otherhand, once the budworm population increases the birds will leave the beetle habitat behind andbegin focusing on the easier prey, budworms in this scenario. Thus predation on budworms exhibitsthis switching phenomenon, and it is this behavior which is represented by the Hollings Type IIIfunction. The importance of the parameter A, known as the switching value, is that when N = Athe value of the Type III predation function is exactly one-half. This indicates the population atwhich predators begin showing increased interest in harvesting budworms.14.1 AdimensionalizationWhen one adimensionalizes a given equation does precisely that: eliminates the units by choosingappropriate substitutions for the original variables. A possible adimensionalization for the budwormproblem would be: N ArB KB Bt u= , r= , q= , τ= A B A Awhich transforms Equation 2 into: du u u2 = ru 1 − − = f (u; r, q) dτ q 1 + u2. This is beneficial for the analysis of the equation 1 See more on this at http://www.stolaf.edu/people/mckelvey/envision.dir/spruce.htmlDEs 7
  8. 8. MAT: 2011-31035-T1 MSc Bioinformatics for Health SciencesFigure 6: The analysis of the expression h(u) = g(u) for the adimensional budworm equations yields1 to 3 stationary points while varying r leaving q constant. Figure 7: Different values for r and q may produce histeresis.4.2 Steady state analysis du u u2 = ru 1 − − = f (u; r, q) = 0 dτ q 1 + u2Solutions: • u=0 u u • h(u) = r 1 − q = 1+u2 = g(u)The second solution can be analyzed in graphical form, if we think in the problem h(u) = g(u). Fig-ures 6 shows such analysis. Check also http://www.aw-bc.com/ide/idefiles/media/JavaTools/wormtime.html. This system presents bifurcation points. To understand the meaning of the different regions in7, check http://www.aw-bc.com/ide/idefiles/media/JavaTools/wormkr.html.DEs 8
  9. 9. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Nota de classe repassar el concepte d’histresi en EDs Exercise 5 Let us assume that the population of a given fish species follows a logistic curve and that we collecta given amount of individuals per unit time following: dN N = rN 1− −H dt Kwhere we assume that r = 2 and N = 1000. 1. find the equilibrium points and analyze their stability 2. What is the maximum rate of extraction that keeps a viable size for the populaiton?5 Oscillations and delaysFigure 8 shows an example of engineered biological oscillator. Figure 9 shows another example ofoscillatory behaviour in the differentiation of the somites during embriogenesis. In this particular case, we can imagine a simple model in which there is just a ”feedback loop”by which a gene (Her1) generates a protein that interacts with the DNA regulatory region of thesame gene, inhibiting its own transcription: dp = am − bp dt dm = f (p) − cm dtCan this simple system explain by itself the oscillatory behavior? In fact no if a, c > 0 (we will notdemonstrate it).5.1 Delay differential equations (DDEs)To introduce oscillations we could choose to incorporate more components into the model, but therea simpler way to do it. Let us assume that Tm represents the time that an mRNA molecule needsto mature and that Tp the time lapse until a given protein is functional. Then: dp(t) = am(t − Tm ) − bp(t) dt dm(t) = f (p(t − Tp )) − cm(t) dtDEs 9
  10. 10. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences d[P X] dt = −β(P X − X) d[P Y ] dt = −β(P Y − Y ) d[P Z] dt = −β(P Z − Z) d[X] α dt = −X + 1+P Z n + α0 d[Y ] α dt = −Y + 1+P X n + α0 d[Z] α dt = −Z + 1+P Y n + α0 Figure 8: The repressilator model [3]DEs 10
  11. 11. MAT: 2011-31035-T1 MSc Bioinformatics for Health SciencesFigure 9: Example of the Notch/Delta pathway induced oscillations in the development of thesomites The above equations consider that there is a time needed to mature the system. In generalequations of the type dN (t) = f (N (t)) dtare transformed into dN (t) = f (N (t), N (t − τ )) dtwhere τ is the delay parameter.5.2 A simple oscillatory system πtTake, for example, N (t) = A cos 2T (with A constant). It is easy to see that such function representsa solution for dN π = − N (t − τ ) dt 2τSo: d d πt N (t) = A cos dt dt 2τ dN Aπ πt Aπ π(t − τ ) =− sin =− cos dt 2τ 2τ 2τ 2τusing that cos(a − b) = cos(a)cos(b) − sin(a)sin(b)DEs 11
  12. 12. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Figure 10: Variation of the number of hares and lynx in a wild population5.3 Delayed logistic modelAnother simple example can be obtained by extending the logistic model to assume that the regu-latory term depends on the population at a previous time t − τ : dN N (t − τ ) = rN (t) 1 − (3) dt Kwhich needs to be solved numerically (see accompanying excel file). The result is an oscillatoryfunction. Why is that? By close inspection of Eq. 3, it is easy to see that, given t = t1 at whichN (t1 ) = K, • for t < t1 , N (t − τ ) < K and, thus, at t = t1 the poppulation is still growing, dN/dt > 0 (note that the logistic curve would suggest that the population would not increase anymore, as we already reached K); • when t = t1 + τ we reached dN/dt = 0. Is that an stable steady state? Nota de classe s estable? podrem fer la derivada de f (N ; τ ) respecte N ?6 Predator-prey modelEcology is more complex and two species are linked by their interactions (see Figure 10). Lotkaand Volterra (1926) proposed a pair of first order non-linear differential equations to describe thepredator (P ) prey (H) interactions: dH = rH − aHP = H(r − aP ) dt dP = bHP − mP = P (bH − m) dtIt is not very realistic, but it is a good start for discussion. Thus, a qualitative study leads to Figure11.DEs 12
  13. 13. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Figure 11: A qualitative view of the Lotka-Volterra model Nota de classe buscar les refs perdudes6.1 Phase curves Nota de classe incloure nullclines (FitzHugh-Nagumo) i phase portrait (phase space) veure apunts la carpeta demates del mster bH(t) aP (t)We start by adimensionalizing the L-V expression by using u(τ ) = m , v(τ ) = r , τ = rt andα = m , getting r du dv = u(1 − v), = αv(u − 1) dτ dτWe can obtain dv v(u − 1) =α du u(1 − v)that can be easily integrated yielding Nota de classe xdx x b usar ax+b = a − a2 ln |ax + b| i fent que u − 1 = x i v − 1 = x per integrar cada terme de laigualtat resultantDEs 13
  14. 14. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences Figure 12: Direction field for the Lotka-Volterra model. αu + v − ln uα v = K ∂f (u,v) ∂f (u,v)This function has a minimum at ∂u = ∂v = 0, where f (u, v) = αu + v − ln uα v − K. Thederivatives follow: ∂f (u,v) ∂f (u,v) ∂u ∂v v u 1 1 α− uα v αvuα−1 =0 1− uα v αu = α 0 u=1 v=1 m rThat involves that such a minimum will exist at H(t0 )∗ = b i P (t0 )∗ = a or, in our adimensionalizedversion: u∗ = 1 and v∗ = 1.6.2 Jacobian matrixOne can approximate the nonlinear system near the fixed point, (x∗, y∗), by the linear system: dx/dt = (x − x∗) ∗ fx (x∗, y∗) + (y − y∗) ∗ fy (x∗, y∗), dy/dt = (x − x∗) ∗ gx (x∗, y∗) + (y − y∗) ∗ gy (x∗, y∗). The Jacobian matrix of the nonlinear system described by the equations: dx = f (x, y) dt dy = g(x, y) dtis the matrix of partial derivatives of the functions f and g given by: fx (x, y) fy (x, y) J(x, y) = gx (x, y) gy (x, y)When the Jacobian matrix is evaluated at a fixed point (x∗, y∗), the matrix of constant coefficients,J(x∗, y∗), is identified with the matrix A of linear systems. Near a fixed point (x∗, y∗), the dynamicsDEs 14
  15. 15. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciencesof the nonlinear system are qualitatively similar to the dynamics of the linear system associated withthe J(x∗, y∗) matrix, provided the eigenvalues, µ1 and µ2 , of the J matrix have non-zero real parts. ∂x = eλ1 t x ; ∂y = eλ2 t yFixed points with a J matrix such that Re(µ1 , µ2 ) = 0 are called hyperbolic fixed points, as occurswith the first fixed point in the LV model. Otherwise, fixed points are non-hyperbolic fixed points,whose stabilities must be determined directly. This is what occurs with the second fixed point inthe LV model. In general, the analysis of the trace and eigenvalues of the Jacobian matrix is a guide for theclassification of the hyperbolic fixed points of the model.2 . Nota de classe la primera cosa que cal ampliar aqu s parlar-los del Jacobi de l’expressi. Mostrar com es calculaper a f(P,H), seguint el mateix raonament que feiem per a f(N) ms amunt. Exercise 6 Evaluate the Lotka-Volterra model, a local stability analysis at the positive equilibrium u = 1,v = 1.7 Numerical integrationTaking the rate of change for the density of population: dN = f (N ) dt • Euler’s method: N (t0 + ∆t) = N (t0 ) + ∆t · f (N (t0 )) • Runge-Kutta’s method (second order) 1 k = N (t0 ) + ∆t · f (N (t0 )) 2 N (t0 + ∆t) = N (t0 ) + ∆t · f (k)) Exercise 7 Play with the companion excel file to see the effect of setting up the parameters: r = 0.04,a = 0.0005, b = 5 · 10−5 and c = 0.2 for the Lotka-Volterra model. Discuss the equilibrium points. Numerical integration of ODEs leads to their use in the analysis of complex biochemical modelsand paves the way for sensitivity analysis or optimal experimental design[4]. The integration ofdeterministic ODEs differs from the simulation of stochastic models. See refs. [5, 6] 2 see also http://www.phys.uri.edu/~gerhard/PHY520/mln73.pdfDEs 15
  16. 16. MAT: 2011-31035-T1 MSc Bioinformatics for Health Sciences8 Sources of information • Numerical recipes: http://www.nr.com • LTCC math department http://www.ltcconline.net/greenl/courses/204/204.htm • SOS MATH: http://www.sosmath.com/diffeq/diffeq.html • Miscellanea: – http://www.maths.leeds.ac.uk/~carmen/3565/excl1.pdf – http://faculty.ncf.edu/lkaganovskiy/LaTeX/talkmylotkaextend.pdf • Software: – R: http://www.r-project.org/ – Octave: http://www.octave.org/ – gnuplot http://www.gnuplot.info/References[1] U. Alon. An introduction to systems biology: design principles of biological circuits. CRC Press, 2007.[2] D.J. Wilkinson. Stochastic Modelling for Systems Biology. CRC Press, 2006.[3] M. B. Elowitz and S. Leibler. A synthetic oscillatory network of transcriptional regulators. Nature, 403:335–338, 2000. ıa `[4] A. L´pez Garc´ de Lomana, A. G´mez-Garrido, D. Sportouch, and J. Vill`-Freixa. Optimal o o a experimental design in the modelling of pattern formation. LNCS, 5101:610–619, 2008.[5] Daniel T. Gillespie. Stochastic simulation of chemical kinetics. Annual review of physical chem- istry, 58:35–55, xx 2007. 10.1146/annurev.physchem.58.032806.104637.[6] Pau Ru´, Jordi Vill`-Freixa, and Kevin Burrage. Simulation Methods with Extended Stability e a for Stiff Biochemical Kinetics. BMC Syst. Biol., 4:110, 2010.DEs 16

×