system identi cation - bridge.t.u-tokyo.ac.jp · state space identi cation system identi cation...

55
Introduction Classification Least Squares Estimation Recursive Least Squares Estimation Weighted Least Squares Discrete-Time Kalman Filter State Space Identification System Identification Satish Nagarajaiah, Prof., CEVE & MEMS, Rice July 16, 2010 Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

Upload: donhi

Post on 04-Jun-2018

229 views

Category:

Documents


1 download

TRANSCRIPT

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

System Identification

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice

July 16, 2010

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Outline I

1 IntroductionDefinitionObjective

2 ClassificationNon-parametric ModelsParametric Models

3 Least Squares Estimation

4 Recursive Least Squares EstimationDerivationStatistical Analysis of the RLS Estimator

5 Weighted Least Squares

6 Discrete-Time Kalman FilterFeatures

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Outline II

Derivations

7 State Space IdentificationWeighting Sequence ModelState-space Observer ModelLinear Difference Model

ARX ModelPulse Response ModelPseudo-Inverse

Physical Interpretation of SVDApproximation ProblemBasic EquationsCondition Number

Eigen Realization Algorithm

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DefinitionObjective

Definition

System identification is the process of developing or improving themathematical representation of a physical system usingexperimental data. There are three types of identificationtechniques: Modal parameter identification andStructural-model parameter identification (primarily used instructural engineering) and Control-model identification(primarily used in mechanical and aerospace systems). The primaryobjective of system identification is to determine the systemmatrices, A, B, C, D from measured/analyzed data often withnoise. The modal parameters are computed from the systemmatrices.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DefinitionObjective

Objective

The main aim of system identification is to determine amathematical model of a physical/dynamic system from observeddata. Six key steps are involved in system identification (1)develop an approximate analytical model of the structure, (2)establish levels of structural dynamic response which are likely tooccur using the analytical model and characteristics of anticipatedexcitation sources, (3) determine the instrumentation requirementsneeded to sense the motion with prescribed accuracy and spatialresolution,(4) perform experiments and record data, (5) applysystem identification techniques to identify the dynamiccharacteristics such as system matrices,modal parameters, andexcitation and input/output noise characteristics, and (6)refine/update the analytical model based on identified results.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Non-parametric ModelsParametric Models

Parameteric and Non-parameteric Models

Parametric Models: Choose the model structure and estimatethe model parameters for best fit.

Non-parametric Models: Model structure is not specified apriori but is instead determined from data. Non parametrictechniques rely on the Cross correlation function (CCF) Ryu /Auto correlation function (ACF) Ruu and Spectral DensityFunctions Syu / Suu (Fourier transform of CCF and ACF) toestimate the transfer function/frequency response function ofthe model

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Non-parametric ModelsParametric Models

Non-parametric Models

Frequency Response Function (FRF)

Y (jω) = H(jω)U(jω)

FRF - Nonparametric

H(jω) =Syu(jω)

Suu(jω)

Impulse Response Function (IRF)

y(t) =

t∫0

h(t − τ)u(τ) dτ

[Note: IRF and FRF form a Fourier Transform Pair]Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Non-parametric ModelsParametric Models

Parametric Models

TF Models (SISO)

Y (s) =bmsm + bm−1sm−1 + · · ·+ b1s + bo

sn + an−1sn−1 + · · ·+ a1s + aoU(s)

In this model structure, we choose m and n and estimateparameters b0, · · · , bm, a0, · · · , an−1.

Time-domain Models (SISO)

dny

dtn+ an−1

dn−1y

dtn−1+ · · ·+ a1

dy

dt+ aoy(t)

= bmdmu

dtm+ bm−1

dm−1u

dtm−1+ · · ·+ b1

du

dt+ bou(t)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Non-parametric ModelsParametric Models

Parametric Models

Discrete Time-domain Models (SISO)

y(k)+a1y(k−1)+· · ·+any(k−n) = b1u(k−1)+· · ·+bmu(k−m)

State Space Models (MIMO)

xn×1 = An×nxn×1 + Bn×mum×1

yr×1 = Cr×nxn×1 + Dr×mum×1

