 Okay so let us start looking at this ARMAX model well one thing I want to emphasize before I proceed is you have to solve problems which I have given you to start solving them yourself or with the help of your friends come for the tutorial sessions if you do not solve problems there is no point in attending to these lectures you will not understand anything okay it will all become Greek and Diter in beyond a certain point okay it is like without solving problem attending this lectures is like learning swimming by theory you have to jump into water you have to solve problems otherwise the concepts will not become clear extremely important that you solve problems I will wait actually for this course other than just the hand problems it is important to do simulations and programming because this is an advanced course and everything cannot be done by hand very very simple things can be done by hand okay so I am just waiting to cover up to certain point so that I can start giving you programming assignments okay and to be very frank even though I might decide to give 20 or 25% weightage to the programming real learning will happen if you do programming parts seriously okay so that is more important than hand written you know exams in which I cannot ask more than 2 by 2 matrices or 3 by 3 you know some simple systems which you can work with in 3 hours or 1 hour or whatever is set for the exam but if you do the project seriously what I am trying to do is trying to pick up say what are 8 different systems and ask you to simulate those systems I will give you differential equations for those systems with all the parameters with a sample program as to how to simulate stochastic process how to simulate noise so that you can look at my program and develop your programs okay and then when you start working with matlab programs and real data you will get much better understanding than what you can get just by listening to the lectures so this is only one part listening to the lectures look at the loads is only one part that is one thing the second thing is that please upload my or please download my latest notes I have revised them then I have rearrange them revise them so some definitions I have changed in the literature there is you know different people seem to use different definitions for covariance auto covariance some some books you know prefer 1 by n minus 1 some books 1 by n and so on so it is important that we follow one stick to one particular notation and use that okay so we were looking at this we were looking at this model which is our max model ARMAX model and then I said that trouble here is that I do not know E I only know why and you okay so this even C2 and E sequence E is not known and that is a trouble when you want to estimate the model parameters so my aim in the next few minutes or next in the next few slides is to show you that how can I do some algebraic manipulation so that I can do calculations only with why and you I somehow try to eliminate I somehow try to eliminate these variables here EK minus 1 and EK minus 2 these two variables I want to eliminate okay doing some algebra and then algebra I am going to do okay why because we have developed ARX model in ARX model we had this term EK appearing if only EK appears in my equation I do not have so much problem okay I am able to manage doing calculations but yeah it is a colored noise yeah so we have seen yesterday in the exercises that WK plus WK minus 1 together uses a colored noise because auto covariance 1 is not 0 okay so for this particular moving average process you know auto covariance will be I have actually there is a exercise problem if you check for this kind of a process C1 C2 okay I think problem number 8 or something I do not remember now you were asking yesterday problem number 5 just look at that problem okay so this is a colored noise but so I want to do algebraic manipulation so algebraic manipulations just keep this global picture in mind that somehow I want to do an algebraic manipulation and I want to transform this equation such that it has only why you had only EK I do not like EK minus 1 EK minus 2 okay so I am going to do this algebraic manipulation and that is why I am doing some preparation for that so how do I estimate the model parameters and still what do you optimize it okay I do not know A1 A2 B1 B2 and C1 C2 6 parameters I still have to use optimization but I somehow want to eliminate right now for purpose of calculations to set up the optimization problem I need a transformed equation which only has you know which will have all 6 parameters will not vanish but only y and u will be there in my equation so that you know my computations become because only y and u is the known signal EK is not a measured real signal okay EK is not a measured real signal so the first yeah it is contained in yk why it is yeah but I want to separate the effects of deterministic contribution to y okay and disturbance contribution to y so this is here this is to y coming from known inputs u is a known input manipulate variable okay this is model for contribution to y which is coming from unknown sources okay I want to separate them okay I want to separate them I want to separate them because it will help me afterwards to design a controller which can reject disturbances see what is the aim of control controller design aim of controller design aim of controller design a is to you know take the system from one state to other state I want to you know my temperature inside a reactor is some 300 I want to take it to 350 set point change okay for tracking or I am flying at you know some altitude of 20,000 feet I want to take it 25,000 feet okay so that is my tracking problem other problem is disturbance rejection okay is disturbance rejection so h inverse the when you inverse okay 0s will become poles and poles will become 0s right you understand that is why we need that is why we need invertibility of the I will just give you a example here this is an example of Arma process okay for this particular process the pole and 0 there is one pole and 1 0 both of them are inside unit circle okay both of them are inside unit circle and if you do h inverse yesterday I showed you how to do long division and actually there is an exercise in the exercise that I have given you there is an exercise in which you should do long division by hand and actually check how do you express okay so I talked about FIR model then going from you know AR to moving average and so on so you should do the exercises then you will realize so what you can see here is that if the poles are inside the unit circle and 0s are inside the unit circle this coefficients here will go on diminishing and you know as k increases okay so which means in this series actually you can truncate because after sometime the coefficients will become negligible they will become close to 0 and then you can take a finite you can take a finite approximation okay but you will need large number of terms depending upon how the poles and 0s are we will need large number of terms so actually this inverse okay see I had told you somebody had asked me why go for ARMA model why not use AR or MA model the reason is somewhat hidden here okay you will need less number of parameters for an ARMA model than either one of them ARMA or AR because if you expand this as a series and then truncate okay then you will need more number of coefficients to get the same effect which this is giving okay that is why we normally use this is a highly parameterized form than the series expansion okay it is more convenient to work with this parameterized form as far as number of parameters is concerned it is easier to work with this form than okay and then this will happen that you can truncate only if the poles and 0s both are inside the unit circle okay inverse this truncation either way okay is possible only poles and 0s are inside the unit circle if they are not inside the unit circle then in one direction it might grow and then you have problem okay so now let us go to what is called as one step prediction this is the critical thing when you come to identifying model from data let us keep the global aim in into the mind I want to somehow eliminate ek-1 ek-2 ek-3 whatever appears I am only comfortable with ek, yk and uk past yk appears in my predictions no problem past uk appears in my prediction no problem only just ek appears not a problem I have trouble with all ek in the past because I do not know them okay so what we are going to do is okay so suppose you have observed vk up to time t which is equal to k-1 and then you want to predict vk based on measurements of vk up to time k-1 okay so let us write vk as let us say I have done this long division I have done this long division and then I have expressed this as you know summation of I have just explained this in the previous slide if you have the slide with you can check that so see I am going to split this into two component this summation ek and everything that is in the past I do not like ek-1 ek-2 so I have summed up here I have summed up here 1 to infinity okay in practice there will not be infinity 1 to some capital N into the past okay so this component this component I am going to call as the conditional expectation of vk based on see there are two components at instant k there are two components something coming from the past this is coming from the past okay and this is see always remember one thing time k is the current time instant k plus 1 is the next one k-1 is the past okay so vk okay is a random variable okay it has some part which is coming from the past history and something is going to happen now instantaneously okay now before this ek happens before this ek happens can you give me a guess of what is the best guess for vk how will you find out see suppose you happen to know all this past ek suppose for the time being you happen to know all past ek okay but you do not know you do not know the current ek what is the best guess for ek ek is a 0 mean random variable the 0 mean random variable what is the best guess mean 0 okay so I am going to call this part I am going to call this part as the conditional mean that is conditional expectation what is the best that you can expect okay value of vk that you know the next the ek that is going to come now is 0 okay and see this part this part is coming from the past it is not going to change now whatever has happened in the past has happened okay the random variable which is going to occur now okay I assume that the best guess for it is 0 okay so in that case we split this vk into two parts you know this v had k we had k given k-1 this notation we are going to use from now on throughout k given k-1 k given k-3 and so on so this means estimate of the way you should read this is that estimate hat is an estimate of v stochastic process v at instant k using measurements up to instant k-1 using measurements up to the previous instant okay that is what is so now I can just do an algebra and show that this is nothing but hq-1 because what is hq into e okay and I am just doing the algebra here okay I am writing this as this just see whether you are comfortable with this algebra I am just doing this algebra okay is everyone with me on this what is ek ek is you know you can write ek as h1 upon h into vk okay that is what I have done going from here to here I have written ek as vk upon hq okay vk upon hq yeah it is conditional expectation oh it is not an estimate so hat should not be there there is a certain difference I agree with you hat will appear when you start doing computations right now it is just the conditional expectation you have a point okay get what I am saying you have a point right now right now we are so right now this hat should not be here yeah so this slide if I start correcting now it will take some time read it without hat mentally remove hat here this is the true this is the true if you know the truth then this is the true hat will come when you start doing computations using y and u that time hat will appear okay you take expectation no you take expectation of v now what is expectation of v expectation of e plus expectation of this term so what is expectation of what is expectation of e 0 what will be expectation of this see now you have to be very careful when you like expectation because this is something in the past which is already happened it is not going to change now okay so you cannot take expectation operator inside and say expectation is equal to 0 yeah conditional expectation is non-zero value okay so given something has happened up to it is a conditional expectation on both sides yeah it is a conditional expectation on both sides okay so now let us go back to our model I want to eliminate vk I want to eliminate e k which is in the past so I am going to write a conditional expectation of yk yk is conditional expectation of so I am taking here you see this I am taking conditional expectation of yk now the conditional expectation of yk is gq into uk times vk given k-1 that is conditional expectation of vk now with the algebra which we have done earlier we know that this can be do you see this what I am doing now yeah no we are using up to k-1 typically there is always a unit delay between in any digital system there is always a unit delay between u and y so we are using u in the past we are not using current in real systems it really would we will have a situation where you give an input and instantaneously y will get affected okay in a physical system I am talking about physical system okay now do you see the algebra here see v is y-gu okay I am just substituting that here so I get this I get this expression here just see the algebra now okay so this conditional expectation of y okay does not involve e right now I removed e effectively using h inverse I have removed e okay using h inverse I have removed e the right hand side only contains u and y but uk is multiplied by this operator now gq gq has always a delay of unit delay okay gq will always have a unit delay see for a real system the delay between the input and output is always minimum delay of 1 is there okay so current yk is affected by uk-1 it is not affected by uk okay so that thing that u comes from the past is hidden in q gq okay no those have to be estimate so it is a chicken and egg problem just wait no just wait to hear the full story okay just wait so I am just rearranging this and I am see what I have done here I have just rearranged this equation and I have put it like this just do the algebra if you are not comfortable you can do it I can wait for some time you do it by hand just see whether you get the same expression which I got here okay just start from this point and see whether you get this expression is the derivation correct it is not why should it be expectation the prediction but it is conditional expectation actually conditional expectation in stochastic term how do you what is prediction there is something unknown component for which you have to make a guess then only you can do prediction right hat we have been using for estimate of the prediction okay so the true conditional expectation will not have hat so very very subtle difference does not matter too much is everyone okay with this derivation is this clear okay see now I have to do let us look at one step ahead prediction here let us go back to our let us go back to ARX model I am going back to ARX model this is my ARX model okay let us look at what is gq here this is my gq okay this is my yeah you just see here even though uk is written here because of q-2 q-3 you are never going to get uk you will get uk-2 uk-3 okay so now what is what is h inverse this go back and see what is h inverse what is what is this term what should be this term 1- h inverse okay so what is h here 1 by this what is h inverse 1 plus a1q okay so this is my h inverse-1 this is h inverse-1 okay so for ARX model for ARX model one step ahead predictor okay turns out to have only past you and past is that alright just be comfortable with this is this okay just read carefully yeah you heard it out so it one step ahead no see from k-1 to k I am predicting value of k given information up to k-1 so is one step ahead prediction one step in one step with reference to k-1 it is one step right see without knowing without knowing the measurement yk I am trying to guess what will be yk okay so what is the best estimate see you are going to get the measurement at instant k which is yk before that before it happens if I ask you to give me a guess what is the best guess and you have this model how will you create a guess this is how you will create that guess which one this one this one this one look at this equation look at this equation h inverse g what is h see okay let me just go here see this my model is yk everyone agree with me yeah so this is my g and this is my h okay what is h inverse g is a by 1 x b by a a cancels so this is equal to b okay what is 1-h inverse a-1 sorry 1-a right so that is what I have done just go back and check so this is this is this is g okay so this is nothing but h inverse g okay a a cancels in this case okay this is 1-h inverse okay so my what is my best estimate of yk using information available only up to k-1 that is that is in this case you get yk-1 which is in the past which has happened you have the data okay at kth instant okay you are giving a prediction okay now the trick is to define ek as difference between yk and prediction of yk okay so the nice thing about ARX model is that the right hand side has only y and u and it is simple function of a1 a2 b1 b2 moment I move to ARMAX you will have a very complex function of a1 a2 b1 b2 c1 c2 okay there are two extra parameters c1 c2 there and you will have trouble yeah this is the best estimate this is the conditional now see what is the best estimate whether the more is the best estimate or the mean is the best estimate are there are so many questions are there you know but if you assume Gaussian distribution okay mean and more and everything collapses to only one value and mean is the best estimate conditional mean is the best estimate we always assume Gaussian process we work with mostly for simple modeling we assume Gaussian process non Gaussian process will assume for some very complex problems yeah Gauss has created a universe that is unmatchable you know many of us get bread and butter because of great work by Gauss okay so let us look at this equation now ARMAX model okay can you do it can you do this business yourself and let us see whether what I have written here you get the same thing so you have to do h inverse g and 1- and tell me what you get okay so I will move to this okay now the only difference that you have is that you have a C here you have a C here okay so when so this is for ARX okay now when you have a C here for this case you have to talk about h inverse g that will be A by C into B by A so AA cancels you will get B by C you will get B by C what will you get for 1- h inverse C- C-A so 1- h inverse is C-A by A by C sorry by C you will get this right so what is the one step I had predicted here the one step I had predicted here so this is my h inverse g okay this is 1- h inverse C- C-A by C okay what is nice about this equation in this equation on the right hand side you only have y and u okay no we are using a lower order model with less number of parameters less number of parameters means you need excitation for a smaller period of time which means you are wasting product for a smaller period of time so your experimentation period to get the model is smaller is cost effective no no no see I am giving you toy examples in real industrial systems I have worked with some I can show you some industrial data where you know you need between one input and one output okay you need 40 parameters or 50 parameters okay which compresses to 4 or 6 parameters when you go to Arman's okay where is 40 and where is 4 or 6 it is that kind of a difference in some sense yeah it is a compressed form yes yeah exactly if the current disturbance was 0 perfectly a very nice interpretation if current disturbance was 0 then the best estimate of yeah would have been this that is another way of looking at it if the current estimate happens to be 0 and why do we choose 0 because it is a VR I should model it as a 0 mean okay so I can convert this into a difference equation okay I have transferred the problem of unknown to this why hat okay now how am I going to deal with so my error here well my error here is I have called it epsilon because it is an estimate of ek it is not equal to ek estimate of ek okay so now I have this I have this I have this one step predictor I have this one step predictor I can start using it in time okay I have this data I have this data which is uk given from k equal to 0 1 2 3 4 I have this data okay then to kick off my estimator I need these values I need these values of why hat initially I can guess them equal to y 0 okay and then I will start using this difference equation so what is y 3 given to what is y 3 given to I will use a difference equation and find out see I have made a guess that this value is nothing but equal to y 0 this value is nothing but equal to y 0 this is my guess okay now how do you do parameter estimation you are given a guess okay of c 1 c 2 a 1 a 2 b 1 b 2 okay and then you actually predict why find out a difference and minimize the sum of the square of errors that is what you want to do finally right minimize some of the square of errors so I am started using the difference equation in time I am starting from time 0 so y 3 epsilon 3 is given by this okay next I will find out y 4 given 3 I will find y 4 given 3 notice one thing here I have generated y 3 given 2 it is used here it is used here okay now y 5 given 4 I am using I am using this estimate and this estimate here okay so given a guess of c 1 c 2 a 1 a 2 and b 1 b 2 and I have this data of u and y I can go on estimating these numbers y hat 3 2 4 3 5 4 and so on right I can do this up to capital N my data is some thousand data points I can do this yeah yeah only here because y appears no in my equation see why and see there are two things here y hat appears and y appears in this equation consist of y hat is different from y is the true measurement y hat is the estimate so in this difference equation y hat is appearing y is appearing so that is why in my equation here my equation here y 2 y 1 is appearing y 3 y 2 is appearing but there is no problem y is measured only trouble is only trouble with this guy see this has to be estimated here and then put here I can actually okay this we can skip I have given an alternate way of predictions okay you can see this in the notes there are two different ways of predictions I have explained you one way of doing prediction this is another way of doing predictions okay so now how do I estimate the parameters I estimate the parameters such that some of the square of errors is minimized over you know 3 to N sum over 3 to N with respect to the six parameters a 1 a 2 b 1 b 2 we solve to solve this problem using nonlinear optimization okay I have to solve this problem using nonlinear optimization there is no other go why the problem comes the problem comes because of this the problem comes because y 3 is estimated which is this depends upon the guess c 1 c 2 then this estimate gets multiplied by c 1 again you see that or here these two are estimates previous estimates they get multiplied by c 1 c 2 it is a nonlinear in parameter problem okay typically very difficult to solve not so easy to solve this problem okay subject to this model equations you have to solve this problem so I have to solve this constraint optimization problem that is epsilon k is computed using this equation and you know it is very important to give a good initial guess and so on so it is not a trivial solution to fortunately there are toolboxes now available and then you can make use of those toolboxes as control engineers develop models and so I would just generalize what I have said there is something called prediction error method I have this model I have this model I have this model y k is equal to g I have just I am just saying that g has some parameters theta okay and h has some parameter entire parameter vector a 1 a 2 b 1 b 2 c 1 c 2 I am calling it as theta okay and I have this data of y k u k then what is the optimal prediction we just derived this optimal prediction optimal prediction of y hat k given k – 1 is given by h inverse g x 1 – h inverse y okay then you find out this error okay you find out this error and then you minimize some of the square of errors okay this way of identifying models v square estimation of the models okay this is called as prediction error method why prediction error method because we explicitly construct predictions and then use that minimize value okay this is called a prediction error method or in system identification literature this is popularly known as PEM okay so you are predicting note one thing the predictor here what is main thing about the predictor predictor does not have e in the past predictor only has y and u y and u are measured values known values so you can actually construct the some of the problems in the tutorial sheet are given a second order model construct a predictor or given a first order model construct a predictor so you should actually work out those predictors and check how the predictors work out okay the predictor equation becomes more complex for box Jenkins model for r max is easier than box Jenkins okay and it is even more difficult to identify box Jenkins than r max so let us come back to our old problem we have to minimize this some of the square of errors and if I do this using MATLAB toolbox I get this under data that we have been looking at one time data okay I get this model parameters and well as I told you this model consist of two things one is ABC the other polynomials that you get and then e is a white noise whose mean is almost equal to 0 okay why it is not equal to 0 because this is an estimate okay and instead I was telling you that you know the estimate of a random number might which is true mean 0 the estimate might come very very close to 0 see how it is coming 10-3 very very close to 0 okay and its variance is this lambda square this is my model second order this is convention of MATLAB that means is a time delay of 2 order of a polynomial is to order of b polynomial is to order of c polynomial is to that is what is 2222 okay and then I get this r max model you know I should then check auto correlations cross correlations all that business we should do you can see that this is almost a white noise e k is a white noise you do not have to have higher order here a rx model we have to go to 6th order here only using second order model I am going to get reasonably good model okay so e k if I put histogram of e k looks like it is a Gaussian noise the way it is distributed the way the errors are distributed if I compare different models now there is something this is this is simulation which is noise free I removed the noise component and compared how good are the three models I developed oe model a rx model r max model all of them are giving almost similar predictions this is these predictions are using the noise model that is why it is just fitting okay these predictions are without the noise model that is why there is a difference because this gap is because of the noise okay so what is typically done what is typically done in a real exercise is that you take one data set okay you identify a model using the data set you take another data set and see whether these models predict that data okay that is what I have done here okay so you can visually see here that most of the variation in the data is explained by this model so model is a good model okay that is called prediction see you are removing uncertainty and saying that what is the best prediction so I talked about one step prediction you can talk about two step prediction three step prediction five step predictions you can talk about infinite horizon predictions actually technically speaking what I have plotted here is infinite horizon prediction not taking into account why at all if I just know you okay see go back here to this model if I were to assume that only this part is there okay and I do not know anything about this what is the best prediction see this prediction problem is always there you know see I want to know what is the best prediction of temperature of the 15 days if I develop this model for temperature variation in Bombay I would like to predict okay and the models are bad that is why you curse you know newspapers or whatever the weather department for but the problem is you know you have to develop GQ and HQ okay if your GQ is not so good your predictions for next 15 days are not going to be good or this one more thing which we do not realize that there are always unknown disturbances okay in the weather prediction if you are always unknown disturbances so those can upset your prediction you say that day after tomorrow is going to be sunshine but there is some disturbance somewhere and you know the clouds come in so you have problem so best estimate of day after tomorrow's weather okay given you know given this is 0 you can make using this model okay so just like I developed one step ahead prediction in the books on this thing you will talk about multi step predictions multi step predictions we are going to use for control after sometime I will talk about predictive control where we will do p step ahead predictions and k step ahead predictions and all then you know I have once I have this model I am using it for doing all kinds of I want to see step response I want to see impulse response and I can do all that I want to see Nyquist plots of these models so let me just summarize what are the steps in the model development given data you have to first select the model structure OE model or max model box Jenkins model whatever ARX model okay then you have to plan the experiment now planning of the experiments and selection of model structure are coupled you must have realized that if I am using ARX model let me collect data for a longer time if I intend to develop you know ARMAX model I can do a shorter experiment and so on so your maths understanding of maths is deeply related to where you plan your work you know where you plan the experiments very very important there are so many issues I mean we are just touching the tip of the iceberg this is a very huge area do you do these excitations when the plant is in closed loop or in open loop I mean there are a lot of debates people are still working on closed loop excitations and so on so moment you move to this closed loop experimentation there are a lot of issues the noise and the input become correlated because of controller output is function of measurements but measurements have noise so the controller output becomes function of noise and then you have miss you cannot estimate model parameters correctly I have given one problem in the just check what is the problem the of my identifying a parameters if the plant is in closed loop okay there are problems and then you have to validate the model is the model good or bad you have to take some independent data and see whether this model predicts that data okay all those things are required without that you cannot really you know do a do a good job I think before I go to the before I go to that let me see that I can demonstrate to you this toolbox at least some part of it we will probably visit it again so this MATLAB has this toolbox developed by a professor Jung and it has a very nice interface I think professor Bhartia showed you how to use commands this has a nice interface it makes even life more simple okay so you probably would say that if it is all this simple of five minute job why did you give so many lectures you know that is a good question this is the data which I have been showing you this is the data which is so this is the this is the perturbation data for the tank two tanks in series okay level variation in the lower tank with respect to voltage given to the wall in the to the control wall okay in the data we have been looking at this is the level variation these are the inputs this kind of input is called as zero random binary input two state input why only two state why not multiple state well this has come this is a historical baggage because of you know earlier probably through you know limited digital hardware it was possible to introduce perturbations which are only of two levels okay so there is nothing wrong in introducing multi-level signal you can always introduce but we still keep using this so PRBS it is called PRBS is pseudo random binary input okay why what why do not we give step input why do not we give you know there is a problem in an exercise sheet which tells you why you should not do just step input you will have difficulties in this matrix omega transpose omega will have you know column dependencies in this matrix omega transpose so rank of the matrix omega transpose omega is deeply related to where you plan this experiment okay so remember that now how do I develop the model here well I have taken this data I just go here and say parametric model what model you want ARX model or okay I will choose box Jenkins model okay I will choose a box Jenkins model and just say estimate okay and it has done that okay this is my BJ model this is my BJ model okay I want to see how good is the model predictions see this model prediction pretty good for box Jenkins model okay I want to I want to compare this with other models that I have developed okay I have developed here ARX model 222 or max model ARX model 442 ARX model 662 or max model 222 I want to compare with this and then I want to compare with this okay all this optimization business which I have been telling you okay is solved like this in fraction of a second inside the toolbox for simple systems of course and then you know you can see all kinds of plots you can see how good is the model prediction you can say well I want to see whether there is a autocorrelation of the residuals model residuals I want to check autocorrelations of the model residuals so this is for box Jenkins and other models this is for the ARX 222 model which is or OE model only this is for the OE model so OE model the noise is colored for box Jenkins and Armax the noise is white so the autocorrelation is within the band except at lag 0 lag 0 is 1 they are plotting everything other than lag 0 lag 0 is always 1 we saw that yesterday while doing calculations okay this is cross correlation in the cross correlation so you can get all this plot just you know you want to see the step response of the two models all the three models are compared okay so it just click of things provided you know you want to compare body plots of all the three models okay so doing it is now not the problem you should know the theory and why you are doing it okay so for that you have to keep reading my notes go back to the references that I have given and slowly it will come in not instantaneously I can see what are the poles and zeros of the model I can check what is the noise spectrum you know what is the power spectrum so these are just clicks away you know you can just develop all kinds of models then you want to see the model parameters you know what was the box and Jenkins model parameters so I just take this and drag it to work space I go to Matlab work space and say this is my model okay it gives me a by b c by d lambda square mean everything calculated okay what is this f so this look at this model you know it is b by f and c by d notation is different okay I am calling b by a and c by d they are calling but b by f and c by c by d loss function is some of the square of errors fp is I will come to that session is created in identity you can create in multiple ways you can load data directly so there are ways of loading data import data you can import existing models you can import you can say data from a file you can data from you know you have to prepare data outside I will give you a program which will take the full time model okay create simulation and create data file for identity then you load it into identity and then you can run your own sessions okay to do that actually you can have a session in the you know computer lab we have actually problem is our computer lab is now split and we are undergoing reservation so let me see if I can do a session next week so that you have real data and then you can play with the data you know you can see all these models being developed and actually I have talked about only bare minimum essential there are many models that you can develop using this you can develop ARX output error model OE is output error ARMAX model you know BJ you know you can also develop state space models directly okay so you can decide to develop a fourth order a state space model okay and it has not done a good job I think state space model is not working see it is going to infinity so it has not been able to do a good job of state space model okay so you have some trouble with the state space model so maybe we should change the method we should go to prediction error method not enforce it and say estimate now I expect things to be better so now what we can do is we go to the identity interface we do not like this model so knock it off and go back and see things yeah this model is good prediction error method is very good okay there is one more of method of identifying models called as subspace identification method sometimes it gives trouble it is also a good method I should not say bad things about subspace identification but it sometimes gives you not so great models TEM is very very stable nice method okay and then you can do other things I go to add an interface I want to see okay you want to see how the state space model is developed you just go to workspace have pss4 this is the four state model so this is the state space model it has developed see matrix is this B matrix is this for what we are calling in our notes as Phi gamma C they are calling a b a b c okay so you have data you can directly get a state space model in fact next thing I am going to talk about is that if you identify these transfer function models how to convert into state space that is called a state realization so you can directly get a state space model and then you can work develop controllers based on the state space model there is one more thing here which probably you should know I want to look at comparing all kinds of properties of these models I take them to something called LTI view LTI view is linear time invariant system property viewer okay so you know let me take two different models let me take this OE model to LTI view along with and go back to LTI view so what is it LTI view bring into table LTI view is a wonderful tool you can plot configuration I want to have a plot configuration of this type and I want to look at Nyquist plot comparison and step response comparison okay this is comparison of the Nyquist plots of two models which I have estimated and comparison of you know step responses typically you want to look at frequency response and step response okay so well you can create all kinds of things here you can go and say plot configuration E4 you like impulse response also you also like Bode plot let us say you can see all four phase angle will also come into picture and then so it is possible to no the tools are available all these tools are available very very advanced tools are available you should know what it means otherwise you will generate garbage okay you should know what is the stochastic process what is the colored noise what is the white noise what is really happening when you develop these models and why should I make choices and how do I make choices you know those things you can develop models very very quickly okay and so you should know how do I inject a perturbation and all these things do become a piece of art beyond the point they are not really you have to know your maths you have to know understand it very very well so how do you select the model structure very very difficult job you know whether the process is running in continuous mode or it is running in a you know batch mode what is the time scale of operation so you cannot do this completely as a control engineer okay you have to have your you know mechanical engineering chemical engineering metallurgical engineering whatever it is whatever is your basic background that you have to use because to perturb a plant you should know what that plant is okay this is what I have heard is that some of the earlier failures of this light combat aircraft where because the control systems were not designed by aeronautical engineers they are designed by mechanical engineers who are control engineers but you have to know how the aircraft flies you know if I have to control a chemical plant I should know how a chemical reactor works I cannot just say you know I will develop this time series models and then I will control you can do it to some extent but you should also know the physics you cannot forget that so it is a complex thing so what kind of application it is you know you do not need to know the system but it is not completely true you actually see how do you put up what is the frequency range in you put up so you should know what is the relevant frequency range okay see here I showed you this perturbation data right earlier I have shown you the this if I go here if I look at this time plots okay I have chosen a certain frequency of excitation right I have done that knowing the process physics see if I had given too fast excitation then this why would not have you know change so much it has no time to change okay then we call it that input is not sufficiently exciting the input is not sufficiently exciting okay then you cannot do good identification you will get a bad model okay so actually actually this is not truly black box in that sense when I chose this okay what should be the switching time between any two jumps I chose it carefully if I do not choose it carefully doing the physics I will end up into problem okay so black box is in quotes with a pinch of salt okay so