 So we have been looking at stability of dynamical systems and yesterday I talked about a very simple method based on analysis of calculations or analysis of coefficients of characteristic equation and we can say whether the roots of the polynomial whether they are inside the unit circle or outside the unit circle using a very simple hand calculation. Now this method has limitations first of all it is applicable only when you can do analysis using linear models okay transfer function models or linear state space models it cannot be used when you have non-linear differential equations and real systems are non-linear okay even though we are not going to look at non-linear difference or differential equations as part of this course I am going to briefly introduce this idea of Lyapunov stability which is actually applicable to linear as well as non-linear systems, non-linear systems can be very elegantly handled through this approach and actually it forms the foundation of modern theory of behavior of differential equations. So this was founded by Russian mathematician and physicist who lived between 1857 and 1918 is doctoral work on general problem of the stability of motion which forms the foundation of this entire theory stability of motion has always been you know at the center of curiosity of scientific community for example scientist or physicist have been bothered about the stability of orbits around the sun it should not happen that it should be a center you see we talked about this face plane portraits you better I mean the solar system better behaves like center it should not behave it should not behave like this system this one you know if the trajectory asymptotically dies and you know finally you merge into the center it will be just as far as okay so the stability of this stability of motion stability of orbits of planetary orbits different planetary orbits could be asteroids or it could be planets or comets it has always been a matter of curiosity and you want to what is the problem the problem is that you want to predict how it will behave okay now methods based on Eigen values or analysis of the roots of the characteristic polynomial can tell you whether the system is stable or unstable but as I said the linear system is not a real world problem linear system is a toy is an approximation that we have created in which we are very very comfortable in doing things okay the real world is non-linear and you need so after looking at BIBO stability some final concepts we want to now move on to Lyapunov stability I am just going to give you half an hour introduction to this not really getting deep I am going to talk about things that are relevant to linear system analysis which will be using subsequently in our controller design nevertheless I will show one example which actually shows the power of this method that so what is the Lyapunov function Lyapunov functions are actually you know in some sense very crudely speaking they represent generalization of energy function okay now from physics we know that a system tries to take the path of minimum energy minimum energy principle so this is something which is generalization of that basic idea okay but not for a system which is governed by laws of mechanics okay but general dynamical system okay general dynamical system would be represented either through differential equations or through difference equations okay would be differential equations for convenience of computer based calculations you can represent them as difference equations because you normally solve them using some kind of numerical method in computer and you advance only in finite time finite time steps you can convert it into difference equations so for us the stability of motion would mean stability of different set of different equations or set of differential equations which are coupled not a single differential equation okay so in general I am worried about a system which is of this form xk plus 1 is equal to f of xk and f of 0 is 0 so what it means is that if there is a steady state x bar we have done a transformation we have done a transformation and then we are you know dealing with a differential equation which is whose or difference equation whose steady state is nothing but the origin so if I have a difference equation let us say in the absolute variables xk plus 1 is equal to f of xk and let us say x bar is equal to f x bar if this is the steady state okay I can define a new variable which is xk that is xk minus x bar and then I can transform this equation as so this I can write as small xk plus 1 and this I can write as f xk so this is capital x xk plus x bar minus x bar and then this new one this new function I can define as redefine as f so essentially if I do this transformation I will get a function when x when small x is equal to 0 the right hand side will be also equal to 0 so what I am expecting here is not something which is not possible when x is equal to 0 the right hand side is also identically equal to 0 so let us say we have done this transformation we have actually done a transformation of your original difference equation such that the steady state is 00 this is very simple you just take the non-zero steady state and subtract and then you can do a translation origin translation so for the simplicity I am assuming that 00 is the steady state okay now I am going to define a function which is energy light function energy function is a scalar function remember energy function is a scalar function so this is I want this function to be a continuous function okay I want this function v of x I am going to call this function as v of x this new function v of x is called Lyapunov function the first characteristic is that it should be continuous function of x well simplest function of simplest Lyapunov function would be x1 square plus x2 square x3 square and so on norm of x is a simplest Lyapunov function the scalar function norm of 0 is 0 right norm of vector x0 is 0 and it is a the second thing it should be a positive function which means for any value of x for any value of x v of x should be positive okay v of x should be positive a simplest way of constructing such function which of course we are going to exploit in this is v of x is equal to x transpose px where p is a positive definite matrix if p is a positive definite matrix for any x for any x v of x will be greater than 0 if p is positive definite this is for x not equal to 0 will have v of x greater than 0 okay and x equal to 0 v of x will be equal to 0 okay this is simple way of constructing a Lyapunov function this is a candidate Lyapunov function this is not the only Lyapunov function there are any function which is a positive function okay and satisfies these two things and there is one more thing that it needs to satisfy to be qualified as a Lyapunov function it is not sufficient that it is a function which is positive function we also want one more thing we want delta v that is derivative or difference of v as time progresses should be negative it should be negative definite or they should be negative okay so in some sense they should be a decreasing function as time evolves this is not a real function coming from any physics this is a function which we are fabricating okay this is a energy like function that we are fabricating okay so it should have three characteristics one is that it should be at origin v of x v of 0 should be 0 second characteristic is that v of x should be a positive function okay and positive definite function for any x okay we should get only a positive number and rate of change of v in time rate of change of v in time okay that should be negative okay so the energy function energy like function should be decreasing as time progresses that is the now whether it decreases or increases okay that will be governed by the system dynamics so whether a particular function qualifies to be a Lyapunov function for a given system will be decided by the system dynamics itself how does the system dynamics come into picture we will see that okay so basically what I am saying here is that when xk let us say these are the countours of v of x equal to constant these are different countours of v of x equal to constant okay I can plot countours of v of x equal to constant in x1 x2 plane okay so as xk goes from xk to xk plus 1 through dynamic equation okay on this countours I should move from outer countour to the inner countour that is what I mean okay it should continuously decrease that is what I expect to happen okay so these are the countours if you plot a 3d plot it will look something like this two dimensional system and a Lyapunov function for it so v of x is plotted on z axis and this is x1 x2 axis so a Lyapunov function for a two dimensional system this is a simplified visualization of a Lyapunov function it should look like a valley okay with a sharp minimum okay with a sharp minimum that is what it should look like and if you cut here different slices for v of x equal to constant see if you take any height here on this scale you know you will get v of x equal to constant and if you project that if you project that on to x1 x2 plane then it should look like concentric circles and what I want to happen is that as system evolves okay on this surface of this function I should move inside and inside that is what I want to happen okay the system evolves according to its laws of dynamics and the third condition actually tells you that Lyapunov function never increases with time it should be less than or equal to 0 so it should either stagnate it should never grow as time progresses that is what I want if I can find a function for a given system which obeys these three conditions then now whether this will happen or not will depend upon the system matrix you can just go back and see here see my system evolves according to xk plus 1 is equal to f of xk my system evolves according to this okay now let me define this v of x so v of x v of xk let us say I have defined as I have defined as xk transpose p xk where p is a positive definite matrix what I want to happen is that v of xk plus 1 which is xk plus 1 transpose p xk plus 1 which is same as f xk transpose p f xk right okay so this I compute v xk plus 1 like this and then I want delta v to be negative definite so you see where the dynamics enters here the dynamics enters here through this f of xk transpose okay so that is where the dynamics enters into the system so this Lyapunov function does not naturally come out of the system dynamics we are defining an artificial function okay and if you can find an artificial function which obeys this characteristic then we can talk about the stability there are so many numerical methods for example you could use simplest is Euler method the you can have more complicated algorithms like Rangokata methods so you can convert into a equivalent difference equation from differential equation there are particular corrector methods one could represent that into a all of them will be approximate they will not be exact but then so we can we have when we deal with non-linear differential equations in computers we have to deal with this approximate discretization and then okay so now so this I want to stress that it is an artificially constructed scalar function okay if I am able to construct a scalar function which has certain properties then I am able to talk about the stability of the dynamical system if I am not able to construct that does not mean anything if I am able to construct then I can prove some characteristics of the dynamical system if I am not able to construct then that does not mean the system is unstable or anything of that sort okay so do not stretch it the other way around now let us look at this particular system okay this is a very very simple system what will be the equilibrium point is 0 0 okay the linearization of this system if you do linearization of this system at 0 0 okay you will find that the system has two poles on the unit circle for this particular system if you do linearization you find that there are two poles on the unit circle okay and based on our linear system theory you would say that well this is you know a center this is marginally stable okay actually using here so what I said is that for a system when you do linearization if you get Eigen values on the unit circle you cannot do analysis using linear approximation that is ruled out you can linearization based analysis holds for the non-linear system only for two cases asymptotically stable or unstable marginal stability cannot be established using linearization so this is a classic example you cannot do that here okay let us define the simple Lyapunov function simplest that you can think of x1 square plus x2 square okay the simplest Lyapunov function one can think of v is a continuous function just check that is it a continuous function it is a continuous function now can you find out just do the calculations what will be v of xk plus 1 and tell me whether the third condition is satisfied two condition is satisfied what is the first condition x0 is equal to 0 what is the second condition let us go back x should be a continuous function of x vx should be continuous function of x which is happening right what is the second criteria it is a positive function x1 square plus x2 square for any x1 x2 is a positive function no problem what about the third one just try what do you think upon not positive value value which is greater than 1 so if you substitute x1 if you find out the value for v of xk plus 1 okay you will see that you will get this x2 square upon 1 plus x2 square whole square okay and this quantity is nothing but vx upon 1 plus x2 square whole square the denominator is always greater than 1 so which means v of xk plus 1 is always less than v of xk okay v of xk plus 1 sorry is always less than I made a mistake let me correct v of xk plus 1 is always less than v of xk okay so as time progresses this Lyapunov function value reduces okay as time progresses the Lyapunov function value will reduce and so this is the Lyapunov function for the system now what is the significance of having a Lyapunov function well is the Lyapunov function unique just try what happens if you take alpha where alpha and beta alpha x1 square plus beta x2 square will it be a Lyapunov function if you take any alpha and any beta which are positive okay even they will turn out to be a Lyapunov function you will get the same expression okay so this will also be a Lyapunov function so there is no unique Lyapunov function for this particular system fortunately you are able to find out infinite number of Lyapunov functions okay this may not happen for most of the real systems it is difficult to find a Lyapunov function but that is a different story this is a very very fundamental theorem of Lyapunov well let us not get into the theorem statement you can read what I want to say here or what the message here is that in the neighborhood of the steady state okay in this particular case 00 right in this particular case 00 in the neighborhood of the steady state if you can find a region okay in which you can define a Lyapunov function okay if you can find a region in the neighborhood of the steady state okay on which you can define a Lyapunov function what is a Lyapunov function it should be positive okay it should be decreasing as time progresses okay a positive function which is decreasing and time progresses then okay it says that the equilibrium point is stable then it guarantees that it guarantees that the system trajectory will stay in the neighborhood of the steady state that is then investigated now there are two things there are two possibilities okay one possibility is see one possibility is that delta v xk is less than or equal to 0 and other possibility is delta v xk is less than 0 strictly less than 0 okay and these two are different possibilities in one case in one case we can we allow possibility that delta v is 0 okay so there is no change there is no change in the value of so it means if I go here see suppose it happens that my you know suppose it happens that xk moves to xk plus 1 suppose it happens that xk moves to xk plus 1 and you reach this trajectory here once you reach the trajectory the next point is trajectory in the sense this is the constant v value this is the counter for v equal to constant the next move occurs such that it is again on the same counter okay a third move occurs such that it is in the same counter what will happen is delta v this is a counter for v is equal to constant okay suppose the system gets trapped in a region where the value of the v is not decreasing okay if value of the v is not decreasing then all that you can say is that the dynamics will keep hovering in the neighborhood of the steady state. The second situation is that this difference is strictly less than 0 every time so what will happen every time every time it will move inside and inside okay and finally as time goes to infinity xk will collapse into the origin so these are two different situation in one case all that you are saying is that delta v is not decreasing okay it is remaining 0 so you allow either decreasing or non decreasing you know 0 0 or less than 0 in other case you are saying strictly less than 0 these two are different two situations okay and these situations are captured through okay so if delta v is strictly negative for every k then we know that the system will eventually go to origin okay if the further given delta v we just find that it becomes 0 at some point okay and remain 0 for example then you cannot say about asymptotic stability the first thing that I talked about is asymptotic stability because you know every time system moves from a counter outside to a counter inside and finally it should collapse if every time it is negative it has to move inside all the time so you know it will collapse into if sometimes it may happen that it is neither increasing nor decreasing the system stays you know in some trajectory in some bounded region in the example that we considered okay since there exist a Lyapunov function so this theorem powerful theorem says that if you can find a Lyapunov function for a given dynamical system okay which obeys these three criteria then okay you can guarantee stability in fact if it is if the difference is negative then you can guarantee asymptotic stability okay and this idea holds for any dynamical system you can see the sweeping generalization this result brings in it is a different question whether you can construct a Lyapunov function for a complex system but if you can construct it guarantees that you know it guarantees to analyze the stability of the dynamical system in the neighborhood of a given point okay it tells you whether it is linear or non-linear does not matter okay so very very very very general result and now just going back to the system that we looked at just now okay if you do linearization you get two Eigen values which are on the unit circle and you have problem and you cannot analyze stability using linearization but you can talk about that particular system happens to be asymptotically stable and this you can never establish using a linearization based it is asymptotically stable in the neighborhood of zero origin that you can never establish using Lyapunov stability analysis because you get this difficulty of poles on the so linear world is a ideal world and everything that all the results that you create there do not one to one transfer to the non-linear you have to use something else well we are not going to get into this Lyapunov stability too much except we need some simple results for linear system theory which we will be using and you probably have to attend a separate course if you want to understand this thing in detail I am just going to derive some useful results for linear systems because we are going to use them later when we talk about design or analyzing some stability of certain systems now let us look at this simple system well Lyapunov stability as I have defined right now it talks about unforced stability okay you can of course talk about you can analyze stability in presence of some inputs okay and those concepts are much more advanced and I am not going to touch upon them in this course so there is something called input to state stability and input to state practical stability there are many many more notions if you are interested the book by Khalil on non-linear systems is a very good book I listed the book at the end of my lecture notes so also I think there are courses in the Institute SISCON systems and control and electrical engineering offers courses on non-linear systems analysis even we offer a course when whenever it is possible elective on so now for the linear system the task of constructing Lyapunov functions is very simple okay for linear systems I need to construct a Lyapunov function I can do it using any positive definite matrix so if you actually substitute v of xk plus one this is a very simple calculation that you will get here v of this you will get this xk transpose phi transpose p phi into xk this is just by substituting the dynamic equation this is very very straightforward and if I take a difference I will get this delta v that is v xk plus one minus v xk will give me this matrix all that I need is this matrix this matrix should be negative definite if this is negative definite what is the problem minus p should be there yeah not i so there we are so this matrix that is phi transpose p phi minus p this matrix should be negative definite if this matrix is negative definite then we have constructed a Lyapunov function for this particular system okay now the question is when does such a matrix exist okay you can show that such a max is such a matrix exist then of course the system is asymptotically stable so actually you can show that if eigenvalues of phi are inside the unit circle okay eigenvalues of phi are inside the unit circle then you can always construct a matrix p such that phi transpose p phi minus p this is negative that is always possible you wonder why when you can analyze stability of a linear system using eigenvalues and eigenvalues can be computed very elegantly very easily now why do I need this particular method you will see as we progress we still need this classic equation this particular equation is called as Lyapunov equation it can be shown that this equation will always have a solution provided eigenvalues of phi are inside the unit circle if phi is asymptotic if phi has eigenvalues which are inside the unit circle which mean the system is asymptotically stable you can always construct a Lyapunov function such that phi transpose p phi minus p is negative definite okay so this is this is guaranteed and this is used this will be used in analysis at some point later okay so there are times when you analyze some controller behavior closed loop behavior it becomes difficult to analyze using eigenvalues okay it is easier to analyze using Lyapunov theory so that is why I am developing this right now for linear systems it will have some other implications when it comes to design okay so in matlab you have a function called Lyap okay so if you give phi matrix and if you specify q matrix if phi has eigenvalues inside unit circle and if you specify q matrix okay it will give you back p matrix okay it will give you back p matrix so I am just taking a simple example this is a simple harmonic oscillator system this has eigenvalues which are 3 by 4 and plus or minus 1 by 4j so the system is asymptotically stable so if I specify q I can solve this equation I can specify q see what is this equation this equation says that phi is system matrix q let us say I specify I want to design I want to design and Lyapunov function I want to find Lyapunov function for this particular system so given what I will do is I will choose a matrix q which is positive definite so that minus q is negative definite okay and then I can back calculate p okay and this Lyapunov equation appears in many other context so it is so if I give this p if I give q1 to be see I have chosen q to be 1.25.251 this is a positive definite matrix so negative of this is a negative definite matrix okay and then for this particular choice of q I will get Lyapunov function which is p1 matrix is given here if I choose q to be 11 then I will get this Lyapunov function which is 8 by 3 8 by 3 so there is no unique way of constructing Lyapunov function both this p1 and p2 both these matrices will give you a Lyapunov function for this particular linear system okay so both of them are valid Lyapunov functions that is x1 transpose p1 x1 p1 xk and xk transpose p2 xk both of them are can be used as Lyapunov functions. Now when I am stopping it here I am not getting into more details of Lyapunov function I have introduced this Lyapunov stability because it will be useful later when we analyze state feedback controllers that is where it is going to be useful okay it is a very very very brief introduction it cannot be shorter something shorter than this Lyapunov stability theory it is a as I said if you are interested you should actually read this book very well written book for those who have clever for maths it is a very nice book Khalil non-linear systems and non-linear systems and this book is of course available in our library so even the second book is a very nice book Khalil's book is a advanced text it is useful if you are going to do research in control theory this is probably the primer this book is will give you brief introduction the kind of thing which I have given you in one-and-a-half like ours but it will give you a practical knowledge about what it is Leonberger's book is intermediate it is not at the level of Khalil it also introductory book very nicely deals with dynamic systems and a third book of course Khalil's book is a specialized book well so why I have done this that is because I need this a little later so I am going to use two tools for analyzing stability one is roots of the characteristic polynomial other is Lyapunov function okay so this is just just a brief background to the stability analysis and we are going to move on now we are going to move on to something different now so now let us move on to the controller design what I want to do eventually is controller design using state feedback or using the state space models that we have developed okay but before I move to those controller design problems or code it controller design methods I need to give some motivation as to why do I need to do all that why is there any benefit because in your first course in control you study about PID controllers and if you go to industry if you have done any industrial training or if you have spent some time in industry before coming for your post graduation you would realize that PID controllers are everywhere and you go to any company any power plant any chemical plant it is just full of hundreds and hundreds of PID controllers okay and here I am talking about state feedback controller why what is so great is there a motivation to go for something more complex than simple PID controllers also PID controllers which we are taught to in your first course are they do they remain simple when you have hundreds of them together okay is the question okay it is possible to define for continuous time systems continuity is a different notion from continuous time and continuity what is continuity of a function that is a different different notion all together you know you do not confuse between continuous time system and a continuous function these two are the word continuous is common does not mean that they are referring to the same things what is a continuous function for every epsilon greater than 0 what what something what we should be able to find out delta greater than 0 what is it tell me who remembers left limit and right limit that is a simple way of looking at it so for every epsilon greater than 0 so if you advance f of x mod of f of x minus f of x plus epsilon or x minus epsilon whatever you want to call it difference of this okay so you should be able to find x minus x which is less than delta such that yeah for any value of x in this interval you know f of x will be less than epsilon f of x minus f of x mod of f of x minus f of x so that is the definition you can of course go for multiple functions and talk with norms okay continuity of a continuity of a nonlinear function is different from continuous time systems and no don't confuse the two I can get into those things but we have limited time so and then I think you are attending those lectures right on nonlinear systems where I dealt about continuity different notions of continuity yeah we talked about lip sheets continuity and you know uniform continuity and so there are okay so I just want to move on for a very short period to another topic so now finally we start doing the main business business of control okay now that we have models we have tools of analysis we have two tools of analysis one is Eigen values and then we have lay up on no functions okay and now let us get into the business of doing control okay the nice thing now is that we are in a imaginary world where we have a model and we believe that the process dynamics is represented by this model on this model is something which we can play with we can turn it around we can you know introduce some new terms we can do all kinds of things later we have to worry about how to translate that into reality if you design a controller in the space of models which are linear models okay we will have to then take it back to the reality through some computer implementation or something but now once we have developed the model we have you know a description of the dynamics and now the idea is can I alter the dynamics the way I want okay that is the main idea we believe that this model is a good representation of the real system so if I do manipulations with this model the similar manipulations will hold for the real system under that belief we carry out a design okay okay so let me see what we have here I will talk about something called multi loop control I want to go before you go to advanced control I want to talk a little bit about these PID controllers which we have looked at in your first course and what happens when you have multiple PID controllers what is what is the problem then is there a way of intelligently choosing PID controllers that is what we look at through something called relative gain array analysis there is a single analysis which will also help us in finding out how to go about doing you know choosing PID controller pairing what is this pairing we will come to that then there is a concept called decoupling controllers I will briefly introduce this decoupling controllers and then conclude well this this part I am going to do very quickly because yes it is important it is an important link between what you have studied in your undergraduate as a control course and what we are going to study next nevertheless I do not want to emphasize it too much I will go through it somewhat quickly there is lot to it if you a lot of work has been done on this area but what I am going to do for next maybe one or two lectures is not completely representative it just gives you a flavor okay so real systems real industrial systems are multi-variable multi-variable systems there are multiple inputs and there are multiple outputs to be controlled you have multiple things at your manipulation the example that I keep using in many many lectures on advanced control is your car the car has you know you want to control speed direction and you have three inputs at your disposal you can accelerate you can break and you can you have a steering okay then real industrial systems there are hundreds hundreds of measurements and hundreds of manipulate inputs that are available to you look at a power plant we have many many many manipulated variables available to you many temperatures pressures flows all data coming in and you want to simultaneously control everything you want to control the state of the system okay and the conventional approach to doing this is using multiple PID controllers okay this is something which is being done last for 40 50 years 60 years very complex thing when you do it using multiple PID controllers using multiple PID controllers to control a complex multi-variable plant is like having three different drivers or two different drivers in your car one who only manages accelerator one who only manages the break the third who only manages steering okay not not a funny thing to have in your car when you are driving if you are three people who do not talk to each other who do not know about existence of each other you can have chaos and that is why controlling industrial plants is quite difficult when you have multiple PID controllers typically the way these PID controllers are implemented today they are implemented in such a way that they do not talk to each other they do not know about existence of each other okay and so it is like hundred drivers simultaneously driving a plant okay and that is why you need a you know a team of plant engineers and operators who are continuously on the watch what is happening 24 hour there has to be a watch so you will start wondering how it still it works so this is what I am going to call as a multi loop control strategy multi loop is multiple drivers okay and multi variable controller is you driving your car single person making decisions about all three things simultaneously by taking into consideration both speed and direction this is the ideal situation one driver for your car not or at least if there are you know if there are thousand variables to be controlled and manipulated you do not want thousand drivers you can probably reduce it to twenty drivers it is better than having thousand drivers okay so that is so multi variable controllers is what we want to eventually go to so what is the problem with loop interactions so typically there is a lack of interaction there is a lot of coordination between the loops now the neighboring loops okay can collaborate and help each other or they can destroy each other they can fight okay if they fight you know you have a trouble how do you find out whether the loops are fighting or not fighting how do you pair which controlled output should be controlled using which manipulated variable if I am controlling speed should I use accelerator to control or brake to control what is what is my strategy if I have multiple ways of controlling a system what is the pairing because PID controller means I have a single input and single output right I have a single measurement single manipulation okay so even if let us let us let us go to this plan this is a distillation column plan do not worry about if you do not understand distillation there are things that are to be controlled that you can definitely appreciate top end point this is a distillation column in which you separate chemicals mixture of chemicals using you know difference between their relative volatilities so this is an industrial column of shell you want to get top end point means top product quality okay side end point means side product quality and temperature here at the bottom these three things have to be controlled or have to be are the controlled outputs from the viewpoint of operating the system I have three manipulated variables I have top draw amount of liquid that I draw from here this is called top draw okay then there is a side draw I can draw some liquid from the side and I can input heat here this is called bottom reflux duty so there is a boiler here you you put in some heat here say through steam so I can heat this system look at this as a input output system okay there are three inputs there are three outputs there are multiple states okay what is happening inside is very very complex but as a control engineer I have developed a model using you know MATLAB's toolbox or whatever toolbox that you have silab toolbox you have a model which is probably data driven model and you know how the dynamics of the system is you know how dynamics behaves in the level of some operating point so you have a model point now question is if I want to put IPID controllers how do I put them should Y1 be controlled or Y1 be tied up with a PID controller that manipulates U1 or U2 or U3 so there is a combinatorial problem here okay what should be my control output what should be my manipulated variable okay I am allowed to put three PID controllers okay and which one to go which one goes with which one and what is the basis for choosing that okay well the life is not so simple there are also other inputs which you cannot manipulate there are true to heat there is a heat exchange between some other stream in the chemical plant and some liquid inside here on some trays so there are two disturbances which keep influencing the plant this is one of the standard problems which the shell group has floated in the control literature okay so there are two disturbances there are three inputs and there are three outputs I am defining a simplified problem they have given a problem which is more complex they have given a problem with seven outputs five inputs and three disturbances I have created a simplified problem here so now the question is which one which one should I pair with how do I couple these inputs and outputs into one PID controller at a time so difficult problem so which scheme is better I can come up with many schemes right I can say that top end point the you know I can say that physical proximity is important so if the manipulated variable is here and I want to control this concentration I should tie them up together okay but somebody might say no no no this heating here has a very high influence on the concentration here so this concentration should be tied up with this heating well that is also logical okay so there are possibilities which are similar okay and then one needs a filter to screen out these possibilities okay I need some filter to screen out these possibilities so fundamental question is which is the better scheme which is this scheme better that is y1 u1 y2 u2 y3 u3 now this numbering u1 u2 u3 is arbitrary okay so I have written some scheme here 112233 okay I can come up with some other scheme y2 u1 y1 u2 and so on okay so typically way people are practicing engineers have been dealing with this is through so called experience okay people have operated plants for years and they know that if you actually do the second combination it may not be a great idea and this knowledge is transferred from generation to generation and then you know you keep doing those things so is there a way of systematically reaching a decision how do I do pairing in a complex plant I will just show you one simple example of a complex plant so this is a Tennessee Eastman problem which is plotted by Tennessee Eastman company now well we can appreciate this plant as a control engineer without knowing what is physics this is a reactor here and in this reactor there is some reaction being carried out the reaction gives rise to products which are gaseous so these products are coming out here they go to a condenser so you condense those products products what happens unfortunately is that what comes out is not just the products reactants and products together come out okay so you have here a mixture of reactants and products so you need to separate them because you want a product okay so this is done in this vapor liquid separator okay and part of what is recovered is is fed back through a compressor to this particular reactor so I do not want to throw out you know good stuff which is the reactants are gaseous and liquid and then the product which comes out is gaseous what is the product Tennessee Eastman has not said anything they have published a paper as a challenge problem in for control engineers and they just say A, B, C, D, E, F, G, H okay so there are six components A, B, C, D, E, F, G, H and they have given some reactions which you do not understand and you write to them or you go to their web page you can download a program which will simulate this plant okay so you can actually give inputs there are 12 inputs to this plant you can give 12 inputs there are different inputs here you can see the measurements given here these are symbols of measurements these are the concentration measurements available at the purge and these are the concentration measurements available at the product now what happens is the bottom of this particular vapor liquid separator comes to this unit called stripper and in this stripper at the bottom you get the product and again for stripping you use this one of the reactants the C is a reactant which is used to strip some components which are remaining still in my bottom liquid and again recycled here okay and the product is withdrawn here now you can see here that this is a coupled system okay what a modern systems modern plants are always very very tightly coupled integrated plants you do not want to waste even a you know kg of a material so whatever is might you know in olden days you may not have such couple things you just create a product and then store it somewhere then you know separate it and then afterwards might think of using it and so on whereas now you know you do not have time you want to do it online separate unreacted material put it back into the reactor take the products and then send them for packaging or whatever so any small perturbation in this reactor will have effect on this heat exchanger will have effect on this vapor liquid equilibrium will have effect on this stripper so these are coupled interacting systems okay it's stupid to put you know 12 drivers 12 PID controllers I am allowed to put for this system it's you can see this when to see this you know that if you put 12 drivers driving this plant who do not know about each other it can be chaos okay so how do you choose this 12 PID controllers how do you select pairing okay should I should I measure pressure here and manipulate you know this cold water flow should I measure pressure here and manipulate the flow out what should I do everything affects everything okay so it's very hard to make the decision okay and we want a systematic method for reaching that decision yeah that's a very good guess very good thinking so I want to systematize this which variable will have maximum effect so what what is the primary when you develop models it's a transfer function model what will you look at gain gain will give you sensitivity steady state gain steady state gain I can look at the steady state is there a trouble with using looking at steady state gain it does depend upon tau to S sensitivity does depend upon tau but let's not let's right now look at a steady state model simple suppose I have a simple gain model like he's saying sensitivity in some sense can it be used see if you look here the variables of are of all kinds some of them are mole fractions some of them are pressures some of them are temperatures okay some of them are flows okay so what all things I can manipulate I can manipulate this inlet flow I can manipulate this flow I can manipulate this flow I can manipulate this flow this four flows I can manipulate this compressor feedback line this feedback line I can manipulate this this particular wall on the compressor feedback line this is called purge purge means you let out some bleed stream because you want to maintain balance of something that are not reacted in a reaction that always happens that there are some things which come in which are not useful for example you want oxygen but you have to you are pumping in air and nitrogen comes in and you have to keep pumping out nitrogen and that is done through this I mean I'm giving a very crude example but you manage it through this purge you keep purging the nitrogen out through or some gases out which are not useful so this purge is you can change the purge flow rate you can change the flow rate from this you know vapour liquid separator to this stripper this flow rate can be changed this cooling water flow rate can be changed this cooling water flow rate can be changed this product draw rate can be changed so there are so many manipulate variables okay what do I want to control okay I want to control pressure level temperature here I want to control pressure level temperature here see l i p i are pressure indicator level indicator temperature indicator any reaction I want to control reaction pressure reaction temperature and amount of reactants inside the reactor level okay I of course want to control the product purity that's why I am worried about putting the analyzer here okay I am worried about the product purity if I am producing you know let's say alcohol that it better be of particular quality okay otherwise it is useless for me so the quality is very very important so so putting up how do you systematically come up with pairing of which control output and which manipulate variable if I want to put 12 PID controllers for this system is not a trivial exercise it requires lot of okay so there are large loop interactions the loop start fighting then you can have poor quality of control so is there a configuration is there a configuration of 12 PID controllers or whatever N PID controllers such that they fight least okay is what I want to find out I want to find this out mathematically okay I am just going to use simple information of gains now gains on their own are not useful that is because gain value depends upon the unit used for calculating the gain okay and units of each variables see pressure might be Newton per meter square it might be 10 to the power 5 okay temperature is in 100 okay so if I find out change in pressure by change in flow that value might look very large the pressure is expressed but the same thing if I express in terms of atmospheres instead of Newton per meter square it might look very small so you know comparing gains of different variables becomes very difficult you cannot compare gains so easily so you need a method which is gain independent sensitivity you should look at sensitivity is no doubt but directly looking at sensitivity doesn't help because those values can be deceptive they can be unit dependent okay so you find a value which is per hour or per second will give you different values and you know difficult to make a call on whether this gain is high or this gain is low it's very difficult to say okay so what is done practical way of dealing with this problem is to try to find a configuration of PID controllers such that they are you know in some sense fighting least okay and if you can come up with a least fighting configuration then you choose that configuration and hope for the best that is you try to tune them in such a way that okay let us take this good old example of quadruple tank okay I have two inputs and two outputs question is which input I want to put two PI controllers or two PID controllers whether level one and input one or level one and input two okay that's the question but that is multi variable controllers I will talk about multi variable controllers separate you can have PID controller which controls multiple output simultaneously that's a different class that is not right now used in the industry it is not readily available of the shelf you can buy a single loop PID controller you can go to market and say I want a PID controller you will get one input one output at the most you can do cascade with it or some feed forward control but that's it okay though modern DCS allows you to implement multi variable PID controllers people don't know about it they still use you know a hammer to kill and so they have very very powerful tool in a DCS you can actually implement multi variable PID controllers people just don't know about it so they just keep implementing multiple PID loops okay why because we are comfortable doing that over years okay how will you normalize all variables yeah but then then your values also the way you normalize also will play a role now isn't it how do I compare gain with respect to pressure and gain with respect to temperature I mean if I take temperature variable and pressure normalize with respect to what maximum but maximum of pressure means what which maximum maximum which can occur under disaster or maximum which occurs under normal operation which maximum right see normal operation it could be that you know it plus or minus 5 degrees a disaster maximum could be plus or minus 50 degrees which one do you may use so your decision there will influence the gain value calculations what you say is a is a good thing we actually do that we do dimensionless kind of gains but even then they do not help they help only to a limited point okay now where is the problem where is the trouble okay look at two PID controllers this is my process whatever is drawn here this is my process this is representation mathematical representation of the process okay we have seen we have seen that if I if I change input 1 tank 1 changes and tank 4 changes level changes also that means tank 2 level changes okay same is true here if I change input 2 tank 2 level changes and through this leg even tank 1 level changes so if I actually find a transfer function matrix we have done this earlier we found the transfer function matrix it was a full matrix okay and I have just represented this here graphically G11 is a transfer function between U1 Y1 G12 G21 is between U1 and Y2 to 1 is a transfer function between U2 and Y1 and this is a transfer function between Y2 and U2 okay and there are 2 PID controllers okay I will just try to show you what is happening what are the paths see this this particular this particular look at this output of this particular controller M1 influences Y1 through this path right direct path there is a direct path between M1 and Y1 through this G11 and there is an indirect path which is this right to trace this path so when there is another PID controller okay whatever this controller is doing is affecting Y1 through 2 channels through 2 routes one is the direct route okay and other is this other is this route through the other loop and just imagine what would happen if there are multiple such controls okay there will be interactions between different loops and a given loop okay and then I need to actually is everyone clear about this what is happening here is a simple very very simple explanation of when and typically typically these 2 controllers are independent they do not know about existence of each other okay even though they are implemented through same hardware they might be 2 controllers running parallelly in this computer but they do not talk to each other they do not exchange information okay if the do not exchange information you ask why why do not exchange information that is because we started using PID controllers historically using analog hardware okay initially the PID controllers were implemented using you know pneumatic hardware yeah bellows and you know things like that springs and bellows and then we moved to electrical circuits op-amp circuits okay where gain was you know op-amp and integral and derivative was realized through capacitance and resistance and inductance okay so historically we have that baggage of using electronic controllers then you know what happened after that from you know pneumatic controllers to electronic controllers to we moved to microprocessor based controllers now microprocessor based controllers you do not what you do is you are solving a differential equation or a difference equation you do not have to stick to you know those old forms why those old forms were thought of P, I and D because those 3 fundamental forms can be realized through a physical hardware very easily okay RLC circuits you can actually fabricate and realize a differential equation can come up with a equivalent of a differential equation you can have a value of op-amp gain which is same as your design gain you can have a value of L and R and C such that you know you get designed integral time and derivative time and so on so those were done okay because of certain constraints that existed in those times and in 80s when we are in 90s when we moved to digital control okay so these were on board computers which were used for doing control and they could do much more than you know just implementing a PID controller PID controller is one differential equation solving it online you know is child's play for using a microprocessor even the prime preliminary ones which existed in 80s okay so that is you know highly underuse of what is existing but that is because of the historical background we still continue to use multiple PID controllers in the plans because we have been using them for last 50 years and we have a lot of experience okay and how to design controllers multivariable controllers is something which is not so well known yet yeah but this PID controller will work only according to output Y1 no see this PID controller will only look at Y1 and this PID controller will look at Y2 it is not cross links see this PID controller does not know when you when you do this it does not know that M2 will actually will have a effect on Y1 which will through this loop will have effect on Y2 yeah it is just trying to control Y1 it does not realize that you know if I make up change here yeah so ideally what we should do see if I ask you if I if I ask you to control this plan if I give you two knobs you know this and this okay actually we can we can now actually start this we have this setup in the lab we can go and do experiments so if you what will you do you will not if you if you are put in the job of doing it you will look at both the walls you will look at both the levels and look at both the walls and try to control both you will never try to you know say that okay I will only look at this okay now just imagine situation that you are only looking at one wall and he is looking at one wall and then you do not talk to each other okay you only look at you know your level which is strange okay you are reacting you know to only level one and he is reacting only to level two and you are taking independent control actions okay so there is a problem yeah no so attempt to track level two will create a disturbance in level one control okay same way attempt of attempt to travel track level one very precisely can create a problem in level two okay so what we need to do is that if they start fighting we call it detuning we need to sort of not tune each controller aggressively okay see you may have designed a single loop controller using some beautiful method for single loop design it will be very tight control but you know two tight controllers if they start fighting is a trouble okay so we need to sort of back off from two tight designs to do you know there has to be some compromise which has to be struck between them first of all you should choose them properly pairing should be chosen properly okay so that is the first question so we will actually do this using what is called as interaction analysis so we will continue looking at interaction analysis in the next lecture so I will talk about this interaction analysis how do you analyze you know how do you analyze these loops behavior okay particularly in presence of other loops and in absence of other loops can you compare and make some judgment what will happen