The parameters n, r , m are given and the models parametersA, B, C, D are to be estimated.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Non-parametric ModelsParametric Models

Parametric Models

Transfer Function Matrix Models (MIMO)

Y (s) =

H11 (s) . . . H1m (s)...

. . ....

Hr1 (s) · · · Hrm (s)

U (s)

which can be written as:

Y (s) = H(s)U(s)

=[C(sI− A)−1B + D

]U(s)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Non-parametric ModelsParametric Models

Parametric Models

System identification can be grouped into frequency domainidentification methods and time-domain identificationmethods. We will focus mainly on discrete-time domain modelidentification and state-space identification:

1 Discrete Time-domain Models (SISO)2 State Space Models (MIMO)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Least Squares Estimation

Consider a second-order discrete model of the form,

y(k) + a1y(k − 1) + a2y(k − 2) = a3u(k) + a4u(k − 1)

The objective is to estimate the parameter vectorpT = [a1 a2 a3 a4] using the vector of input and outputmeasurements. Making the substitution,

hT = [−y(k − 1) − y(k − 2) u(k) u(k − 1)]

we can writey(k) = hT p

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Least Squares Estimation

Let us say, we have k sets of measurements. Then, we canwrite the above equation in matrix form as,

y1

y2...

yk

=

h11 h12 · · · h1n

h21. . .

.... . .

hk1 hkn

p1

p2...

pn

yi = hT

i p i = 1, 2, · · · , k (1)

In matrix form, we can write,

y = HT p

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Least Squares Estimation

In least-squares estimation, we minimize the followingperformance index:

J =[y −HT p

]T [y −HT p

]= yT y − yT HT p− pHy + pT HHT p (2)

Minimizing the performance index in eq. 2 with respect to p,

∂J

∂p=

∂p

[yT y − yT HT p− pHy + pT HHT p

]= 0

= −Hy −Hy + 2HHT p = 0

which results in the expression for the parameter estimate as:

p =(

HHT)−1

Hy (3)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DerivationStatistical Analysis of the RLS Estimator

Derivation

Limitations of Least Squares Estimation

The parameter update law in eq. 3 involves operating in a batchmode. For every k + 1th measurement, the matrix inverse(HHT

)−1needs to be re-calculated. This is a cumbersome

operation and it is best if it can be avoided.

In a recursive estimator, there is no need to store all theprevious data to compute the present estimate. Let us use thefollowing simplified notations:

Pk =(

HHT)−1

andBk = Hy

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DerivationStatistical Analysis of the RLS Estimator

Derivation

Hence, the parameter update law in eq. 3 can be written as:

pk = PkBk

In the recursive estimator, the matrices Pk , Bk are updatedas follows:

Bk+1 = Bk + hk+1yk+1 (4)

In order to update Pk , the following update law is used:

Pk+1 = Pk −Pkhk+1hT

k+1Pk

1 + hTk+1Pkhk+1

(5)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DerivationStatistical Analysis of the RLS Estimator

Derivation

Note that the update for matrix Pk+1 does not involve matrixinversion.The updates for Pk , Bk can then be used to update theparameter vector as follows:

pk+1 = Pk+1Bk+1

pk = PkBk (6)

Combining these equations,

pk+1 − pk = Pk+1Bk+1 − PkBk

Substituting eqs. 4 and 5 in the above equationwe get:

pk+1 = pk + Pkhk+1

(1 + hT

k+1Pkhk+1

)−1 (yk+1 − hT

k+1pk

)(7)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DerivationStatistical Analysis of the RLS Estimator

Statistical Analysis

Consider the scalar form of the equation again:

yi = hTi p i = 1, 2, · · · , k

In the presence of measurement noise, it becomes,

yi = hTi p + ni i = 1, 2, · · · , k

With the folowing assumptions1 Average value of the noise is zero, that is, E (ni ) = 0, where E

is the expectation operator.2 Noise samples are uncorrelated, that is

E (ninj) = E (ni )E (nj) = 0, i 6= j3 E (n2

i ) = r , the covariance of noise.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DerivationStatistical Analysis of the RLS Estimator

Statistical Analysis

Recalling eq. 6:pk = PkBk (8)

This can be expanded as:

