Matlab System Identification Toolbox
|
|
Bookmark Matlab System Identification Toolbox |
About Matlab System Identification ToolboxHere you can find all about Matlab System Identification Toolbox like pdf and other informations. For example: .
Matlab System Identification Toolbox manual (user guide) is ready to download for free.
On the bottom of page users can write a review. If you own a Matlab System Identification Toolbox please write about it to help other people. [ Report abuse or wrong photo | Share your Matlab System Identification Toolbox photo ]
Manual
Download
(English)
|
Matlab System Identification Toolbox
User reviews and opinions
| LeedleSt |
4:22pm on Saturday, September 25th, 2010 ![]() |
| Not suitable for UK This phone is supplied with a European power cable, ie. you will need to also buy a UK adaptor plug. | |
Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.
Documents

Many state-space models: A similar feature is also available for black-box state-space models, estimated using n4sid. When a good order has been found, try the PEM estimation method, which often improves on the accuracy. ARMAX, OE, and BJ models: Once you have a feel for suitable delays and
dynamics orders, it is often useful to try out ARMAX, OE, and/or BJ with these orders and test some different orders for the disturbance transfer functions (C and D). Especially for poorly damped systems, the OE structure is suitable. There is a quite extensive literature on order and structure selection, and anyone who would like to know more should consult the references.
Multivariable Systems
Systems with many input signals and/or many output signals are called multivariable. Such systems are often more challenging to model. In particular systems with several outputs could be difficult. A basic reason for the difficulties is that the couplings between several inputs and outputs lead to more complex models. The structures involved are richer and more parameters will be required to obtain a good fit.
Available Models
The System Identification Toolbox as well as the GUI handle general, linear multivariable models. All models mentioned earlier are supported in the single-output, multiple-input case. For multiple outputs, ARX models and state-space models are covered. Multiple-output ARMAX and OE models are covered via state-space representations: ARMAX corresponds to estimating the K-matrix, while OE corresponds to fixing K to zero. (These are options in the GUI model order editor.) Generally speaking, it is preferable to work with state-space models in the multivariable case, since the model structure complexity is easier to deal with. It is essentially just a matter of choosing the model order.
Working with Subsets of the Input-Output Channels
In the process of identifying good models of a system, it is often useful to select subsets of the input and output channels. Partial models of the systems behavior will then be constructed. It might not, for example, be clear if all measured inputs have a significant influence on the outputs. That is most easily tested by removing an input channel from the data, building a model for how the output(s) depends on the remaining input channels, and checking if there is a significant deterioration in the model outputs fit to the measured one. See also the discussion under Step 3 above. Generally speaking, the fit gets better when more inputs are included and often gets worse when more outputs are included. To understand the latter fact, you should realize that a model that has to explain the behavior of several outputs has a tougher job than one that must just account for a single output. If you have difficulties obtaining good models for a multioutput system, it might be wise to model one output at a time, to find out which are the difficult ones to handle. Models that are just to be used for simulations could very well be built up from single-output models, for one output at a time. However, models for prediction and control will be able to produce better results if constructed for all outputs simultaneously. This follows from the fact that knowing the set of all previous output channels gives a better basis for prediction than just knowing the past outputs in one channel. Also, for systems where the different outputs reflect similar dynamics, using several outputs simultaneously will help estimating the dynamics.
Direct Estimation of the Frequency Response
The frequency response of a linear system is the Fourier transform of its impulse response. This description of the system gives considerable engineering insight into its properties. The relation between input and output is often written y(t)=G(z)u(t)+v(t) where G is the transfer function and v is the additive disturbance. The function G ( e iT ) as a function of (angular) frequency is then the frequency response or frequency function. T is the sampling interval. If you need more details on the different interpretations of the frequency response, see The System Identification Problem on page 3-9 or any textbook on linear systems. The systems frequency response is directly estimated using spectral analysis by the menu item Estimate -> Spectral Model, and then selecting the Estimate button in the dialog box that opens. The result is placed on the model board under the default name spd. The best way to examine it is to plot it using the Model View Frequency Response. This view offers a number of different options on how to graph the curves. You can also select the frequencies for
which to estimate the response by specifying the number of frequencies and the spacing (linear or logarithmic) in the Spectral Model dialog box. The spectral analysis command also estimates the spectrum of the additive disturbance v(t) in the system description. This estimated disturbance spectrum is examined under the Model View item Noise Spectrum. The spectral analysis estimate is stored as an idfrd object. If you need to work further with the estimates, you can export the model to the MATLAB workspace and retrieve the responses directly from this object or by using the nyquist or bode command. See idfrd, bode, and nyquist in Chapter 4, Function Reference, for more information. (Export a model by dragging and dropping it over the To Workspace icon.) A few options that affect the spectral analysis estimate can be set in the dialog box. The most important choice is the frequency resolution. This is a number, M, (the size of the lag window) that affects the frequency resolution of the estimates. Essentially, the frequency resolution is about 2 /M radians/(sampling interval). The choice of M is a tradeoff between frequency resolution and variance (fluctuations). A large value of M gives good resolution but fluctuating and less reliable estimates. The default choice of M is good for systems that do not have very sharp resonances and may have to be adjusted for more resonant systems. The options also offer a choice between the Blackman-Tukey windowing method spa (which is the default); a variant with frequency dependent resolution, spafdr; and a method based on smoothing direct Fourier transforms, etfe. etfe has an advantage for highly resonant systems in that it is more efficient for large values of M. It however has the drawbacks that it requires linearly spaced frequency values, does not estimate the disturbance spectrum, and does not provide confidence intervals. The actual methods are described in more detail in Chapter 4, Function Reference, under spa, spafdr, and etfe. To obtain the spectral analysis model for the current settings of the options, you can just type the hot key s in the ident window.
The dialog window also gives online information about the progress of the iterative optimization of the fit between data and model. The iteration number, the fit at the current information, as well as the improvement in fit (in percent) compared to the previous iteration, are shown. There is also a possibility to abort the iterations and save the current model, after the current iteration is finished. You access parameters that affect the minimization process by clicking Options.
Estimation of Parametric Models
The System Identification Toolbox supports a wide range of model structures for linear systems. Except for process models, they are all accessed by the menu item Estimate -> Parametric Models in the ident window. This opens a dialog box Parametric Models, which contains the basic dialog for all parametric estimation as shown below.
Figure 2-4: Dialog Box for Estimating Parametric Models
The basic function of this box is as follows. As you select Estimate, a model is estimated from the working data. The structure of this model is defined by the menu Structure together with the edit box Orders. It is given a name, which is written in the edit box Name.
The GUI will always suggest a default model name in the Name box, but you can change it to any string before clicking Estimate. (If you intend to export the model later, avoid spaces in the name.) The interpretation of the model structure information (typically integers) in the Order box depends on the selected structure in the menu. This covers, typically, six choices: ARX models ARMAX model Output-error (OE) models Box-Jenkins (BJ) models State-space models Model structure defined by initial model (user-defined structures) You can fill out the Order box yourself at any time, but for assistance you can select Order Editor. This opens another dialog box, depending on the chosen structure, in which the desired model order and structure information can be entered in a simpler fashion. You can also enter the name of a MATLAB workspace variable in the Order edit box. This variable should then have a value that is consistent with the necessary orders for the chosen structure.
Note For the state-space structure and the ARX structure, you can enter several orders and combinations of orders. Then all corresponding models will be compared and displayed in a special dialog window for you to select suitable ones. This could be a useful tool to select good model orders. This option is described in more detail later in this section. When it is available, a button Order selection is visible.
To transform models to other representations
arxdata, polydata, ssdata, tfdata, zpkdata Layer 3: Model Structure Selection. The third layer of the toolbox contains some useful techniques to select orders and delays. arxstruc, selstruc Layer 4: Structured Models and Further Model Conversions. The fourth layer contains transformations between continuous and discrete time, and functions for estimating completely general model structures for linear systems. The commands are c2d, d2c, idss, idgrey, pe, predict ss, tf, zp, frd (to be used with the Control System Toolbox)
The corresponding material is covered in Defining Model Structures on page 3-39 and in Examining Models on page 3-57.
Layer 5: Recursive Identification. Recursive (adaptive, online) methods of parameter estimation are covered by the commands rarmax, rarx, rbj, roe, rpem, rplr
They are covered in Recursive Parameter Estimation on page 3-85. See Chapter 4, Function Reference, for a complete list of available functions.
An Introductory Example to Command Mode
A demonstration M-file called iddemo.m provides several examples of what might be typical sessions with the System Identification Toolbox. To start the demo, execute iddemo from inside MATLAB. Before giving a formal treatment of the capabilities and possibilities of the toolbox, this example is designed to get you started with the software quickly. This example is essentially the same as demo #2 in iddemo. You might want to invoke MATLAB at this time, execute the demo, and follow along.
Example Details
Data has been collected from a laboratory scale process. (Feedbacks Process Trainer PT326; see page 526 in Ljung (1999). For more references, see Reading More About System Identification on page 1-21.) The process operates much like a common hand-held hair dryer. Air is blown through a tube after being heated at the inlet to the tube. The input to the process is the power applied to a mesh of resistor wires that constitutes the heating device. The output of the process is the air temperature at the outlet, measured in volts by a thermocouple sensor. One thousand input-output data points were collected from the process as the input was changed in a random fashion between two levels. The sampling interval is 80 ms. The data was loaded into MATLAB in ASCII form and is now stored as the vectors y2 (output) and u2 (input) in the file dryer2.mat. First load the data.
(3-29)
in analogy with G and B. This is a good approximation for short sampling intervals T.
Estimating Impulse Responses
Consider the descriptions (Equation 3-1) and (Equation 3-2). To directly estimate the impulse response coefficients, also in the multivariable case, it is suitable to define a high-order Finite Impulse Response (FIR) model y ( t ) = g ( 0 )u ( t ) + g ( 1 )u ( t 1 ) + + g ( n )u ( t n )
(3-30)
and estimate the g-coefficients by the linear least squares method. In fact, to check whether there are noncausal effects from input to output, for example, due to feedback from y in the generation of u (closed loop data), g for negative lags can also be estimated. y ( t ) = g ( m )u ( t + m ) + + g ( 1 )u ( t + 1 ) + g ( 0 )u ( t ) + g ( 1 )u ( t 1 ) + + g ( n )u ( t n )
(3-31)
If u is white noise, the impulse response coefficients will be correctly estimated, even if the true dynamics from u to y are more complicated than these models. Therefore it is natural to filter both the output and the input through a filter that makes the input sequence as white as possible before estimating the g. This is the essence of correlation analysis for estimating impulse responses.
Estimating Spectra and Frequency Functions
This section describes methods that estimate the frequency functions and spectra (Equation 3-11) directly. The cross-covariance function R yu ( ) between y ( t ) and u ( t ) is defined as Ey ( t + )u ( t ) analogously to (Equation 3-7). Its Fourier transform, the cross spectrum, yu ( ) , is defined analogously to (Equation 3-6). Provided that the input u ( t ) is independent of v ( t ) , the relationship (Equation 3-1) implies the following relationships between the spectra.
y ( ) = G ( e ) u ( ) + v ( ) yu ( ) = G ( e ) u ( )
(3-32)
By estimating the various spectra involved, the frequency function and the disturbance spectrum can be estimated as follows. Form estimates of the covariance functions (as defined in (Equation 3-7)) R y ( ) , R yu ( ) , and R u ( ) , using
1 R yu ( ) = ---N
y ( t + )u ( t )
(3-33)
and analog expressions for the others. Then, form estimates of the corresponding spectra y ( ) =
i R y ( )W M ( )e
(3-34)
and analogously for u and yu. Here W M ( ) is the so-called lag window and M is the width of the lag window. The estimates are then formed as i yu ( ) G N ( e ) = ------------------- ; u ( )
2 yu ( ) v ( ) = y ( ) ----------------------- u ( )
(3-35)
This procedure is known as spectral analysis. (See Chapter 6 in Ljung (1999).)
Estimating Parametric Models
Data.Tstart = 24
The actual time-point values are given by the property SamplingInstants, as in
plot(Data.sa,Data.u)
for a plot of the input with correct time points. Autofill is used for all properties, and they are case insensitive. For easy writing, 'u' is synonymous to 'Input' and 'y' to 'Output' when you are referring to the properties.
Manipulating Channels
An easy way to set and retrieve channel properties is to use subscripting. The subscripts are defined as
Data(samples,outputs,inputs)
so Dat(:,3,:) is the data object obtained from Dat by keeping all input channels, but only output channel 3. (Trailing :s can be omitted so Dat(:,3,:) = Dat(:,3).) You can also retrieve the channels by their names, so that
Dat(:,{'speed','flow'},[ ])
is the data object where the indicated output channels have been selected and no input channels are selected. Moreover,
Dat1(101:200,[3 4],[1 3]) = Dat2(1001:1100,[1 2],[6 7])
will change samples 101 to 200 of output channels 3 and 4 and input channels 1 and 3 in the iddata object Dat1 to the indicated values from iddata object
Dat2. The names and units of these channels are then also changed accordingly.
To add new channels, use horizontal concatenation of iddata objects.
Dat =[Dat1, Dat2];
See Adding Channels on page 3-26 or add the data record directly, so that
Dat.u(:,5) = u
will add a fifth input to Dat.
Nonequal Sampling
The property SamplingInstants gives the sampling instants of the data points. It can always be retrieved by get(Dat,'SamplingInstants') (or Dat.s) and is then computed from Dat.Ts and Dat.Tstart. SamplingInstants can also be set to an arbitrary vector of the same length as the data, so that nonequal sampling can be handled. Ts is then automatically set to [ ]. Most of the estimation routines, though, do not handle unequally sampled data.
Multiple Experiments
The iddata object can also store data from separate experiments. The property ExperimentName is used to separate the experiments. The number of data as well as the sampling properties can vary from experiment to experiment, but the input and output channels must be the same. (Use NaN to fill unmeasured channels in certain experiments.) The data records will be cell arrays where the cells contain data from each experiment. You can define multiple experiments directly by letting the 'y' and 'u' properties as well as 'Ts' and 'Tstart' be cell arrays. It is normally easier to create multiple-experiment data by merging experiments, as in
m = idss([1, -1;0, 1],[2;3],[1,0],0,[4;5]) m.As = [1, NaN; 0 ,1]; m.Bs = [NaN;NaN]; m.Cs = [1, 0]; m.Ds = 0; m.Ks = [NaN;NaN]; m.x0s = [0;0];
The definition thus follows in two steps. First the nominal model is defined. Then the structure (known and unknown parameter values) is defined by the structure matrices As, Bs, etc. The command setstruc makes the above syntax more efficient.
Example 3.2: A Continuous-Time Model Structure. Consider the following model
structure: 0 x(t) = x(t) + u(t) 2 y(t) = x(t) + e(t) x(0) = This corresponds to an electrical motor, where y 1 ( t ) = x 1 ( t ) is the angular position of the motor shaft and y 2 ( t ) = x 2 ( t ) is the angular velocity. The
parameter 1 is the inverse time constant of the motor and 2 1 is the static gain from the input to the angular velocity. (See Example 4.1 in Ljung (1999).) The motor is at rest at time 0 but at an unknown angular position. Suppose that 1 is around -1 and 2 is around 0.25. If you also know that the variance of the errors in the position measurement is 0.01 and in the angular velocity measurements is 0.1, you can then define an idss model using
m = idss([0 1;0. -1],[0;0.25],eye(2),[0;0],zeros(2,2),[0;0],'Ts',0) m.as = [0 1; 0 NaN] m.bs = [0 ;NaN] m.cs = m.c m.ds = m.d m.ks = m.k m.x0s = [NaN;0] m.noisevar = [0.01 0; 0 0.1]
The structure m can now be used to estimate the unknown parameters i from observed data
Data = iddata([y1 y2], u, 0.1)
model = pem(Data,m)
The iterative search for minimum is then initialized at the parameters in the nominal model m. The continuous-time model is automatically sampled to agree with the sampling interval of the data. The structure can also be used to simulate the system above with sampling interval T = 0.1 for input u and noise realization e.
e = randn(300,2) u = idinput(300); simdat = iddata([],[u e],'Ts',0.1); y = sim(m,simdat) % The continuous system will automatically be % sampled using Ts = 0.1.
The nominal parameter values are then used, and the noise sequence is scaled according to the matrix m.noisevar. When estimating models, you can try a number of neighboring structures, such as what happens if I fix this parameter to a certain value or what
arxstruc ivstruc n4sid, pem selstruc struc
Compute loss functions for sets of ARX model structures. Compute loss functions for sets of output-error model structures. Give state-space model order as a range. Select structure. Generate sets of structures.
rarmax rarx rbj roe rpem rplr segment
Estimate ARMAX or ARMA models recursively. Estimate ARX or AR models recursively. Estimate Box-Jenkins models recursively. Estimate output-error models (IIR filters) recursively. Estimate general input-output models using a recursive prediction error method. Estimate general input-output models using a recursive pseudolinear regression method. Segment data and estimate models for each segment.
advice get set setpname size timestamp
Give context-dependent advice on data and models. Retrieve object properties. Set object properties. Set default mnemonic parameter names. Give sizes of the different objects. Show objects time of creation.
advice
Purpose Syntax Description
4 advice
Give the user advice about a data set or an estimated model
advice(Model) advice(Data) Model is any estimated idmodel (idarx, idgrey, idpoly, idproc, idss). Data is any data set in the iddata format.
The command gives text information to the Command Window about the data set or the model. Typical advice given is For data sets, - The excitation level of the signals and what consequences this has for what model orders can be supported (see also pexcit) - Whether detrending should be applied - Presence of output feedback in the data, and its consequences (see also feedback) For models, - Whether the model appears to have captured the essential dynamics of the system, and/or the disturbance characteristics - Whether the model seems to be of unnecessarily high order - Whether significant feedback effects in the validation data can be detected
See Also
feedback, pexcit
Compute the Akaike Information Criterion for an estimated model
am = aic(Model1,Model2,.) Model is any estimated idmodel (idarx, idgrey, idpoly, idproc, idss). am is returned as a row vector with the values of Akaikes Information Criterion
Here is an example that generates data and estimates an ARX model.
A = [1 -1.5 0.7]; B = [0.5]; m0 = idpoly(A,B);
u e y z m
= = = = =
iddata([],idinput(300,'rbs')); iddata([],randn(300,1)); sim(m0, [u e]); [y,u]; arx(z,[1]);
The least squares estimation problem is an overdetermined set of linear equations that is solved using QR factorization. The regression matrix is formed so that only measured quantities are used (no fill-out with zeros). When the regression matrix is larger than MaxSize, the QR factorization is performed in a for loop.
ar, ivx, iv4, Algorithm Properties, EstimationInfo
arxdata
4arxdata
Extract the ARX parameters from idmodel models
[A,B] = arxdata(m) [A,B,dA,dB] = arxdata(m) m is the model as an idarx or idpoly model object. arxdata will work on any idarx model. For idpoly it will give an error unless the underlying model is an ARX model, that is, the orders nc=nd=nf=0. (See the reference page for idpoly.) A and B are returned in the standard multivariable ARX format (see idarx),
describing the model. y ( t ) + A 1 y ( t 1 ) + A 2 y ( t 2 ) + + A na y ( t na ) = B 0 u ( t ) + B 1 u ( t 1 ) + + B nb u ( t nb ) + e ( t ) Here A k and B k are matrices of dimensions ny-by-ny and ny-by-nu, respectively. (ny is the number of outputs, that is, the dimension of the vector y ( t ) , and nu is the number of inputs.) See Multivariable ARX Models: the idarx Model on page 3-43. The arguments A and B are 3-D arrays that contain the A matrices and the B matrices of the model in the following way:
A is an ny-by-ny-by-(na+1) array such that A(:,:,k+1) = Ak A(:,:,1) = eye(ny)
Similarly B is an ny-by-nu-by-(nb+1) array with
B(:,:,k+1) = Bk
Note that A always starts with the identity matrix, and that leading entries in B equal to zero means delays in the model. For a time series, B = [].
dA and dB are the estimated standard deviations of A and B.
arxstruc
4arxstruc
Compute loss functions for a set of different model structures of single-output ARX type
V = arxstruc(ze,zv,NN) V = arxstruc(ze,zv,NN,maxsize) NN is a matrix that defines a number of different structures of the ARX type. Each row of NN is of the form nn = [na nb nk]
with the same interpretation as described for arx. See struc for easy generation of typical NN matrices for single-input systems. Each of ze and zv is an iddata object containing output-input data. Frequency-domain data and idfrd objects are also supported. Models for each of the model structures defined by NN are estimated using the data set ze. The loss functions (normalized sum of squared prediction errors) are then computed for these models when applied to the validation data set zv. The data sets ze and zv need not be of equal size. They could, however, be the same sets, in which case the computation is faster. Note that arxstruc is intended for single-output systems only. The output argument V is best analyzed using selstruc. It contains the loss functions in its first row. The remaining rows of V contain the transpose of NN, so that the orders and delays are given just below the corresponding loss functions. The last column of V contains the number of data points in ze. The selection of a suitable model structure based on the information in v is normally done using selstruc. See Model Structure Selection and Validation on page 3-70 for advice on model structure selection and cross validation. See Algorithm Properties for an explanation of maxsize.
The estimate is based on a comparison of ARX models with different delays: y ( t ) + a 1 y ( t 1 ) + + a na y ( t na ) = b 1 u ( t nk ) + + b nb u ( t nb nk + 1 ) The integer na is the order of the A polynomial (default 2). nb is a row vector of length equal to the number of inputs, containing the order(s) of the B polynomial(s) (default all 2).
nkmin and nkmax are row vectors of the same length as the number of inputs, containing the smallest and largest delays to be tested. Defaults are nkmin = 0 and nkmax = nkmin+20.
detrend
4detrend
Remove trends from output-input data
zd = detrend(z) zd = detrend(z,o,brkp) z is an iddata object containing the input-output data. detrend removes the trend from each signal and returns the result as an iddata object zd.
The default (o = 0) removes the zeroth order trends; that is, the sample means are subtracted. If z is a frequency-domain data object, the response at frequency 0 is then set to zero, With o = 1, linear trends are removed after a least squares fit. With brkp not specified, one single line is subtracted from the entire data record. A continuous piecewise linear trend is subtracted if brkp contains breakpoints at sample numbers given in a row vector. Note that detrend for iddata objects differs somewhat from detrend in the Signal Processing Toolbox.
Remove a V-shaped trend from the output with its peak at sample number 119, and remove the sample mean from the input.
zd1(:,1,[]) = detrend(z(:,1,[]),1,119); zd2(:,[],1) = detrend(z(:,[],1)); zd = [zd1,zd2];
To difference signals in iddata objects
zdi = diff(z) zdi = diff(z,n) z is a time-domain iddata object. diff(z) and diff(z,n) apply this command to each of the input/output signals in z.
Convert a model from discrete to continuous time
mc = d2c(md) mc = d2c(md,method) mc = d2c(md,'CovarianceMatrix',cov,'InputDelay',inpd)
The discrete-time model md, given as any idmodel object, is converted to a continuous-time counterpart mc. The covariance matrix of the parameters in the model is also translated using the Gauss approximation formula and numerical derivatives of the transformation. The step sizes in the numerical derivatives are determined by the function nuderst. To inhibit the translation of the covariance matrix and save time, enter among the input arguments (.,'CovarianceMatrix,'None',.) (any abbreviations will do).
Default: sinedata = [10,10,1]; Grid_Skip can be useful for controlling odd and even frequency multiples, for
example, to detect nonlinearities of various kinds.
Very simple algorithms are used. The frequency contents are achieved for 'rgs' by an eighth-order Butterworth, noncausal filter, using idfilt. This is quite reliable. The same filter is used for the 'rbs' case, before making the signal binary. This means that the frequency contents are not guaranteed to be precise in this case. For the 'sine' case, the frequencies are selected to be equally spread over the chosen grid, and each sinusoid is given a random phase. A number of trials are made, and the phases that give the smallest signal amplitude are selected. The amplitude is then scaled so as to satisfy the specifications of levels.
References Examples
See Sderstrm and Stoica (1989), Chapter C5.3. For a general discussion of input signals, see Ljung (1999), Section 13.3. Create an input consisting of five sinusoids spread over the whole frequency interval. Compare the spectrum of this signal with that of its square. The frequency splitting (the square having spectral support at other frequencies) reveals the nonlinearity involved:
u = idinput([20],'sine',[],[],[1]); u = iddata([],u,1,'per',100); u2 = u.u.^2; u2 = iddata([],u2,1,'per',100); ffplot(etfe(u),'r*',etfe(u2),'+')
idmdlsim
4idmdlsim
Simulate idmodel objects in Simulink
Typing idmdlsim launches the Idmodel block in Simulink. By clicking the block you can specify the idmodel to simulate, whether to include initial state values, and whether to add noise to the simulation in accordance with the models own noise description.
idmodel
Purpose Description
4idmodel
Package all common model properties
The model m contains all relevant information. Just typing m will give a brief account of the model. present(m) also gives information about the uncertainties of the estimated parameters. get(m) gives a complete list of model properties. Most of the interesting properties can be directly accessed by subreferencing.
CovarianceMatrix: Estimated covariance matrix of the parameter vector. For a nonestimated model this is the empty matrix. For state-space models in the 'Free' parameterization the covariance matrix is also the empty matrix, since the individual matrix elements are not identifiable then. Instead, in this case, the covariance information is hidden (in the hidden property 'Utility') and retrieved by the relevant functions when necessary. Setting CovarianceMatrix to 'None' inhibits calculation of covariance and uncertainty information. This can save substantial time for certain models. See No Covariance on page 3-100. NoiseVariance: Covariance matrix of the noise source e. An ny-by-ny matrix. InputDelay: Vector of size nu-by-1, containing the input delay from each input channel. For a continuous-time model (Ts = 0) the delay is measured in TimeUnit, while for discrete-time models (Ts > 0) the delay is measured as the number of samples. Note the difference between InputDelay and nk (which is a property of idarx, idss, and idpoly). 'Nk' is a model structure property that tells the model structure to include such an input delay. In that case, the corresponding state-space matrices and polynomials will explicitly contain Nk input delays. The property InputDelay, on the other hand, is an indication that in addition to the model as defined, the inputs should be shifted by the given amount. InputDelay is used by sim and the estimation routines to shift the input data. When computing frequency responses, the InputDelay is also respected. Note that InputDelay can be both positive and negative. Algorithm: See the reference page for Algorithm Properties. EstimationInfo: See the reference page for EstimationInfo. Notes: An arbitrary field to store extra information and notes about the object. UserData: An arbitrary field for any possible use.
Note All properties can be set or retrieved either by these commands or by subscripts. Autofill applies to all properties and values, and is case insensitive.
For a complete list of property values, use get(m). To see possible value assignments, use set(m).
The outputs and input channels can be referenced according to
Use a colon (:) to denote all channels and an empty matrix ([ ]) to denote no channels. The channels can be referenced by number or by name. For several names, you must use a cell array.
m2 = m('y3',{'u1','u4'}) m3 = m(3,[1 4])
For a single output model m,
selects the corresponding input channels, and for a single input model,
selects the indicated output channels. The string 'measured' (or any abbreviation like 'm') means the measured input channels.
m4 = m(3,'m') m('m') is the same as m(:,'m')
Similarly, the string 'noise' (or any abbreviation) refers to the noise input channels. See The Noise Channels on page 4-94 for more details.
y ( t ) = G ( q )u ( t ) + v ( t ) where v ( ) is the spectrum of v ( t ).
data contains the output-input data as an iddata object. The data can be complex valued. data can be both time domain and frequency domain. data can also be an idfrd object. g is returned as an idfrd object (see idfrd) with the estimate of G ( e i ) at the frequencies specified by row vector w. The default value of w is w = [1:128]/128pi/Ts
Here Ts is the sampling interval of data.
g also includes information about the spectrum estimate of v ( ) at the same frequencies. Both outputs are returned with estimated covariances, included in g. See idfrd. M is the length of the lag window used in the calculations. The default value is M = min(30,length(data)/10)
Changing the value of M controls the frequency resolution of the estimate. The resolution corresponding to M is approximately /M rad/sampling interval. The value of M exchanges bias for variance in the spectral estimate. As M is increased, the estimated functions show more detail, but are more corrupted by noise. The sharper peaks a true frequency function has, the higher M it needs. See etfe as an alternative for narrowband signals and systems. The function spafdr allows the frequency resolution to depend on the frequency. See also Estimating Spectra and Frequency Functions on page 3-15.
maxsize controls the memory-speed tradeoff (see Algorithm Properties).
For time series, where data contains no input channels, g is returned with the estimated output spectrum and its estimated standard deviation. When spa is called with two or three output arguments, g is returned as an idfrd model with just the estimated frequency response from input to output and its uncertainty. phi is returned as an idfrd model, containing just the spectrum data for the output spectrum v ( ) and its uncertainty. spe is returned as an idfrd model containing spectrum data for all output-input channels in data. That is, if z = [data.OutputData, data.InputData], spe contains as spectrum data the matrix-valued power spectrum of z.
Ez ( t + m )z ( t ) exp ( iWmT ) win ( m )
Linear Model Structures
A linear model is often sufficient to accurately describe the system dynamics and, in most cases, you should first try to fit linear models. Available linear structures include transfer functions and state-space models, summarized in the following table. Model Type Process model (idproc object) Usage Use this structure to represent low-order transfer function that include integrator, delay, zero, and up to 3 poles. You can also specify parameter bounds. Use this structure to represent known state-space structures and black-box structures. You can fix certain parameters to known values and estimate the remaining parameters. If you need to specify parameter dependencies or constraints, use the grey-box model structure. Learn More Identifying Low-Order Transfer Functions (Process Models) on page 3-20
State-space model (idss object)
Identifying State-Space Models on page 3-73
Model Type Generalized transfer function (idpoly object)
Usage Use to represent linear transfer functions based on the general form input-output polynomial form:
Learn More Identifying Input-Output Polynomial Models on page 3-39
B C u+ e F D
where A, B, C, D and F are polynomials with coefficients that the toolbox estimates from data. Typically, you begin modeling using simpler forms of this generalized structure (such as ARX: Ay = Bu + e and
B OE: y = u + e ) and, if F necessary, increase the model complexity.
Grey-box model (idgrey object) Use to represent arbitrary parameterizations of state-space models. For example, you can use this structure to represent your ordinary differential or difference equation (ODE) and to define parameter dependencies. Estimating Linear Grey-Box Models on page 5-6
Nonlinear Model Structures
System Identification Toolbox provides several nonlinear black-box model structures, which have traditionally been useful for representing dynamic systems. Model Type Nonlinear ARX model (idnlarx object) Usage Use to represent nonlinear extensions of linear models. This structure allows you to model complex nonlinear behavior using flexible nonlinear functions, such as wavelet and sigmoid networks. Use to represent linear models with static nonlinearities. Learn More Identifying Nonlinear ARX Models on page 4-8
Linear models with input/output nonlinearities, or Hammerstein-Wiener model (idnlhw object) Nonlinear grey-box model (idnlgrey object)
Identifying Hammerstein-Wiener Models on page 4-49
Use to represent nonlinear ODEs with unknown parameters.
Estimating Nonlinear Grey-Box Models on page 5-16
Recommended Model Estimation Sequence
System identification is an iterative process, where you identify models with different structures from data and compare model performance. You start by estimating the parameters of simple model structures. If the model performance is poor, you gradually increase the complexity of the model structure. Ultimately, you choose the simplest model that best describes the dynamics of your system. Another reason to start with simple model structures is that higher-order models are not always more accurate. Increasing model complexity increases the uncertainties in parameter estimates and typically requires more data (which is common in the case of nonlinear models). Note Model structure is not the only factor that determines model accuracy. If your model is poor, you might need to preprocess your data by removing outliers or filtering noise. For more information, see Ways to Prepare Data for System Identification on page 2-5. Estimate impulse-response and frequency-response models first to gain insight into the system dynamics and assess whether a linear model is sufficient. Then, estimate parametric models in the following order:
Supported Models for Frequency-Domain Data
There are two types of frequency-domain data: Continuous-time data Discrete-time data You specify frequency-domain data as continuous- or discrete-time when you either import data into the System Identification Tool GUI or create a System Identification Toolbox data object. For more information about representing your data as System Identification Toolbox data objects, see Chapter 2, Data Import and Processing. To designate discrete-time data, you set the sampling interval of the data to the experimental data sampling interval. To designate continuous-time data, you must set the sampling interval of the data to zero. Setting the sampling interval to zero corresponds to taking a Fourier transform of continuous-time data.
You can estimate the following types of continuous-time models directly: Low-order transfer functions. See Identifying Low-Order Transfer Functions (Process Models) on page 3-20. Input-output polynomial models. See Identifying Input-Output Polynomial Models on page 3-39. State-space models. From continuous-time frequency-domain data, you can estimate continuous-time state-space models. From discrete-time frequency-domain
data, you can estimate continuous-time black-box models with canonical parameterization. See Identifying State-Space Models on page 3-73. To get a linear, continuous-time model of arbitrary structure for frequency-domain data, you can estimate a discrete-time model and use d2c to transform it to a continuous-time model.
You can estimate only output-error (OE) polynomial models using frequency-domain data. See Identifying Input-Output Polynomial Models on page 3-39. Other linear model structures include noise models, which are not supported for frequency-domain data.
For linear grey-box models, you can estimate both continuous-time and discrete-time models from frequency-domain data. Nonlinear grey-box models are supported only for time-domain data. See Chapter 5, ODE Parameter Estimation (Grey-Box Modeling).
Nonlinear Black-Box Models
Frequency-domain data is not relevant to nonlinear black-box models, which support only time-domain data.
Supported Continuous-Time and Discrete-Time Models
For linear and nonlinear ODEs (grey-box models), you can specify any ordinary differential or difference equation to represent your continuous-time or discrete-time model in state-space form, respectively. In the linear case, both time-domain and frequency-domain data are supported. In the nonlinear case, only time-domain data is supported. For black-box models, the following tables summarize supported continuous-time and discrete-time models. Supported Continuous-Time Models Model Type Low-order transfer functions (process models) Linear input-output polynomial models Description Estimate low-order process models for up to three free poles from either time- or frequency-domain data. To get a linear, continuous-time model of arbitrary structure from time-domain data, you can estimate a discrete-time model, and then use d2c to transform it into a continuous-time model. For frequency-domain data, you can directly estimate only the ARX and output-error (OE) continuous-time polynomial models by setting the sampling interval of the data to 0. Other structures include noise models and are not supported for frequency-domain data. To get a linear, continuous-time model of arbitrary structure for time-domain data, you can estimate a discrete-time model, and then use d2c to transform it into a continuous-time model. For frequency-domain data, you can estimate continuous-time state-space models directly. Estimate ordinary differential equations (ODEs) from either time- or frequency-domain data. Estimate arbitrary differential equations (ODEs) from time-domain data.
How to Analyze Data Using the advice Command
You can use the advice command to analyze time- or frequency- domain data before estimating a model. The resulting report informs you about the possible need to preprocess the data and identifies potential restrictions on the model accuracy. You should use these recommendations in combination with plotting the data and validating the models estimated from this data. Note advice does not support frequency-response data. Before applying the advice command to your data, you must have represented your data as an iddata object. For more information, see Representing Timeand Frequency-Domain Data Using iddata Objects on page 2-50.
If you are using the System Identification Tool GUI, you must export your data to the MATLAB workspace before you can use the advice command on this data. For more information about exporting data, see Exporting Models from the GUI to the MATLAB Workspace on page 11-13. Use the following syntax to get advice about an iddata object data:
advice(data)
For more information about the advice syntax, see the advice reference page. Advice provide guidance for these kinds of questions: Does it make sense to remove constant offsets and linear trends from the data? What are the excitation levels of the signals and how does this affects the model orders? Is there an indication of output feedback in the data? When feedback is present in the system, only prediction-error methods work well for estimating closed-loop data. What is the estimated input-output delay in the system (dead time)?
advice delayest detrend feedback pexcit
Selecting Subsets of Data
In this section. Why Select Subsets of Data? on page 2-90 Selecting Data Using the GUI on page 2-91 Selecting Data at the Command Line on page 2-93
Why Select Subsets of Data?
You can use data selection to create independent data sets for estimation and validation. You can also use data selection as a way to clean the data and exclude parts with noisy or missing information. For example, when your data contains missing values, outliers, level changes, and disturbances, you can select one or more portions of the data that are suitable for identification and exclude the rest. If you only have one data set and you want to estimate linear models, you should split the data into two portions to create two independent data sets for estimation and validation, respectively. Splitting the data is selecting parts of the data set and saving each part independently. You can merge several data segments into a single multiexperiment data set and identify an average model. For more information, see Importing Data into the GUI on page 2-15 or Representing Time- and Frequency-Domain Data Using iddata Objects on page 2-50. Note Subsets of the data set must contain enough samples to adequately represent the system, and the inputs must provide suitable excitation to the system. Selecting potions of frequency-domain data is equivalent to filtering the data. For more information about filtering, see Filtering Data on page 2-110.
This example shows how to generate output data by simulating a model using an input signal created using idinput. You use the generated data to estimate a model of the same order as the model used to generate the data. Then, you check how closely both models match to understand the effects of input data characteristics and noise on the estimation.
1 Create an ARMAX model with known coefficients.
A = [1 -1.2 0.7]; B = {[0.5 0.1],[0 1.5 -0.5 0],[0 -0.1 0.5 -0.1]}; C = [0]; Ts = 1; m = idpoly(A,B,C,'Ts',1);
The leading zeros in the B matrix indicate the input delay (nk), which is 1 for each input channel. The trailing zero in B(2,:) makes the number of coefficients equal for all channels.
2 Construct a pseudorandom binary input data.
u = idinput([200,3],'prbs');
3 Simulate model output with noise using the pseudorandom binary data.
y = sim(m,u,'noise');
4 Represent the simulation data as an iddata object.
iodata = iddata(y,u,m.Ts);
5 (Optional) Estimate a model of the same order as m using iodata.
na = m.na; nb = m.nb; nc= m.nc; nk= m.nk me = armax(iodata,[na,nb,nc,nk]);
Use bode(m,me) and compare(iodata,me) to check how closely me and m match.
Simulating Data Using Other MathWorks Products
You can also simulate data using the Simulink and Signal Processing Toolbox software. Data simulated outside the System Identification Toolbox product must be in the MATLAB workspace. For more information about simulating models using the Simulink software, see Simulating Model Output on page 10-6.
Transforming Between Time- and Frequency-Domain Data
In this section. Transforming Data Domain in the GUI on page 2-122 Transforming Data Domain at the Command Line on page 2-129
Transforming Data Domain in the GUI
Transforming Time-Domain Data on page 2-122 Transforming Frequency-Domain Data on page 2-126 Transforming Frequency-Response Data on page 2-127 See Also on page 2-129
Transforming Time-Domain Data
In the System Identification Tool GUI, time-domain data has an icon with a white background. You can transform time-domain data to frequency-domain or frequency-response data. The frequency values of the resulting frequency vector range from 0 to the Nyquist frequency fS = Ts , where Ts is the sampling interval. Transforming from time-domain to frequency-response data is equivalent to estimating a model from the data using the spafdr method.
Identifying Frequency-Response Models
In this section. What Is a Frequency-Response Model? on page 3-2 Data Supported by Frequency-Response Models on page 3-3 How to Estimate Frequency-Response Models in the GUI on page 3-3 How to Estimate Frequency-Response Models at the Command Line on page 3-5 Options for Computing Spectral Models on page 3-5 Options for Frequency Resolution on page 3-6 Spectrum Normalization on page 3-8
What Is a Frequency-Response Model?
You can estimate frequency-response models and visualize the responses on a Bode plot, which shows the amplitude change and the phase shift as a function of the sinusoid frequency. The frequency-response function describes the steady-state response of a system to sinusoidal inputs. For a linear system, a sinusoidal input of a specific frequency results in an output that is also a sinusoid with the same frequency, but with a different amplitude and phase. The frequency-response function describes the amplitude change and phase shift as a function of frequency. For a discrete-time system sampled with a time interval T, the frequency-response model G(z) relates the Z-transforms of the input U(z) and output Y(z):
In other words, the frequency-response function, G(eiwT), is the Laplace transform of the impulse response that is evaluated on the imaginary axis. The frequency-response function is the transfer function G(z) evaluated on the unit circle.
Data Supported by Frequency-Response Models
You can estimate spectral analysis models from data with the following characteristics: Complex or real data. Time- or frequency-domain iddata or idfrd data object. To learn more about estimating time-series models, see Chapter 6, Time Series Identification. Single- or multiple-output data.
How to Estimate Frequency-Response Models in the GUI
You must have already imported your data into the GUI and performed any necessary preprocessing operations. For more information, see Chapter 2, Data Import and Processing. To estimate frequency-response models in the System Identification Tool GUI:
1 In the System Identification Tool GUI, select Estimate > Spectral
models to open the Spectral Model dialog box.
2 In the Method list, select the spectral analysis method you want to use.
For information about each method, see Options for Computing Spectral Models on page 3-5.
3 Specify the frequencies at which to compute the spectral model in one of
the following ways: In the Frequencies field, enter either a vector of values, a MATLAB expression that evaluates to a vector, or a variable name of a vector in the MATLAB workspace. For example, logspace(-1,2,500). Use the combination of Frequency Spacing and Frequencies to construct the frequency vector of values: In the Frequency Spacing list, select Linear or Logarithmic frequency spacing.
5 (Optional) If you approximately know a parameter value, enter this value
in the Initial Guess column of the Parameter table. The estimation algorithm uses this value as a starting point. If you know a parameter value exactly, enter this value in the Initial Guess column, and also select the corresponding Known check box in the table to fix its value. If you know the range of possible values for a parameter, enter these values into the corresponding Bounds field to help the estimation algorithm. For example, the following figure shows that the delay value Td is fixed at 2 s and is not estimated.
6 In the Disturbance Model list, select one of the available options. For
more information about each option, see Options for the Disturbance Model Structure on page 3-35.
7 In the Focus list, select how to weigh the relative importance of the fit at
different frequencies. For more information about each option, see Options for Frequency-Weighing Focus on page 3-36.
8 In the Initial state list, specify how you want the algorithm to treat initial
states. For more information about the available options, see Options for Initial States on page 3-37. Tip If you get a bad fit, you might try setting a specific method for handling initial states, rather than choosing it automatically.
9 In the Covariance list, select Estimate if you want the algorithm to
compute parameter uncertainties. Effects of such uncertainties are displayed on plots as model confidence regions.
To omit estimating uncertainty, select None. Skipping uncertainty computation might reduce computation time for complex models and large data sets.
10 In the Model Name field, edit the name of the model or keep the default.
11 To view the estimation progress in the MATLAB Command Window, select
the Trace check box. During estimation, the following information is displayed for each iteration: Loss function Equals the determinant of the estimated covariance matrix of the input noise. Parameter values Values of the model structure coefficients you specified. Search direction Change in parameter values from the previous iteration. Fit improvements Shows the actual versus expected improvements in the fit.
12 Click Estimate to add this model to the Model Board in the System
13 To stop the search and save the results after the current iteration has been
completed, click Stop Iterations. To continue iterations from the current model, click the Continue iter button to assign current parameter values as initial guesses for the next search.
Validate the model by selecting the appropriate check box in the Model Views area of the System Identification Tool GUI. For more information about validating models, see Overview of Model Validation and Plots on page 8-2. Refine the model by clicking the Value > Initial Guess button to assign current parameter values as initial guesses for the next search, edit the Model Name field, and click Estimate.
Export the model to the MATLAB workspace for further analysis by dragging it to the To Workspace rectangle in the System Identification Tool GUI.
How to Estimate Process Models at the Command Line
Prerequisites on page 3-27 Using pem to Estimate Process Models on page 3-27 Example Estimating Process Models with Free Parameters at the Command Line on page 3-29 Example Estimating Process Models with Fixed Parameters at the Command Line on page 3-30
Prerequisites
Before you can perform this task, you must have Regularly sampled data as an iddata object. See Representing Time- and Frequency-Domain Data Using iddata Objects on page 2-50. For supported data formats, see Data Supported by a Process Model on page 3-21. Performed any required data preprocessing operations. If you need to model nonzero offsets, such as when model contains integration behavior, do not detrend your data. In other cases, to improve the accuracy of your model, you should detrend your data. See Ways to Prepare Data for System Identification on page 2-5.
Using pem to Estimate Process Models
You can estimate process models using the iterative estimation method pem that minimizes the prediction errors to obtain maximum likelihood estimates. The resulting models are stored as idproc model objects. You can use the following general syntax to both configure and estimate process models:
m = pem(data,mod_struc,'Property1',Value1,., 'PropertyN',ValueN)
To capture offsets that are essential to describe the dynamics of interest, such as when the model contains integration behavior, set the InputLevel property set to estimate.
data is the estimation data and mod_struc is a string that represents
the process model structure, as described in Options for Specifying the Process-Model Structure on page 3-33. Tip You do not need to construct the model object using idproc before estimation unless you want to specify initial parameter guesses or fixed parameter values, as described in Example Estimating Process Models with Fixed Parameters at the Command Line on page 3-30. The property-value pairs specify any model properties that configure the estimation algorithm and the initial conditions. For more information about accessing and setting model properties, see Model Properties on page 1-17. Note You can specify all property-value pairs in pem as a simple, comma-separated list without worrying about the hierarchy of these properties in the idproc model object. For more information about validating a process model, see Overview of Model Validation and Plots on page 8-2. You can use pem to refine parameter estimates of an existing process model, as described in Refining Linear Parametric Models on page 3-104. For detailed information about pem and idproc, see the corresponding reference page.
value specifies the numerical value of the parameter, if known. To set the value of K to 12 and keep it fixed, use the following commands:
mod.K.value=12; mod.K.status='fixed';
Note mod is defined for one input. This model is automatically adjusted to have a duplicate for each input. To estimate Tp1 and Td only, use the following command:
mod_proc=pem(ze,mod)
MATLAB computes the following result:
Process model with 2 inputs: y = G_1(s)u_1 + G_2(s)u_2 where K G_1(s) = ---------- * exp(-Td*s) 1+Tp1*s with K = 12 Tp1 = 7.0998e+007 Td = 15
K G_2(s) = ---------- * exp(-Td*s) 1+Tp1*s with K = 12 Tp1 = 3.6962 Td = 3.817
In this case, the value of K is fixed at 12, but Tp1 and Td are estimated.
If you prefer to specify parameter constraints directly in the estimator syntax, the following table provides examples of pem commands. Action Fix the value of K to 12.
m=pem(ze,'p1d','k','fix','k',12)
Initialize K for the iterative search without fixing this value. Constrain the value of K between 3 and 4.
m=pem(ze,'p1d','k',12)
m=pem(ze,'p1d','k',. {'min',3},'k',{'max',4})
Options for Specifying the Process-Model Structure
This section describes how to specify the model structure in the estimation procedures How to Estimate Process Models Using the GUI on page 3-21 and How to Estimate Process Models at the Command Line on page 3-27. In the System Identification Tool GUI. Specify the model structure by selecting the number of real or complex poles, and whether to include a zero, delay, and integrator. The resulting transfer function is displayed in the Process Models dialog box. At the command line. Specify the model structure using an acronym that includes the following letters and numbers: (Required) P for a process model (Required) 0, 1, 2 or 3 for the number of poles (Optional) D to include a time-delay term e sTd (Optional) Z to include a process zero (numerator term) (Optional) U to indicate possible complex-valued (underdamped) poles (Optional) I to indicate enforced integration
Typically, you specify the model-structure acronym as a string argument in the estimation command pem: pem(data,'P1D') to estimate the following structure:
pem(data,'P2ZU') to estimate the following structure:
K p (1 + sTz )
+ 2sTw + s2 Tw
pem(data,'P0ID') to estimate the following structure:
pem(data,'P3Z') to estimate the following structure:
(1 + sTp1 ) (1 + sTp2 ) (1 + sTp3 )
For more information about estimating models , see How to Estimate Process Models at the Command Line on page 3-27.
Options for Initial States
Because the process models are dynamic, you need initial states that capture past input properties. Thus, you must specify how the iterative algorithm treats initial states. This information supports the estimation procedures How to Estimate Process Models Using the GUI on page 3-21 and How to Estimate Process Models at the Command Line on page 3-27. In the System Identification Tool GUI. Set Initial state to one of the following options: Zero Sets all initial states to zero. Estimate Treats the initial states as an unknown vector of parameters and estimates these states from the data. Backcast Estimates initial states using a backward filtering method (least-squares fit). U-level est Estimates both the initial states and the InputLevel model property that represents the input offset level. For multiple inputs, the input level for each input is estimated individually. Use if you included an integrator in the transfer function. Auto Automatically chooses one of the preceding options based on the estimation data. If initial states have negligible effect on the prediction errors, the initial states are set to zero to optimize algorithm performance.
At the command line. Specify the initial states as an argument in the estimation command pem using the same options as in the GUI. For example, use this command to estimate a first-order transfer function and set the initial states to zero:
m=pem(data,'P1D','InitialState','zero')
For a complete list of values for the InitialState model property, see the idproc reference page.
Identifying Input-Output Polynomial Models
In this section. What Are Black-Box Polynomial Models? on page 3-39 Data Supported by Polynomial Models on page 3-46 Preliminary Step Estimating Model Orders and Input Delays on page 3-48 How to Estimate Polynomial Models in the GUI on page 3-56 How to Estimate Polynomial Models at the Command Line on page 3-59 Options for Multiple-Input and Multiple-Output ARX Orders on page 3-64 Option for Frequency-Weighing Focus on page 3-65 Options for Initial States on page 3-66 Algorithms for Estimating Polynomial Models on page 3-66 Example Estimating Models Using armax on page 3-67
Preliminary Step Estimating Model Orders and Input Delays
Why Estimate Model Orders and Delays? on page 3-48 Estimating Orders and Delays in the GUI on page 3-48 Estimating Model Orders at the Command Line on page 3-52 Estimating Delays at the Command Line on page 3-53 Selecting Model Orders from the Best ARX Structure on page 3-54
Why Estimate Model Orders and Delays?
To estimate polynomial models, you must provide input delays and model orders. If you already have insight into the physics of your system, you can specify the number of poles and zeros. In most cases, you do not know the model orders in advance. To get initial model orders and delays for your system, you can estimate several ARX models with a range of orders and delays and compare the performance of these models. You choose the model orders that correspond to the best model performance and use these orders as an initial guess for further modeling. Because this estimation procedure uses the ARX model structure, which includes the A and B polynomials, you only get estimates for the na, nb, and nk parameters. However, you can use these results as initial guesses for the corresponding polynomial orders and input delays in other model structures, such as ARMAX, OE, and BJ. If the estimated nk is too small, the leading nb coefficients are much smaller than their standard deviations. Conversely, if the estimated nk is too large, there is a significant correlation between the residuals and the input for lags that correspond to the missing B terms. For information about residual analysis plots, see Residual Analysis on page 8-21.
Estimating Orders and Delays in the GUI
The following procedure assumes that you have already imported your data into the GUI and performed any necessary preprocessing operations. For more information, see Chapter 2, Data Import and Processing.
To estimate model orders and input delays in the System Identification Tool GUI:
1 In the System Identification Tool GUI, select Estimate > Linear
parametric models to open the Linear Parametric Models dialog box. The ARX model is already selected by default in the Structure list. Note For time-series models, select the AR model structure.
2 Edit the Orders field to specify a range of poles, zeros, and delays. For
example, enter the following values for na, nb, and nk:
[1:10 1:10 1:10]
Tip As a shortcut for entering 1:10 for each required model order, click Order Selection.
y ( t ) = H ( x ( t ) , u ( t ))
where F and H can have any parameterization. You use the idnlgrey object to specify the structures of such models as nonlinear ODEs, based on physical insight about your system. The parameters of such models typically have physical interpretations. For more information about estimating nonlinear state-space models, see Chapter 5, ODE Parameter Estimation (Grey-Box Modeling).
Preparing Data for Nonlinear Identification
Estimating nonlinear ARX and Hammerstein-Wiener models requires uniformly sampled time-domain data. Your data can have one or more input and output channels. For time-series data, you can only fit nonlinear ARX models and nonlinear state-space models. Tip Whenever possible, use different data sets for model estimation and validation. Before estimating models, import your data into the MATLAB workspace and do one of the following: In the System Identification Tool GUI. Import data into the GUI, as described in Importing Data into the GUI on page 2-15. At the command line. Represent your data as an iddata object, as described in the corresponding reference page. You can analyze data quality and preprocess data by interpolating missing values, filtering to emphasize a specific frequency range, or resampling using a different time interval (see Ways to Prepare Data for System Identification on page 2-5). Data detrending can be useful in certain cases, such as before modeling the relationship between the change in input and the change in output about an operating point. However, most applications do not require you to remove offsets and linear trends from the data before nonlinear modeling.
Identifying Nonlinear ARX Models
In this section. Nonlinear ARX Model Extends the Linear ARX Structure on page 4-8 Structure of Nonlinear ARX Models on page 4-9 Nonlinearity Estimators for Nonlinear ARX Models on page 4-10 Ways to Configure Nonlinear ARX Estimation on page 4-12 How to Estimate Nonlinear ARX Models in the GUI on page 4-16 How to Estimate Nonlinear ARX Models at the Command Line on page 4-19 Using Linear Model for Nonlinear ARX Estimation on page 4-28 Validating Nonlinear ARX Models on page 4-35 Using Nonlinear ARX Models on page 4-40 Low-Level Manipulation of Nonlinear ARX Components on page 4-41
Nonlinear ARX Model Extends the Linear ARX Structure
A linear SISO ARX model has this structure:
y(t) a1 y(t 1) a2 y(t 2) . ana y(t na)
b1u(t) b2u(t 1) . bnbu(t nb 1) e t
where the input delay nk is zero to simplify the notation. This structure implies that the current output y(t) is predicted as a weighted sum of past output values and current and past input values. Rewriting the equation as a product:
y p (t) = [ a1 , a2 ,., ana , b1 , b2 ,., bnb ]
[ y(t 1), y(t 2),., y(t na), u(t), u(t 1),., u(t nb 1)]T
where y(t 1), y(t 2),., y(t na), u(t), u(t 1),., u(t nb 1) are delayed input and output variables, called regressors. The linear ARX model predicts the current output yp as a weighted sum of its regressors. The nonlinear ARX structure is an extension of the linear ARX structure: Instead of the weighted sum that represents a linear mapping, the nonlinear ARX model has a more flexible nonlinear mapping function:
M1 = nlhw(data, [1], `sigm','wave'); % original model M1p = init(M1); % randomly perturbs parameters about nominal values M2 = pem(data, M1p); % estimates parameters of perturbed model
You can display the progress of the iterative search in the MATLAB Command Window using the Display property of the idnlhw class:
Improve estimation results using initial states. If your estimated Hammerstein-Wiener model provides a poor fit to measured data, you can repeat the estimation using the initial state values estimated
from the data. By default, the initial states corresponding to the linear block of the Hammerstein-Wiener model are zero. To specify estimating initial states during model estimation, use:
m = nlhw(data,[nb nf nk],[sigmoidnet;pwlinear],[],. 'InitialState','e');
Example Using nlhw to Estimate Hammerstein-Wiener Models
Use nlhw to estimate a Hammerstein-Wiener model for the data in Tutorial Identifying Nonlinear Black-Box Models Using the GUI.
m1 = nlhw(ze,[1]); m2 = nlhw(ze,[3]); m3 = nlhw(ze,[3], pwlinear('num',13),. pwlinear('num',10)); m4 = nlhw(ze,[3], sigmoidnet('num',2),. pwlinear('num',10));
m5 = idnlhw([3], 'dead','sat') m5 = pem(ze,m5);
3 Compare the resulting models by plotting the model outputs on top of the
compare(zv,m1,m2,m3,m4,m5)
Example Improving a Linear Model Using Hammerstein-Wiener Structure
Use the Hammerstein-Wiener model structure to improve a previously estimated linear model. After estimating the linear model, insert it into the Hammerstein-Wiener structure that includes input or output nonlinearities.
1 Estimate a linear model:
load iddata1 LM = arx(z1,[1]);
2 Extract the transfer function coefficients from the linear model:
[Num, Den] = tfdata(LM);
3 Create a Hammerstein-Wiener model, where you initialize the linear block
properties B and F using Num and Den, respectively:
nb = 1; % In general, nb = ones(ny,nu) % ny is number of outputs % nu is number of inputs
nf = nb; nk = 0;
% In general, nk = zeros(ny,nu) % ny is number of outputs % nu is number of inputs M = idnlhw([nb nf nk],'poly1d','pwlinear'); M.b = Num; M.f = Den;
4 Estimate the model coefficients, which refines the linear model coefficients
in Num and Den:
M = pem(z1, M);
5 Compare responses of linear and nonlinear model against measured data:
compare(z1,LM,M)
Using Linear Model for Hammerstein-Wiener Estimation
About Using Linear Models on page 4-65 How to Initialize Hammerstein-Wiener Estimation Using Linear Polynomial Output-Error or State-Space Models on page 4-66 Example Using Linear OE Models to Estimate Hammerstein-Wiener Models on page 4-66
You can use the following discrete-time linear models for Hammerstein-Wiener estimation. The linear model must sufficiently represent the linear dynamics of your system. Discrete-Time Linear Model Single-output polynomial model of Output-Error (OE) structure (idpoly) or state-space model with no disturbance component (idss model with K = 0) State-space with no disturbance component (idss model with K = 0) Use for Initializing. Single-output Hammerstein-Wiener model estimation
What Does a Noise Spectrum Plot Show?
The general equation of a linear dynamic system is given by:
y(t) = G( z)u(t) + v(t)
In this equation, G is an operator that takes the input to the output and captures the system dynamics, and v is the additive noise term. The toolbox treats the noise term as filtered white noise, as follows:
v(t) = H ( z) e(t)
The toolbox computes both H and during the estimation of the noise model and stores these quantities as model properties. The H(z) operator represents the noise model. e(t) is a white-noise source with variance .
Whereas the frequency-response plot shows the response of G, the noise-spectrum plot shows the frequency-response of the noise model H. For input-output models, the noise spectrum is given by the following equation:
v () = H ei
For time-series models (no input), the vertical axis of the noise-spectrum plot is the same as the dynamic model spectrum. These axes are the same because there is no input for time series and y = He. Note You can avoid estimating the noise model by selecting the Output-Error model structure or by setting the DisturbanceModel property value to 'None' for a state space model. If you choose to not estimate a noise model for your system, then H and the noise spectrum amplitude are equal to 1 at all frequencies.
In addition to the noise-spectrum curve, you can display a confidence interval on the plot. To learn how to show or hide confidence interval, see the description of the plot settings in How to Plot the Noise Spectrum Using the GUI on page 8-48. The confidence interval corresponds to the range of power-spectrum values with a specific probability of being the actual noise spectrum of the system. The toolbox uses the estimated uncertainty in the model parameters to calculate confidence intervals and assumes the estimates have a Gaussian distribution. For example, for a 95% confidence interval, the region around the nominal curve represents the range of values that have a 95% probability of being the true system noise spectrum. You can specify the confidence interval as a probability (between 0 and 1) or as the number of standard deviations of a
Gaussian distribution. For example, a probability of 0.99 (99%) corresponds to 2.58 standard deviations. Note The calculation of the confidence interval assumes that the model sufficiently describes the system dynamics and the model residuals pass independence tests.
How to Plot the Noise Spectrum Using the GUI
To create a noise spectrum plot for parametric linear models in the GUI, select the Noise spectrum check box in the Model Views area. For general information about creating and working with plots, see Working with Plots in the System Identification Tool GUI on page 11-15. To include or exclude a model on the plot, click the corresponding model icon in the System Identification Tool GUI. Active models display a thick line inside the Model Board icon. The following figure shows a sample Noise Spectrum plot.
Tags
Bracket NV-GS17E S9-HD Renault Clio Siemens AP75 PV-GS300 32PW6006 KDL-40V1000 Automatique Onyx Easy C182CR S31 Music HP-305 8410D Digital N2020 VN2200 HX2110 L8008R Live 2 SF-370-XEU R310SC 1515MF GHD8015F2 345GSM HBH-610A PBD-V30 CME UF7 HM320II SRP Magic HS-12W Dryer SV-MP110V DCR-TRV325E 22PFL3403D KV-25X5R Magic RX-V420 Audio CQ-C3301 Yahtzee Rmsthm303J-RM-sthm303 GD-1920C-BB XW-NAV1k-K Descriptif V3I DG RX-D11 10 6 Machine Ixus 95IS FT-897 GT-C3110 Lwhd1000R LAC-M5500 SGH-C160 TM 2350 Modeler LST-255 Easyshare 5300 BHS-316 Wl-5460AP CTK-5000 AR-M200 201 DCR-DVD506E GMT-12A VP-D301 Horrorland Factor PC Studioworks 452V BT500V CT-29K30E Factor PC GCC-4480B 303SI WD10000H1q-00 SGH-P300 44 AF-4 NAD C372 97930 DG45FC DJM-300S DV203AES-XAC Only RX-V490 7250I Walkie Panasonic A101 ART 418 1120 Y TD9368 KDL-40P302H ICN530-smartst FO-51 MC-100 Tahoe Powerlook III SGH-E800 RX-5062S Lavw1039-W Iden I880
manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding
Sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101








1. Multivariable System Identification For Process Control
2. Modeling and Identification of Linear Parameter Varying Systems (Lecture Notes in Control and Information Sciences)
3. System Identification 2003 (IPV IFAC Proceedings Volume)
4. Iterative Identification and Control
5. System Identification: Theory for the User (2nd Edition)
6. Dynamic Modelling of Gas Turbines: Identification, Simulation, Condition Monitoring and Optimal Control (Advances in Industrial Control)
