System Identification 1 the Basic Ideas
Total Page:16
File Type:pdf, Size:1020Kb
System Identication Lennart Ljung Department of Electrical Engineering Linkoping University S Linkoping Sweden email ljungisyliuse May The Basic Ideas Basic Questions Ab out System Identication What is System Identication System Identication allows you to build mathematical mo dels of a dynamic system based on measured data How is that done Essentially by adjusting parameters within a given mo del until its out put coincides as well as p ossible with the measured output How do you know if the mo del is any go o d A go o d test is to tak e a close lo ok at the mo dels output compared to the measurements on a data set that wasnt used for the t Validation Data Can the quality of the mo del be tested in other ways It is also valuable to lo ok at what the mo del couldnt repro duce in the data the residuals There should be no correlation with other available information such as the systems input What mo dels are most common The techniques apply to very general mo dels Most common mo dels are dierence equations descriptions such as ARX and ARMAX mo dels as well as all typ es of linear statespace mo dels Lately blackb ox non linear structures such as Artical Neural Networks Fuzzy mo dels and so on have been much used Do you have to assume a mo del of a particular typ e For parametric mo dels you have to sp ecify the structure However if you just assume that the system is linear you can directly estimate its impulse or step resp onse using Correlation Analysis or its frequency resp onse using Sp ectral Analysis This allows useful comparisons with other estimated mo dels How do you know what mo del structure to try Well you dont For real life systems there is never any true mo del anyway You have to be generous at this point and try out several dierent structures Can nonlinear mo dels be used in an easy fashion Yes Most common mo del nonlinearities are such that the measured data should b e nonlinearly transformed like squaring a voltage input if you think that its the p ower that is the stimulus Use physical insight ab out the system you are mo deling and try out such transformations on mo dels that are linear in the new variables and you will cover a lot What do es this article cover After reviewing an archetypical situation in this section we describ e the basic techniques for parameter estimation in arbitrary mo del struc tures Section deals with linear mo dels of blackb ox structure and Section deals with particular estimation metho ds that can be used in addition to the general ones for such mo dels Physically param eterized mo del structures are describ ed in Section and nonlinear black box mo dels including neural networks are discussed in Section The nal Section deals with the choices and decisions the user is faced with Is this really all there is to System Identication Actually there is a huge amount written on the sub ject Exp erience with real data is the driving force to further understanding It is im portant to remember that any estimated mo del no matter how good it lo oks on your screen has only picked up a simple reection of real ity Surprisingly often however this is sucient for rational decision making Background and Literature System Identication has its ro ots in standard statistical techniques and many of the basic routines have direct interpretations as well known statis tical metho ds such as Least Squares and Maximum Likeliho o d The control community to ok an active part in the development and application of these basic techniques to dynamic systems right after the birth of mo dern con trol theory in the early s Maximum likeliho o d estimation was applied to dierence equations ARMAX mo dels byAstrom and Bohlin and thereafter a wide range of estimation techniques and mo del parameteriza tions ourished By now the areaiswell matured with established and well understo o d techniques Industrial use and application of the techniques has b ecome standard See Ljung for a common software package The literature on System Identication is extensive For a practical user ori ented intro duction we may mention Ljung and Glad Texts that go deep er into the theory and algorithms include Ljung and Soderstrom and Stoica A classical treatment is Box and Jenkins These books all deal with the mainstream approach to system identica tion as describ ed in this article In addition there is a substantial literature on other approaches such as set memb ership compute all those mo dels that repro duce the observed data within a certain given error b ound estima tion of mo dels from given frequency resp onse measurementSchoukens and Pintelon online mo del estimation Ljung and Soderstrom nonparametric fre quency domain metho ds Brillinger etc Tofollow the developmentin the eld the IFAC series of Symp osia on System Identication Budap est Cop enhagen is a go o d source An Archetypical Problem ARX Mo dels and the Linear Least Squares Metho d The Mo del We shall generally denote the systems input and output at time t by ut and y t resp ectively Perhaps the most basic relationship b etween the input and output is the linear dierence equation y t a y t a y t nb ut b ut m n m Wehavechosen to represent the system in discrete time primarily since ob served data are always collected by sampling It is thus more straightforward to relate observed data to discrete time mo dels Nothing prevents us how ever from working with continuous time mo dels we shall return to that in Section In we assume the sampling interval to be one time unit This is not essential but makes notation easier A pragmatic and useful way to see is to view it as a way of determining the next output value given previous observations y ta y t a y t nb ut b ut m n m For more compact notation we intro duce the vectors T a a b b n m T t y t y t n ut ut m With these can be rewritten as T t y t To emphasize that the calculation of y t from past data indeed dep ends on the parameters in we shall rather call this calculated value ytj and write T ytj t The Least Squares Metho d Now supp ose for a given system that we do not know the values of the parameters in but that we have recorded inputs and outputs over a time interval t N N Z fu yuN yN g An obvious approach is then to select in through so as to t the calculated values ytj as well as p ossible to the measured outputs by the least squares metho d N min V Z N where N X N V Z y t ytj N N t N X T y t t N t We shall denote the value of that minimizes by N N arg min V Z N N arg min means the minimizing argument ie that value of which min imizes V N Since V is quadratic in we can nd the minimum value easily by setting N the derivative to zero N X d N T V Z ty t t N d N t which gives N N X X T ty t t t t t or N N X X T ty t t t N t t Once the vectors t are dened the solution can easily b e found bymodern numerical software such as MATLAB Example First order dierence equation Consider the simple model y t ay t but This gives us the estimate according to and P P P a y t y t ut y ty t N P P P y t ut u t y tut b N All sums are from t to t N A typical convention is to take values outside the measuredrange to bezero In this case we would thus take y The simple mo del and the well known least squares metho d form the archetyp e of System Identication Not only that they also give the most commonly used parametric identication metho d and are much more versatile than p erhaps p erceived at rst sight In particular one should realize that can directly be extended to several dierent inputs this just calls for a redenition of t in and that the inputs and outputs do not have to be the raw measurements On the contrary it is often most imp ortant to think over the physics of the application and come up with suitable inputs and outputs for formed from the actual measurements Example An immersion heater Consider a process consisting of an immersion heater immersed in a cooling liquid We measure v t The voltage applied to the heater r t The temperature of the liquid y t The temperature of the heater coil surface Suppose we need a model for how y t depends on r t and v t Some sim ple considerations based on common sense and high school physics Semi physical modeling reveal the fol lowing The change in temperature of the heater coil over one sample is pro portional to the electrical power in it the inow power minus the heat loss to the liquid The electrical power is proportional to v t The heat loss is proportional to y t r t This suggests the model y ty t v t y t r t which ts into the form y t y t v t r t This is a two input v and r and one output model and corresponds to choosing T t y t v t r t in Some Statistical Remarks Mo del structures such as that are linear in are known in statistics as linear regression and the vector t is called the regression vector its comp onents are the regressors Regress here alludes to the fact that we try to calculate or describ e y t by going back to t Mo dels such as where the regression vector t contains old values of the variable For that reason to be explained y t are then partly autoregressions the mo del structure has the standard name ARXmo del Autoregression with extra inputs There is a rich statistical literature on the prop erties of the estimate N under varying assumptions See eg Drap er and Smith So far we have just viewed and as curvetting In Section