pk =

[k∑

i=1

hihTi

]−1 k∑i=1

hiyi (9)

Taking E () on both sides, we get,

E (pk) = E (p) = p (10)

This makes the estimator unbiased estimator, that is theexpected value of the estimate is equal to to that of thequantity being estimated.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

DerivationStatistical Analysis of the RLS Estimator

Statistical Analysis

Now, let us look at the covariance of the error,

Cov = E[(pk − pk) (pk − pk)T

](11)

Which upon simplification, we get

Cov = Pk r (12)

It can be shown that Pk decreases as k increases. Hence, asmore measurements become available, the error reduces andconverges to the true value of p. Hence, this is known as aconsistent estimator.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighted Least Squares

Extension of RLS Method

The scalar formulation can be extended to a MIMO(multi-input multi-output) system.

A weighting matrix is introduced to emphasize the relativeimportance of one parameter over the other.

Consider eq. 1. Extending this to the MIMO case andincluding measurement noise,

yi = HTi p + ni , i = 1, 2, · · · , k

where, yi is l × 1, Hi is n × l , p is n × 1 and ni is l × 1.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighted Least Squares

The performance index,J is defined by,

J =k∑

i=1

(yi −HT

i p)T (

yi −HTi p)

Minimizing J with respect to p, we get,

p =

(k∑

i=1

HiHTi

)−1 k∑i=1

Hiyi

The above equation is a batch estimator. The recursive LS estimator canbe calculated by proceeding the same way as was done for the scalar case.Defining,

Pk =

(k∑

i=1

HiHTi

)−1

Bk =k∑

i=1

Hiyi (13)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighted Least Squares

The parameter update rule is given by,

pk+1 = pk + PkHk+1

(yk+1 −HT

k+1pk

)Now, if we introduce a weighting matrix, W into theperformance index, we get

J =k∑

i=1

(yi −HT

i p)T

W(

yi −HTi p)

(14)

The minimization of eq. 14 leads to

p =

(k∑

i=1

HiWHTi

)−1 k∑i=1

HiWyi

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighted Least Squares

Once again, defining

Pk =

(k∑

i=1

HiWHTi

)−1

Bk =k∑

i=1

HiWyi (15)

the recursive relationships are given by,

pk+1 = pk + Pk+1Hk+1W(

yk+1 −HTk+1pk

)(16)

and

Pk+1 = Pk − PkHk+1

[W−1 + HT

k+1PkHk+1

]−1HT

k+1Pk (17)

Assuming that the noise samples are uncorrelated, or,

E{[

ninTi

]}=

