Dynamics of the whale equation x ) − α1 xy = f1 (x, y) k1 y y 0 = r2 y(1 − ) − α2 xy = f2 (x, y) k2 x0 = r1 x(1 − Recall: The intrinsic growth rates are r1 = 0.05, r2 =0.08 In absence of competition, k1 , k2 are maximum sustainable population. α = competitive rate. Note: When y= 400,000 =⇒ y 0 = −α1 x · 400, 000 = −(10−8 · 400, 000) x | {z } decrease rate proportional to x when y= 400,000 One rate we are interested in is the steady-state = no change (x 0 = y 0 = 0). We solved for this already when α1 = α2 =α. x ) − α1 y] k1 y f2 (x, y) = 0 = y[r2 (1 − ) − α2 x] k2 f1 (x, y) = 0 = x[r1 (1 − y x'=y'=0 y'=0 x'=0 x We do have a steady-state (equilibrium) where x 0 = y 0 = 0, x > 0, y > 0, also (0,0)is an equilibrium. Is there any value of α for which there is no such equilibrium? YES! 37 r1 r2 If we increase α then the points (0, ), ( , 0) on axes move. α α 0.08 0.05 < 400, 000 and < 150, 000 α α Let’s graph the vector field: y x'>0, y'<0 x'<0, y'<0 y'=0 x'=0 x x'>0, y'>0 x'<0, y'>0 y'=0 x'=0 Moves to y = 400,000, x= 0 If we start on equilibrium, stay there. What if we start off on the equilibrium? Consider the vector field and the equations will tell us how population changes. Now compare without competition: continuous dynamic vs. discrete dynamics. Discrete time (FIGURE) 38 y ) k y 0 = ry(1 − r∆t 2 y = αyn − βyn2 k n yn+1 = yn + r∆tyn − For simplicity we take β = 1 yn+1 = αyn − yn2 Predator-Prey Problem - (Foxes - Rabbits) Let x = the number of foxes and y = the number of rabbits Rabbits eat grass and foxes depend on rabbits. ẋt = ax : without predators, the prey population grows without bound ẏt = −cy : without prey, the predators die off ẋt = ax − γxy : predator increases with prey encounters ẏt = −cy + δxy : prey decreases with predator encounters c a The equilibrium solution is: x = 0, y = 0 and x = , y = δ γ Local stability (linear stability) • At (x0 , y0 ) = (0, 0). We solve the linear system of ODE’s: ẋt = ax ẏt = −cy The general form of the solution is: x y ! =e σt c1 c2 ! Substitute this solution into the system: ! c c σ 1 eσt = eσt 1 c2 c2 a−σ 0 0 −c − σ ! 39 ! ! a 0 0 −c ! c1 σt e =0 c2 In order to have a nontrivial solution we must have: a−σ 0 det 0 −c − σ ! = 0 =⇒ (a − σ)(−c − σ) = 0 σ is an eigenvalue of the linear system: σ 1,2 = a, −c and next we find the corresponding eigenvectors. For σ = a a−a 0 0 −c − a ! c1 c2 ! =0 c1 c2 ! Thus, an eigenvector corresponding to σ = a is For σ = −c a+c 0 0 −c + c ! c1 c2 ! Thus, an eigenvector corresponding to σ = −c is = 1 0 ! =0 c1 c2 ! = 0 1 ! So, the homogeneous solutions are: k1 ! ! 0 −ct 1 at e e + k2 1 0 where k1 , k2 are arbitrary constants determined from the initial conditions. In fact we are interested in the behavior of this solution as t → ∞, i.e. the sign of σ1 , σ 2 . Note: x = k1 eat y = k2 e−ct 40 (0, 0) is ”attracting” in the y direction and ”repelling” in the x direction =⇒ (0, 0) is a saddle point =⇒ (0, 0) is unstable. Another view : x = 0 + X(t) y = 0 + Y (t) where X(t), Y (t) are small perturbations. Then Ẋ = aX − γ(0 + X)(0 + Y ) Ẏ = −cX + δ(0 + X)(0 + Y ) c a • At (x0 , y0 ) = ( , ). δ γ c + X(t) δ a y = + Y (t) γ x= Then c a c Ẋ = a( + X) − γ( + X)( + Y ) δ δ γ a c a Ẏ = −c( + Y ) + δ( + X)( + Y ) γ δ γ 41 Next, neglect the nonlinear terms from the previous equations: −cγ Y δ aδ Ẏ = X γ Ẋ = Again we have to look for a solution of the form: X Y ! c1 c2 = eσt ! Substitute this solution into the system: σ ! c1 σt c e = eσt 1 c2 c2 −σ aδ γ ! 0 aδ γ −cγ ! c1 σt δ e =0 c2 −σ −cγ δ 0 For nontrivial solution we have to have −cγ −σ √ 2 δ det aδ = 0 =⇒ σ + ca = 0 =⇒ σ1,2 = ±i ca −σ γ √ √ Then eσ1,2 t = cos(t ca) ± i sin(t ca). Next we find the corresponding eigenvectors for σ1,2 . √ For σ1 = i ca √ −cγ ! −i ca c 1 δ aδ √ c =0 2 −i ca γ √ Thus, an eigenvector corresponding to σ 1 = −i ca is √ For σ2 = −i ca √ i ca aδ γ −cγ ! c1 δ √ c =0 2 i ca 42 c1 c2 ! = √ ! iγ c/δ √ a ! √ ! c1 −iγ c/δ √ Thus, an eigenvector corresponding to σ 2 = i ca is = a c2 Therefore the solution is, for a certain choice of constants, √ X Y We know that ! √ h √ √ i γ c/δ ieit ca − ie−it ca √ i = √ h √ a eit ca + e−it ca √ √ ca √ + e−it ca = cos t ca 2 √ √ it ca √ e − e−it ca = sin t ca 2i eit Then √ √ 2γ c X= cos t ca δ √ √ Y = 2 a sin t ca Y X What if there is a finite amount of grass? x ) − γxy k ẏt = −cy + δxy ẋt = ax(1 − 43 The equilibrium solution is: (x0 , y0 ) = (0, 0), (k, 0), Local stability (linear stability) Write: c a c , (1 − ) δ γ δk x = x0 + ξ y = y0 + η where ξ, η small Solve the following system d dt ξ η ! ! 2x0 ξ ) − γy −γx a(1 − 0 0 = k η δy0 −c + δx0 | d dt {z A ξ η ! ! a − x −γx ξ 0 0 = k η δy0 0 } In order to have a nontrivial solution we must have Thus a − x − λ −γx a 0 0 = 0 =⇒ −λ(− x0 − λ) + γδx0 y0 = 0 det k k δy0 −λ λ= a − x0 ± k s a x0 k 2 2 − 4(γδ)x0 y0 Let’s consider the equilibrium solution (x 0 , y0 ) = (k, 0). Then −a −γk A= 0 −c + δk ! =0 In order to have a nontrivial solution we must have A = −a − λ −γk 0 −c + δk − λ ! = 0 =⇒ (−a − λ)(−c + δk − λ) = 0 =⇒ λ = −a, λ = −c + δk If k > c =⇒ δk > c =⇒ solution unstable. δ 44 (FIGURE) General Price/ Quantity Produced model Pt = f (P, Q) = a1 P + b1 Q + c1 P 2 + d1 Q2 + f1 P 3 + e1 Q3 + · · · Qt = g(P, Q) = a2 P + b2 Q + c2 P 2 + d2 Q2 + f2 P 3 + e2 Q3 + · · · We could find equilibrium solutions P 0 , Q0 such that f (P0 , Q0 ) = 0, g(P0 , Q0 ) = 0 and rewrite equations as: (P − P0 )t = A1 (P − P0 ) + B1 (Q − Q0 ) + C1 (Q − Q0 )2 + D1 (P − P0 )2 + F1 (P − P0 )(Q − Q0 ) + G1 (P − P0 )3 + H1 (Q − Q0 )3 (Q − Q0 )t = A2 (P − P0 ) + B2 (Q − Q0 ) + C2 (Q − Q0 )2 + D2 (P − P0 )2 + F2 (P − P0 )(Q − Q0 ) + G2 (P − P0 )3 + H2 (Q − Q0 )3 Then we could write the deviation from the equilibrium: p = P −P 0 and q = Q−Q0 . Therefore we can rewrite the above equations: pt = A1 p + B1 q + C1 q 2 + D1 p2 + F1 pq + G1 p3 + H1 q 3 qt = A2 p + B2 q + C2 q 2 + D2 p2 + F2 pq + G2 p3 + H2 q 3 Example ṗ = −p3 + αp − q q̇ = p We find the equilibrium solution p0 , q0 by solving the system ṗ = 0, q̇ = 0. From here p0 = 0,q0 = 0. Let’s graph the vector field −→ graph ṗ and q̇. When ṗ = 0 =⇒ q = −p 3 + αp 45 Local analysis • If α = 0 Linearize: ṗ = −q q̇ = p Equivalently in the matrix form: ṗ q̇ ! = 0 −1 1 0 ! p q ! 0 −1 where A = 1 0 ! Then, we find the eigenvalues by solving the following equation : ! −σ −1 det(A − σI) = 0 =⇒ det = 0 =⇒ σ = ±i. Note that we have pure 1 −σ imaginary eigenvalues , so the eigenvectors will be (FIGURE) • If α < 0 46 p q ! cos t = sin t ! Linearize: ṗ = αp − q q̇ = p Equivalently in the matrix form: ṗ q̇ ! = α −1 1 0 ! ! p where A = q α −1 1 0 ! Then, we find the eigenvalues by solving ! the following equation : α − σ −1 det(A−σI) = 0 =⇒ det = 0 =⇒ (α−σ)(−σ)+1 = −σα+σ 2 +1 = 0. 1 −σ So the solutions of this equation are: √ α ± α2 − 4 σ= 2 Then √ |α| ± Re( α2 − 4) Re(σ) = 2 2 2 If α − 4 > 0 =⇒ α < −2, then α − 4 < α2 =⇒ Re(σ1 ) = −|α| + ( something less than α) < 0 Re(σ1 ) = −|α| − ( something less than α) < 0 =⇒ stable solution If α2 − 4 < 0 =⇒ the eigenvalues are complex numbers: √ −|α| ± i 4 − α2 σ= 2 The difference between these two cases 2 Let’s reconsider the case when √ α > 4 and for simplicity take α = −3. So the −3 ± 5 eigenvalues are: σ1,2 = 2 The eigenvectors for σ1 are given by: α − σ1 −1 1 −σ1 47 ! c1 c2 ! =0 By solving this system we get the eigenvector for σ 1 c1 c2 ! = 1 α − σ1 ! Similarly we find the eigenvectors for σ 2 c1 c2 ! σ2 = 1 ! √ 5 3 < 0. Therefore So, for α = −3 we have α − σ1 = −3 + − 2 2 √ ! ! 3 1 5 √ σ2 1 = 3 = − 2 − 2 and 5 α − σ 1 1 − − 1 2 2 Note: the slope of ṗ = 0 near zero gives q ≈ αp (FIGURE) It moves ”quickly” along eigenvector into equilibrium, and away from eigenvector, follows the vector field. Now let’s reconsider the case √ when α 2 < 4 and for simplicity take α = −1. So, the −1 ± 3 . The corresponding eigenvectors are: eigenvalues are: σ1,2 = 2 √ ! 1 3 c1 − + i = 2 2 for σ1 c2 1 √ ! 1 3 c1 = − 2 − i 2 for σ2 c2 1 48 q spiral in towards equilibrium point p • If α > 0 Same analysis as in the previous case, will give us the eigenvalues √ α ± α2 − 4 σ= 2 Here Re(σ1,2 ) > 0 If α2 < 4 √ 4 − α2 α =⇒ the solution is unstable. =⇒ σ = ± i 2 2 If α2 > 4 The eigenvalues are real positive. Therefore the eigenvectors are: √ ! ! 1 α α2 − 4 √ 1 σ2 and = 2 − = α α2 − 4 2 1 α − σ 1 + 1 2 2 (FIGURE) 49 Note: for ṗ = 0 =⇒ q = αp − p3 . On this curve the local maximum, minimum is α p2 = 3 What if p and q grow to be large? ṗ < 0 for q > αp − p3 , q could continue to grow until p < 0. There is no other equilibrium than (0, 0) =⇒ limit cycle. Examples • Pendulum (oscillator) θ̈ + k sin θ = 0 θ3 θ̈ + k θ − 3! ! =0 • Van der Pol ẍ + µ(x2 − 1)x + x = 0 • Bifurcation Contrast cubic vs. quadratic ẏ = αy − y 3 (FIGURE) 50 ẏ = αy − y 2 y y'=0 Stable S S Stable y y y'= - y2 Our Approach for continuous dynamical systems ẋ = f (x, y) ẏ = g(x, y) −→ Find equilibrium points : (x0 , y0 ) by solving the system: f (x0 , y0 )=0, g(x0 , y0 )=0 −→ Linearize about x0 , y0 (local analysis) x = x0 + X , y = y0 + Y where X, Y are small. So we have the following linear system: Ẋ = a11 X + a12 Y Ẏ = a21 X + a22 Y Or equivalently in the matrix form: Ẋ Ẏ ! ! X =B where B = Y a11 a12 a21 a22 The solution of this system is: X Y ! = k1 ! ! c 1 r1 t d e + k 2 1 e r2 t c2 d2 51 ! ! c1 d , 1 c2 d2 where r1 , r2 are the eigenvalues of B and ! are the eigenvectors of B. Equivalently B x̄ = rx̄ c B 1 c2 ! c =r 1 c2 ! d ,B 1 d2 ! d =r 1 d2 ! If r1 , r2 yield solutions that grow (decay) in time , then (x 0 , y0 ) is unstable (stable). What about discrete systems? xn+1 = f (xn , yn ) yn+1 = g(xn , yn ) Again determine equilibrium, (x0 , y0 ) and linearize about this point xn+1 = x0 + Xn+1 , yn+1 = y0 + Yn+1 . Or equivalently in the matrix form: Xn+1 Yn+1 ! Xn =B Yn ! If all eigenvalues of B are |r| > 1 =⇒ unstable (expansion) If all eigenvalues of B are |r| < 1 =⇒ stable (contraction) We have B x̄ = rx̄ for r eigenvalues and x̄ eigenvector. First, look at what happens if we iterate, when Xn Yn ! = k1 ! c1 c + k2 2 d1 d2 ! and |r1 | < 1 and |r2 | < 1. Note that Xn Yn ! is a linear combination of eigenvectors. So Xn+1 Yn+1 ! c = k1 B 1 d1 ! c + k2 B 2 d2 52 ! = k 1 r1 ! c1 c + k 2 r2 2 d1 d2 ! In general Xn+j Yn+j ! = c1 d1 k1 r1j ! + c2 d2 k2 r2j ! j j We know that ! |r1 | < 1 and |r2 | < 1 =⇒ r1 and r2 become smaller. Therefore as X j → ∞, →0 Y Compare also to the continuous case: Xt+∆t − Xt ! Ẋ X X t =B =⇒ Y ∆t− Y = B t+∆t t Y Yt Ẏ ∆t ! ! ! Xt Xt Xt+∆t + B∆t = =⇒ Yt Yt Yt+∆t = ! ! ! Xt+∆t =⇒ = Yt+∆t = ! ! 1 0 + B∆t 0 1 Xt Yt ! Thus Ax̄ = (1 + r∆t)x̄ = r̂discrete x̄ where x̄ is an eigenvector, 1 + r∆t < 0 and r̂ discrete = 1 + rcontinuous ∆t. Example Recall the logistic model (the whale problem) ẏ = r2 y(1 − y ) k2 Note that for y = k2 we have a stable equilibrium. For the discrete model we have u̇n = αun (1 − un ) The equilibrium solution is given by: un+1 = un + (α − 1)un − αu2n For the equilibrium we have to have (α − 1)un − αu2n = 0 so α−1 un = 0, un = α 53 α−1 Linearize system about : α α−1 un+1 = + Un+1 where Un+1 is a small deviation. α So we have α−1 α−1 α−1 + Un+1 = α + Un 1 − − Un α α α α−1 1 =α + Un − Un α α α−1 = + Un − (α − 1)Un − αUn2 α =⇒ Un+1 = 2Un − αUn = (2 − α)Un ( linearized ) Let A be 2 − α. So 2 − α is an eigenvalue and 1 is an eigenvector. If |2 − α| > 1 =⇒ periodic, chaotic solution If |2 − α| < 1 =⇒ stable Next linearize system about 0: Un+1 = αUn Discrete logistic model yn+1 = αyn (1 − yn ) v.s continuous y ẏ = ry(1 − ) k So y(t) y(t + ∆t) − y(t) = ry(t) 1 − ∆t k y(t + ∆t) − y(t) = (∆t)ry(t) 1 − y(t) k r∆t y(t)2 k r∆t y(t + ∆t) = (1 + r∆t)y(t) 1 − y(t) k(1 + r∆t) r yn+1 = (1 + r)yn 1 − yn for ∆t = 1 k(1 + r) y(t + ∆t) = y(t)(1 + r∆t) − 54 Taking α = 1 + r we get yn+1 = αyn 1 − r yn = αyn (1 − yn ) kα Tracing the dynamics (FIGURES) The equilibrium solution is given by yn+1 = yn =⇒ αyn (1 − yn ) − yn = 0 =⇒ y0 = 0 and y0 = Is it stable ? Let r α−1 = . α r+1 yn+1 = y0 + δn+1 yn = y 0 + δ n We have yn+1 = f (yn ) = f (y0 ) + f 0 (y0 )(yn − y0 ) =⇒ y0 + δn+1 = f (y0 ) + f 0 (y0 )(yn − y0 ) y0 = f (y0 ) f (y0 ) = αy0 (1 − y0 ) Thus δn+1 = |f 0 (y0 )|δn . Next we have |f 0 (y0 )| = |α − 2αy0 | = |α| |α − 2α + 2| = | − α + 2| for y0 = 0 α−1 for y0 = . α If | − α + 2| < 1 =⇒ 1 < α < 3 =⇒ δn+1 is larger than δn =⇒ y0 = 0 is α−1 unstable, y0 = is stable. α 55 If | − α + 2| > 1 =⇒ α > 3 =⇒ both equilibrium solutions are unstable If |α| < 1, y0 = 0 is stable, y0 = α−1 is unstable. α The periodic solution has two cycles: xn+2 = xn xn+2 = αxn+1 (1 − xn+1 ) = α[αxn (1 − xn )(1 − αxn (1 − xn ))] and from here xn = xn+2 = α2 xn (1 − xn ) − α3 x2n (1 − x2n ) xn [1 − α2 xn (1 − xn ) + α3 x2n (1 − x2n )] = 0 xn [1 − α + αxn ][1 + α − α(1 + α)xn + α2 x2n ] = 0 p (α(1 + α))2 − 4(1 + α)α2 2α2 p (1 + α) ± (1 + α2 ) − 4(1 + α) = 2 p 2α (1 + α) ± (1 + α)(−3 + α) = 2α2 =⇒ xn = α(1 + α) ± Note that xn is real for α > 3. For stability we must have 3 < α < 1 + √ xn+2 = f 2 (xn ) = xn α2 (1 − xn )[1 − αxn (1 − xn )] From linearization: df 2 |x∗ = α2 [(1 − xn )(1 − αxn (1 − xn )) − xn (1 − αxn (1 − xn )) dx + xn (1 − xn )[−α(1 − 2xn )]]|xn =x∗ Consider p and q the roots. Then xn+1 = d f (f (xn )) = f 0 (f (p))f 0 (p) = f 0 (q)f 0 (p) since f (p) = q dx We have f 0 (q) = r(1 − 2q) and f 0 (p) = r(1 − 2p). Then xn+1 = r(1 − 2q)r(1 − 2p) = r 2 [1 − (p + q) + 4pq] = 4 + 2r − r 2 For stability we must have |4 + 2r − r 2 | < 1. 56 6. Measures of chaos Lyapunov exponent x0 + δ0 −→ x(t) + δ(t) In the discrete case we have x(t) + δn =⇒ |δn | = |δ0 |enλ If λ > 0 −→ expansion If λ < 0 −→ contraction ( attraction to stable behavior) From the above equation λ= 1 δn 1 f n (x0 + δ0 ) − f n (x0 ) 1 · ln = · ln = · ln[(f n )0 (x0 )] n δ0 n δ0 n But n 0 (f ) (x0 ) = n−1 Y f 0 (xi ) i=1 Therefore λ= X 1 n−1 · ln f 0 (xi ) n i=1 If xn → x0 ( stable fixed point), then |f 0 (xi )| < 1 as xn → x0 =⇒ ln f 0 (xi ) < 0 X 1 n−1 ln f 0 (xi ) < 0 λ= · n i=1 Thus δn is decreasing with n. Eigenvalues and eigenvectors for Lorenz ẋ = −γ(x − y) ẏ = −y + rx − xz ż = −bz + xy Find the equilibrium solutions by solving the system: ẋ = 0, ẏ = 0, ż = 0 Thus the equilibrium solutions are: (x0 , y0 , z0 ) = (0, 0, 0) q (x0 , y0 , z0 ) = ( b(r − 1), q q b(r − 1), r − 1) q (x0 , y0 , z0 ) = (− b(r − 1), − b(r − 1), r − 1) 57 Let Find the eigenvalues −γ γ 0 A = r −1 0 0 0 −b det(A − σI) = 0 −γ − σ r 0 Equivalently γ 0 −1 − σ 0 0 −b − σ =0 (−b − σ) [(−γ − σ)(−1 − σ) − rγ] = 0 h i =⇒ (−b − σ) σ 2 + (1 + γ)σ + 1 − rγ = 0 The eigenvalues are σ1 = −b and σ2,3 = −(γ + 1) ± p (γ + 1)2 − 4(1 − rγ) 2 If 1 − rγ < 0, then (γ + 1)2 − 4(1 − rγ) > (γ + 1)2 =⇒ equilibrium solution unstable. Problem - discrete example Consider the spread of a disease through a population of 100,000. 30% of the population is immune. Susceptibles become infected by intersection with those infected with the disease. Those that are infected can spread the disease for 2 weeks after they become infected. Once a person had the disease they cannot get it again. No one dies from the disease. Determine a model for susceptibles, infected, and immune. How long does the disease last? At what time is the number of people newly infected the largest? I(1) = 18 (week one, 18 newly infected) I(2) = 40 (week two, 18 newly infected) Let S(t) = the number of susceptibles at time t J(t) = the number of immune at time t I(t) = the number of new infected at time t 58 J(1) = 30,000 The change in the number of susceptibles is S(k + 1) = S(k) − αS(k) [I(k) + I(k − 1) + I(k − 2)] The disease is contagious for two weeks. The changes in the number of infected and immune are: I(k + 1) = αS(k) [I(k) + I(k − 1) + I(k − 2)] J(k + 1) = J(k) + αS(k)I(k) The initial population is 100,000 How long does the disease last? The time until S = 0. Now consider equivalent vector fields: S(k + 1) − S(k) = ∆S < 0 I(k + 1) − I(k) = αS(k) [I(k) + I(k − 1) + I(k − 2)] If we just had αS(k)I(k) ( not contagious for 2 weeks) then ∆I(k) = (αS(k)−1)I(k). If αS(k) − 1 < 0 =⇒ ∆I(k) < 0 S (k) S (k) = 1 I (k) I (k) S (k) k k Cubic nonlinearities Consider ẏ = y − y 3 59 If y 1 =⇒ y grows (y y 3 ) If y large =⇒ y decays (y y 3 ) Stability of periodic behavior Divergence of trajectories Convergence: Start at an initial point x0 , follow the dynamics =⇒ x(t) another initial point x0 + δ0 =⇒ later x(t) + δ(t) lim λ = lim t→0 Obvious: ẋ = αx =⇒ x = x0 eαt t→0 log δ(t) δ0 t =⇒ x(t) + δ(t) = (x0 + δ0 )eαt (FIGURES) Box dimension dbox = lim →0 ln N () ln 1 L For a curve of length L the equation N () = is the number of segments of length to cover L. A The equation N () = 2 is the number of boxes with side to cover A. • Expensive way Cover a region with boxes of side , count the number of boxes that are occupied, let → 0 • Better way Run trajectories for long time: 60 (FIGURE) Count the number Nx () of points in the ball. This is a point wise dimension: as increases Nx ???d Average Nx over many x =⇒ C(x)???d Logistic map (FIGURE) 61