A TWO-STAGE METHOD FOR IDENTIFICATION

FROM

A Thesis Presented to

The Faculty of the

Fritz J. and Dolores H. Russ College of Engineering and Technology

Ohio University

In Partial Fulfillment

of the Requirements for the Degree

Master of Science

by

Kenneth Allan Nadsady

March, 1998 Acknowledgements

I would like to thank Dr. Dennis Irwin, my thesis advisor, for his inspiration, guidance, and occasional but caring sternness without which I would have never completed this thesis. I would also like to thank the rest of my Professors at Ohio

University, especially Dr. Jerrell Mitchell, Dr. Doug Lawrence, Dr. Larry Snyder, and Dr. Brian Manhire for their help and support throughout my academic experience in Athens.

Special thanks go to Denise Ragan and Janelle Baney for the fantastic job they do helping graduate students with the mundane things. Their cheerful attitude and ability to make me laugh during tense times helped tremendously.

I would also like to thank my graduate student pals, especially Kramer, Eddie

T., Dave Burge, Mark Duncan, and John Shramko. Their success in obtaining the

Master of Science Degree helped me to see the light at the end of the tunnel.

I am deeply indebted to Paul and Beth Stocker, for providing the funding that supported me in my graduate studies.

Lastly, I wish to thank my family for all their love and support throughout my educational career. I can only hope that I will be able to use the knowledge and experience I have gained to help each of them in some way.

I dedicate my graduate work in loving memory of my Grandfather, Joe Case. ii

Table of Contents

Acknowledgements .

Table of Contents . ii

List of Figures ...... iii

Chapter 1: Introduction ...... 1 1.1. Motivation for This Thesis ...... 1 1.2. Thesis Conventions and Organization ...... 2

Chapter 2: Two-Stage Identification Algorithm ...... 5 2.1. Finding a Valid State Vector Sequence...... 5 2. 1.1. Improving Computational 17 2.2. Finding the System Matrices ...... 20

Chapter 3: Application of Spectral Estimation to the Time Series . 22 3.1. Computing Response via Spectral Estimation 22 3.2. Incorporating Averaging for Noise Rejection . 24

Chapter 4: Application to a Constructed Example ...... 26 4. 1. Description of the Example System ...... 26 4.2. ...... 29 4.3. Results from Example System ...... 31

Chapter 5: Application to a Real Sampled-Data System 36 5.1. ACES System Description 36 5.2. ACES Data Description...... 37 5.3. Results from ACES Sampled Data 39

Chapter 6: Conclusions and Recommendations ...... 47

Bibliography 50

Appendices 52 iii

List of Figures

Figure (4.1): Hankel Matrix Singular Values...... 32 WT Figure (4.2): Model vs. Experimental Frequency Response, H11(d ). •••••• 33 Figure (4.3): Model vs. Experimental Frequency Response, H12(~wT). .•...• 33 WT Figure (4.4): Model vs. Experimental Frequency Response, H21(i ). •••••• 34 WT Figure (4.5): Model vs. Experimental Frequency Response, H22(d ). •••••• 34 Figure (4.6): Model Frequency Response Relative Error...... 35 Figure (5.1): Marshall Space Flight Center Large Space Structure Ground Test Facility (ACES Configuration). 37 Figure (5.2): ACES Hankel Matrix Singular Values. 41 Figure (5.3): BGx/AGSx pair 56th Order Model vs. Experimental Frequency Response...... 43 Figure (5.4): BGy/AGSx pair 56th Order Model vs. Experimental Frequency Response. 44 Figure (5.5): BGx/AGSy pair 56th Order Model vs. Experimental Frequency Response...... 45 Figure (5.6): BGy/AGSy pair 56th Order Model vs. Experimental Frequency Response...... 46 1 Chapter 1: Introduction

As technology advances, physical with which scientists and engineers

must deal become increasingly sophisticated. At the same time present economic

conditions result in the demand for higher productivity and performance. For these

reasons and others, the need for accurate models based on measured observations

from the systems is increasing. Models may be used to shorten product development

time, decrease development cost, or otherwise provide a of testing or analysis

in a convenient, nondestructive way. In fact, a major part of the engineering field deals with how to·produce good designs based on mathematical models (Ljung, 1987).

System identification deals with the problem of building mathematical models of dynamical systems based on observed data from the systems.

Flexible mechanical structures can be particularly difficult to model, especially in cases where the structure is itself constructed from many smaller flexible members.

This work focuses on the investigation of a two-stage system identification technique and how well this technique performs when applied to systems that exhibit the lightly­ damped modal behavior that is characteristic of flexible structures.

1.1. Motivation for This Thesis

The purpose of this thesis and the research upon which it is based is to aid in the development and testing of tools that may be used to compute mathematical models of dynamical systems. In particular, the need for accurate mathematical 2 modeling tools for linear, time-invariant systems with lightly-damped modes is

addressed. The fundamental theorems and relationships contained in this thesis come

from the work of Moonen, et. ale (1989).

The primary advantage of this technique is that it computes explicitly a state­ space realization directly from time-domain data. Other algorithms often require an intermediate calculation step and cannot use time-domain data directly. For example, the Eigenvalue Realization Algorithm (ERA) requires the pulse response of the system as input. If the pulse response is not available, as is often the case, it must be calculated from the time .or data. The required pulse response is usually obtained by first applying spectral estimation techniques to the time-domain data to get the frequency response, and then applying inverse Fourier transforms to the frequency domain data (Medina, p42).

1.2. Thesis Conventions and Organization

Most of the computations were performed and all of the graphs were generated using the numeric computation and graphics software package, MATLAB®, from The

Math Works, Incorporated. MATLAB combines a large library of built-in functions with external libraries of script-files and script-functions (called m-files and m­ functions, respectively) that are compiled at run-time, resulting in a flexible software package that well serves the type of computations required in this research.

Matrix, vector, and scalar quantities are not distinguishable by notation but by the context in which they appear. However, submatrices are denoted with the colon 3 notation used by Golub and Van Loan (1989) and the MATLAB User's guide (1992).

All MATLAB built-in commands and external m-files and m-functions are capitalized when referred to by name in the text, but when a command is given as entered on the command line it is lower case bold script.

Discrete-time signals can be represented as sequences of numbers (or possibly sequences of vectors). For example a sequence of numbers x, in which the nth number in the sequence is denoted x[n], can be formally defmed as x = {x[n]}, n =

1,2, ... ,00. However, for convenience either x or x[n] will be used when referring to the entire sequence. The context should guide the reader to the proper interpretation.

In general, the first element of a sequence need not be associated with the index n =

1, since by a change of variables another .index m can be found such that this is so.

For example if x = {x[n]}, n = a,a+l, ... ,oo, then X = {x[m]}, m = 1,2, ... 00, ifm

= n-a+ 1. Often, such sequences arise from periodic of an analog signal, say xa(t), - 00 < t < 00. In this case, the numeric value of the nth number in the sequence is equal to the value of the analog signal at time nT where T is the sampling interval. For example, x[n] = xa(nT), - 00 < n < 00.

Chapter 1 of this thesis is this introductory chapter. Chapter 2 introduces an algorithm that approaches the system identification problem in two stages. In the first stage, a sequence is found that represents consecutive state-space vectors corresponding to the consecutive input and output vectors observed from the system.

The state vector sequence found is consistent with the input and output vector 4 sequences. The second stage involves computing a state-space realization of the system from the state and I/O vector sequences. Chapter 3 discusses spectral estimation as a means to experimentally generate a model for comparison and/or validation purposes. The algorithm is applied to an ideal sampled-data system in

Chapter 4. Application of the method to an actual sampled-data system appears in

Chapter 5. Finally, Chapter 6 draws some conclusions concerning the method and gives some ideas for future work. 5 Chapter 2: Two-Stage Identification Algorithm

It is desired to find a state-space realization (A,B,C,D) for the discrete, linear, time-invariant, multi-input, multi-output (MIMO) system described by the following difference equations, shown in matrix form:

x[k + 1] = Ax[k] + Bu[k] (2.1) y[k] = Cx[k] + Du[k]

where x E lRnx1, y E WX1, U E Rmxl, A E Rnxn, B E Rnxm, C E W xn, and D E wxm.

Only a finite record of the input and output data sequences are known. For example, u[k] and y[k] are known for k=O, 1,... ,N. The identification algorithm contains two basic steps. First a valid state-vector sequence is found as a basis for the intersection of the row spaces of two block Hankel matrices, constructed with the input/output I/O time series data. Next the system matrices are found as the least-squares solution to a set of linear equations, formed from the manipulation of the state-vector sequence found in the first step and partitions of the I/O data-containing block Hankel matrices.

Note that the inputs to the algorithm are input and output data. The pulse response of the system is not used as input nor is it required to be calculated in an intermediate step.

2.1. Finding a Valid State Vector Sequence

Three theorems will be needed to show how a valid state vector sequence may be constructed using an I/O time history only. The proofs of these theorems from 6

Moonen, et. ale (1989), are fundamental to the understanding of this derivation and so

are included here, with some gaps filled in by the author. Theorem 2.1 introduces

some of the matrix structures needed for the determination of a state vector sequence,