{0 i 6= jR i = j

It can be shown that by choosing W = R−1 produces the minimumcovariance estimator. In other words, the estimation error is the minimum.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

FeaturesDerivations

Discrete-Time Kalman Filter

Kalman Filter is the most widely used state estimation toolused for control and identification.

LS, RLS, WLS deals with the estimation of system parameters

Kalman filter deals with the estimation of states for adynamical system.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

FeaturesDerivations

Discrete-Time Kalman Filter

Consider the linear discrete-system given by,

xk = Axk−1 + Gwk−1

yk = HT xk + nk

Note : The parameter vector p is replaced by x, consistent with theterminology we have adopted for representing states.wk is a n × 1, is noise measurements with E() = 0 and COV () = Qxk is the n × 1 state vectorA is the state matrix assumed to be knownnk is a l × 1 vector of output noise with E() = 0 and COV () = Ryk is l × 1 vector of measurementsG is n × n, H is l × n and they are assumed to be known

The objective is to estimate the states, xk based on k observations ofy. A Recursive filter is used for this purpose. This recursive filter iscalled Kalman filter.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

FeaturesDerivations

Fundamental difference between the WLS for Dynamicalcase and Non-dynamic case

Non-dynamic case, at time tk−1, an estimate xk−1 needs to beproduced and the covariance estimate xk−1 needs to be updated.These quantities do not change between tk−1 and tk because,xk−1 = xk .In the dynamic case, xk−1 6= xk , since the state evolves between thetime-steps k − 1 and k . That means a prediction is needed of whathappens to these state estimates and the covariance estimatesbetween measurements.Recall the WLS estimator in eq. 16 and eq. 17

xk = xk−1 + PkHkW(

yk −HTk xk−1

)Pk = Pk−1 − Pk−1Hk

[W−1 + HT

k Pk−1Hk

]−1HT

k Pk−1

In this estimator we cannot replace xk−1 with xk−1|k−1 as xk ischanging between tk−1 and tk . The same applies to Pk−1.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

FeaturesDerivations

Discrete-Time Kalman Filter

Consider the state estimate equation. If we know the stateestimate based on k − 1 measurements, xk−1|k−1 and thestate matrix, A, then, we can predict the quantity xk|k−1

using the relationship,

xk|k−1 = Axk−1|k−1

We can write the state estimate equation as,

xk|k = xk|k−1 + Pk|kHR−1(

yk −HT xk|k−1

)(18)

The above equation assumes that the weighting matrix,W = R−1.Similarly, it can be shown that the covariance estimate is,

Pk|k = Pk|k−1 − Pk|k−1H[R + HT Pk|k−1H

]−1HT Pk|k−1

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

FeaturesDerivations

Discrete-Time Kalman Filter

Note that the matrix, H is constant. The quantity Pk|k−1 canbe calculated as,

Pk|k−1 = E([xk − xk|k−1][xk − xk|k−1]T

)= APk−1|k−1AT + GQGT

In summary, the following steps are for the discrete-timeKalman filter:

1 Prediction:Pk|k−1 = APk−1|k−1AT + GQGT

2 Prediction: xk|k−1 = Axk−1|k−13 Covariance Estimate:Pk|k =

Pk|k−1 − Pk|k−1H[R + HT Pk|k−1H

]−1HT Pk|k−1

4 State Estimate: xk|k = xk|k−1 + Pk|kHR−1(yk −HT xk|k−1

)Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

FeaturesDerivations

Discrete-Time Kalman Filter

If input is present, such that the equations are of the form,

xk = Axk−1 + Buk−1Gwk−1

yk = HT xk + nk

Then, the state estimation becomes,

xk|k = xk|k−1 + Buk−1 + Pk|kHR−1(

yk −HT xk|k−1

)Note: Do not confuse the input matrix, B with Bk !

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

State Space Identification

The objective is to identify the state matrices, A,B and C.

The general state-space description for a dynamical system isgiven by:

x(t) = Acx(t) + Bcu(t)

y(t) = Cx(t) + Du(t) (19)

for a system of order n, r inputs and q outputs.

The discrete representation of the same system is given by:

x(k + 1) = Ax(k) + Bu(k)

y(k) = Cx(k) + Du(k) (20)

Note the distinction in the state matrices between thecontinuous and discrete versions!

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Weighting Sequence Model

Representing output as a weighted sequence of inputsStart from the initial conditions, x(0):

x(0) = 0; y(0) = Cx(0) + Du(0)

x(1) = Ax(0) + Bu(0); y(1) = Cx(1) + Du(1)

x(2) = Ax(1) + Bu(1); y(2) = Cx(2) + Du(2)

If x(0) is zero, or, k is sufficiently large, Ak ≈ 0 (stablesystem with damping). Hence,

y(k) = CBu(k − 1) + · · ·+ CAk−1Bu(·) + Du(k)(21)

y(k) =k∑

i=1

CAi−1Bu(k − i) + Du(k) (22)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Weighting Sequence Model

Eq. 22 is known as the weighting-sequence model it does notinvolve any state measurements, and depends only on inputs.

The output y(k) is a weighted sum of input valuesu(0), u(1), u(k)

Weights CB, CAB, CA2B, · · · are called Markov parameters.

Markov parameters are invariant to state transformations

Since, the Markov parameters are the pulse responses of thesystem, they must be unique for a given system.

Note that the input-output description in eq. 22 is valid onlyunder zero initial conditions (steady-state). It is not applicableif the transient effects are present in the system.

In this model, there is no need to consider the exact nature ofthe state equations.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

State-space Observer Model

If the system is asymptotically stable, then there are only afinite number of steps in the weighting sequence model.

However, for lightly damped systems, the number of terms inthe weighting sequence model can be too large.

Under these conditions, the state-space observer model isadvantageous.

Consider the state space model:

x(k + 1) = Ax(k) + Bu(k)

y(k) = Cx(k) + Du(k)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

State-space Observer Model

Add and subtract the term Gy(k) to the state equation:

x(k + 1) = Ax(k) + Bu(k) + Gy(k)− Gy(k)

y(k) = Cx(k) + Du(k)

x(k + 1) = Ax(k) + Bv(k)

y(k) = Cx(k) + Du(k)

where,A = A + GC

B = [B + GD − G]

and

v(k) =

[u(k)y(k)

]Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

State-space Observer Model

Continuing from the previous method, objective is to find Gso that A + GC is asymptotically stable.

The weighting-sequence model in terms of the ObserverMarkov parameters (from eq. 22) is:

y(k) =k∑

i=1

CAi−1

Bv(k − i) + Du(k) (23)

where, CAk−1

B are known as the observer Markovparameters. If G is chosen appropriately, then Ap = 0 forfinite p.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model

Eq. 23 can be written as (proceeding the same way as donefor the weighting-sequence description):

y(k) =k∑

i=1

CAi−1 (B + GD) u(k−i)−k∑

i=1

CAi−1Gy(k−i)+Du(k)

which can written as:

y(k) +k∑

i=1

Y(2)i y(k − i) =

k∑i=1

Y(1)i u(k − i) + Du(k) (24)

where Y(1)i =

k∑i=1

CAi−1 (B + GD) and Y(2)i =

k∑i=1

CAi−1G

Eq. 24 is commonly referred to as ARX (AutoRegressive witheXogeneous part) model.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model

Models discussed so far (weighting sequence, ARX, etc.) arerelated in terms of the system matrices, A,B,C and D.If these matrices are known, all the models can be deriveddescribing the IO relationships.The system Markov parameters and the observer markovparameters play an important role in system identificationusing IO descriptions.Starting from the initial conditions, x(0) we get :

x(l − 1) =l−1∑i=1

Ai−1Bu(l − 1− i)

y(l − 1) =l−1∑i=1

CAi−1Bu(l − 1− i) + Du(l − 1)Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model

which can be written as,[y(0) y(1) . . . y(l − 1)

]=

[D CB . . . CAl−2B

]

×

u(0) u(1) u(2) . . . u(l − 1)

u(0) u(1) . . . u(l − 2)u(0) . . . u(l − 3)

. . ....

u(0)

In compact form,

Yq×l = Pq×rlVrl×l (25)

Hence,P = YV + (26)

where V + is called the pseudo-inverse of the matrix. The matrix,V becomes square in case if single-input system. ARX modelscan be expressed in this form.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model: ARX Model

Consider the ARX model given in eq. 24. This can be written in aslightly modified form as:

y(k)+α1y(k−1)+· · ·+αpy(k−p) = β0u(k)+β1u(k−1)+· · ·+βpu(k−p)(27)

where, p indicates the model order. This can be arranged as:

y(k) = −α1y(k−1)−· · ·−αpy(k−p)+β0u(k)+β1u(k−1)+· · ·+βpu(k−p)(28)

which means that the output at any step k, y(k) can be expressed interms of p previous output and input measurements, i.e.,y(k − 1), · · · , y(k − p) and u(k − 1), · · · , u(k − p).

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model: ARX Model

Let us define a vector v(k) as,

v(k) =

[y(k)u(k)

], k = 1, 2, · · · , l

where, l is the length of the data. Eq. 28 can be written as,

[y0 y ] = θ [V0 V ] (29)

where,y0 = [y(1) y(2) · · · y(p)]

y = [y(p + 1) y(p + 2) · · · y(l)]

θ = [β0 (−α1 β1) · · · (−αp−1 βp−1) (−αp βp)]

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model: ARX Model

V0 =

u(1) u(2) · · · u(p)v(0) v(1) v(p − 1)

......

. . ....

v(2− p) v(3− p) · · · v(1)v(1− p) v(2− p) · · · v(0)

V =

u(p + 1) u(p + 2) · · · u(l)

v(p) v(p + 1) v(l − 1)...

.... . .

...v(2) v(3) · · · v(l − p + 1)v(1) v(2) · · · v(l − p)

The parameters can then be solved as:

θ = [y0 y ] [V0 V ]+ (30)

If the system does not start from rest, the quantities y0 and V0 areusually unknown. In which case, the parameters are calculated as:

θ = yV + (31)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model: Pulse Response Model

Given,

y(k) = Du(k) + CBu(k − 1) + CABu(k − 2) + · · ·+ CAp−1BU(k − p)(32)

Find, D,CB,CAB, · · · ,CAp−1B using,[y(k) y(k + 1) . . . y(k + l − 1)

]

=[

D CB . . . CAp−1B]

u(k) u(k + 1) · · · u(k + l − 1)u(k − 1) u(k) u(k + l − 2)u(k − 2) u(k − 1) u(k + l − 3)

......

...u(k − p) u(k − p + 1) u(k + l − 1− p)

In compact form,

Yq×l = Pq×r(p+1)Vr(p+1)×l (33)

q:output, r :input and l :length of data.Hence,

P = YV + (34)

In Matlab, you can compute the pseudo-inverse through thecommand: pinv(V)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Linear Difference Model: Pseudo-Inverse

Say, Am×nXn×1 = bm×1 ⇒ X = A+b, m equations in nunknowns.It has a unique (consistent) solution if:Rank[A,b] = Rank(A) = nIt has infinite(fewer linear independent equations thanunknowns) number of solutions if: Rank[A,b] = Rank(A) < nIt has no solutions(inconsistent) if: Rank[A,b] > Rank(A)Note that [A,b] is an augmented matrix.Rank is the number of linearly independent columns or rows.Due to the presence of noise, system identification mostlyproduces a set of inconsistent equations. These can be dealtwith what is known as the Singular Value Decomposition(SVD).

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Physical Interpretation of SVD: Approximation Problem

Let A ∈ <n×m, where n ≤ m and rank(A) = n. Then, find amatrix X ∈ <n×m with rank(X) = k < n such that ‖A− X‖2

is minimized (minimize σ1), ‖A− X‖2 ≥ σk+1(A) andrank(X) = k.

SVD addresses the question of rank and handles non-squarematrices automatically.

1 If the system has an unique solution, SVD provides this uniquesolution

2 For infinite solutions, SVD provides the solution with minimumnorm

3 When there is no solution, SVD provides a solution whichminimizes the error

Items 2 and 3 are called Least Squares Solutions

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Physical Interpretation of SVD: Basic Equations

if A is a m × n, then there exists two ortho-normal matricesU (m ×m and V (n × n such that

Am×n = Um×mΣm×nVTn×n (35)

where, Σ is a matrix with the same dimension as A, butdiagonal.

The scalar values, σi are the singular values of A withσ1 ≥ σ2 ≥ σ3 ≥ · · ·σk > 0 and σk+1 = σk+2 = · · · = 0

Example

Example: Let σ = [1, 0.3, 0.1, 0.0001, 10−12, 0, 0]

Then, strong rank=3, weak rank=4, very weak rank=5.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Physical Interpretation of SVD: Basic Equations

The nonzero singular values are unique, but U and V are not.U and V are square matrices.The columns of U are called the left singular vectors and thecolumns of V are called the right singular vectors of A.Since, U and V are orthonormal matrices, they obey therelationship,

UT U = Im×m = U−1U

VT V = In×n = V−1V (36)

From eq. 35, if A = UΣVT then,

Σ = UT AV

Σm×n =

[Σk×k 0k×n−k

0m−k×k 0m−k×n−k

]Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Physical Interpretation of SVD: Basic Equations

SVD is closely related to the eigen-solution in case ofsymmetric positive-definite matrices AAT and AT A.

A = UΣVT ⇒ AT = VΣT UT

Hence, the non-zero singular values of A are the positivesquare roots of the non-zero eigenvalues of AT A or AAT .The columns of U are the eigenvectors corresponding to theeigenvalues of AAT andThe columns of V are the eigenvectors corresponding to theeigenvalues of AT A.If A consists of complex elements, then the transpose isreplaced by complex-conjugate transpose.Definitions of condition number and rank are closely relatedto the singular values.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Physical Interpretation of SVD: Condition Number

Rank: The rank of a matrix is equal to the number ofnon-zero singular values. This is the most reliable method ofrank determination. Typically, a rank tolerance equal to thesquare of machine precision is chosen and the singular valuesabove it are counted to determine the rank.In order to calculate the Pseudo-inverse of matrix A, denotedby A+ using SVD,

A+ = V1Σ−1UT1 = V1diag [σ−1

1 , σ−12 , · · · , σ−1

k ]UT1 (37)

where,

A = UΣVT =

[U1

... U2

] [Σ1 00 0

] VT1

· · ·VT

2

and

A = U1Σ1VT1

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Eigen Realization Algorithm

Given the pulse-response histories (system Markov parameters),ERA is used to extract the state-space model of the system.

Define the Markov parameters as follows:

Y0 = D = β0

Y1 = CB = β(1)0

Y2 = CAB = β(2)0

Y3 = CA2B = β(3)0

...

Yk = CAk−1B = β(k)0 (38)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Eigen Realization Algorithm

Start with a generalized αm × βr Hankel matrix (m outputsand r inputs and α, β are integers)

H(k − 1) =

Yk Yk+1 · · · Yk+β−1

Yk+1 Yk+2 · · · Yk+β...

.... . .

...Yk+α−1 Yk+α · · · Yk+α+β−2

For the case when k = 1,

H(0) =

Y1 Y2 · · · YβY2 Y3 · · · Y1+β...

.... . .

...Yα Y1+α · · · Yα+β−1

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Eigen Realization Algorithm

If α ≥ n and β ≥ n, the matrix H(k − 1) is of rank n.Substituting the Markov parameters from eq. 38 intoH(k − 1), we can factorize the Hankel matrix as:

H(k − 1) = PαAk−1Qβ (39)

ERA starts with the SVD of the Hankel matrix

H(0) = RΣST (40)

where the columns of R and S are orthonormal and Σ is,

Σ =

[Σn 00 0

]in which 0’s are zero matrices of appropriate dimensions, andΣn = diag [σ1, σ2, · · · , σi , σi+1, · · · , σn] andσ1 ≥ σ2 ≥ · · · ≥ σi ≥ σn ≥ 0.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Eigen Realization Algorithm

Let Rn and Sn be the matrices formed by the first n columnsof R and S respectively. Then,

H(0) = RnΣnSTn = [RnΣ

1/2n ][Σ

1/2n ST

n ] (41)

and the following relationships hold: RTn Rn = ST

n Sn = InNow, examining, eq. 39 for k = 1, that is,

H(0) = PαQβ (42)

Equating eq. 42 and eq. 41, we get,

Pα = RnΣ1/2n

Qβ = Σ1/2n ST

n (43)

That means, B = the first r columns of Qβ, and C = the firstm rows of Pα and D = Y0.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Eigen Realization Algorithm

In order to determine the state matrix, A, we start with,

H(1) =

Y2 Y3 · · · Yβ+1

Y3 Y4 · · · Y2+β...

.... . .

...Yα+1 Y2+α · · · Yα+β

From eq. 38, we can then see that H(1) canbe factorizedusing SVD as:

H(1) = PαAQβ= RnΣ

1/2n AΣ

1/2n ST

n (44)

from whichA = Σ

−1/2n RT

n H(1)SnΣ−1/2n (45)

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification

IntroductionClassification

Least Squares EstimationRecursive Least Squares Estimation

Weighted Least SquaresDiscrete-Time Kalman Filter

State Space Identification

Weighting Sequence ModelState-space Observer ModelLinear Difference ModelPhysical Interpretation of SVDEigen Realization Algorithm

Acknowledgements

The materials presented in this short course are a condensedversion of lecture notes of a course taught at Rice University

References

1. Jer-Nan Juang, Applied System Identification, Prentice Hall.2. Jer-Nan Juang and M. Q. Phan, Identification and control ofmechanical systems, Cambridge Press.3. DeRusso et al., State variables for engineers, Wiley Interscience.

Satish Nagarajaiah, Prof., CEVE & MEMS, Rice System Identification