Dynamical Systems 3 Nonlinear systems Ing. Jaroslav Jíra, CSc. Stability of Nonlinear Systems First Lyapunov method – linearization To examine stability of nonlinear systems we have to use more complicated tools than for linear ones. The first step, which frequently works, is the method of linearization, sometimes called first Lyapunov method. The principle is expanding of the righthand side function in the equation of motion around the fixed point into the Taylor series with neglecting of higher order members. Taylor series 2 f 1 f 2 ~ ~ ~ f ( x) f ( x ) ( x x ) ( x x ) ... 2 x 2! x Neglecting the higher order terms we obtain f ~ f ( x) f ( x ) ( x ~ x) x Being at an equilibrium point, we know, that f(x~)= dx~/dt = 0 , so dx f f ( x) (x ~ x) dt x Since the derivative of a constant is zero, then d~ x 0 dt and consequently The original system dx1 f1 ( x1 , x2 ,....,xn ) dt dx2 f 2 ( x1 , x2 ,....,xn ) dt . dxn f n ( x1 , x2 ,....,xn ) dt d (x ~ x ) dx dt dt d (x ~ x ) f (x ~ x) dt x ~x Linearized system f1 d ( x1 ~ x1 ) f1 ~ ( xn ~ ( x1 x1 ) .... xn ) dt x1 ~x xn ~x f d ( x2 ~ x2 ) f 2 ( x1 ~ x1 ) .... 2 ( xn ~ xn ) dt x1 ~x xn ~x . f n d ( xn ~ xn ) f n ~ ~ ( x x ) .... ( x xn ) 1 1 n x dt x 1 ~x n ~x Now we have to distinguish between the Jacobian matrix of the original system and the matrix for the linearized system at the specific fixed point, let’s say Df and Df(x~). While the Jacobian matrix of the original nonlinear system Df contains variables and constants, the Jacobian matrix of the linearized system at the fixed point Df(x~) contains just constants. f1 x 1 f 2 Df x1 ... f n x1 f1 x2 f 2 x2 ... f n x2 f1 ... xn f 2 ... xn ... f n ... xn f1 x1 ~x f 2 Df ( ~ x ) x1 ~ x ... f n x1 ~x f1 x2 ~x f 2 x2 ~x ... f n x2 ~x f1 ... xn ~x f 2 ... xn ~x ... f n ... xn ~x Example of the system linearization x1 x1 x2 1 x 2 x1 x2 2 The system is defined by the set of equations 2 f1 ( x) x1 x2 1 0 2 To find the fixed points of the system, we have to solve equations We find two fixed points: ~ xA 2 f 2 ( x) x1 x2 0 1 1 0.7 0 . 7 2 2 ~ and xB 1 0.7 1 0.7 2 2 Then we can do necessary calculations for the Jacobian matrix f1 f1 f 2 f 2 2 x1; 2 x2 ; 1; 1 x1 x2 x1 x2 Before examining stability of particular fixed points we can make a preview of the dynamical flow by the Mathematica program: More detailed previews of areas around fixed points The area around the xA~ looks like a saddle point, i.e. the fixed point should be unstable The area around the xB~ looks like a sprial sink, i.e. the fixed point should be stable Jacobian matrix of the original system is: For the first fixed point we have 2 x1 2 x2 Df 1 1 1 / 2 2 ~ ~ xA ; Df ( x A ) 1 / 2 1 2 1 Eigenvalues of this matrix are approx. λ1=1.9016 and λ2= -1.4874 Conclusion: near xA~ the system behaves like a linear system with one positive and one negative eigenvalue, i.e. the system is unstable here. For the second fixed point we have 1 / 2 2 ~ ~ xB ; Df ( xB ) 1 / 2 1 2 1 Eigenvalues of this matrix are approx. λ12= -1.2071 +/- 1.171i Conclusion: near xB~ the system behaves like a linear system with complex eigenvalues with negative real part, i.e. the system is stable here. What can we do if linearization method cannot decide? Example 2 – unusually damped harmonic oscillator We have a harmonic oscillator, where the mass m moves in very viscous medium, where the damping force is proportional to the cube of the velocity. x v Set of differential equations describing the system v x v 3 After setting vector variable y we can write x y f ( y), where y v v x f ( y) f 3 v x v Fixed point result from equations There is only one fixed point v0 x v3 0 0 ~ y 0 The Jacobian matrix 1 0 Df 2 1 3 v Jacobian matrix for linearized system at the fixed point 0 1 ~ Df ( y ) 1 0 x v v x v 3 Eigenvalues for this system are λ12= +/- i, so they have zero real part and the method of linearization cannot decide about the stability. The graph shows phase diagram for μ=0.25, x0=2 and v0=0. Even from the graph it is not clear if the trajectory will converge to (0,0) point or if it will remain at certain non-zero distance from it. We will have to use another tool – Lyapunov functions Second Lyapunov method – Lyapunov functions If we look on the damped harmonic oscillator from the point of view of energy, there is clear, that the system is still losing energy and sooner or later it must stop at the equilibrium point (0,0). The principle of the second Lyapunov method is to find a function V(x) that represents energy or generalized energy and satisfies the following conditions. 1. the function V(x) is continuously differentiable around the fixed point 2. positive definite V V ( x) 0 ~ ~ for all x x and V ( x ) 0 ~ dV ( x ) dV ( x) 3. negative definite dV/dt 0 at all states x ; 0 dt dt ~ dV 0 Additional condition to 3: at any state x x where the 3rd dt condition is considered satisfied if the system immediately moves to a state, where dV 0 dt If we succeed in finding such function, then the fixed point x~ is stable. Application of the second Lyapunov method on our Example 2 The total energy of a harmonic oscillator 1 2 1 2 E kx mv 2 2 We simplify by taking m=1 and k=1 1 2 E (x v2 ) 2 This function is continuously differentiable around zero and is positive for all states except for the fixed point (0,0), i.e. the first and second condition are satisfied. This means that we have a Lyapunov candidate function. The formula for the derivative of E E x; x E v; v dx v; dt dE xv v( x v 3 ) v 4 dt dE E dx E dv dt x dt v dt dv x v 3 dt x v v x v 3 The final result for the time derivation is dE v 4 dt We can notice that dE/dt is always negative except for the v=0, where dE/dt=0. The velocity is zero in three situations: 1. At the fixed point, which is in conformity with the third condition 2. At the instant, where the spring is maximally compressed 3. At the instant, where the spring is maximally extended Situations 2 and 3 satisfy the additional condition, because the system immediately moves from here to the state where dE/dt<0. Also the third condition is satisfied. Conclusion: our Lyapunov candidate function satisfies all conditions for the Lyapunov function, so examined fixed point (0,0) is stable. How to estimate Lyapunov candidate functions? If we examine a physical system, we should calculate the energy. If the state vector is x and the fixed point is 0, we could try 2 2 2 V ( x) x1 x2 ... xn If the fixed point is not at the origin of coordinate system, we have to modify 2 2 2 ~ ~ ~ V ( x) ( x1 x1 ) ( x2 x2 ) ... ( xn xn ) If we are not successful, then we can try V ( x) a1 ( x1 ~ x1 )2 a2 ( x2 ~ x2 )2 ... an ( xn ~ xn )2 If it still does not work, we can use a general quadratic form n V ( x) i 1 n ~ ~ a ( x x )( x ij i i j x j ) j 1 Classification of Stability of Nonlinear Systems 1. Lyapunov stability: fixed point x~ is a stable equilibrium if for every neighborhood U of x~ there is a neighborhood V U such that every solution x(t) starting in V remains in U for all times t0 Lyapunov stability of an equilibrium means that solutions starting "close enough" to the equilibrium remain "close enough" forever. Such fixed point is considered Lyapunov stable or neutrally stable. In this case the third condition for Lyapunov function is satisfied, when dV/dt <=0. The time derivative must be negative semidefinite. 2. Asymptotic stability: fixed point x~ is asymptotically stable if it is Lyapunov stable and additionally V can be chosen so that x(t ) ~ x 0 as t for all x(0) V Asymptotic stability means that solutions that start close enough not only remain close enough but also eventually converge to the equilibrium Such fixed point is considered asymptotically stable. In this case the third condition for Lyapunov function is satisfied, when dV/dt < 0. The time derivative must be negative definite. 3. Exponential stability: fixed point x~ is exponentially stable if there is a neighborhood V of x~ and a constant a>0 such that x(t ) ~ x eat as t for all x(0) V Exponential stability means that solutions not only converge, but in fact converge faster than or at least as fast as the exponential function Exp(-at). Exponentially stable equilibria are also asymptotically stable, and hence Lyapunov stable. Bifurcations We distinguish two principal classes of bifurcations: Global bifurcation occurs when larger invariant sets of the system 'collide' with each other, or with equilibria of the system. They cannot be detected purely by a stability analysis of the equilibria (fixed points). The global bifurcation includes, for example, collision of a limit cycle with a saddle point, collision of a limit cycle with a node etc. Local bifurcation is a sudden change in the number or nature of the fixed and periodic points caused by a parameter change in the system. Fixed points may appear or disappear, change their stability, or even break apart into periodic points. Such bifurcation can be analysed entirely through changes in the local stability properties of equilibria, periodic orbits or other invariant sets. The Logistic Equation The logistic equation, also known as Verhulst equation, is a formula for approximating the evolution of an animal population over time. Contrary to the bacteria model, living condition for animals significantly vary during the year. Some species are fertile just for particular season of year, not every existing animal reproduce etc. For this reason, the system might be better described by a discrete difference equation than a continuous differential equation. xn1 r xn (1 xn ) or xn1 r xn r xn 2 where xn is an actual population in the current year, xn+1 is population in the next year and r is combined rate for reproduction and for starvation. Zero value for the x means dead population and x=1 means population on its limit. Now we will examine what happens with stability and fixed points, if we try to change r. The only sure thing without any computations is, that for x(0)=0 we have a stable fixed point meaning dead population for any r. Development of the population for various values of r. Bifurcation diagram for the logistic equation The graph is an output of the Mathematica program. The initial value was x(0)=0.1 and 300 iterations were calculated for every r. For the value r=3 we can observe the first bifurcation (doubling of the functional dependence). Another bifurcations follow for r=3.449, r=3.544 etc. The bifurcation diagram can be divided into 4 parts 1. Extinction (r<1): if the growth rate is less than 1 the system "dies„ 2. Fixed point area (1<r<3): the series tends to a single value for any initial x0 3. Oscillation area (3<r<3.57): The series jumps between two or more discrete states. 4. Chaos area (3.57<r<4): the system can evaluate to any position at all with no apparent order For higher values of r (r>4) all solutions zoom to infinity and the modeling aspects of this function become useless. Basic types of local bifurcations 1. Saddle node (fold) bifurcation 2. Period doubling (flip) bifurcation 3. Pitchfork bifurcation 4. Transcritical birurcation 5. Hopf bifurcation 1. Saddle node (fold) bifurcation In this bifurcation two fixed points collide and annihilate each other. For r<0 there are two fixed points: a stable at x r and unstable at x r For r>0 there are no fixed points Differential equation of the system dx r x2 dt Example for two-dimensional system, where r= -2 Differential equations dx1 x1 ; dt dx 2 2 2 x2 dt Fixed points 0 ~ 0 ~ x A ; xB 2 2 The Jacobian matrix 1 0 0 2x 2 Linearized Jacobian matrix for xA~ 1 0 0 2 2 Eigenvalues for this Jacobian matrix 1 1; 2 2 2 Conclusion: the fixed point xA~ is a saddle point since there are real eigenvalues of various signs. Linearized Jacobian matrix for xB~ Eigenvalues for this Jacobian matrix 0 1 0 2 2 1 1; 2 2 2 Conclusion: the fixed point xB~ is an attracting node since there are real eigenvalues, both of negative signs. The name of this bifurcation is derived from the pair of these two types of fixed points – saddle and node. __________________________________________________________________________________________________ An example of the saddle-node bifurcation for dx r x2 dt 2. Period doubling (flip) bifurcation This type of bifurcation can be observed at the logistic equation. If we accept also negative values, we observe period halving in the left part of the graph and period doubling in the right part. xn1 r xn (1 xn ) 3a. Pitchfork bifurcation Supercritical case In this bifurcation one fixed point splits into three various ones. For r<0 there is just one stable fixed point at x=0 For r>0 there is one unstable fixed point at x=0 and two stable fixed points at x r Differential equation of the system dx rx x 3 dt 3b. Pitchfork bifurcation Subcritical case In this bifurcation three various fixed points annihilate into one fixed point. For r>0 there is just unstable fixed point at x=0 one For r<0 there is one stable fixed point at x=0 and two unstable fixed points at x r Differential equation of the system dx rx x 3 dt 4. Transcritical bifurcation In this bifurcation there is one stable and one unstable fixed point and they exchange their stability when they collide. For r<0 there is one stable fixed point at x=0 and one unstable fixed point for x=r For r>0 there is one unstable fixed point at x=0 and one stable fixed point for x=r Differential equation of the system dx rx x 2 dt 5. Hopf bifurcation This bifurcation is a two-dimensional one. In this bifurcation a single fixed point changes into a limit cycle or vice versa. Differential equations of the system dx1 2 2 rx1 x 2 x1 ( x1 x2 ) dt dx2 2 2 x1 rx 2 x2 ( x1 x2 ) dt There is only one fixed point 0 ~ x 0 Jacobian matrix r 3 x12 x2 2 Df 1 2 x1 x2 linearized Jacobian matrix r 1 ~ Df ( x ) 1 r 1 2 x1 x2 2 2 r x1 3 x2 Eigenvalues determination det(Df ( ~ x ) E) (r )2 1 2 2r r 2 1 0 Characteristic equation yields two complex conjugate roots 2r 4r 2 4(r 2 1) 12 r i 2 According to our previous experience we can say, that for r<0 there is a stable fixed point and for r>0 there is an unstable fixed point. To be able to decide about r=0 we have to use a Lyapunov function, choosing candidate function 2 2 V ( x) x1 x2 dV dx dx 2 x1 1 2 x2 2 dt dt dt ... 2( x1 x2 ) 2 2r ( x1 x2 ) 2 2 2 2 We can clearly see, that for r=0 the dV/dt is outside the fixed point always negative, hence we have a Lyapunov function. This also tells us, that for r=0 the fixed point is Lyapunov stable and also asymptotically stable. Phase diagram for r=-0.1, x10=1 and x20=0 Phase diagram for r=+0.1, x10=1 and x20=0 Phase diagram x10=1 and x20=0 for r=0, Phase diagram for r=+0.1, x10=0.2 and x20=0 3D interpretation of the Hopf Bifurcation. For negative values of r the system converges to the fixed point (0,0), for r=0 the system still converges to the fixed point, but very slowly. For positive values of r the attractor is not an unstable fixed point (0,0) but a limit cycle regardless of the starting point, i.e. it does not matter whether we start inside or outside the cycle. Diameter of the limit cycle raises with raising parameter r. A program in Mathematica, which calculates the Hopf bifurcation General rules concerning bifurcations. Continuous systems: a local bifurcation appears, when an eigenvalue has zero real part. If the eigenvalue is zero, then there is a saddle-node, pitchfork or transcritical bifurcation. If eigenvalues have zero real part, but they are complex conjugate, then there is a Hopf bifurcation. Discrete systems: a local bifurcation appears, when the modulus of eigenvalue is equal to one. If the eigenvalue is +1, then there is a saddle-node, pitchfork or transcritical bifurcation. If the eigenvalue is -1, then there is a period doubling bifurcation. If there are two complex conjugate eigenvalues with modulus equal to one, then there is a Hopf bifurcation. Poincaré maps The Poincaré map, sometimes called first recurrence map, is the intersection of a periodic orbit in the phase space of a continuous dynamical system with a certain lower dimensional subspace, called the Poincaré section, transversal to the flow of the system. The method of Poincaré sections enables us to reduce multidimensional dynamical system by one or more dimensions and transforms continous function to a series of discrete points. In a simplified way we can say, that the Poincaré map is a profile of the phase portrait, where one or more state variables are constant. Suppose we have a 3D plot Γ. Instead of directly studying the flow in 3D, we will examine the its intersection with a plane (x3=h) • Points of intersection in this case correspond to dx3/dt<0 • Height h of plane S is chosen so that Γ continually crosses S. • The points P0, P1, P2 form the 2-D Poincaré section. The following pictures illustrate distinguishing of various trajectories by their Poincaré sections. a) chaotic motion b) stable fixed point c) limit cycle d) cycle of period two Example – we have a dynamical system described in cylindrical coordinates r r (1 r ) Solution of the equations -> z z r0 r (t ) r0 (1 r0 )e t (t ) t 0 z (t ) z0 e t 3D interpretation of the system λ<0 λ>0 A Poincaré map, constructed as a cut of the phase portrait by a halfplane Θ=0 looks like an attracting node for λ<0 and like a saddle point for λ>0. The point (x,z)=(0,1) corresponds to an intersection of the only closed orbit with the cutting halfplane. The second name of the Poincaré map – the first recurrence map means, that trajectories in the map consist of points, where xi is the actual intersection point of the trajectory and the plane, while xi+1 is the point, where the trajectory must return to the plane next time. First recurrence – first return. λ<0 λ>0 The explicite shape of our Poincaré map is xi xi 1 P( xi , zi ) xi (1 xi )e zi 1 zi e where Tau=2*π/β is a period of the return to the cutting plane Continuous interpretation of the Poincaré sections from the Mathematica λ<0 λ>0