Chapter #4 Robust and Adaptive Control Systems Nonlinear Dynamics.... Linear Combination.... Equilibrium points... 3 3. Linearisation... 5 4. Limit cycles... 3 5. Bifurcations... 4 6. Stability... 6 7. Exercises... 9 8. Matlab Based Exercises for EEE8086... 0 Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /0
Nonlinear Dynamics. Linear Combination Until now we have seen only linear (autonomous) systems which unfortunately can only fully describe a small class of real systems. In general a nonlinear system is given by: x t f x t,u t () with x,u, f n q n The main property of a linear system (as we have seen) is that if you have solutions x and x then also their linear combination is a solution. For example, if we have: xt 3 x and x 3t e and x 3t 7e then x x x e e 3 3 3 0 0 t t 4 is also a solution as: d 0e 4e 3t 3t dt 30e 4e e 3t 3t 3t 3 0e 4e 30e 4e e 3t 3t 3t 3t 3t However this is not the case in nonlinear systems: x t x and a solution: x t C as x and t C x A 3 is not a solution: t C x t C t C but Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /0
3 x and t C 3 9 3 x t C t C t C x. Equilibrium points Before we see more differences between linear and nonlinear systems it is important to understand the concept of the equilibrium or rest or singular point which is defined as the point where xt 0 () For first order linear systems we have that 0 0 x t A t x t B t u t x t A t B t u t (3) For autonomous systems: 0 state spaces were drawn with respect to the origin: x t and for that reason in Chapter 3 all the Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 3/0
One of the biggest differences between linear and nonlinear systems is that a nonlinear system may have more than one s. Example.: Find the s of The s are: x ' x x x ' x x x' x x 0 x x x x 0 0 x' x x x x x x,x, x,x, So we have Eps at (,) and at (-,-). Example.: Find the s of The s are: x ' x x 3x x 0x x ' x x 4x x x 3xx 0x 0 x x 4x 0 From the nd expression we have that x 0 or x 4 From the st expression we have for x 0 0 x i.e. x,x, and for 00 xx 4 we have that either x 0 which implies that x 0 (as before) or x 3x 0 0 which is a nd order polynomial and can easily be solved as: syms x x, f=x-x, f=x^+x^-, [xs xs]=solve(f,f) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 4/0
37 x 5 x,x 5, 4 49 x, x x,x, 4 So the system has the following s: 0 0 5 4 4 x,x,, x,x,, x,x, In linear systems we were using the term stable/unstable system but effectively we will referring to the equilibrium point. Now that we have multiple equilibriums we need to determine the stability of each. It has to be stated here that for nonlinear systems it does not make sense to talk about stable/unstable systems, but for stable/unstable s as it is possible to have systems with multiple s and some of them to be stable and other to be unstable. Also, the stability of linear systems was determined by the eigenvalues of the state matrix. Hence, now we need a state matrix for each fixed point. 3. Linearisation In order to determine if each of the s of a nonlinear system is stable or not we have to take a local picture of each. This local picture is called a linearization. I.e. we will describe each in a neighbourhood around it. The main tool for that is the Taylor series. Remember that the Taylor series around a point x 0 is defined as: 3 x x x x x x 3 f x 0 f x 0 f x 0 f x f x 0... 3 x! x! x 3! xx xx xx 0 0 0 Notice how the command solve returns the results. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 5/0
Example.3: Approximate the function y=sin(x) with respect to x around x=0, using several expansion orders. The TS of sin(x) around x=0 is: sin x x x x 3! 5! 7! 9! 3 5 7 9 x x Ox Now let s try to approximate sin(x): Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 6/0
3 So by increasing the order of the Taylor Series we get a better approximation. But let s get back to the first term y=x, obviously it is not a good approximation but if we focus close to the origin then: 3 x=-*pi:0.0:*pi; plot(x,sin(x)), hold on, plot(x,x), plot(x,x-x.^3/6), plot(x,x-x.^3/6+x.^5/0), plot(x,xx.^3/6+x.^5/0-x.^7/5040), plot(x,x-x.^3/6+x.^5/0-x.^7/5040+x.^9/36880) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 7/0
So we see that close to the origin effectively the two traces coincide, i.e. our approximation is good close to the point of expansion. This is exactly how we will study a nonlinear system and the stability of their s. By approximating them locally using a Taylor series expansion and by keeping only the linear term: Assume that we have a nonlinear system x x f x f x x 3 f3 x x t f x and a at x=x, then the TS expansion is: f x t xt f x xt x HOT xt xx By keeping only the linear term we have: f x t xt f x xt x xt xx (4) As 0 f x : f x t xt xt x xt xx dx Obviously we also have that: 0 and hence: dt Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 8/0
dt xt d x t x f x t xx x t x We can define now a new variable: x t x t x and we have that: dx dt f x t x t xx x Also, f x t xt xx f x t f x t f x t x t x t xn t f x t x t fn xt fn x t x t xn t xx A (this matrix is called the Jacobian of f) and hence: dx dt Ax (5) Which is a linear equation that we know how to solve and how to determine its stability. Similarly if xt f x,u then: dx f x t,u t f x t,u t x dt x t u t xx,u u xx,u u u (6) with u u u Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 9/0
dx which will give us: Ax dt Bu which is the form for a linear state space model. Example.4: Find the s and determine the stability of its s x x For the s we set x x x 0 0. Now the Jacobian is: x f x A x x x And when this is evaluated at the s: A Hence, the state space models are: x x for x x x for x This implies that the eigenvalue of the st is - and hence this is stable, while the eigenvalue of the nd is + and hence that is unstable. So we expect the following D state space: - + It is interesting to note here, that if we start at the left of the -, I will diverge to -. While otherwise I will converge to +: Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 0/0
4 Example.5: Find the s and determine their stability for x ' x x x ' x x We have seen that the s are: x,x, x,x, So we have: x x x x x ' x x x x A x ' x x x x x x x x x x Now the Jacobian evaluated at the s: 4 hold on, for x0=-:0.5:.5, sim('non_d.slx'), plot(x(:,),x(:,)), end Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /0
3 7i A eigs which implies that (,) is an unstable focus. A 7 eigs which implies that (,) is a saddle. Now in order to understand what happens we have to draw the eigenvectors of the saddle (the eigenvectors of the focus do not give us anything as we have seen). The saddle has eigenvalues at.56 and -.56 with the corresponding eigenvectors being: e 0. 56 and e 0. 8 Hence, the state space is: 5 5 syms x x, f=x-x, f=x^+x^-, [xs xs]=solve(f,f), J=jacobian([f f], [x x]); A=subs(J,{x,x},{xs() xs()}), A=subs(J,{x,x},{xs() xs()}), eigsa=eval(eig(a)) eigsa=eval(eig(a)) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk /0
Chapter 4 4. Limit cycles Apart from the previous difference of having multiple equilibria in nonlinear systems, another feature of these systems is that it is possible to have a persistence periodic motion, a limit cycle. Assume the Van der Pol system x x x x 0. The time and the state space responses are: Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 3/0
5. Bifurcations Another difference between linear and nonlinear systems is the phenomenon of bifurcation, which (very briefly) is the creation (or destruction) of equilibria by changing some (one in our case) parameters of the system. This can be the inductance in an RL circuit, the mass of a mass-spring system, the force applied on a bridge, the temperature in a water tank So now, we study systems of the form x f x, p, where p is a vector that contains the system s parameters that may change and effectively the algebraic equation f x, p 0 has different number of solutions for different parameters in p. Example.6: Assume 6 the system x r x for various values of r. The equilibria are: x r x x r So if r>0 there are no equilibrium points 6 Example taken from https://en.wikipedia.org/wiki/saddle-node_bifurcation Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 4/0
While if r<0: x r x x r i.e. equilibria which for various values of r are: hold on for r=-0:0.:0 plot(r,sqrt(-r),'k.') plot(r,-sqrt(-r),'k.') end The linearised system closed to these points is: r rx 0 x x x t e x rx x x t0 e r The response for r=-: Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 5/0
6. Stability In linear systems we called a system stable if the orbit was not diverging to infinity (exponentially or with oscillations). In nonlinear systems, we have multiple equilibria and we must check the stability locally around each equilibrium point. But we need a more general definition that will allow us to focus on global stability. Assume that we have a general nonlinear ODE and a specific solution x(t). Obviously as this will depend on the initial conditions we can denote it as x t,t 0. Now we want to test the stability of the general orbit φ (note that the can be one such orbit). To do that, we add a perturbation (say at t=t 0 ) and then we observe the perturbed orbit. If it stays close to the nominal then it is called stable. Effectively this means that for each required Δ we can always find a suitable δ. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 6/0
x t,t 0 0 x t,t 0 0 x t,t t 0 0 As we are focused on equilibria we have the following definition: x t,t t 0 0 An equilibrium point x is stable if for each R>0 there exists an r>0 such that E E, then x x t r 0 x x t R E One of the most important theorems that are used to study the stability of nonlinear systems is called: Lyapunov Stability Theorem Let function V of the states x, such as: Vx 0 Vx 0 x lim V x then the equilibrium point is globally asymptotic stable. The difficulty here is how to find the function V, so for the purposes of this module, this function V will be given. Example.7: Determine the stability of the origin of d x x y xy y dt x y x y V x, y x y as a candidate, by using Lyapunov Function and by using local linearization: Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 7/0
V x, y x y 0, V x y xx yy x x y xy y x y x y x xy x y 4xy y x y x xy y 4x y x y 4x y 0 x y xy y xy F A x y x y xy x r A 0 r 0 r 4 r r 3 0 r complex with negative real part, so stable 7 7 syms x x, f=-x+x-x*x^; f=-*x-x-x^*x; [xs xs]=eval(solve(f,f)); J=jacobian([f f], [x x]); A=subs(J,{x,x},{0 0}); eigsa=eval(eig(a)) Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 8/0
7. Exercises ) For the system d u u v dt v, 4 u v i. Find the fixed points and classify them according to their stability. ii. Make a draft sketch showing the fixed points and a few trajectories. ) For the system point at the origin, using: i. V x, y x y d x x y xy y, prove that the system has a stable equilibrium dt x y x y. ii. Local linearization. 3) For the Lorenz equations: x a y x, y bx y xz, z xy cz where abc,, 0 are constants: i. Find the equilibrium point(s). ii. Show that if b, then the origin is the only equilibrium point, and that there three equilibrium points if b. Discuss the stability of the origin for b< and for b>. It is given that for b< we have that b> we have that a a 4ab. 4) Determine the stability of the equilibrium points of Sketch a draft bifurcation diagram. 5) Assume an input matrix a a 4ab while for dx dt B 3 and four state matrices: 0 0 3 3 A, A, A 3, A 4 0 3 0 3 3 3 rx x for r<0 and r>0. i. Find the equilibrium points of each system. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 9/0
ii. iii. Find the eigenvalues and hence describe the response of each system starting from x0 0 T a) and b) from the equilibrium point. Create the Simulink model for the above systems and hence crosscheck your previous answers. 6) For a given function f x cos x i. Find the st, nd, 3rd and 4th order TS expansion around x=0. ii. Using Matlab crosscheck that the fourth order is indeed a better approximation that the st order one. 7) A nonlinear system is given by i. Find the equilibrium points. ii. iii. iv. Determine the stability of each point. Create a draft sketch of the state space. x x y x xy, y x y Create the Simulink model of system and hence crosscheck your answers. v. For each, simulate the linearized approximation of the nonlinear system and compare the responses. 8) For the system x r x : i. Describe its response based on the values of r. ii. Create a Simulink model that will crosscheck your answer. 9) Repeat question 8 for x a x, y y 8. Matlab Based Exercises for EEE8086 Crosscheck your analysis in section 7 using Matlab. This must include mfiles and Simulink models. Module Leader: Dr Damian Giaouris - damian.giaouris@ncl.ac.uk 0/0