as well as the primary relationship (2.2) upon which the two-stage algorithm depends.

Theorem 2.1. Given the linear discrete-time multivariable time-invariant system

shown in Equation (2.1), the following general structured I/O equation holds:

(2.2)

Yh1 is a block Hankel matrix (i block rows, j columns) constructed with consecutive output vectors (p x 1 column vectors, corresponding to the p outputs):

y[k] y[k+l] . y[k+j -1]

y[k + 1] y[k+2] . y[k +Jl

y[k+i-l] y[k+i] ... y[k+i+j-2]

Uh1 is a block Hankel matrix constructed with consecutive input vectors (m x 1 column vectors, corresponding to the m inputs):

u[k] u[k+l] . u[k + j -1]

u[k + 1] u[k +2] . u[k +Jl

u[k+i -1] u[k+ll ... u[k+j «i -2]

H, is a matrix containing the Markov of the system (i block rows, i block columns): 7

D 0 0 ... 0 CB D 0 ... 0 CAB CB D ... Ht = 0

CAi-2B CAi-3B CAi-4B ... D

Xl is a matrix of consecutive state vectors (n rows, j columns):

Xl = [x[k] x[k+l] x[k+2] ... x[k+j-l]].

Finally, I', is an extended observability test matrix (i block rows, n columns):

(2.3)

Proof: By repeated application and substitution of Equation (2.1), expressed in matrix form, in the following manner. First find the entries in the first column of

Equation (2.2):

y[k] = Cx[k] + Du[k]

y[k + 1] = Cx[k + 1] + Du[k + 1] = C(Ax[k] + Bu[k]) + Du[k + 1] = CAx[k] + CBu[k] + Du[k + 1]

y[k +2] = CAx[k + 1] + CBu[k + 1] + Du[k +2] = CA(Ax[k] + Bu[k]) + CBu[k + 1] + Du[k + 2] = CA2x[k] + CABu[k] + CBu[k+l] + Du[k+2]

y[k+3] = CA2x[k+l] + CABu[k+l] + CBu[k+2] + Du[k+3] = CA2(Ax[k] + Bu[k]) + CABu[k + 1] + CBu[k +2] + Du[k + 3] = CA3x[k] + CA2Bu[k] + CABu[k+l] + CBu[k+2] + Du[k+3]

y[k+i-l] = CAi-1X[k] + CAi-2Bu[k] + CAi-3Bu[k+l] + ... + CBu[k+i-2] + Du[k+i-l] 8 Next find the entries in column two of Equation (2.2). Note the substitutions are made to yield entries that are expressed in terms of the state vector with a single index, i.e. x[k+ 1]:

y[k + 1] = Cx[k + 1] + Du[k + 1]

y[k+2] = CAx[k+l] + CBu[k+l] + Du[k+2]

y[k + 3] = CA2x[k + 1] + CABu[k + 1] + CBu[k + 2] + Du[k + 3]

i 1X[k+l] i 2Bu[k+l] i 3Bu[k+2] y[k+i] = CA - + CA - + CA - + ...

+ CBu[k+i-l] + Du[k+ll

Repeat the application and substitution of Equation (2.1) to obtain the rest of the columns to form matrix Equation (2.2). Each column requires the entries be solved in terms of a different state vector index, i.e. the first column contains state vector terms of only x[k] , the second column only x[k+l], etc. Finally, just express the resulting equations in matrix form as defined above. II

It is assumed that the state-space realization produced during the identification process is completely observable, since the unobservable part of a system cannot be identified from input-output data. It is also assumed that i > n, where n is the order of the realization that will be identified. Therefore the observability test matrix I', defined in Equation (2.3) is assumed to have full column rank. The next theorem introduces a means for estimating the system order. 9

Theorem 2.2. Let Yh1, Uh1, and Xl be defined as in Theorem 2.1 and let HI denote the concatenation of Yh1 and Uhl:

Then if: i) rank(X1) = n, and ii) spanrow(Xt ) nspanrow(Uhl) = 0, the following rank property holds:

(2.4) where n is the order of a minimal realization of the system. Furthermore, if: iii) rank(Uh1) = mi = the number of rows in Uh1, the rank property reduces to:

rank(H1) = mi + n (2.5)

Proof: Let Uhll. be the matrix whose columns span the kernel of Uh1. Then from

Equation (2.2),

YhlUh~ Uh~ HtUhlUh~ = fiXl + = fiXIUh~' and so

Since, for i ~ n > the observability index, I', is observable, it has full column rank, and 10

Uh~) Uh~) Uh~) rank(riXl = rank(Xl - dim[spancol(Xl n(spanrow(ri».l] U~) Uh~) = rank(Xl - dim(spancol(Xl n0) Uh~)' = rank(Xl

Now from condition (ii),

Uh~) (spanCOl(Uh~».l] rank(Xl = rank(X1) - dim[spanrow(X1) n = rank(X1) - dim[spanrow(X1) nspanrow(Uhl)] = rank(X1)·

Finally, by a series of equality statements,

II

Condition i) will be met if all the system modes are sufficiently excited. This will be the case if the inputs are persistently exciting of order n, where n is the system order (Moonen, et. al.). Persistently exciting inputs will also ensure condition iii).

In general this means that the input must be such that the data sequences contain enough information to make identification possible. The selection of normally distributed white noise signals for the inputs generally meets this requirement. For

MIMO systems, the inputs should be component-wise uncorrelated. Theorem 2.3 identifies an important geometric relationship between a candidate state vector sequence and block Hankel matrices formed from I/O data.

Theorem 2.3. Let Yh1 and Uh1 be as defined in Theorem 2.1. Let Yh2 and Uh2 be defined by: 11

y[k + i] y[k + i + 1] ... y[k + i +j -1] y[k+i+l] y[k+i +2] ... y[k -i +11 = Yh2

y[k+2i-l] y[k +2i] ... y[k + 2i +j - 2]

and

u[k + i] u[k+i + 1] ... u[k+i +j -I] u[k+i+l] u[k+i +2] ... u[k+i +11 Uh2

u[k+2i-l] u[k +211 ... u[k + 2i +j - 2]

Note the entries in Yh2 and Uh2 are time-shifted (by i) sequences of the corresponding

entries in Yh1 and Uhl , respectively. If Xl is as defined previously and if X2 is defined as

Xz = [x[k+ll x[k+i+l] ... x[k+i+j-l]], then both sets of matrices satisfy the I/O equation:

(2.6)

Let HI and H2 be the concatenation of Yh1, Uh1 and Yh2 , Uh2 , respectively:

Then

(2.7) 12

Thus any basis for the above intersection is also a valid state vector sequence X2 with the basis vectors as the consecutive row vectors.

Proof: It will be sufficient to show first that the dimension of the intersection equals

n, the minimal system order, and second that the row space of X2 is contained within both row spaces. By the rank property (2.5),

dim(spanrow(H1» = dim(spanrow(HZ» = mi + n.

This rank property holds equally well for the concatenation of HI and Hz:

since H as defined here differs only in the choice of i. Recall that the entries in Hz are time-shifted (by i) sequences of the entries of HI, and so the concatenation H is really an extension of HI with twice as many rows. If i' is the index corresponding to the concatenation H, and i is the index corresponding to HI' then i'= 2i. Thus from

Equation (2.5),

rank(H) = mil + n

= m(2i) + n (2.8)

= 2mi + n.

It is more convenient to speak in terms of row spaces, so Equation (2.8) can be equivalently expressed as:

dim(spanrow(H») = 2mi + n. (2.9) 13

Note that since the rows of HI and Hz are concatenated to form the rows of H,

(2.10) where the + operator denotes the subspace sum (defined in Appendix B) and it follows that

dim(spanrow(H) = dim(spanrow(H + spanrow(H2» I) (2.11) = 2mi + n.

Applying a theorem adapted from Bretscher (1997, see Appendix B for proof), and using Equation (2. 11):

dim(spanrow(Ht) nspanrow(H2» = dim(spanrow(Ht» + dim(spanrow(H2»

- dim(spanrow(Ht) + spanrow(H2) )

= mi + n + mi + n - (2mi + n)

= n.

Having proven that the intersection has dimension n, next consider from

Equation (2.6):

=[r;-r;Ht ] [~::]

= [r; - ttn, ] H2•

where I'," is the left pseudo-inverse of I', (i.e. ri+ri = In). Recall from Section 2.1 that the observability test matrix I', is assumed to have full column rank and so the left pseudo-inverse exists. This shows that the row space of X2 lies within the row 14

space of H 2• Similarly, the row space of Xl lies within the row space of HI. Next,

X2 may be expressed as

Thus the row space of X2 lies within the subspace sum of the row spaces of Xl and

Uh1 ' and since each of these row spaces lies within the row space of HI' then by a series of containments so does X2 • _

The Singular Value Decomposition (SVD) can be used to compute a basis for

the intersection of the row spaces of HI and H2 in the following way. Let the SVD of

Hbe

H = usvr. (2.12) where VI' is the transpose of V, i.e. lfiij = "}i for i, j. The SVD factorization produces orthogonal matrices U and V, and a diagonal matrix S (Golub, 71). From

Equation (2.8) the rank of H equals 2mi + n. The matrix factors in Equation (2.12) may be partitioned accordingly to give

(2.13)

where the partitions have the following dimensions (Note dim here refers to the number of rows and columns, respectively, in each matrix). 15

) = dim(Ull (mi +pi) x (2mi +n)

) = + dim(U12 tmi pi) x (2pi - n)

) dim(U21 = (mi +pi) x (2mi +n)

) dim(U22 = tmi -pi) x (2pi -n)

dim(Sll) = (2mi + n) x (2mi + n)

From Equation (2.12), since U is orthogonal,

U'H = svr, which gives, from Equation (2.13),

or

(2.14)

TH From Equation (2.14) the row space of U12 l lies within the row spaces of HI and H2 and so lies within the intersection. The SVD can be used to find a basis for

TH U12 I and thus, by Theorem 2.3, a valid state vector sequence. The following theorem (Moonen, et. al., 1989) can be used to compute an equivalent basis using a smaller SVD.

Theorem 2.4. Let the SVD of H be as given in Equation (2.13). Then the state vector sequence X2 = [X[k+l] x[k+i+l] ... X[k+i+j-l]] can be calculated as

(2.15)

T where U q is an n x (2pi-n) matrix defined through the SVD of U12TUl1S1l: 16

Proof: See Moonen et. ale (1989). II

Thus Equation (2.15) gives a basis for the intersection of the row spaces of the two

Hankel matrices and by previous derivation a valid state vector sequence for the given system. Recall that this state vector sequence is not unique, and the given system can be described by many different sets of state variables (Kailath, 1980). Consequently the realization (A,B,C,D) found using this state-vector sequence is also non-unique.

In fact, other methods exist for finding bases for the intersection of two subspaces, and the motivation for using these methods has more to do with efficiency than accuracy.

The calculation of a state vector sequence described in Section 2.1 involves the computation of two successive SVD's. The second SVD is applied to a rather small

(2pi-n) x (2mi+n) matrix, and so generally is not computationally demanding.

However, as systems become more complex, and as the amount of data required for increases, calculation of the first SVD of the concatenated Hankel matrices can quickly lead to computer memory shortage problems and excessive computation times. This problem is discussed further in Chapter 5 during the presentation of the results from application of the present method to a real sampled- data system. In the next section, an alternate method of finding subspace intersection will be discussed. 17

2. 1.1. Improving Computational Efficiency

In some cases the previous method for finding the intersection of the row

spaces of HI and H2 is impractical, due to memory or time limitations when

calculating the first SVD. A logical approach to the solution of this problem is to

attempt to break it down into smaller, more manageable parts. An alternate method is

presented that avoids the factorization of the concatenated matrix H, by computing

individual QR factorizations of HI and H2 and applying the SVD to a matrix

manipulation of the orthogonal factors to find a basis for the subspace intersection.

First, some background information on QR and the concept of principal angles between subspaces .is given.

Every matrix A € jRnxm may be reduced to upper triangular form, if n > m

(Petkov, et. al., p. 57). This reduction is commonly called orthogonal triangularization or Householder reduction. The algorithm for this reduction computes elementary reflections (called Householder reflections) UI, U2 , ••• , Um» such that Am+ l = UmUm-I ... UIA is upper triangular. Each U, is found to zero selected components of a column vector of Ai' which was determined in the previous step.

For example, UI is determined such that it zeros all but the first component of the first column of A. Thus A2 = UIA has column one in the form [rII 0 ... O]T. Next

U2 is chosen to zero additional components in column two of A2 and without changing column one. The resulting A3 = U2A2 has column two in the form [r12 r22 0 ... O]T.

This process is repeated until m elementary reflections are determined. 18

If A has linearly independent columns, and defining QT = UmUm-1...UIA, then

Am+ 1 can be expressed as

where R is an m x m upper triangular matrix. If Q is partitioned as Q = [QI Q2]' where QI has m columns, then

(2.16)

The representation in Equation (2.16), in which QI has orthonormal columns and R is upper triangular is called the QR decomposition of A. Since QI is orthogonal,

and the columns of QI span the column space of A.

If A has linearly dependent columns, then column pivoting can be used at each stage of the reduction to put the result in a more convenient form. A permutation matrix P is found such that Equation (2.16) becomes

where the first r = rank(A) diagonal elements of R are nonzero and the first r columns of Ql form an orthonormal basis for the column space of A. The algorithm for QR decomposition with column pivoting is given in Petkov (p 61). 19

The concept of principal angles and vectors gives a measure of the distance between subspaces. Given matrices A € Rmxp and B € Rmxq, each with linearly independent columns and p ~ q, the following algorithm computes the orthogonal

the principal angles between (A) and range(B) and u, and vk are the principal vectors (Golub, p585). First compute the QR factorizations

Then define C = QATQB. Compute the principal angles by the SVD yTCZ =

diag(cos«(Jk)) and the corresponding principal vectors [u 1, ••• ,uq] = QAY(:,I:q) and

[VI, ...Vq] = QBZ. If the index r is defined by

1 = cos«(Jj) = COS«(J2) = ... = cos«(J,) > cOS«(J,+l)' then

The assumption p ~ q does not limit the application of this algorithm, since the matrix with the most linearly independent columns can arbitrarily be called A.

This algorithm can be used to find the intersection of the row spaces of HI and

H2 without computing the SVD of the concatenated matrix H. Let HIT and H 2T be given by the following factorizations:

(2.17) 20 where PI and P2 are permutation matrices necessary if HI and H 2 are not of full row rank, Ql and Q2 are orthogonal, and R1 and R2 are upper triangular. Define r1 and r2 as the number of nonzero diagonal elements of R1 and R2, respectively. Now the

columns of Ql1 = QI(:,l:rl ) span the column space of HIT and the columns of Q21 =

T Q2(:,1:r2) span the column space of H2 • Assume r l > r2. Compute the SVD of C =

QII TQ21 as yTCZ = diag(cos(Ok» and find the index r that defines the number of principal angles Ok between range(QII) and range(Q21) that are equal to zero.

Compute the corresponding principal vectors [u1, ... ,u ] = QlI Y(:,1:r Then r 2 2).

more linearly independent columns than Ql' then simply define C = Q21TQll and proceed accordingly.

2.2. Finding the System Matrices

The system matrices can be identified by extending the state vector equations given in Equation (2.1) to an overdetermined set, and solving them in the least- squares sense. From Equation (2.1), in matrix form:

X[k +i + l ] x[k+i+j-l] ] = [A B] [X[k+i] ... x[k+i+j-2] ]. (2.18) [ y[k+i] y[k+i+j-2] C D u[k+ll u[k+i+j-2]

In Equation (2.18) the two state vector sequences are just partitions of X2 , so everything required to solve this system in the least-squares sense has been found.

However, Moonen, et. ale (1989) outlines a more efficient method of solving for the system matrices by taking advantage of the previously computed SVD of the matrix

H. An equivalent set (see Moonen for proof) of linear equations, in particular, 21

U: Ui2U(m+p+ 1:(i+1)(m+p),:)svr ] [ Utmi -pi+m+1:(m+p)(i+1),:)svr

A B] [ U:Ui2 U(I:mi+pi,:)Svr ] (2.19) = [ C D Utmi-pi-l:mi+pi+m,:)Svr ' is found, and since v'v = I, the common factor yT can be discarded without affecting the least-squares solution. Multiplying Equation (2.19) by y, the system to be solved is

U: ui2 U(m+p+ 1:(i+1)(m+p), :)S ] [ U(mi -pi-m»1:(m+p)(i+1),:)S

A B] [ U: Ui2U(I:mi+pi,:)S ] (2.20) = [ C DU(mi+pi+l:mi+pi+m,:)S · 22 Chapter 3: Application of Spectral Estimation to the Time Series

Applying spectral analysis techniques to the I/O time data can often provide valuable insight into the nature or dynamics of the system to be identified. Spectral estimation can be used to estimate the frequency response. This estimated frequency response can sometimes yield a rough guess for the system order prior to the application of an identification technique. It can also be used for comparison during the model validation phase. This chapter briefly describes how identifiability may be improved by taking advantage of some of the benefits that spectral estimation offers, including averaging for noise reduction.

3.1. Computing Frequency Response via Spectral Estimation

All linear discrete time-invariant systems are described by the convolution sum

(Oppenheim and Schafer p. 21) given by

00 y[n] = L urn] h[k - n] , (3.1) k= -00 where y[n], u[n], and h[n] are the system output, input, and impulse response sequences, respectively. If the input and output signals can be modeled as stochastic processes, then their and cross correlation functions can be found. A detailed presentation of the relationships of discrete random signals to linear systems can be found in Brown (1992 Chapter 2). Only the needed results will be presented here. The autocorrelation function of the sequence x[n] is itself a sequence, denoted by cPxx[m]. The autocorrelation sequence gives a measure of the degree to which 23 paired members of the sequence, say x[k] and x[k+m] , are dependent, where m is some time delay. The cross correlation function (or sequence) between the sequences x[n] and y[n], denoted by cPxy[m], represents a measure of the dependency between members of the sequence x[n] , say x[k] , and corresponding m-shifted members of the output sequence y[k+m]. The autospectral and cross spectral density functions can be calculated via the double-sided Z-transforms of the autocorrelation and cross correlation functions, respectively. The autospectral density is also referred to as the autospectrum, and the cross spectral density is also called the cross spectrum.

The SISO frequency response of a linear, time-invariant system can be estimated experimentally by dividing the input-output cross spectrum 4>xy(~W) by the

W input autospectrum 4>xx(ei ) (Oppenheim and Schafer, 1989, pp. 66-67). This function is provided by MATLAB's Control System Toolbox m-function SPECTRUM, used as

Pi} = spectrum(u}'YiJ,m,L). The argument m denotes the window width to use when calculating the m-point fast-Fourier transform (FFT). The argument L denotes the number of points to overlap between adjacent windows. The 4th column of Pi}

wT contains the complex frequency response Hij(ei ) from input} to output i. The algorithm implemented by SPECTRUM is as follows. First the input and output sequences are each divided into segments of length m where m is an even power of 2.

Linear trends are removed from each segment, and each resulting sequence is then multiplied by a Hanning window of the same length. The autospectral density of each of the two sequences is calculated by summing the m-point FFTs of each windowed segment. The cross spectral density is calculated by multiplying the complex 24 conjugate of each input FFT by the output FFT and summing over all windowed segments.

3.2. Incorporating Averaging for Noise Rejection

The motivation for this section arises from the specific case where the output data may contain noise, introduced by the output sensors or signal conditioning. A method is proposed that may reduce the effects of certain types of noise on the model produced from the noisy data, using averaging in the frequency domain. First, the system frequency response is calculated from the time-domain data using the spectral­ estimation techniques introduced in the previous section. Averaging in the frequency domain occurs inherently in this step. Next the pulse response is found corresponding to the computed frequency response. Finally, convolution is used to find a new output time sequence from the pulse response and the original input sequence. The rest of this section provides practical detail on how each of the steps is implemented using MATLAB.

SPECTRUM is used as before to find the SISO frequency response from the jth output to the ith input as Pi j = spectrum(uj'Yij,m,L). The 4th column of P returned by SPECTRUM contains the frequency response for positive frequencies. It is used to calculate the response for negative frequencies by taking the complex conjugate and reordering. The negative half is then appended to the positive half to form the double-sided complex frequency response Gil' before computing the impulse response. The impulse response is calculated as the real part of the inverse DFT of the complex frequency response, using the MATLAB functions REAL and IFFT, by 25 hi j = real(ifft(G;j,m). The function CONY is then used to compute a new output sequence by convoluting the impulse response with the desired length of the original

input sequence, by the command ynewi j = conv(h;i,u(l:q,I). 26 Chapter 4: Application to a Constructed Example

The following example was constructed to test the effectiveness of the Two-

Stage Identification Method with ideal data. The two-, lightly damped example system is one that has been commonly used by researchers at Ohio University to test other methods of system identification. The system is excited with random noise, and the responses are recorded. The data from this simulation is then input to the Two-

Stage Identification Algorithm and a model in the form of a state-space realization is found. The frequency responses are obtained experimentally via spectral estimation.

Finally the experimentally' obtained model and the model computed by the algorithm are compared.

4.1. Description of the Example System

The system is defined by the continuous-time matrix

.5 1 .3 -.03 .25 .5 -.6 .06 G(s) + s2+.01s+1 S2 + .02s +4

It has two inputs, two outputs, and two lightly damped modes. The first mode has natural frequency t» = 1 rad/sec and damping ratio t = .005. The second mode n1 1 has natural frequency w = 2 rad/sec and damping ratio t = .005. A realization n2 2 for this system is given by 27

0 1.0 0 0 0 0 -1.0 -.01 0 0 1 2 Ae Be 0 0 0 1.0 0 0 0 0 -4.0 -.02 1 -.1

.3 C [.5 0 0] Dc e = -.25 0 -.6 0 =[~ ~l·

To simulate a real sampled-data system identification problem, this continuous- time realization is transformed into a corresponding sampled-data realization. The first step in this transformation is the selection of the sampling interval. In fact the choice of the sampling interval T can significantly effect the success of the identification process. A T that is much larger than the interesting time constants of the system would yield data with little information about the dynamics. Conversely, the selection of a very small T tends to cause numerical problems, and also diminishes the positive (i.e. smoothing) effect that sampling tends to have upon noise reduction.

In most cases, a sampling frequency that is about ten times the bandwidth of the system should be a good trade-off (Ljung, 1987). Another accepted practice is to select a sampling frequency that is at least ten times the highest natural frequency of the system. This provides for at least ten samples per period of oscillation of the fastest mode. Since the highest natural frequency of the example system is 0.318

Hz., a sampling period T of 0.3 sec., corresponding to a sampling frequency is of

3.33 Hz., is chosen. Note that in the usual system identification problem the system bandwidth and modal frequencies are unknown and so some judgement must be exercised in choosing the sampling interval. 28 The discrete state equations can be determined directly from the continuous state equations in the following way if it is assumed that the system inputs are outputs of a zero-order hold. The discrete matrices Cd and Dd are equal to the continuous C,

and D, values, respectively. Ad and Bd can both be found using the state transition matrix (Phillips and Nagle, 1990 pp. 144-146). Ad is given by the following convergent series representation of the state transition matrix (or matrix exponential), evaluated at T:

2Tl 3T3 Ad = -I>c(T) = I +AT +A - +A - + ... c c 2! c 3!

B; is given by the following convergent series, also derived using the state transition matrix:

Tl 2T3 B = IT+A -+A -+A3r-+ ... d C2! c 3! c 4 !

The continuous-to-discrete conversion function C2D from the MATLAB

Control System Toolbox (Grace et. al., 1990) uses a more efficient method for finding Ad and Bd by employing the Pade approximation to calculate the matrix exponential (MATLAB, 1992). Using C2D with T = 0.3 sec., and the command

[Ad,BcJ = c2d(Ac,Bc,1) , and repeating the corresponding continuous values for Cd and

D d» the discrete-time realization is 29

.9554 .2951 0 0 .0446 .0892 -.2951 .9524 0 0 .2951 .5902 A = B = d 0 0 .8257 .2815 d .0436 -.0044 0 0 -1.1259 .8201 .2815 -.0281

C- [ .5 o .3 0] [~ ~] d - -.25 o -.6 0 Dd = ·

Recall from Chapter 1 that the purpose of this thesis is to develop tools that can be used to identify real sampled-data systems. The next section discusses how the example system can be used to simulate the usual case when the observed I/O time sequences are the only known information.

4.2. Simulation

The proof of Theorem 2.2 was based on the sufficient excitation of all the system modes, and therefore the Two-Stage Identification Method is valid only if all modes are sufficiently excited. This generally will be the case using normally distributed random white noise input signals. For the example system, two uncorrelated, normally distributed random noise input signals are required. A last step in choosing the system excitation involves the selection of an appropriate length.

The importance of choosing an appropriate sampling period T has already been discussed. The total time TN during which data is recorded can also affect the identification process. In selecting TN' a trade-off exists between cost and noise reduction. Typically, the of an estimated decreases with 30 increasing amounts of data (Ljung, 1987). In most cases, a total time span of several times the slowest time constant of the system should be sufficient for identifiability.

The lowest natural frequency of the example system is w = 1 radians/second (or n 1

0.159 Hz.), corresponding to a time constant of 71 = _1_ = 200 seconds. Taking W r1 n1 N = 2048 samples provides a TN = 614 second time span containing more than 97 cycles of the slowest mode, while maintaining an acceptable computation time.

Two 2048-point normally distributed random input vectors, uj and u2 are created using the MATLAB pseudo-random number generator RANDN by the command u = randn(N,2), with N = 2048. The first and second columns of U are

u, and u2 respectively.

To simulate the usual system identification problem, the system is excited in only one input at a time, while the responses at all outputs are measured. This process is automated using the MATLAB m-function DLSISIM (see appendix) by the command ysimo=dlsisim(u,Ad,Bd,Cd,Dd), where ysiso is a matrix whose columns are the N = 2048 point time responses measured at each output due to the excitation at a single input, with all other inputs zero (i.e. one column for every input-output pair).

The data is collected in this single-input-multiple-output (SIMO) manner because spectral estimation is used to compute a frequency response for comparison and it requires separate responses to each input. For example, to compute H12(ejwT), the frequency response from input 2 to output 1, using spectral estimation, the input

U2 and response Y12 are needed. See Chapter 3 for more about spectral estimation. 31 The two-stage algorithm needs data that is collected in a MIMO fashion.

Ideally the inputs should be excited simultaneously while all outputs are measured.

However, for linear, time invariant systems, the principle of superposition may be used to combine the SIMO data to get the two-column, two-output data sequence Y =

[Yl Y2]· For example the output vector Yl is the sum of Yl1 and Y12' the responses measured at output 1 due to inputs 1 and 2, respectively. Similarly, Y2 is the sum of

Y21 and Y22. In the next section, results are presented using this noise-free, ideal

MIMO data.

4.3. Results from Example System Data

A realization is computed using the two-stage algorithm implemented in the m­ function 102S81, by the command [A,B,C,D] = io2ss1(u,y,iJ,n). The arguments i and j determine the amount of data used (see Chapter 2) and n, the desired system order, is optional. If n is omitted, 102SS1 allows the system order to be estimated during program execution by looking at the singular values of the Hankel matrix H

(i.e. n = rank(H) - 2mi). For i = 20, j = 400, the two-stage algorithm computes the singular values shown in Figure (4.1). It is evident from the figure there is a large decrease in magnitude near the 85th singular value. A closer look at the associated data reveals the magnitude of the 85th singular value drops sharply by 13 orders of

13 magnitude to ass = 1.8xlO- • Thus, assuming the rank of H is 84, the estimated order of the m = 2-input system is n = 84 - 80 = 4. 32

600 .-----.------r----..----~--~--_____.~--...... __-~

5 00 ~ ---_ -_. ---···f ._. -_. _-·_f." --_ ..---.---T--- -_. -.- --_ '·-1-- _. _..------_ ---. 1·,··,·_· -_.._ _ -[.-- _ -. ------._. _. _·r ----.-_. -----_ ------I------I------~------I------1------1------1 i 400 t 300 ------r------~------~------: ------1 ------, ------

~ 2 00 -. ------~ ------.------.------1------1------[------

100 ------~ ------f------. ------r------[------T------

: ~ 0L-__....L.--__-L..-: __-L-: __--l.---l.-_-L:__---lL--: __~: _ _.I o 20 40 60 80 100 120 140 160

Index Figure (4.1): Hankel Matrix Singular Values.

The Two-Stage Identification Algorithm 102SSl computes the 4th order realization:

.9598 .3736 -.0053 -.0064 .0076 .0172 -.2332 .9481 .0097 -.0182 .1525 .3264 A B -.0008 -.0024 .8257 .5714 .1943 -.0199 .0003 .0007 -.5546 .8199 .0021 .0016

c = [.7216 .1007 .0776 -.2523] D 10-15 X [-.1312 -.0216] .3598 .0472 -.1327 .4233 -.0211 -.0336

The eigenvalues of the computed realization are identical (to 4 significant digits) to the original system eigenvalues. The frequency response of this realization is calculated directly from the system matrices using the command z =

wT mimofres(A,B,C,D,w,7). MIMOFRES computes G(jwn = C[ei / - A]-IB + D. A comparison of the frequency responses from the calculated model and that estimated 33 from the data is shown in Figures (4.2) through (4.5). From these figures, the model

computed by the two-stage algorithm looks very close to the model formed from the

data. The models can be compared quantitatively by computing the error in the

frequency response of the calculated model relative to that from the data. The

number of inputs and outputs are equal, so assuming the inverse exists, the relative error at a particular frequency oi can be defined by

where the double bar delimiters denote the matrix 2-norm defined by the largest eigenvalue of M*M

"" 10-2 10'

Frequency (rodisec) Frequency (rod/sec)

10-2 i 0-' 1OQ 10' t Doto Frequency (mdisec) - Model Figure (4.2): Model vs. Experimental Figure (4.3): Modelvs. Experimental Frequency Response, HI1(duT). Frequency Response, H,,(d"T). 34

50 50 OJ m ~J \. \ 'V 0 -..iiII" 3 0 Q} ___ Q} iJ l1li- \-. IJ ~ 3 3 1II111 .~ .~ -50 -50 '-- " o o :1 ~ iii ~ : ~ -100 -100 10-2 10-' 100 102 10-2 10-1 100 102 Frequency (rod/sec) Frequency (rod/sec)

200 200 ~ ~ ~:::: .'..:

...... -

i ~ ~oi : i ~o: : :: ~OP: '--1-1'1'- I:· j j fopi + : -200 -200 10-2 10-1 100 10' 102 10-2 10-1 100 10' 102 + Dota + Dota Frequency (rod/sec) Frequency (rod/sec) - Model - Model Figure (4.4): Model vs. Experimental Figure (4.5): Model vs. Experimental WT WT Frequency Response, H21(d ). Frequency Response, H22(d ).

A plot of the relative error shown in Figure (4.6) shows that the only significant error occurs near the two modal frequencies, with 9 dB and 6 dB peaks at frequencies of 1 and 2 rad/sec, respectively. The peaks in the frequency response are inversely related to the damping ratio r of the associated mode. Therefore the error at the modal frequencies should result in values for the model damping ratios that slightly differ from those computed from the data. This is likely a somewhat undesirable characteristic of the method. However, the results show that the method does work when applied to a simple, constructed example. The next chapter applies the method to a real and much more complex sampled-data system. 35

10

0

-10

OJ 3 -20 I- 0 l- wI- -30 (l) :g> Q) -40 a::::

-50

-60

- 70 L..-_---l_--L---L--L-__L._~~__....L..._____J_"'__L._..L...... I...J...... L.L____L._~__L___L._..I.....L...I....I.....L...___"'______L_L__l__L.~_1_J 10-2 10-1 10° 10 1 10 2

Frequency (rod/sec)

Figure (4.6): Model Frequency Response Relative Error. 36

Chapter 5: Application to a Real Sampled-Data System

The NASA Large Space Structure Ground Test Facility (LSS GTF) was an experimental facility located at NASA Marshall Space Flight Center in Huntsville,

Alabama. It was used for conducting research concerning the dynamics of large flexible structures. During the Active Control Technique Evaluation for Spacecraft

(ACES) program, the facility was configured as shown in Figure (5.1), and so is often referred to as the ACES structure (Irwin).

Input and output data recorded using ACES was converted to MATLAB data format and given to the author for use in this research. As in the constructed example, the system responses to random noise inputs were recorded, and the data was input to the algorithm to find a model. The experimentally obtained model was compared to that computed by the algorithm. Unlike the constructed example, however, this real sampled-data application placed severe demands on the SPARC-II workstation used, both in terms of memory usage and computation time.

5.1. ACES System Description

The ACES system consists of a large flexible member suspended vertically from a fixed support structure via a three-axis Advanced Gimbal System (AGS). The

AGS contains a shaker mechanism capable of applying torque excitation to the base of the member in three axes. There are several sensor subsystems distributed along the main member of the ACES system. The three-axis Base Rate Gyros (BGs) measure 37 the angular velocity of the base in three axes. Similarly the Tip Rate Gyros measure angular velocity about the tip. The three-axis base and tip accelerometers measure the linear acceleration in each of the three axes at the base and tip, respectively.

There is also a two-axis Pointing Gimbal System that is used to control the reflection path of a laser in response to the motion of the main member. For the purposes of this research, only the AGS inputs and BGs outputs are used.

SingleStructure Control Laboratory 1. Base Excitation Table 2. 3 AxisBaseAccelerometers 3. 3 AxisGimbal System 4. 3 AxIs Base RateGyros and Counterweight 5. 3 AxIsTip Accelerometers 6. 3 AxIsTip Rate Gyros 7. Optical Detector 8. Mirrors 9. Laser 10. 2 AxIs Pointing GimbalSystem 11. LMEDSystem

Ught Path ----+-~

Figure (5.1): Marshall Space Flight Center Large Space Structure Ground Test Facility (ACES Configuration).

5.2. ACES Data Description

Data was collected by applying a random white noise torque input to a single x or y axis at a time, and recording the responses of the rate gyros in the three axes.

This SIMO data was stored in MATLAB variable format in two sets of data files x., x2 , ••• , X14' and YI' Y2' ... , Y14' where x and y denote the excitation was applied to the 38 x or y axis, and the numerical subscript denotes the experiment number of one of the fourteen runs performed. The data set provided for this research did not contain excitation in the z axis. Each data file is composed of three matrices bg, tg, and torq, each of which has 3250 rows and 3 columns. The columns of bg respectively are the x, y, and z axis sampled data vectors from the base gyros. The columns of tg similarly are the data vectors from the tip gyros, and were disgarded to further reduce the complexity of the computations. The columns of torq respectively are the sampled-data excitation applied to the x, y, and z torque actuators. Two columns of torq are zero vectors, corresponding to the unexcited axes.

The sampling interval was T = 0.02 seconds, resulting in a sampling frequency of fs = 1IT = 50 .. Hz. and in experiment lengths of TN = 0.02 seconds x

3250 = 65 seconds. Using the methodology introduced in Section 4.1, this data should provide enough information to identify modes as high as fmax = fsl 10 = 5 Hz.

If it is assumed that 10 cycles of the slowest mode are required to be sampled within the time span, then the data should contain identifiable modes as low as fmin = 10/(65 seconds) = 0.154 Hz.

The last 250 data points in each experiment were recorded with no excitation, i.e. torq(3000:3250,:) = [000]. This was likely done to reduce the effect of discontinuity when concatenating multiple together in order to simulate experiment lengths longer than 65 seconds. By removing the excitation during the last 0.02 seconds x 250 = 5 seconds, the energy in the system is allowed to dissipate, 39 and the magnitudes of the outputs tend toward zero. It would likely take much longer than 5 seconds for the ACES system to come to a complete rest. However, recall that the inputs must be persistently exciting and component-wise uncorrelated. Long periods of data sampling with zero inputs certainly violates these requirements.

Therefore, when attempting to incorporate more data into the identification process by concatenating independent experiments, a tradeoff exists between the effect of discontinuities introduced by short or nonexistent zero-input transition periods and the degradation of results due to violation of the algorithm input requirements. Since the data used in this research was not specifically geared toward the Two Step algorithm, it can only be assumed that the experiment lengths and transition conditions were chosen to provide for good identifiability in general.

5.3. Results from ACES Sampled Data

The computational demands of the Two-Stage method increase dramatically with the amount of data included in the Hankel I/O matrices. The large amount of memory required to store the Hankel matrix and simultaneously compute its SVD puts

2 a practical limit on the choices for i and j. Recall H, S € lR (mi + pl) Xi,

2 U € lR (mi +pi) X 2(mi +"", and V € lRvxJ) and so for i = 100, j = 2000 the memory required to store these matrices is approximately 63 megabytes (MB), where 1 MB= 106 bytes.

Increasing i and j by 10% to 110 and 2200, respectively, increases the storage requirement by 20% to 75 MB. For i=200, j=4000, 251 MB are required. The

SPARC-II workstation used for this research had 64 MB of random access memory 40 (RAM). When the available RAM is used up, MATLAB swaps data temporarily from memory to virtual memory on the hard disk and continues. Since hard disk access is much slower than memory access, this memory swapping significantly increases the computation time. It was quickly determined that the ACES system could not be modeled satisfactorally without exceeding the 64 MB in the SPARC-II, and therefore virtual memory swapping became necessary. Models computed using i and j values that did not result in memory swapping did not include the lowest modes contained in the comparison models produced using spectral estimation, regardless of the value chosen for system order n. It is assumed that since much more data can be used in the spectral estimation process, the experimentally computed models represent the system more accurately. Another problem was uncovered concerning the structure of the ACES data as supplied. The nonzero excitation vector in the data file x, was the negative of the nonzero excitation vector given in yI' and so combining the

SIMO data x, with YI resulted in excitation vectors for the X and y axes that were linearly dependent. This violates the algorithm requirements for persistent, uncorrelated input excitation, and the result was all zero columns in matrices Band D and failure of the algorithm. Therefore, when creating MIMO data from the SIMO data, combining Xi with Yj was not allowed for i = j.

A fairly good result was realized using i = 190, j = 4000. Computation time required for the SVD of H was approximately 60 hours. This corresponds to approximately 244 MB of storage required and lots of virtual memory swapping.

Since the algorithm requires only the left singular matrix U and the singular values on 41

800----....------,.----.....----T'---,..----..,.----~---.,

700

600

500

400

300

200

100

OL---..L------'------J---...... ",---""'----..loo---~--- a 200 400 600 800 1000 1200 1400 1600

Figure (5.2): ACES Hankel Matrix Singular Values. the diagonal of S, significant memory is wasted when using the MATLAB SVD function. A more efficient SVD algorithm could possibly result in higher fidelity models and/or reduced computation times. The resulting Hankel matrix singular values are plotted in Figure (5.2). The data shows an abrupt decrease in magnitude of the 761st singular value. However, using this value and the criteria from Equation

(2.5) the system order would be n = rank(H) - 2mi = 760 - 2(2)(190) = O. A closer look shows a more gradual decrease in magnitude from 0"761 to 0"800' and then leveling

off at UgO I and beyond. Assuming rank(H) = 800, a 40th order model was computed.

However, it compared unfavorably to the experimentally obtained model. Several 42 modes were missing or poorly represented. Increasing the order to 56 produced better results. This suggests that there were not enough independent rows, and thus not enough data, contained in H. The 56th order models are shown in Figures (5.3) through (5.6), with the experimentally obtained model data appearing as dots.

Generally the Two-Step and experimental responses compare very closely within the

0.6 Hz. to 6.0 Hz. frequency range. The magnitudes and phase of the BGy/AGSy pair are particularly close, even at frequencies as low as 0.15 Hz. and as high as 20

Hz. The modes in the off-axis (BGy/AGSx and BGx/AGSy) models from either method are not as well-defined. This is expected, however since excitation in the x­ axis would couple better to a response in the x-axis than it would to the off-axis (y­ axis). Note the magnitude of the off-axis responses is generally 10dB below the x-x and y-y responses.

Overall however, the results are promising. The Two-Stage Algorithm computed a model for the ACES system that was close to the experimentally obtained model, even with much less data used as input (2i+j-2 = 4378 time samples for the algorithm vs. 7(4096) = 28672 samples for the experimental method). Results would likely improve if the sampling process was specifically designed for use with the algorithm (i.e. a single experiment with more samples and no all-zero inputs) and, and if more data could be included in the computations, either by increasing the available memory and/or by increasing the efficiency of the SVD algorithm through selective storage of the factors. 43

-60 ",-...... CJ:l ""0 "'-"" 0,) -c ~ -80 ::: c ~ 0 ~ -100

- 120 """--- ...... _....I.--'--010...... _-....-...... '""""-"--_""""--'~...... 10-2 10-1 100 102 Frequency (Hz)

• • ••• , •• I ., ••••• I' I I • II • 100 ···········f···:···j·····j···r·r··Fr·f·~·· ~ ..·..·..·..r····..r·:·r·::j· ..r·T·r·rr···········..r..·····I·····I···r..r· '1'; CJj OJ i ; : :..... :.' : .J' +.. J. ~ j ii · 1 i i 1: i! OJ ~ 1 1 ~ ; 1 ., 1 1 1 1; ;; ~ ~ ~ OJ j . , .. \ : r) j j ••· 1: j j j \ \ 1 • -c "-" 0 0..> CJj s:0 Q.. -100

- 200 """---O---"-...... _ ...... ~~---'-~...... ~~ 10-2 10-1 100 10 1 10 2 Frequency (Hz)

Figure (5.3): BGx/AGSx pair 56th Order Model vs. Experimental Frequency Response. 44

-60 ~ CD U '-'" Q) u ~ -80 :t: c: ~ 0 ~ -100

- 120 '-----'----I-............... &...01.."'"-_~...... __ ...... 1....1...... ~_ _"'__~.....&...1.~ 10-2 10- 1 100 10' 10 2 Frequency (Hz)

t , • I• 1.1 100 ··:T··.. ·~····rTT·,·r I

• ., • 1 ~ ~ j ~ ~ j j

Q) CJj e s:

0... -1 00 ."••'I~+.I~ •••••IlI•••-::otti··t·i"r·r ·..\...... ~.. ···t····i····t..·r··t··r··

j1111 1',111111 - 200 '-----'----I-.....I....I...... ~_..10..-~...... -.- ~~...... -~...... --'--'...... 10-2 10-1 10° 10' 10 2 Frequency (Hz)

Figure (5.4): BGy/AGSx pair 56th Order Model vs. Experimental Frequency Response. 45

, • I •, ••• t • I ••• -60 U:··:I::·::II] ~ CI:J U "'-"'" OJ "0 :::::::·:I:·::I".II.lIII..::. ..4-+ ~ -80 ::: c CT' 0 [.[ !' i i·[I< ,..r.<.,J[ iiii ~ -100 ···········r·······~·····~····~··i··+·+·r·!·············~·······+····+···~···~··f··~·~·+·········· .. ·~·· ..···r·····t···t··i··t·i· ·~··········:··~·······t····i····t···~··t··~·

I I I II IIII I I I IIIIII I I I IIIIi'l I I I IIII - 120 ~~---""-"-"""""""""'_-"-'-""""""""~~_....I.oo-....I.oo-~~~_"'--..Lo..-L.--'--'-"""""" 10-2 10-' 100 10 2 Frequency (Hz)

.. fl...... ,. 100 ···········[·······1·····r···[· ···[·1""[·i·..·· ·······r·······[····~·:·1···f··I ~en OJ OJ \- ~ I III 11·1 ·1 11'111, Q) "'0 ...... " 0 uuuuu·fu.uujuu.Juuh+H-luuu..uu+u ·l.h.l.uju·H· 1f- U"'Uu :

OJ ~ ~ 1 1 1 1 1 11 1 • . 1 ; 11 en 0 s: ! i ! : iII:! : Ill! Q.. -100 "u"uu""uu"uu"ur"u",u""u,uuu,u,uuu,~uurutr ~u,·t' ..··u..u.u,

- 200 '---~--"'-"""""'...L..oI..u....I--_....I--""""'~"""".I.-----'-~....r...... Io"""""'''''''''''_....,L",.,-''''''''''''''''''''''''''~ 10-2 10- 1 100 10' 10 2 Frequency (Hz)

Figure (5.5): BGx/AGSy pair56th Order Model vs. Experimental Frequency Response. 46

-40 ~ C!:l "0 ~ OJ -0 ~ -60 :+:: c 0"\ 0 ~ -80

- 100 1.....-..~~~~~_...... L.-~--'--'....a.....L.",'""'---""'---.I.--'--~~_--lo.-.--lo.-...... I.-l-L"""""" 10-2 10- 1 100 10 2

Frequency (Hz)

, • , I I' •• • I , ," .,. I' I I• 1'1. ,. I , t I I' 100 .,•••••••••~ ••••••• , ••••• ~ •••• ~. '-:,••:-' .~.., ••••••••••••• ~. II.11':-••••":II••• ~ ••• ~ •• ~ •• ~. ~.-: ••••••••••••••:-II••••• ~ •••• I"" -:- •• ~ •• -:-'~":" ~ ••• II • I" .~ ••••I" -:- •••• ': •••• ~ ••• ~ •• ~ •• ~ •• ~ : t , III ': :. ;.' : '1: : : ::: :::: : : ::: :::: : : :: Cf) : : ~ t:, ., ~ : : : : :::: : : : : : :::: : : : : a.> OJ ~ . : . "i:' IiI. I.. I ,,:: III II II' i II ~ ~11 ~ ~ ~1;1~1 ~ ~ ~~~ OJ 1 11 1 ; j -0 ...... t ~ ~ ~ ...:...:. ~.; : ~ .:. L..L. .~ :.1. ' L L..l ..l..l.l..t.L. . l 1. L.. ~ ..L.L ~ "-"'" 0 Q.) Cf) i·· III i Ii· I" i i·1 i'· .. 11111 . II1I1I s:0 ~ ~ ~ ~~~11~ ; ~ ~ ~~1,1 ~ ~ ~~~111 ; 11~~~~ o, .J~ ~ :~. -100 ...... l L...L.LU.Ll.L L. ..l l...l...l..u.J. i , l.....l... i• i l.. L..L.L.l..U.: 1 ~ j 1 j ~ ; j 1 1 j ~ 1 ~ 1 j, ~ 1".' j j 1: .. ~ ~ , ~ j 1 ~ ~ 1 j iii iii iii iii iii iii i" iii iii iiii - 200 ~~ .....--...... --_Io..-oI,-"""--...... _-...-.....a-.....I---...... ~-....-"- ...... ~...... 10-2 10- 1 100 10' 10 2 Frequency (Hz)

Figure (5.6): BGy/AGSy pair 56th Order Model vs. Experimental Frequency Response. 47 Chapter 6: Conclusions and Recommendations

This thesis has investigated a method for identification of MIMO dynamic

systems from I/O time sequences. The method was shown to consist of two major steps. First, a valid state-space vector sequence is found from and consistent with the

I/O time sequences. Then a state-space realization of the system is found as the least

squares solution to a set of linear equations, formed from the state and I/O vector

sequences.

The theory behind the method was collected, organized, and derived where necessary to provide a solid foundation to support its application. The algorithm and supporting routines were implemented in software in the form of the MATLAB script files included in the appendix which facilitate application. The method was successfully applied to a lightly-damped constructed example system. The system order was predicted correctly and the eigenvalues of the computed realization were found nearly identical to that of the original system. In addition, spectral analysis techniques were discussed that allow the SISO frequency response to be experimentally calculated. The experimental frequency response was compared to the response of the identified model to validate the algorithm.

The method was also applied to a real sampled-data system, called the ACES system, with limited success. The large amount of data required to be processed during the SVD of the I/O hankel matrix caused problems in terms of computer 48 resources and time, and the criteria for selecting system order did not prove feasible.

The structure of the ACES data and the limited amount used may have contributed to the failure of the method. The method is valid only for inputs that are persistently exciting and component-wise uncorrelated. The 65 second experiment lengths were too short for identification of the lowest frequency modes, and the 4378 time samples used in the construction of the I/O hankel matrix did not provide enough data for identification of all modes. Elimination of the zero-input excitation periods and an increase in experiment length would likely improve the results.

Some advantages of this identification method over others include: 1) It computes directly a state-space realization of the identified system from the input and output sampled-data, 2) it is very automated, with little additional input required from the user other than the time sequences and system order, and 3) it can be modified such that the least-squares solution of the linear equations in the second stage could be constrained as desired by the user.

The high level of automation can also be viewed as a disadvantage, in the sense that little apriori knowledge about the system, such as mode locations, can be incorporated ahead of time to increase the accuracy or quality of the model. The user is free to choose the system order, however, and as shown in the ACES example, any knowledge concerning the number of system modes can be used to increase model accuracy. 49 While this thesis should serve as a basic reference for the theoretical and practical issues related to the Two-Stage Algorithm, more work is needed in several areas. The efficiency of the method needs to be improved. This could be accomplished by coding a custom SVD algorithm that only stores the factors specifically needed to compute the state vector sequence, thereby freeing up additional memory that would enable larger amounts of data to be used. This could also be accomplished by coding a modified algorithm that incorporates the QR factorization for computing the state vector sequence as introduced in section (2.1.1). The effect of adding contraints to the solution of the set of linear equations when finding the system matrices should be investigated. Finally, the effect each variable, i.e. i, j, system order, experiment length, and sampling period, has on the results should be better characterized, so that minimum values for these variables could be established for a given in order to achieve the desired degree of accuracy. 50

Bibliography

Bretscher, O. (1997), Linear Algebra with Applications, Prentice Hall, New Jersey.

Brown, J. R. (1992), "Model Identification for the Space Shuttle Main Engine High Pressure Oxidizer Turbopump, " Master of Science Thesis, Ohio University, August, 1992.

Golub, G.H. and Van Loan, C.F. (1989), Matrix Computations, 2nd ed., Johns Hopkins University Press, Baltimore.

Grace, A., Laub, A.J., Little, J.N., and Thompson, C. (1990), Control System Toolbox for use with MATLAB~\ User's Guide, The Math Works, Inc., South Natick, MA.

Kailath, T. (1980), Linear Systems, Prentice-Hall, New Jersey.

Ljung, L. (1987), System Identification: Theory for the User, Prentice-Hall, New Jersey.

MATLAB® Reference Guide (1992), The Math Works, Inc., Natick, MA.

Medina B., E. A. (1991), "Multi-input, Multi-output System Identification from Frequency Response Samples with Application to the Modeling of Large Space Structures," Master of Science Thesis, Ohio University, November, 1991.

Moonen, M., De Moor, B., Vandenberghe, L., and Vandewalle, J. (1989), "On and Off-line Identification of Linear State-space Models," International Journal of Control, vol. 49, no. 1, pp. 219-232.

Ogata, K. (1990), Modern Control Engineering, Prentice-Hall, New Jersey.

Oppenheim, A. V. and Schafer, R. W. (1989), Discrete-Time , Prentice-Hall, New Jersey.

Petkov, P. Hr., Christov, N. D., and Konstantinov, M. M., Computational Methods for Linear Control Systems, Prentice Hall International Series in Systems and Control Engineering.

Phillips, C. L. and Nagle, H. Troy (1990), Digital Control System Analysis and Design, 2nd ed., Prentice-Hall, New Jersey.

Strang, G. (1976), Linear Algebra and its Applications, Academic Press, London. Appendix A

MATLAB M-Files

The software used in this research was written in the scripting language of

MATLAB "m-files". All m-files written specifically for this thesis are included in this appendix. Other m-files or functions referenced may be found in the standard library or in one of the specialized toolboxes available from The Math Works, Inc. % DLSISIM % An m-function which computes the p-output sequence y as % the discrete-time SISO response of the MIMO realization % (A,B,C[,O]) to an r-input sequence u. If desired the % m-function will create and return a random white noise % input sequence u of length n for use in the simulation. % % Use as [y]=dlsisim(u,A,B,C,O) or [y]=dlsisim(u,A,B,C) % or if input sequence is not supplied, use as % [y,u]=dlsisim(n,A,B,C,O) or [y,u]=dlsisim(n,A,B,C). % % The number of columns in u is r (1 per input). The % columns of yare the SISO outputs ordered: % % y = [y11 y21 yp1 y12 y22 ... yp2 ... ypr] % % where yij is the response measured at the ith output % while the excitation is applied only to the jth input, % with zero at all other inputs. % % To get the true MIMO output, use superposition and sum % the responses cornmon to each output, i.e. % y1 = y11 + y12 + .•• + y1r % % See also RANDN, DLSIM.

% Ken A. Nadsady. ECE Dept. Ohio University. May 2, 1993. function [y,u]=dlsisim(x,a,b,c,d)

[dummy,r]=size(b); [p,durnmy]=size(c)i if nargin == 4 d=zeros(p,r)i end % (d exist?) if nargout == 2 n=x; randn('seed',sum(100*clock)); u=randn(n,r) ; else u=x; [n,dumrny]=size(u); end % (if=2) y= [] ; utemp=zeros(n,r); for jj=l:r utemp(:,jj)=u(:,jj)i ytemp=dlsim(a,b,c,d,utemp); y=[y,ytemp] ; utemp(:,jj)=zeros(n,l); end % 102551 % An m-file that obtains a state-space realization [a,b,c,d] of a % system given the input sequence u and the output sequence y, by % implementing the off-line system identification algorithm given by % Moonen, M. et. ale in Int. J. Control, 1989, vol.49, No.1, pp.219-232. % SEE ALSO: MAKEH.M % i Use as [a,b,c,d]=io2ss1(u,y,i,j,norder) % or [a,b,c,d]=io2ss1(u,y,i,j) 9­ o % where i: number of blocks [u(*);y(*)] in a column of h1(k) % j: number of columns in H(k) % norder: desired order of the realization % u has r cols where r number of inputs % y has p cols where p = number of outputs

% Enrique A. Medina & Ken A. Nadsady. ECE Department. Ohio University. % 9/23/97.

function [a,b,c,d]=io2ss1(u,y,i,j,norder)

[dummy,r]=size(u); % r: number of system inputs [durnmy,p]=size(y) ; % p: number of system outputs

%---- Form Matrix H: fprintf('\n Forming Hankel matrix. ') hl=makeh(u',y',l,i,j) ; fprintf (,.') h2=makeh(u',y',i+l,i,j) ; H=[hl;h2] ; fprintf('. ') [mh,nh]=size(H); c Lea r hI h2

t---- Compute SVD of H: fprintf('\n Calculating SVD of %O.Of by %O.Of H matrix ... \n', ... mh,nh) start=clock; [uu,ss,vv]=svd(H) ; forever=etime(clock,start) ; disp([' It took ',int2str(forever), , seconds to compleLe svd']) keyboard save svdh uu ss vv

Determine the order of the system: clear vv Hsv=diag(ss) ; save svh Hsv format short e

if nargin == 4 disp(' Singular Values of H: ') disp(Hsv') disp('You can look at the singular values again! ') disp(['Order of the realization is equal to rank(H) int2str(2*r*i)] ) keyboard n=input('Please assign the desired order of the realization » '); else n=norder; end % (nargin=4) while n > (p*i) Add=int2str(1+round(n/p-i) ); disp(['You must increase i by ',Add,' to use order ',int2str(n)]) yn=input('Do you want to assign another order? > y/[n]', 's'); if strcmp(yn, 'y') I strcmp(yn, '¥') n=input('Please reassign the desired order of the realization> '); else return end % (yin) end % (while)

%---- Set up least squares problem to construct realization: ull=uu(1:r*i+p*i,1:2*r*i+n); u12=uu(1:r*i+p*i,2*r*i+n+l:2*r*i+2*p*i); sll=ss(1:2*r*i+n,1:2*r*i+n); [uuq,ssq,vvq]=svd(u12'*ull*sll) ; uq=uug ( : , 1 : n) ;

Ml= rug' *u12' *uu (r+p+l: (i+l) * (r+p), :) *ss; uu(r*i+p*i+r+l: (r+p) * (i+l),:) *ss]; M2=[uq'*u12'*uu(1:r*i+p*i, :)*ss; uu(r*i+p*i+l:r*i+p*i+r,:) *ss];

0---- Now solve the linear system Ml=sys*M2: 'skeyboa r d sys= (M2' \Ml '),; a=sys(l:n,l:n) ; b=sys(l:n,n+l:n+r) ; c=sys(n+l:n+p,l:n); d=sys(n+l:n+p,n+l:n+r); format short % MAKEH % An m-file that forms the matrix H(k) given the input sequence matrix u % and output sequence matrix y of the system 9­ o % u = [u(k) u(k+1) u(k+j+i-2)] u(k) is r x 1 % y [y(k) y(k+1) y(k+j+i-2)] y(k) is p x 1 % % where r: number of inputs % p: number of outputs % i: number of blocks [u(*);y(*)] in a column (samples/col) % j : number of samples in a row % k: starting index for sequence % % The (r*i+p*i) x j matrix is formed as: % % u (k) u (k+1) u(k+2) u (k+j -1) % y(k) y (k+1) y(k+2) y(k+j-1) % u (k+1) u(k+2) u (k+3) u(k+j) ,~ o y(k+1) y(k+2) y(k+3) y(k+j) % H ( k )

'% u(k+i-1) u(k+i) u(k+i+1) u(k+i+j-2) % y(k+i-1) y(k+i) y(k+i+1) y(k+i+j-2) % % This matrix is used in the off-line system identification algorithm.

% Use as h = makeh(u,y,k,i,j);

% Enrique A. Medina & Ken A. Nadsady. ECE Department. Ohio University. % July, 1992.

function h=makeh(u,y,k,i,j);

[r,numu]=size(u); ~ numu: available number of input samples [p,nurny]=size(y); % numy: available number of output samples

if numu < (k+i+j-2); error('Not enough available samples in u. I) % Can't build h() end if numy < (k+i+j-2); error('Not enough available samples in y. I) % Can't build h() end

if ((j < 10*r*i) I (j < 10*p*i)); disp('WARNINGl H(k) may not be fat enough. Recommend an increase in' ) disp( ['the number of row samples (j) by ',int2str(lO*max(r*i,p*i)­ j ) ] ) end h=zeros( (r+p)*i,j); % pre-allocate memory for array

for ii=l:i % Now build H(k) h ( (i i -1 )* (r+p) +1 : i i * (r+p) , : ) = [u ( : , k+ i i -1 : k+j +ii-2) ; y ( : , k+ ii­ 1:k+j+ii-2)]; end % MIMOFRES % An m-function that calculates the frequency response x of a multiple­ % input, multiple-output system, given its state-space realization [a,b, c, d] % and column frequency vector w (rad/sec). % Use as x=mimofres(a,b,c,d,w,Ts). % % The sampling time Ts is required only for discrete systems. % % x(l) : number of outputs m, x(2) : number of inputs r, x(3) : number of points N % x (4) - x (3+N) : frequencies in rad/sec: % x(3+N) .... frequency response matrices for each point in w, stored % as a column.

% Enrique A. Medina B. & Ken A. Nadsady. October 4, 1997. % Department of Electrical and Computer Engineering % Ohio University function x=mimofres(a,b,c,d,w,Ts)

[n,n]=size(a) ; [rn,r]=size(d);N=length(w); clg;hold off;plot(lOO*(l:N)/N,ones(l,N));grid title('COMPUTING FREQUENCY RESPONSE') xlabel('PERCENT DONE');hold on text(.03, .05, ['Order: ',int2str(n)], 'sc'); text(.03, .00, [int2str(N), , points'], 'sc'); nelemx=m*r; x=[m;r;N;w;zeros(N*nelemx,l)];

% Transform matrix a to Hessenberg form. u is the similarity transformation: [u,a]=hess(a); % Apply the similarity transformation to band c: b=u'*b;c=c*u;

% Generation of the frequency response matrix for each point in frequency. '% Use Matlab's built-in linear equation solver at each point in frequency; % it takes advantage of the upper-Hessenberg form of a. for ii=l:N if nargin==5 % continuous case

g=(sqrt(-l)*w(ii)*eye(size(a) )-a)\b; g=c*g + d; else % discrete case g=(exp(sqrt(-l)*w(ii)*Ts)*eye(size(a) )-a)\b; g=c*g + d; end % continuous or discrete

%Load frequency response matrix fOT current frequency point to column vector x x(N+4+(ii-l)*nelemx:N+3+ii*nelemx)=reshape(g,nelemx,l); plot(ii*lOO/N,l, 'g*') end % frequency points clg;hold off disp('Frequency Response Completed') return Appendix B

Supplemental Definitions and Theorems

Definition: Consider two subspaces V and W of R". The sum of subspaces V and W, denoted V + W, is defined as the set of all vectors in jRn of the form v + w, where v

E V and W E W.

Theorem: Given two subspaces V and W of R". Then dim(V) + dim(W) = dim(Vn W) + dim(V+ W).

Proof: (Adapted from Bretscher, 1997 p. 174) Let {u1, uz,... ,um} be a basis for vn W. Suppose the set is extended such that {u1, UZ, ... ,Um' VI' Vz, ... ,Vr ,} is a basis for V. Suppose similarly that {uI , Uz,... ,Um' WI' WZ, ••• , Wp ,} is a basis for W.

Choose arbitrary x E V+W. Then x can be expressed as x = v + W where v E V and W E W. However v and W can each be expressed in terms of basis vectors like:

v = alul + azuz + + amum + bivi + bzvz + + b.v.,

W= CIU I + czuz + + cmum + diwi + dzwz + + dpwp.

SUbstituting, x can be expressed as

x = alu l + azuz + + amum + bivi + bzvz + ... + brvr,

+ CIUI + CzUz + + cmum + diwi + dzwz + ... + dpwp.

= (al+cI)uI + (az+cz)uz + ... + (am+cm)um + bivi + ... + b.v,

+ dlw1 + dzwz + ... + dpwp. span V+ W. This spanning set can also be shown to be linearly independent.

Suppose {uI , U2 , ••• ,Um, VI' v2, ••• ,V" Wi} linearly dependent, where i E {I, 2, .. .,p}.

Then Wi E V, which implies Wi E vn W, which implies {uI , U2 , ••• ,U m , Wi} linearly

dependent. But this contradicts the assumption that {uI , U2, ••• ,Um, WI' w2, ••• ,Wp ,} is a basis for W. Therefore {uI , U2, ... ,Um, VI' V2, ... ,V" W b W2, ... , wp } is a linearly independent spanning set of V+ W, and dim(V+ lV) = m+r+p. Finally,

dim(V) + dim(lV) = (m+r) + (m+p)

= m + (m+p+r)

= dim(Vn lV) + dim(V+ lV).

II