Introduction to System Identification

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this webinar on system identification my name is Leonard young and I am a professor of automatic control adventure the University in Sweden I am the person behind match-ups system identification toolbox and I will introduce you both to that toolbox and to the basic auto system identification in this webinar system education is often science or constructing mathematical models from observed data from a dynamic system a dynamic system is a system we memory how it reacts your inputs depends on what you have done previously mathematical models are paying increasingly important roles in today's science and engineering and they are required for solving a number of tasks say like simulation control design and proper signal processing it is important to master various techniques for model building there are two ways of modeling dynamic systems if you know the sistex or math behind a problem you should make use of that knowledge to form the model this is known as first principle model if you don't know if this is the detail but you had measured data from a system use that data to construct the model that we call data-driven modeling networks offer several products for modeling systems simile sim scaped sim mechanics roxette's than our first principle suit tools Simulink design optimization system application toolbox in the neural network toolbox or data driven tools if you may use about fiscal insights the measured data we talk about gray box modeling the system education toolbox and the design of Malaysian offer several tools for gray box techniques the game of these products provided complete solution for modeling dynamic systems so to pinpoint the notions a system is a real thing like an aircraft with input input signals rather an alien ail angles fast and so on and outputs to be velocity aircraft attitude like pitch angles etc a model is no object where you replace the real system with mathematical expressions these expressions create a similar relationship between input things that we output seeing them which are generally never to be input by you and the output by Y the eastern assistance or system education degrees is the n2 subjective actual system and the model to the same inputs and compare the real response with one's output the mon parameters of their adjusted so as to minimize the size of this error so the key feature is to provide a model that produces an output that is as close as possible to a measured system output we can inspect the success of a given model by protein and comparing to these two curves we see here as a gray curve the true measured output will be blue curve is the models response an American measuring of hit compute can computed as a percentage of a measure output duration that is reproduce by the model this particular plot shows the feet of about 60% let us test the Ivies ideas on some real data here we are in match ups usual command window I load a data record it contains measured input and output signals from a system you can analyze and work with the data record entirely in the command window it is typically easier to embarrass the graphical user interface the GUI and work with within that I open the GUI by typing ident in a command window the agree basically consists of a number of frames for datasets to the list and the number of frames for models to the right the steps of system identification are basically carried out by a two pop-up menus one for pre-processing and polishing data one for estimating models by these pop-up menus you can reach all the essential functions and commands or the toolbox let us give a first demonstration of how it works the data thing is alerted into the workspace can be imported into agreed by selecting input time domain data I right you free input Y for the output as if starting time is zero the sampling time of the data is 80 milliseconds and I gave the data set the name dryer can I import the data you can see that the data set is now inserted into one or data frames we can examine the data by plotting it as time domain signals the data are collected from a hair dryer the input is a power applied to a heating device at the inflow of the air and the output is a temperature or the air at the outflow we can also look at the frequency contents of a data if we check the data view data spectrum we can estimate different models use the estimate pop-up we shall later on talk in much more detail about available choices but it allows first pick a standard type of model a linear transfer function model you see here that we can decide in our powers and the novel zeros of the model and whether it is in continuous-time or discrete-time they pick a very simple model with one pole and no zeros in continuous time I give a name the default name T of one to the model and I estimated and we now see that the bond has been inserted into the model board if a double-click on the model I can see a value the transfer function which there are simple first order transfer function for the moment we are not interested in a method mathematically tails or body model but where I would just like to see how well we can reproduce the data I mean look at the data fit I do that by checking a model view model output increasing comparison plot I discussed before the black curve is a true measure output the blue curve is models respond to the same input these first of all order model is that are good at reproducing measured output it just gives support is 10 percent fit so let us try some more flexible second-order models with two poles and one zero let's call T of two so estimate that we see that a new green model is much better it does this fit has jump to 86% can we do even bedroom let us try higher-order models I first try a model with three poles and two zeroes and one set Phi one with six poles and five zeros so these models with a red and cyan water have been asserted they share every better fit the third order model has a fit of 92% and this the sixth water model has a bit of 95 95 percent so how far can we go in the model tips well we can try very flexible at non linear model of neural network type there's a special webinar on nonlinear models and I will not give any details or that but just think this is a very flexible model with many parameters I pick 10 delaney inputs and p.m. delayed outputs and I take a nonlinear structure being a sigmoid and or network and I ask tomato that is now inserted into the model board as the NL ox1 model and look at the fit amazing it is a 100% fit a perfect model that is very catch when you think about it it is it is here that you can get arbitrarily good fit to the data by just testing flexible models with more and more parameters the catch is that you should not be impressed by a good fit to the data that you use to fit the model we call it the estimation data the real test is when you evaluate the model on a new segment of data we call that validation data so while we sit becomes better and better to estimation data where the model becomes more flexible it will read reach a minimum and then we can burst when you test models on the relation later you will then no longer benefit from adjustment to a particular heart defects or the estimation data that is known as a vervet in this context let us test it in our example we have recorded another data set D dryer from your hairdryer I have noted that it will work space and are now imported into the GUI the dryer import it is now inserted into one of the data frames and by checking the data icons I can decide upon which data to look at the dryer record is for the same system but for a different recording the input changes a bit faster but otherwise it's quite similar let us see how five or five models can reproduce the validation data you should note that the model output U is computed for the data record that sits the validation data frame so if I change the earlier early set dryer that I use for estimation to the new data set V dryer all the fits are recalculated automatically so what happened now the previously perfect model in the locks one has gone wild it is unstable like kind of disappears into infinity to see if it's better we have to remove this model by clicking on the icon we see what the third order model tier 3 the red curve is now the best model and reproduces 80% the output variation so this for this data set that it has not seen before the more complex six order model TF form which was touched better on estimation later is now a touch worse our conclusion must be that the Model T a Model T of three is a good and robust model of the hairdryer that can reproduce assistant behavior and various conditions we will not spend some time on discussing the general nature of system identification the workflow follows the following scheme first collected from a experimental data it is good to get at least two data sets one for estimation and one for validation then estimate models from data that involves two steps first decide what model structure to use then estimate the best model in that structure the graphical user interface the GUI may provide a good guide through this workflow finally evaluate the model by confronting it with important with independent data centers in that way we are assured that you are we have not ever fitted the data to artifacts to a particular data set I may add that this process we do not only get a model of a system but also some indications about how reliabilities we get measures or where certainty of a model as well as how much or the output is affected by utility disturbances this may be quite useful for example for robust control design there is comment in somewhat more details of different steps of education process the input-output data that we collect may be sample time domain signals it may also be measurements of their Fourier transforms that is frequency domain data or it could be measurements or the frequency functions of a system obtained for example by a frequency analyzer I'd alerted here in red names or toolbox commands that are relevant for the applications designing experiments that produce input and output measurements that carry suitable information about the system requires some thought and also insight about the character of the system it involves questions like of sampling rates we should use what frequency content is suitable for input etc when the data has been collected it is necessary to have a critical look at it and also possibly polish polish it it can mean things by removing rock steps and trims looking for missing data and outliers pre-filtering to remove bad disturbances and more the next problem is to select a sudra structure were to use to look for a good model this is no doubt the most difficult step in the application process this is because there are so many possibilities and process exists or the model may critically dependent on the choice later on in a webinar we will look at a few specific examples but for now let us just recognize that the toolbox offers a wide variety of choices so how do we know which smaller structures to test it may be that we have a prior fiscal knowledge for example that the system is known to be nonlinear it may be that the intended model application requests a model a particular kind but in a typical case we do not know really what to test the basic advice is going to stick to a number of standard structures that are proved useful one should be generous that is depth and try many choices after all it is likely but you skipped quite some time and money on collecting the data so spending a few seconds more to compute the model in a new structure seems like a trite reasonability effort the next step to sign the best model in a given structure is really the main duty toolbox it may involve a considerable amount of computations but it is conceptually straightforward the final step is acceptance test of a model we should have found a candidate model that is best we can achieve by trying various polar structures but is it good enough when you solve a task which we have test test we have in mind the final test is of course to try it out on the application but before we do that we should try to get some confidence even model by twisting and turning it looking at different aspects confronting it with various datasets from a system that should be it should be able to handle the selkie OCAD procedure for risks but I will comment on a few specific specific methods later on it is important to realize that the system education is not a straightforward one short procedure that is Robert in EE 20 procedure it evolves several decisions which may have to be revised in the course of an iterative approach we may have to go back and try the riot EO manufactures who even go back and collect a new data set if it turns out that the first one was not informative enough it has now turned to what I call a most difficult problem to sign a suitable suitable model structure or a few general features to its problem first do we have any prior information about the system that will guide the choice the model if not we have to stick to flexible model structures with considerable approximation power we call that black box models or if we know for example as in the aircraft case a fair amount of physics describing the system dynamics Newton's laws of motion etc but on a certain about the number of constants like the arithmetic derivatives we should build a model that incorporates that physical knowledge that we have with the annual physical constants as parameters that is known as gray box models another key question which you could ask is where we are looking for linear or nonlinear model his third basic question is where we are content with Waddle the described we have the output is actually output or input it takes the output or if you want also go through the description of how the output is affected by low disturbances this webinar basically only deals with linear black box models it is not time to get back to the graphical user interface and recognize the basic steps of the identification process designing an input signal and collecting the data lies outside what to do in agree but once the data set is inserted the pre-process pop-up allows you to process the data signals that reside in lurking data's lot for muscularis data you can click subchannels for multi experiment data you can select particular experiments you can select certain ranges of a signal D train signals and notice and you can also filter the signals through various bandpass filters you can transform the data between time and frequency domain representations for example here I transform our dryer set to its Fourier transforms creatively set dryer AFF i can transfer any data set to work in data floods and to the validation data so that will we estimate pop-up I can estimate models for the data set even working later front the pop-up supports the variety of under structures and I shall short to talk about the view of EMA the created models can be examined by different views you have seen them aloud with you before and that simulates the model it uses the little validation data normally I keep the validation data frame populated by an indicator data set so to quickly see if a new model is a better choice the created models can be rearranged at will by clicking clicking and dragging I can fairway models I don't need by dragging to a trash can and I can expose them to the workspace and to have a server look at them let me expose the good model ts3 to the workspace and now it's available in workspaces you see here ts free if I writing it in the workspace can here we see the model so here we cannot continue if I mean interested in control applications for example by applying all types of control system toolbox tool to this model like C so tool etcetera as I said we estimate pop-up gives you concise summary of what model structures are available I encourage you to explore possibilities on your own let me comment on some of these structures a little more detail so here we have the three main cases of model structures supported by the GUI the most common class is narrowed out linear parametric models and I will turn to this in a minute later on I will treat linear nonparametric models nonlinear models is a rich and interesting topic however they fall outside the current webinar linear primitive models can be written as input/output transfer functions where we could relate directly to the output in the difference or differential equation these equations are often written in terms of Laplace or Z transforms they can also be written in state space form using the state vector as an immediate intermediate variable the flexibility or size of a structure is described by one or a few integrals the number of states in or the number of terms in the numerator and denominator of a transfer function that is the number of zeros and codes in Z N and n NP actually the transfer functions States based models are two sides to the same coin they both describe the model within your difference in different differential equations and the scary same set the relationships between input and output the difference is how they are power parameterised in terms of polynomials or matrices there is one more feature that is essential for models often there is a delay or their timing system that is time interval passes before we input the fix the output in our hair dryer system for example it will take some time before a power change in the heating part it takes out a temperature simply because it takes some time before the air has been transported to the outlet it is important to get an idea of its delay time it could be estimated or measured from data and it will be passed to the model for the free time model delay is integral the number of sampling intervals before we input reaches the output that means that linear parametric models are Korea characterized by a few integrals the orders indeed the delay to estimate such black box linear models we just need to select these integrals another common type of linear pair parametric models is to form a simple model we run one pole at one time delay it can be parameterize din terms of a time constant they state again in real time such models are quite popular in process industry and we call them process models more complex variants can complain can contain more poles and then interior and or in the M or a 0 to estimate such models we just need to specify the number of poles and whether or not you should include a time delay or or a zero or order integrator I said that the nature of the airflow in the hairdryer indicates that there should be some time delay in the system so Paris that we let the input be a step at time 0 we should then see how long time it takes before a reaction is visibility output even if we are not collecting such data which are subjective models to such an experiment that is done by checking the box transferred spots even model use let us look at the step response of tier 3 we see that it takes about 0.2 seconds before a response of a input step is visible these means that we could perhaps build lower order models with this time delay let's try that with the transfer function models you see that the transfer function dialog has a segment about input-output delays here we can specify the delay to a fixed time or ask that it be estimated from data by unclicking that the delay is fixed to a given number let us try a second-order model to peral's 1 0 and the delay of 0.2 and I call that model tf2 0-2 I could also estimate the number of the delay in this model by clicking that by clicking fixed so we're looking for a delay between 0 and 2.4 with the same number of poles and zeros I call that model TF de like a delay estimation and I estimated we see that the step responses of these two new models tf2 o2 and TF d are practically the same as TF 3 they make us look at the model output and see that they are practically the same fits all them to validation data if you don't keep in mind that TF 2 0 2 and t fde or lower or remodels than tier 3 so we are simpler that have a time delay to estimate a process model I pull it down the estimate menu to process models and the dialog opens where should make some simple choices let us first try a simple model with one pole and the end delay its called p1 p1 D in estimate now and we'll see here the step response pretty much the same but we model output has the burst fit 57% compared to almost 80% but we see that the delay is estimated 2.2 4 7 which is kindly correct delay Testament as from any previous experiments we could try a also a model with two poles Corvus result p.2d and estimate really model and we have a now slightly better fit sixty-two percent so it's almost the same quality as we've seen before with with this simple process models an important issue in modeling concerns how to describe noise and disturbances all systems are affected by other stimuli in addition to a measure input we call that noise or disturbances essentially it is like a never that unmeasurable input including a model for how the services a effective system gives two important advantages if there are some systemic relations to disturbances that might help forecasting future outputs from the system based on observations or past outputs the disturbance can formally be treated as an additional and measured input simply by adding it to a transfer function or state-space model in the same way as you Endres since E is of measured we must assume that it has some predetermined properties typically that the disturbance was e is white noise that if e is a sequence of independent random variables national puts contain the services so observations or past outputs given information and part about disturbances if they are correlated over time we can actually guess future values of the disturbances so we disturb us model we should be able to predict the future outputs bedroom let us check if we can obtain better predictions for our hair dryer data using a disturbance model let us first discuss state space descriptions with and without disturbance models it is estimated state space model or o3 I pull out the state space dialogue I pick or o3 we see the basic system here with an input U and a noise source e I now first expect no is no disturbance one so a fix K to be zero and I call the model m3 and estimated and I look at the model output it is pretty much identical to TF three in performance and steps step response as we saw previously this confirms what I said that the state space model at the transfer function models are two sides of the same coin the tests are also estimate the K matrix so we build a model for how the white noise affects the system and I change the focus to prediction we call that model n3 dist:4 disturbance model and estimate it we can compare this model and predict within three in terms of simulation performance we see that introduced is slightly better actually this is because the noise model allows better weighting of information in data but it has I checked how the two models are capable of predicting predicting the output five samples ahead that is we let the models had access to all inputs and all outputs up to a certain time and we ask it to guess the output five samples later I do that by selected and options five step eight prediction and the responses are recalculated for m3 we desert without disturbance model the pre cloud put is the same as a simulated output but the disturbance modeling in in m3 list now knows how to use the information in the previous outputs to forecast future disturbances that is clearly beneficial the fit is improved by about two and a half percent units to 82 put a point four percent one would guess that the effect is more pronounced to the short we prediction horizon is I can select the horizon under the options menu and I now select one step operation friction arise on one step ahead we see that models that the model that includes disturbance descriptions gives a very substantial that advant predict the output one step ahead eighty nine percent fit compared to a team I can also look at the error between the predictive signal and the measured output by selecting the error plot the option so we see here once they appeared prediction errors if we look at the m3 disturb them so we see here the one step eight prediction errors forum for my model for volumes reduced in fact when you estimate a model that includes the disturbance model it is risked once they appeared prediction error that is minimized with respect all the model parameters that explains the term PM prediction error method for the estimation technique the one step eight prediction errors of that part the output that could not be reproduced or explained by the model they are so to speak the leftovers or residuals of a model they contain a fair amount of information about the success of a modelling so what the model leaves unaccounted for other residuals the ones they are paired prediction errors they should be uncorrelated we watching you at the time of a prediction like test input signals otherwise we should have been able to do the better prediction so how do we know if the procedures are acceptable we should estimate the correlation functions and see if they show significant correlation here we see the cross correlation function between residuals that I n inputs it should ideally be zero but Mayor costs show some random variations the significance of the estimate is here illustrated by a yellow band in the outside his band has an indication is an indication or sing of significant correlation he received or autocorrelation among the residuals if we have built a successful disturbance model these residuals should be right so that this function should not rely within the yellow band so let us try that on our on our data set by checking the model receipts books we obtain a plot of a sample cross correlation function between the residuals and the input formally introduced is this correlation plot is the lower plot here if the dashed lines mark the confidence region if the curve stays within atleast these limits there are significant correlation between between the input to the residuals as a model has done a good job the upper plot is auto correlation in my among the residuals if we are built in the service model the residuals should ideally be right we be white let's uncorrelated with each other we see here that the model introduced with a disturbance model has done it has done a good job but without if you look at take a look at m3 we have very clearly correlated procedures among themselves analyzing residuals in this manner is a very good tool to get an indication if the model is good it has been a too simple model a first-order state space model here I call it to the store I call it Molly mm1 and I estimate it and in the autocorrelation plot and cross correction plot we see clearly indications of correlations between the residuals and the out and and the and the input so as more to squeeze out or more information to squeeze out from the data server for we are discussed parametric estimation methods that is methods where parameters in certain models have been estimated the third turn to methods that directly estimate curves that are relevant as sufficient to describe linear systems they are methods to estimate transient that recreate frequency responses they can typically be directly estimated from data and generally I recommend to initially take a quick look at these curves to get a feel for assistant properties right the way the transient response of a system is the output where the input is a short pulse or step of course this transient response can be recorded directly from an experiment where resistor is subjected to step or a positive input in fact simply step response experiments may be the most common example of identification experiments in practice it is in any case a very valuable third stage in understanding system dynamics cities typical timescales delayed times and similar for given model we can of course always determinate its transient response by simulating the system with a step or impulse input our also techniques to estimate directly the trance transient response from any experimental data we was assuming any particular model essentially that is achieved by estimating a flexible high order linear model the frequency response is the system's respond to sinusoidal inputs if we apply a sinus function with a certain frequency Omega as input to a linear system the output will also be sinusoid or that same frequency but with different amplitude and a phase shift this amplitude change and phase shift is a function of frequency it's a systems frequency response and crossing these two quantities as a function of frequency give the bode plot of it for a system this can be done by direct experimentation by subjecting the system to input science functions or different frequencies this is called frequency analysis for any given model the frequency function can be directly derived by just asserting certain complex values in the transfer function of a system there are many techniques techniques to directly estimate the frequency function from NH from a experimental data set such techniques are narrowness spectral analysis and are closely related to use of Fourier transforms let us now try the nonparametric techniques for a hair dryer to directly estimate a transient response for the hair dryer data I pull down the estimate pop-up - correlation models that opens a window where I can make a few choice it choices but typically the default choice is good pressing estimate computes the transient response and it serves it into a model board here I look at it by checking the transient response blog now you can look both at the step response that the impasses once this is a discrete time model now it is natural to compare this directly estimated step response with the responses to a good parametric model to m3 and m4 this that has for me probably form and we see that they are practically indistinguishable which is a good reassurance that the model is not immediate is only on the right track to directly estimate a frequency frequency response I pull down the menu - spectral models that opens another dialogue were with some choices to make I press estimate for the default choice and a model SP 100 is computed and inserted into the board I can look at its better plot by pressing frequencies will freak receive spots and here we see the amplitude curve and the taste curve of the modern for spectral analysis of course I can't compare this responses also with a response the responses of the parametric models the final estimation topic I want to bring up is that of model uncertainty it is here that any model that we estimate will not be a perfect system description even in an ideal situation where the true middle modular structure is known the estimates will be affected by the disturbances in the estimation data that uncertainty can be estimated from data and represented as confidence intervals of model parameters those in turn can be translated to conference bounds on any model characteristics that we may be interested in to study that for her hair dryer model take a particular model like TF 3 and look at its step response how reliable is which is this step response and how much does it depend on random disturbances in estimation data to see that we choose an options menu share 99 99 percent confidence intervals and we see here by - to the lines how much variation that could be expected in the SIPP response due to a disturbance in the estimation data we see what the transient stage is over certain but a steady state gain we have about 10 percent uncertainty from 0.8 to 1 similarly we can look at the Builder plot of a frequency response and if I turn on the 99 percent confidence intervals and I love the because seat bedroom we see that this be relatively speaking the amplitude is more certain at lower frequencies when at high frequencies I can zoom by drawing rectangles in a plot if I like to examine it plot more in more detail I can also turn on these grids if you like if you like to measure the sizes of the errors now if I do to do two logarithmic amplitude scale we don't see the app to amp the absolute values of the errors in the amplitude so if I change to log into linear amplitude scale I see more clearly that in real terms in actual terms the response is more uncertain so frequencies and we see here at the steady state gain we had about ten percent uncertainty between point eight and one the SS we saw in the in the step response we could also also look at the zeros and poles of the model and we can examine we see here three poles and two zeros and we can examine the uncertainty of these quantities again checking the showed 99% confidence intervals and we see here the regions in a complex plane where we poles and zeros may may vary due to the uncertainties in the estimation data also simulations are certain T can be evaluated in a similar way so the bottom line of all this is that we can never rely 100% on a model but it is very useful to take a look just as we did on the Rayleigh reliability of different age aspects just keep in mind that these measures and relevant or relevant only model is in essentially correct model structure that is if does not fail you see a residual analysis test when we have obtained a final model it is a matter to put it to work typical tasks or to analyze system properties and to simulate and predict responses of a system the identification tool box comes with dedicated Semenuk blocks they can be directly used for simulate simulations or we estimated models you can also directly import the estimates models into seaso tool in the MPC design task for controller design a useful application is use the identification tool box to simplify complex systems for example a symlink system can be simulated to produce data from which simplified approximations or complex subsystems can be built by system education the workflow for using models for controls this was designed basically goes as follows click data for a real system estimate the plant along with model uncertainties also be the model for what the service is the effector system bring the uncertain model with the service descriptions to your favorite robust design procedure then create the correct controller that is robust therefore respect to model uncertainties and the system knows well this is the end o seminar I look forward to any questions you have that have been figured by a discussion you can also find more relevant information about these metrics on these NASA X networks web pages and the several text books on the subject thank you
Info
Channel: MATLAB
Views: 108,994
Rating: undefined out of 5
Keywords: MATLAB, Simulink, MathWorks, 2270251895001
Id: u7hJ1aF-JrU
Channel Id: undefined
Length: 45min 55sec (2755 seconds)
Published: Sat May 20 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.