1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>April 1999</DATE>
8
<SHORT_DESCRIPTION name="findBD"> initial state and system matrices B and D of a discrete-time system</SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM>[(x0) (,B (,D)) (,V) (,rcnd)] = findBD(jobx0,comuse (,job),A (,B),C (,D),Y</CALLING_SEQUENCE_ITEM>
11
<CALLING_SEQUENCE_ITEM> (,U,tol,printw,ldwork)) </CALLING_SEQUENCE_ITEM>
16
<PARAM_NAME>jobx0</PARAM_NAME>
18
<SP>: integer option to specify whether or not the initial state should be computed:</SP>
21
<PARAM_NAME>= </PARAM_NAME>
23
<SP>1 : compute the initial state x0;</SP>
27
<PARAM_NAME>= </PARAM_NAME>
29
<SP>2 : do not compute the initial state (possibly, because x0 is known to be zero).</SP>
36
<PARAM_NAME>comuse</PARAM_NAME>
38
<SP>: integer option to specify whether the system matrices B and D should be computed or used:</SP>
41
<PARAM_NAME>= </PARAM_NAME>
43
<SP>1 : compute the matrices B and D, as specified by job;</SP>
47
<PARAM_NAME>= </PARAM_NAME>
49
<SP>2 : use the matrices B and D, as specified by job;</SP>
53
<PARAM_NAME>= </PARAM_NAME>
55
<SP>3 : do not compute/use the matrices B and D.</SP>
62
<PARAM_NAME>job</PARAM_NAME>
64
<SP>: integer option to determine which of the system matrices B and D should be computed or used:</SP>
67
<PARAM_NAME>= </PARAM_NAME>
69
<SP>1 : compute/use the matrix B only (D is known to be zero);</SP>
73
<PARAM_NAME>= </PARAM_NAME>
75
<SP>2 : compute/use the matrices B and D.</SP>
80
job must not be specified if jobx0 = 2 and comuse = 2, or if comuse = 3.
85
<PARAM_NAME>A</PARAM_NAME>
87
<SP>: state matrix of the given system</SP>
91
<PARAM_NAME>B</PARAM_NAME>
93
<SP>: optionnal, input matrix of the given system</SP>
97
<PARAM_NAME>C</PARAM_NAME>
99
<SP>: output matrix of the given system</SP>
103
<PARAM_NAME>D</PARAM_NAME>
105
<SP>: optionnal, direct feedthrough of the given system</SP>
109
<PARAM_NAME>Y</PARAM_NAME>
111
<SP>: the t-by-l output-data sequence matrix. Column j of Y contains the t values of the j-th output component for consecutive time increments.</SP>
115
<PARAM_NAME>U</PARAM_NAME>
117
<SP>: the t-by-m input-data sequence matrix (input when jobx0 = 1 and comuse = 2, or comuse = 1). Column j of U contains the t values of the j-th input component for consecutive time increments.</SP>
121
<PARAM_NAME>tol</PARAM_NAME>
123
<SP>: optionnal, tolerance used for estimating the rank of
124
matrices. If tol > 0, then the given value of tol is used as
125
a lower bound for the reciprocal condition number; an m-by-n matrix
126
whose estimated condition number is less than 1/tol is considered
127
to be of full rank. Default: m*n*epsilon_machine where
128
epsilon_machine is the relative machine precision.</SP>
132
<PARAM_NAME>printw</PARAM_NAME>
134
<SP>:optionnal, switch for printing the warning messages.</SP>
137
<PARAM_NAME>= </PARAM_NAME>
139
<SP>1: print warning messages;</SP>
143
<PARAM_NAME>= </PARAM_NAME>
145
<SP>0: do not print warning messages.</SP>
155
<PARAM_NAME>ldwork</PARAM_NAME>
157
<SP>: (optional) the workspace size. Default : computed by the formula LDWORK = MAX( minimum workspace size needed, 2*CSIZE/3, CSIZE - ( m + l )*t - 2*n*( n + m + l ) - l*m ) where CSIZE is the cache size in double precision words.</SP>
161
<PARAM_NAME>x0</PARAM_NAME>
163
<SP>: initial state vector</SP>
167
<PARAM_NAME>Br</PARAM_NAME>
169
<SP>: system input matrix</SP>
173
<PARAM_NAME>Dr</PARAM_NAME>
175
<SP>: system direct feedthrough matrix</SP>
179
<PARAM_NAME>V</PARAM_NAME>
181
<SP>: the n-by-n orthogonal matrix which reduces A to a real Schur form (output when jobx0 = 1 or comuse = 1).</SP>
185
<PARAM_NAME>rcnd</PARAM_NAME>
187
<SP>: (optional) the reciprocal condition numbers of the matrices involved in rank decisions.</SP>
194
findBD function for estimating the initial state and the system
195
matrices B and D of a discrete-time system, using SLICOT routine
201
[x0,Br,V,rcnd] = findBD(1,1,1,A,C,Y,U)
202
[x0,Br,Dr,V,rcnd] = findBD(1,1,2,A,C,Y,U)
203
[Br,V,rcnd] = findBD(2,1,1,A,C,Y,U)
204
[B,Dr,V,rcnd] = findBD(2,1,2,A,C,Y,U)
205
[x0,V,rcnd] = findBD(1,2,1,A,B,C,Y,U)
206
[x0,V,rcnd] = findBD(1,2,2,A,B,C,D,Y,U)
207
[x0,rcnd] = findBD(2,2) // (Set x0 = 0, rcnd = 1)
208
[x0,V,rcnd] = findBD(1,3,A,C,Y)
212
Note: the example lines above may contain at the end the parameters
216
FINDBD estimates the initial state and/or the system matrices Br and Dr
217
of a discrete-time system, given the system matrices A, C, and possibly
218
B, D, and the input and output trajectories of the system.
221
The model structure is :
225
x(k+1) = Ax(k) + Bu(k), k >= 1,
226
y(k) = Cx(k) + Du(k),
232
x(k) is the n-dimensional state vector (at time k),
235
u(k) is the m-dimensional input vector,
238
y(k) is the l-dimensional output vector,
241
and A, B, C, and D are real matrices of appropriate dimensions.
244
<SECTION label="Comments">
247
<SP>The n-by-m system input matrix B is an input parameter when jobx0 = 1 and comuse = 2, and it is an output parameter when comuse = 1.</SP>
250
<SP>The l-by-m system matrix D is an input parameter when jobx0 = 1, comuse = 2 and job = 2, and it is an output parameter when comuse = 1 and job = 2.</SP>
253
<SP>The n-vector of estimated initial state x(0) is an output parameter when jobx0 = 1, but also when jobx0 = 2 and comuse <= 2, in which case it is set to 0.</SP>
256
<SP>If ldwork is specified, but it is less than the minimum workspace size needed, that minimum value is used instead.</SP>
262
//generate data from a given linear system
263
A = [ 0.5, 0.1,-0.1, 0.2;
269
SYS=syslin(0.1,A,B,C);
271
U=prbs_a(nsmp,nsmp/5);
272
Y=(flts(U,SYS)+0.3*rand(1,nsmp,'normal'));
276
[R,N,SVAL] = findR(S,Y',U');
280
[A,C] = findAC(S,N,L,R,METH,TOL);
281
[X0,B,D] = findBD(1,1,2,A,C,Y',U')
282
SYS1=syslin(1,A,B,C,D,X0);
285
xbasc();plot2d((1:nsmp)',[Y',Y1'])
290
<LINK>inistate</LINK>
293
<LINK>findx0BD</LINK>
296
<LINK>findABCD</LINK>
305
<AUTHOR>V. Sima, Katholieke Univ. Leuven, Belgium, May 2000.
306
(Revisions: V. Sima, July 2000)</AUTHOR>