 Let us begin with development of control relevant models last time I gave you an overview of what we are going to do now I am going to start looking at each component we will begin with modeling control relevant modeling my course this particular course is going to be limited to linear controller synthesis or to be very precise controller synthesis using linear dynamic models the resulting controller may turn out to be non-linear in some cases but the basis which is used for designing controller is a linear dynamic model. So the question is how do I develop a linear dynamic model which is control relevant I am going to do it two ways one is start with models that are developed from physics I am calling them as mechanistic models the second class is developing models directly from data and then both of them finally will have same structure but probably interpretation of variables might be different okay so let us begin with development of linearization of mechanistic model this is my first module well the way I want to run this course this time is mostly I am going to rely on my slides even for the intermediate steps we have time and anywhere you want to stop me ask me some doubt you can do that I will explain you if something is not clear from the slides I will explain you on the sheet on the by writing so please stop me okay I will also upload overall schedule for the entire course how the sequence of lectures is going to be. So this is something which I had earlier talked about why do we need mathematical modeling mathematical modeling is required in control for variety of reasons we probably have to do design of a system so we need mathematical modeling that is not concern in this course the concern in this course is the next part which is operation operation on minute to minute second to second basis so process control that is what is our control current objective well in control there are variety of things for example there is something called soft sensing I will be talking about it a little later or estimating variables which are not directly measurable optimal control you know you want to move a system from one state to other state in some optimal fashion you may want to optimize the operation of the plant online or you may want to implement single loop or multi loop controllers sometimes you need models for doing online fault diagnosis the system start behaving malfunctioning you want to find out what is the reason what is the root cause to do the root cause analysis we can use dynamic models that is one of the major uses of dynamic modeling I had put this figure earlier I am just going to connect again there are different levels of models that you need for different tasks these as I said there are four or five layers and we are going to concentrate mainly on this layer model predictive control this particular layer or multi variable control for the for a plant I am not going to talk about the layers above and I am not going to talk too much about PID controllers or single loop controllers so what kind of models I am going to develop I am going to develop models for layer two layer two is dynamic multi variable time series models well probably you understand right now only word dynamic means the models that capture the dynamics the remaining part will become clear as we go along so what kind of mathematical models one can think of okay one kind of mathematical model is qualitative models there are different kinds of qualitative models which are used in control well whether we are going to use them in this course is a different story initially I just want to give words I view what kind of models exist what kind of models can be used for control well one of them is one class is qualitative models well you have qualitative differential equations there is whole lot of theory associated with this in the field of AI then you can use sign directed graphs that is also comes from AI tools export systems other class of models which as engineers we use much more are quantitative models so the classic form here is differential algebraic equations okay differential equations or algebraic equations or differential algebraic equations coupled this is what is typically the form of models that you come from physics that you develop from basic underlying physics of a particular system there are other class of models in which you have to deal with logical variables okay and then you can have a system which is mixed logical dynamical system there are conditions if this happens then take certain action you know or if temperature is high shut off you know steam wall for example these kind of actions are there when you take design a controller and these kind of conditions can be modeled using mixed logical dynamical systems other class of models are this time series models which are essentially developed from data and we will look at in detail these kind of models there are statistical correlation based models PLS or principal component analysis and so on and then finally there are mixed models which are semi quantitative semi qualitative the word fuzzy systems you might have heard is fuzzy systems are semi quantitative semi qualitative models well people know what fuzzy system because of washing machines you will have some you know sales literature saying that this washing machine is on fuzzy control well there are fuzzy models so this is the entire gamut of models we are going to look at only one small aspect of modeling well the models as engineers we know are white box models or models coming from first principles what are they based on they are based on energy balance material balance charge balance they are based on physical laws constitutive relationships thermodynamic relationships kinetics in chemical case reaction engineering you have reaction kinetics your heat balance so all these are used to construct dynamic models coming from physics we have we have understanding of physical systems and this is what as engineers we often are introduced to in the courses typically we are introduced to models that are static we tend to ignore dynamics in many disciplines that is because we are more concerned about long term behavior or design of the systems and then we look at only static part in control we are actually you know concerned about managing the transients and we have to we have to work with models that are dynamic okay so the rate of change of variables cannot be ignored and that is where what is the advantage of these models these models are valid over a wide operating range you take a system you develop a good model from coming from physics and if your model is tuned to the plant the parameters are correct the sizes and everything is correct this model will help you to predict behavior over a wide range okay so these are good models very good models they can be used for they provide lot of insight into what is happening inside the system okay so if you have the models coming from physics okay they are always very useful you might I mean now that we are beginning you might wonder what do you mean I only know models coming from physics where are the models not coming from physics okay we are going to learn that in this course how to develop models not coming from physics but those are dynamic models okay I will be talking about them soon maybe after 2 or 3 lectures so but I want to begin with models coming from physics because all of you know models coming from physics that is where let us begin let us see what are the difficulties in developing those models and then move on to models that are not coming from physics okay so that will be a easy transition from what you know to something that is relevant for control but if you have these models nothing like if you have a good first principle model for some simple systems like induction motor or some circuit you may have a good model coming from physics okay or for some simple small reactor you have a good model coming from physics and then it is worth using that model if you have that model okay well the trouble is developing these models is not an easy task typically to develop these models you need an expert if I have to develop a model for a automobile coming from physics I need a person who understands modeling of an automobile it should be a mechanical engineer or an automobile engineer should have done so many courses that you need to know for doing this modeling and if you have time and money to do that well please remember it is not just that time when it goes to industrial control it costs money if you have to employ an expert who knows a lot about automobile engineering how to develop a mathematical model for it and you know you can actually get a model which is quite close to the real system well it takes time so you have to wait for a longer time you have to pay him salary for a longer time and you know it might delay your process of developing a controller is it worth doing those models yes it is worth doing those models in some situations it depends upon the situation depends upon the context if you are developing a simulator okay for example in training pilots you develop a flight simulator okay those models are what is a flight simulator it is set of differential algebraic equations that actually simulate a flying conditions you better have a person who knows aerodynamics and you know who can actually write differential equations algebraic equations partial differential equations that really simulate the conditions and then you know that simulator is running on the background and it makes the trainee feel that actually he is flying okay you better have a good model so there is a situation where you need those models but developing a controller if you start using those kind of models it can become very very complex it can be a long drawn process we want to do you know shortcut so there is one more class of models which are in between we call them as grey box models now what are these grey box models grey box models are something in between it is a model between a it is some part of it is developed from physics some part of it is developed by some correlations you know so they are sometimes called as semi phenomenological models part of it is coming from data or some kind of heuristics I will give you an example here I have stated an example in which you have a reactor heat and mass balance are developed from physics but I do not know the reaction how the reaction occurs so I am putting a neural network to develop the reaction model and I combine the two I get a model which is a grey box model partly coming from physics partly coming from it is a good model if you can develop that it cuts down the development time and it is better choice than completely black box models but again as I said the last point is important developing this grey box models or developing white box first principle models mechanistic models you need an expert okay and needing need an expert you need lot of time which means translates to lot of money so sometimes it is possible to do it sometimes it is not possible to do it so let us look at both the scenarios sometimes it is possible to do it and we can develop those models what to do how to use them for control what if you are not able to do those you do not have that kind of a model how to develop a control relevant model we will look at both the scenarios I will just give you an example of a model which is developed for a laboratory system in my lab automation lab we have a very simple system here if you see there are two tanks in series the first tank is used to create hot water okay this is a stirrer here there is a stirrer in this tank cold water comes in into the first tank okay there is a heater electrical heater which is used to heat the water raise it to certain temperature the second tank is a mixing tank hot water and cold water is mixed into the second tank from the first tank to second tank there is a you know overflow so whatever water comes in that overflows into second tank in the second tank the level changes okay as a function of time also temperature changes the function of time because you are mixing hot fluid and cold fluid okay this is a toy system here but this is what you have you know in your bathroom and you have a water heater and then you know in your bucket you mix hot water and cold water okay exactly the same system simple system well my problem control problem is to control level inside the tank and control temperature inside the tank if you ask me as a control engineer what I would like to control level inside a tank and temperature inside a tank okay so I am measuring two temperatures temperature in tank one temperature in tank two and level in tank two I can write differential equations for rate of change of temperature in the first tank rate of change of temperature in the second tank rate of change of level in the second tank I can do this using my knowledge of physics okay flow in minus flow out heat in minus heat out okay I am not going to develop this model here in this class right now I am assuming that all of you know how to develop these balances and I am just going to show you the final model but there is one one tricky part here well if you see here there are three inputs there are two walls is a control wall here cold water control wall there is a cold water control wall here and there is a thyristor control element here thyristor control element is just like your you know speed regulator in your fan okay I can change the current input to this thyristor power controller the heat output will change okay it's it takes input between 4 to 20 milliamps it gives me heat you know between some minimum to some maximum okay if I put 4 milliamps it will give me 0 if I put 20 milliamps it will give me some you know maximum heat whatever it is now how do I develop models for this thyristor power controller one way is of course you know I can call some electronic engineer and say that well why don't you develop a model which relates you know the 4 to 20 milliamp current and the heat input so it's a very complex model I don't want to do that okay it will take a lot of time it's not worth it particularly just if I want to do control same thing about wall the wall is a very complex system control wall and if I want to develop a model for its dynamics statics it's a difficult thing so I have three inputs here I have a input at I have a input current input this to this wall I have current input to this wall and I have current input to this thyristor power controller which are coming from my computer okay I can manipulate these these walls now instead of developing models coming from physics for these three components I am going to develop develop some kind of you know correlations and I am going to mix this correlation with my physics model that will give me a gray box model look at here if you see this model it has two components first component is three differential equations these three differential equations are coming from physics from energy balance and material balance flow in flow out energy in energy out okay these you can refer to any standard book on heat transfer you will get this model I am not going to develop these three differential equations here if you look at for example if you look at the second equation d x2 by dt it says that f1 is flow in plus flow from tank 1 plus flow from tank 2 minus flow out f is the rate of change of level is related to these three these three flows like and and so on so we have these models which are coming from physics then I have two correlations heat as a function of current input what I have done is I have conducted lot of experiments for different current inputs I have found out what is the steady state heat input I have developed a correlation between billiam current and heat input okay without without asking a electronic engineer to model the fire itself over controller I have just developed a crude model between the current input and the heat output okay as some polynomial and then I have merged the two this is the gray box model okay some part of it is coming through some correlations which is not coming from physics it just says that if this is the current this is the heat if this is the current this is the flow out okay I am merging these two models I get a model which is a gray box model okay the third category is black box models black box models are nonlinear different equations or differential equations with assumed structure what is the structure of this model we have to assume and we will talk about this in great detail how do you develop these models these models are developed entirely from data we are not using too much of physics or any physics and that for doing this so this animal is new to you and we will talk about it a little later the advantage of this modeling is that you can develop them very quickly I will give you the time required for example the first the gray box model which I showed you my students took one month to develop that model that you know just two tanks in series we wanted to get a reliable model that actually captures the dynamics okay it took a PhD student about a month to conduct series of experiments to get all the parameters right you know the time consuming thing the second and then then you know we develop the model which are controlled in a one starting from that model then we get control the other part is just develop models from data I will talk about it and that took probably four or five hours I mean one month to four or five hours is significant reduction in time okay so this data driven models we will talk about the problem with data driven models like the correlation which I showed you is that they do not explain you the physics they do not give you any insight into what is happening inside they cannot be used beyond the range in which you are conducted the experiment okay they are very limited they are useful but they are useful only for the data on which you have trained them beyond that they cannot predict anything okay so so all kinds of models are required for control let us let us now assume that we have a somehow you know you go to a plant where or to a company where you are given a model which is coming from physics mechanistic model or some kind of a gray box model somebody has developed it for you okay or it is a simple system and you had time to develop it yourself okay now so I have a model which is available okay now the problem is the model is a nonlinear differential equation how do I design a controller based on a nonlinear differential equation it is possible very much possible okay but the design procedures are very very cost or very very difficult as compared to designing based on linear differential equations okay it is not that we cannot develop a controller using nonlinear differential equations but it becomes quite difficult to do it so as an engineer my you know approach is to see if some simple method of designing controller works if it does not work okay if a simple linear controller is not going to work then I will spend time on developing a controller which is based on nonlinear differential equations okay so as far as possible I want to use simple things first if simple things do not work I can show that simple things are not working for some reasons then there is a need to go for you know nonlinear controller and so on let us assume that simple things work okay we want to develop models which are control relevant and we want to use the so called linear control theory okay I want to use linear control theory which means control their synthesis methods that are based on linear differential or linear difference equations I am going to concentrate on linear difference equations in this particular course why linear difference equations because they are computer relevant and we will be talking about computer based control throughout the course so they are difficult to use and what is my aim my aim is to develop control relevant perturbation models okay I want to develop I want to start from a model which is given from physics I want to come up with simplified models okay starting from models from physics I want to come up with simplified models okay which are linear differential or difference equations which I can use for controllers that is the aim okay so let us be clear about what is the overall aim overall aim is developing a linear perturbation model if you look at it it has four tanks okay here there is a control wall here there is a control wall there are two pumps the flow here is split okay part of the flow goes to tank one part of the flow goes to tank one part of the flow goes to tank four okay here the same way on this side part of the flow goes to tank two part of the flow goes to tank three okay so this is a interacting system this is just this is just a toy example that actually illustrates you know what is called as multi variable interactions in real systems in real system it never happens that one manipulated variable affects only one output here if you start changing wall one you cannot do it without disturbing three levels okay if you start changing wall two you cannot do it without disturbing the other three levels okay so it is a interacting system you cannot separate whatever you try to do you know changing wall one will have effect on level in tank one and level in tank two changing wall two position will have effect in one and two okay these are the operating conditions and parameters so do not worry about these are some system parameters like area and so on which are given let us look at this model can somebody explain me what is what is this model what are the terms here what do you expect to be this is a this is a simple differential equation model okay rate of change of level from okay so that will wake you up you tell me what is how do you explain this how do you explain the four terms correct so what are the three equations that are showing up here height one so that is flow out that is negative just notice that that is negative it means is the flow out is proportional to level in tank one square root comes from simple Bernoulli's equation okay miss you probably have done in your grade 12 or first year of engineering what is the second term second term is flow in from tank three okay flow in from tank three that is actually flow out from tank three which is coming as a input to tank one the flow out of tank three is proportional to level inside tank three so you have square root of h3 coming there right what is the what is the third term third term is for the flow in due to the wall okay the fraction of flow that is coming in into tank one that is given by gamma one times k by area okay now what is coming in is proportional to what is a1 a2 here capital a1 capital a2 are cross sectional areas of the tank okay what are small a1 small a2 opening areas of the openings see it is 3 and h4 there is only there is only one inflow and there is only one outflow okay that is why there are only two terms here if you look here there are two terms one one term is outflow okay proportional to h3 and this is the fraction of the flow which is coming coming in okay the same thing about h4 there is this is the outflow from tank 4 and this is the inflow to tank 4 okay so this is simple balances simple flow balances flow in minus flow out for each time okay and flow out is proportional to the square root of the height coming from Bernoulli equation okay the flow out will reduce as the level decreases flow out will increase as the level increases but what is the proportion square root and the proportionality constant g here is the gravitational constant okay so this model is coming from physics this model is simply coming from physics v1 v2 we have to interchange so these areas and you know specific areas of the outflow those are given here these I have taken from the paper I am just reporting them here now what I want to do is I want to develop a linear perturbation model starting from this particular model first of all I am going to classify the variables associated with this model there are two variables or two vectors I am finding out here one set of vectors I am going to call as x okay this x are dependent variables or states here what are the dependent variables dependent variables how many equations are there there are four equations four differential equations how many variables are associated with this system 6 there are four levels and two voltages right there are four levels and two voltages and these two voltages are v1 and v2 okay so six variables four equations two variables are specified independently v1 and v2 are the voltages which are specified by an operator or by a controller if you when you design a controller but these are the two degrees of freedom we have to control the system okay the control the system have two degrees of freedom voltage 1 and voltage 2 to the two pumps okay dependent variables are h1 h2 h3 h4 4 levels okay I have put this now into an abstract form dx by dt okay dx by dt where x is a vector okay so this is a vector differential equation on the right hand side you have a function vector f1 x f2 x f3 x f4 x actually function of x and you both not just x so what is this first element of this function vector this this entire equation okay so here you do you get this four elements of the vector equation so finally what I have is a vector differential equation dx by dt x and u okay this capital F is nothing but this function vector entire function vector I am now calling as capital F here you see here okay so this is a vector differential equation dx by dt is equal to function vector f which has two arguments x and u dependent variable and independent variables is everyone with me on this okay let us move to the next part now well you may have further classification of inputs from a control viewpoint you might say that you know the inputs some of them are manipulated some of them are disturbances I think all of you are done one course in control right so disturbances are those inputs to the system which we are not manipulating okay in the heater setup that I showed you a typical disturbance would be air temperature surrounding the heater system okay that would be a disturbance because that changes according to some other factors we are not able to manipulate that okay but that will have an effect the way heat is transferred from each of these vessels to the air okay that will have effect on the dynamics so here I have a model which is dx by dt which is function of x u and d u and d are basically inputs I have just sub classified them as disturbances and manipulate inputs it does not matter if you club them or what I want to do now is I want to linearize this differential equation okay I want to linearize the differential equation what is the basis for linearizing differential equations in many situations you are operating a system in the neighborhood of some steady state point operating point okay I somehow have bought the system let us let us go back to the our four level tanks I have bought the system to four you know steady state levels okay I right now let us not bother about how do I bring it there may be a as an operator you have done some manipulations border system to a steady state now in automatic mode I am worried about maintaining the level at those four points okay so what is this x bar u bar d bar these are some steady state level operating levels for this particular system steady state operating levels under different conditions are given here you know for there are two different operating conditions what are they will look at it later but let us look at p minus under this operating condition the steady state level is 14 12.4 centimeters and 12.7 centimeters this is in lower two tanks and 1.8 and 1.4 in the upper two tanks okay the inputs steady state inputs are 3 volts and 3 volts okay so this 3 volts and 3 volts is my u bar and this 12.4 12.7 1.8 1.4 is my x bar steady state levels steady state inputs okay I have bought the system to the steady state somehow now I am worried about modeling developing a model which is control relevant which is valid in the small neighborhood of the steady state okay I want to model small perturbations around the steady state okay I am not worried about a global model that talks about variation over the entire range which is the global model this is my global model okay but I am not going to use that I am going to use a local model okay yeah you can that is done typically in nonlinear control where you do linearization on the fly okay as you move along in the dynamic space you linearize on the fly but beyond the scope of this course that is done probably you might do it as a part of your project but not in this course okay so right now I am worried about developing a model which is local for small perturbations okay so I am going to define these perturbations here small xt is capital xt capital xt is the physical actual variable minus the steady state okay so the small xt is a perturbation in the levels okay small y here are the measured values I am not going to measure everything typically in a real system you do not measure all the states I am not going to measure all four levels I am going to measure only two levels h1 and h2 it is cost you know putting a level measurement cost me I am not going to measure every level only two levels are measured so here measurement some function of x what I am going to measure is some function of x you are the perturbation inputs small you are perturbation inputs so I have this steady state inputs and I am worried about small perturbations around the steady state okay I want to develop this model starting from this model which is non-linear differential equation I want to develop this linear differential equation okay it says that rate of change of x which are small perturbations in level okay in the neighborhood of the steady state okay is related to the perturbation itself x vector through a matrix A okay with another matrix B relates the rate of change to perturbations in the manipulated inputs okay and this third matrix here relates change the disturbances in this particular system we do not have any disturbances okay or we are not considering right now we are not modeling any disturbances so forget about disturbances part look at only the x and u okay so I want to find out to constant matrices A and B I want to find out to constant matrices A and B okay which will approximately capture local dynamics in the neighborhood of the steady state okay the way this is done is through Taylor series expansion the way this is done is to Taylor series expansion this A B matrices are actually computed by finding out partial derivatives of the function vector f with respect to x partial derivative of function vector f with respect to u okay if you look at these look at these matrix this is called as the Jacobian matrix so this has function vector element 1 differentiated with respect to x1 with respect to x2 with respect to so what is this f1 f2 we have we have put them here this is my f1 this is my f2 this is my f3 this is my f4 I am going to find out perturbations okay I am going to find out partial derivatives of each one of them with respect to h1 h2 h3 h4 also with respect to v1 and v2 okay so this is how I am going to construct my local matrices yeah gamma 1 and k1 are the two fixed parameters which we can choose the split gamma 1 talks about the split from to tank 1 and tank 3 yeah so once you fix it is constant okay so there is a in the real system there is a way of fixing the ratio flow ratio between the split so gamma 1 and gamma 2 are splits flow splits okay what portion goes to the top tank what portion goes to the water okay yeah not constant disturbance d bar is the constant disturbance level at the operating point which you have no in the in this particular system a disturbance could be for example I will give you an example of a disturbance in the system a disturbance could be I have two pumps okay the voltage input to this pump is fluctuating okay yeah so right now I am assuming that there are no disturbances so voltage is constant okay voltage is constant so if I tell the you know if I give certain current input I will get a fixed flow from the pump okay we assume that you have a stabilizer you have eliminated any disturbance in the voltage you have a stable no disturbance okay but even if you have a fluctuation of the voltage let us say between set 200 and 240 they might be some steady state you know typically it is at 220 so that d bar would be 220 okay so I have to find out these two perturbations will actually do this exercise for some real system as a part of you know problem solving so you will get more feel for it now if I actually do this for the quadruple tank setup if I find out partial derivatives what do I get okay I will get this matrices a and b all that I have done is I have just taken partial derivatives of the first element with respect to so this is partial derivative with respect to first element doh f1 by doh h1 this is doh f1 by doh h2 see if you go here h2 does not appear here correspondingly you know you have 0 here x4 does not appear here you have a 0 here and h1 and h3 appear so there are two partial derivatives associated with that likewise d x2 by dt h2 h1 and h3 do not appear so there are 0s here okay and there are two partial derivatives that come in here the two equations these two equations are particularly simple h3 and h4 because they do not involve h1 h2 they just have h3 and h4 separately so if you go back here and see this equation third equation has only h3 it does not have h1 h2 or h4 and it has only h4 it does not have h1 h2 h3 so correspondingly here you have 3 0s and you have 3 0s only two elements are non-zero okay the same way I have taken partial derivatives for my inputs with respect to my inputs okay so this is a linear perturbation model this is a linear perturbation yeah x bar and u bar yeah so this is around this p minus conditions h bar is 12.4 12.7 1.8 1.4 u bar is 3 volts 3 volts okay this voltage is v1 and v2 vary between 1 to 5 or 0 to 5 I have to check in the paper so this is at some middle point okay the flow ratios have been fixed to 0.7 and 0.6 which means 0.7 70% goes to tank 1 30% goes to tank 3 and 60% goes to tank 2 and 40% goes to tank 4 so for this condition this particular condition p minus condition okay well you have these new variables ti defined here they are defined in this particular case you have to go back and read the paper you probably have to sit and do one or two partial derivatives you will understand how this is done is everyone with me on this you understand how this matrix yeah we have only two measurements available that is why this matrix here this matrix here see this is multiplied by x there are x as 4 elements h1 h2 h3 h4 I am going to measure only level in the two lower tanks okay that is why this model is the measurement model why perturbations in the level which are measured are only h1 and h2 okay now what is this what is this kc1 kc kc coming here this kc represents relationship between actual measurement actual measurement is in voltages I have a transmitter which does not give me centimeter reading it gives me voltage reading that is okay and it is related to the actual centimeters through this relationship voltage level measured h1 and voltage level measured h2 is related to the centimeter level through this is everyone clear about this how this is derived or should I just do it anyone has doubt I will do it I am just measuring two levels I have to pick up level 1 and level 2 from the vector so this matrix if you see here this matrix will pick up the first element and 0 0 0 will appear here what is this kc kc is the conversion factor between centimeter level to voltage level voltage level means transmitter output which is voltage okay and the same thing is here there are identical transmitters so the relationship between centimeter to you know level in voltage is this through the same relationship that is why same kc kc is appearing suppose there was some way of directly measuring the level in centimeters this kc would be 1 okay kc would be 1 if there was directly way of measuring level in centimeters kc would be 1 okay in that case this matrix will reduce to just 1 0 0 0 and 0 1 0 0 okay now if I actually do this linearization for this particular process okay you might find I am going little too fast here but when we do exercises okay next week we will do some exercises where we actually take some simple system linearize put in matrices and get the matrices then you will get better feel of what is happening okay if I actually put in the numbers for the area for the steady state for everything that I am talking about you will get these matrices a matrix will look like this b matrix I just put the numbers and then so at the end of this exercise what do I have I have a model that relates rate of change of perturbations in level okay to inputs perturbation inputs okay it also tells me how the perturbation inputs are related to the perturbation measurements or perturbation states are related to perturbation measurements y is measured outputs x are the states and c matrix will tell me so 0.5 0.5 is the conversion factor kc okay well when you do your first course in control you always study Laplace transform right now what is the relationship of this model with the model which you get from Laplace transform I want to connect the two okay so you will feel comfortable something that you have studied already Laplace transforms and this model okay that way easier to relate when you did Laplace transforms you only looked at one input one output system now we have a trouble we have two inputs and two outputs okay they are two inputs and two outputs so I need to now get not one transfer function how many transfer functions will be there there will be four transfer functions actually what I am going to get is a transfer function matrix okay that relates output vector with the input vector measurement vector and input vector that is what I want to get okay how do I do this look at this step okay I am starting with this differential equation here I am starting with this differential equation this is my differential equation okay if I take Laplace transform on the left hand side what do I get simple you know s times xs remember x here is a vector okay and now the manipulations that you do have to be consistent with vector and matrix A is a matrix on the right hand side it has to be consistent okay I am going to assume that my initial condition is 0 what is the meaning of 0 here perturbations are 0 your starting point is exactly perfectly the steady state okay this is typically a simplifying assumption when you develop a transfer function model you assume that the steady state your initial point is 0 0 0 does not mean level is 0 what does it mean perturbation in the level is 0 level is not 0 perturbation from the steady state is 0 important to keep this in mind we are developing only perturbation models okay perturbation in the level is 0 so this guy here x0 is actually 0 okay all that I have done is this a times Laplace transform of this I have taken on the left hand side do you notice this here okay and because this is 0 now I am going to club this term and this term into this term here you see this term here si minus a I have a matrix equation s is a scalar okay s is a scalar I is a 2 cross 2 matrix okay minus a a is my linearized system matrix okay is equal to b times u of s okay and x times d of s okay and I have this equation y of s is equal to c of s what does a transfer function do what does it relate output and input what are the outputs here y what are the inputs u is in this case v1 v2 okay y is h1 h2 okay so I have to somehow get rid of I have to get rid of this x how do I get rid of it substitute for x okay to substitute for x I have to eliminate this matrix on the left hand side si minus a the way to do this is pre multiply both sides by inverse of this matrix okay si minus a inverse I am going to pre multiply on both sides and then substitute in the second equation if I do that is it clear all that I have done is I have eliminated x and substituted for x in the second equation so pre multiplying by si minus a inverse to this equation and then substituting xs here I can rearrange it into these two equations okay so y of s is gp that is the transfer function with reference to u okay and this is with respect to disturbances in our particular case there are no disturbances disturbances are 0 so we have to worry only about g of s okay if I do this for this particular system what do I get I get this transfer function matrix okay well how do you do this actually of course for simple systems in exam and all we will do it by hand but matlab has a tool box or control system tool box you just go on defining matrices I will give you programs to do that and you know you will get all these transfer function matrices for any complex system you have 5 inputs and 10 outputs you have to get a transfer function matrix which is huge matlab will do it for you there is the built in programs which will just give abcd matrices or abc matrices it will just pop it will give you this transfer function matrices to you okay so and for a complex system you cannot but use a computer so in our course we are going to use computers liberally so this is my transfer function matrix what does it relate inputs and outputs I have got rid of intermediate state vector the state vector had 4 variables 4 levels now I am just worried about 2 major levels 2 major 2 known inputs manipulate inputs okay there are 4 transfer functions okay this is between level 1 input 1 level 1 input 2 level 2 input 1 level 2 input 2 okay so now are you comfortable what we have done okay by linearizing earlier okay is relate to the transfer function thing which you know from your course okay except now we are looking at multi variable system you have a transfer function matrix you do not have a transfer function single scalar transfer function okay well now is everyone with me on this up to here point is there any doubt yeah oh yeah a little later I mean I will be talking about minimum phase or minimum phase sometime almost after 3 or 4 weeks okay I am going to come back to that but so right now we concentrate only on the model development what is minimum phase what is non-minimum phase those issues will appear when you start analyzing those models how do you interpret models looking at certain parameters like we did the numerical methods course we just looked at Eigen values and we interpreted in some way so here we are going to look at Eigen values and also we are going to look at the something called zeros so here you worry about 2 things one is roots or the poles of the characteristic equation and also something called zeros so we will look at that little later okay so well this model is fine transfer function model is fine this you know the trouble is this transfer function model is in continuous domain if I convert this into time domain I will get a differential equation okay if I convert this model into time domain I will get a differential equation I will get 2 couple differential equations one for h 1 other for h 2 okay and I suppose you have some idea as the how to convert a transfer function model into differential equation this is then in your first course so I will get differential equations but in a computer control system okay I need something different what is different in a computer control system you are working with discrete time data okay all of you are familiar with computer control systems now you carry mobile okay in some sense it is a microprocessor control system okay so let us call it computer control system the data handling cannot be done in continuous time when you have a digital control system you have to handle data you know in a discrete manner you let us say you are getting temperature measurements or level measurements from my full time setup okay there are two possibilities I have an analog device okay which is doing temperature measurement second possibility is I have a control computer okay in which I am collecting level data okay I cannot I cannot measure every level at every time instant because when I convert this what is what is required to measure level inside the computer I do not want you to answer this in a deep way very simple thing what do you think is required the I will get a voltage measurement from my device what does computer understand only numbers a computer will only understand a number it cannot understand a voltage you have to convert a voltage into an equivalent number okay so I need a device called as analog to digital converter analog to digital converter will convert a voltage signal or a current signal into a number because my computer understands only numbers we are looking at one level higher which is more of an application layer I am going to assume that in a computer control system I will have a D2A converter available with me so the measurements which are going to come to my computer are essentially sampled data okay see when I convert a voltage into a number okay it happens what I what I what happens is something like this because when you convert a voltage into a number it finite okay so suppose it takes let us say it takes 100 milliseconds okay to convert one voltage into a number and then getting into my program that has to happen right it takes some finite time to do this so what about the temperature variation between in this 100 milliseconds you cannot measure it that data is lost okay so I what I get see this is the real continuous signal let us say you measure temperature at every 100 milliseconds or you measure temperature at every 1 second okay if you are sitting inside a computer you will see data like this chart here you will see only coming at discrete time points okay which are proportional to level inside the tank you are never going to see the real continuous level variation inside a computer you will only see sequence of numbers okay so now when I do modeling I need to adjust the reality that inside my computer I am never going to get continuous signals I am only going to get signals that are you know a sequence of numbers okay at you might say why 1 second why not 10 milliseconds okay you can buy a better D2A converted you will get measurements at 10 milliseconds but what about between 0 to 10 milliseconds you are going to lose some data you can make it you know you can probably reduce the sampling interval but there is a limit okay you can never ever get continuous signal inside your computer you always get sample signals okay so I need to add modeling scheme to deal with this reality that the data is not going to be continuous okay now let us say I am doing a controller through my computer the question is I can do controller calculations only at a finite interval you will take some time to do the calculations right once you get the measurement let us say you do proportional controller calculations you will have to multiply you know some gain times you have to first calculate the difference between the set point and you know measured value then multiplied by the gain okay and then calculate the output and then send the output to the real world outside okay all these operations take finite time okay that is done using what is called analog converter D2A converter okay now the problem comes is that computer only gives a sequence of numbers okay at regular interval but the real world only accepts continuous signals so you have to reconstruct when you go from a computer to the real world you have to reconstruct a continuous signal starting from an input which is discrete time okay my computer can only generate a sequence of numbers I have to get a voltage input to my wall which is continuous just imagine if I start giving pulses to my control wall it will start jumping okay I cannot effort to do that I need a continuous input to my control wall or to my you know stripper motor or whatever is my actuating element so this D2A conversion is done typically using what is called as a zero order hold a zero order hold is a simple device which just says that keep the last value constant in the new value arise okay this is called as piecewise reconstruction of the signal okay so typically D2A converters that you get commercially are zero order holds okay the computer will give a signal that voltage should be you know three volts in the next signal comes it will hold at three volts the next signal will be 3.2 volts in the next signal come it will be 3.2 volts and so on so how will the outside signal look like I am sending you know if you look at this sitting inside a computer you will be you know sending one bullet every one second that is one voltage value to the outside world well what the wall sees is a sequence of piecewise constant inputs what you are actuating element in the in this particular case the control walls or two motors will see a piecewise constant signal okay so well one can do piecewise linear reconstruction and so on but all those things are very rarely done in bulk system some special system that might be done most of the D2A converters that you get commercially do signal reconstruction by this particular method okay. Now I need to adjust my models to the reality A the measurements are not continuous they are sampled B the output which goes to the or the manipulated variables which go to the plant are piecewise constant they are not continuously changing within a sampling interval they are piecewise constant I need to adjust my modeling scheme to this reality how do I mathematically state this okay so what I want to do is develop a computer oriented discrete dynamic model okay I want to develop a computer oriented discrete dynamic model my first assumption is that the measurements are sampled let us assume for the simplicity that the measurements are sampled at a constant rate there is no such restriction that one should do it one can have a variable rate sampling but we are developing the course for the first time let us look at the simple things first okay so I am developing I am getting measurements in my computer at a constant rate every one second every one minute or every 10 milliseconds what should be the sampling rate depends on the system under concentration if I am controlling an induction motor it better be 10 milliseconds if I am controlling a furnace okay it can be 10 minutes because a furnace has a very slow dynamics yeah because it is very very commonly used it is very very commonly it is 99% of the systems where you use digital control will be having a zero order hold equivalent G2A converter okay so one can adjust of course models one can develop models which are for first order hold and so on but majority of them bulk of them are zero order hold systems okay so my one assumption that I have to adjust to or one reality that I have to adjust to is that the data is coming at a regular rate okay the second thing that I need to adjust to is that between two sampling instance my input is going to be held constant to the previous value so this states at for the time between see k is the sample number T T is the interval between two samples it is called sampling interval so for the time between two sampling intervals my last input at kth instant is going to be held constant is everyone with me on this any doubt with this okay so now I need to redevelop my models to adjust to the reality that I am going to do a computer based control okay and then linear differential equations are no longer useful we need to convert them into linear difference equations okay yeah it will take some time so one has to then question what is input to the system and what is system if I good question very good question well I will say that my system is everything that is outside my computer okay and I will do a fine distinction between see typically we say that the wall position itself is the input let us not say that let us say that input is the voltage or current input that goes to the wall okay that is instantaneously changing because as far as the wall dynamics is concerned the dynamics between my computer and the input voltage input is instantaneous let us say okay so in my system dynamics I should also model the dynamics of the wall and include when I do the modeling okay then the input for the plant is the voltage output coming from the computer okay is not the flow input we typically say that flow input is equal to voltage input which is not the case the wall has a significant dynamics I would actually when I develop a model I will include the wall dynamics in my model development and I will say the input is just you know the current input okay now the model which I showed you for the heater system I had given a relationship between the flow and the current input as a static algebraic relationship that is an approximation in reality I should have modeled you know if I have to be more accurate I should have modeled a dynamic differential equation between the wall position and the voltage input I decided to ignore that because you know that relatively fast compared to the level dynamics or temperature dynamics okay that is a modeling decision okay but what you say is valid so one could view manipulate input as not the flow but whatever is going out of my computer is not manipulate input it is the hammer on the nail yes back box modeling has an advantage that we do not have to worry about these sub components we just model between what is coming to my computer what is going out of my computer okay that is a great advantage of the black box model we include everything that is outside okay so we will stop here so I will just state this equation I started from a nonlinear differential equation use Taylor series approximation and develop this model but then this model is not useful in a computer control system I need to change it to a difference equation model so my next class is going to be related to how do I change this from differential equation model to a difference equation model I am going to call it computer control relevant linear perturbation model okay that is what I have to adjust to the reality that the inputs are piecewise constant okay.