File: octave_26.html

package info (click to toggle)
octave 2.0.13.95-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 26,052 kB
  • ctags: 16,420
  • sloc: cpp: 67,184; fortran: 41,514; ansic: 26,607; sh: 7,291; makefile: 4,089; lex: 1,961; yacc: 1,852; perl: 1,676; lisp: 1,664; exp: 123
file content (435 lines) | stat: -rw-r--r-- 10,480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.51
     from ./octave.texi on 9 October 1998 -->

<TITLE>GNU Octave - Control Theory</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="octave_1.html">first</A>, <A HREF="octave_25.html">previous</A>, <A HREF="octave_27.html">next</A>, <A HREF="octave_40.html">last</A> section, <A HREF="octave_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC161" HREF="octave_toc.html#TOC161">Control Theory</A></H1>

<P>
Most of the functions described in this chapter were contributed by
A. Scottedward Hodel @email{A.S.Hodel@eng.auburn.edu} and R. Bruce Tenison
@email{Bruce.Tenison@eng.auburn.edu}.  They have also written a larger
collection of functions for solving linear control problems.  It is
currently being updated for Octave version 2, with snapshots of the
sources available from @url{ftp://ftp.eng.auburn.edu/pub/hodel}.

</P>
<P>
<DL>
<DT><U>Function File:</U> [<VAR>n</VAR>, <VAR>m</VAR>, <VAR>p</VAR>] = <B>abcddim</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>c</VAR>, <VAR>d</VAR>)</I>
<DD><A NAME="IDX785"></A>
Check for compatibility of the dimensions of the matrices defining
the linear system
or a similar discrete-time system.

</P>
<P>
If the matrices are compatibly dimensioned, then <CODE>abcddim</CODE> returns

</P>
<DL COMPACT>

<DT><VAR>n</VAR>
<DD>
The number of system states.

<DT><VAR>m</VAR>
<DD>
The number of system inputs.

<DT><VAR>p</VAR>
<DD>
The number of system outputs.
</DL>

<P>
Otherwise <CODE>abcddim</CODE> returns <VAR>n</VAR> = <VAR>m</VAR> = <VAR>p</VAR> = -1.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>are</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>c</VAR>, <VAR>opt</VAR>)</I>
<DD><A NAME="IDX786"></A>

</P>
<P>
Return the solution, <VAR>x</VAR>, of the algebraic Riccati equation

</P>
<P>
for identically dimensioned square matrices <VAR>a</VAR>, <VAR>b</VAR>, and
<VAR>c</VAR>.  If <VAR>b</VAR> is not square, <CODE>are</CODE> attempts to use
<CODE><VAR>b</VAR>*<VAR>b</VAR>'</CODE> instead.  If <VAR>c</VAR> is not square, <CODE>are</CODE>
attempts to use <CODE><VAR>c</VAR>'*<VAR>c</VAR></CODE>) instead.

</P>
<P>
To form the solution, Laub's Schur method (IEEE Transactions on
Automatic Control, 1979) is applied to the appropriate Hamiltonian
matrix.

</P>
<P>
The optional argument <VAR>opt</VAR> is passed to the eigenvalue balancing
routine.  If it is omitted, a value of <CODE>"B"</CODE> is assumed.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>c2d</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>t</VAR>)</I>
<DD><A NAME="IDX787"></A>
Convert the continuous time system described by:
into a discrete time equivalent model

</P>
<P>
via the matrix exponential assuming a zero-order hold on the input and
sample time <VAR>t</VAR>.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>dare</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>c</VAR>, <VAR>r</VAR>, <VAR>opt</VAR>)</I>
<DD><A NAME="IDX788"></A>

</P>
<P>
Return the solution, <VAR>x</VAR> of the discrete-time algebraic Riccati
equation

</P>
<P>
for matrices with dimensions:

</P>
<DL COMPACT>

<DT><VAR>a</VAR>
<DD>
<VAR>n</VAR> by <VAR>n</VAR>.

<DT><VAR>b</VAR>
<DD>
<VAR>n</VAR> by <VAR>m</VAR>.

<DT><VAR>c</VAR>
<DD>
<VAR>n</VAR> by <VAR>n</VAR>, symmetric positive semidefinite.

<DT><VAR>r</VAR>
<DD>
<VAR>m</VAR> by <VAR>m</VAR>, symmetric positive definite (invertible).
</DL>

<P>
If <VAR>c</VAR> is not square, then the function attempts to use
<CODE><VAR>c</VAR>'*<VAR>c</VAR></CODE> instead.

</P>
<P>
To form the solution, Laub's Schur method (IEEE Transactions on
Automatic Control, 1979) is applied to the appropriate symplectic
matrix.

</P>
<P>
See also Ran and Rodman, <CITE>Stable Hermitian Solutions of Discrete
Algebraic Riccati Equations</CITE>, Mathematics of Control, Signals and 
Systems, Volume 5, Number 2 (1992).

</P>
<P>
The optional argument <VAR>opt</VAR> is passed to the eigenvalue balancing
routine.  If it is omitted, a value of <CODE>"B"</CODE> is assumed.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>dgram</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD><A NAME="IDX789"></A>
Return the discrete controllability or observability gramian for the
discrete time system described by

</P>
<P>
For example, <CODE>dgram (<VAR>a</VAR>, <VAR>b</VAR>)</CODE> returns the discrete
controllability gramian and <CODE>dgram (<VAR>a</VAR>', <VAR>c</VAR>')</CODE> returns
the observability gramian.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U> [<VAR>l</VAR>, <VAR>m</VAR>, <VAR>p</VAR>, <VAR>e</VAR>] = <B>dlqe</B> <I>(<VAR>a</VAR>, <VAR>g</VAR>, <VAR>c</VAR>, <VAR>sigw</VAR>, <VAR>sigv</VAR>, <VAR>z</VAR>)</I>
<DD><A NAME="IDX790"></A>
Construct the linear quadratic estimator (Kalman filter) for the
discrete time system
where <VAR>w</VAR>, <VAR>v</VAR> are zero-mean gaussian noise processes with
respective intensities <CODE><VAR>sigw</VAR> = cov (<VAR>w</VAR>, <VAR>w</VAR>)</CODE> and
<CODE><VAR>sigv</VAR> = cov (<VAR>v</VAR>, <VAR>v</VAR>)</CODE>.

</P>
<P>
If specified, <VAR>z</VAR> is <CODE>cov (<VAR>w</VAR>, <VAR>v</VAR>)</CODE>.  Otherwise
<CODE>cov (<VAR>w</VAR>, <VAR>v</VAR>) = 0</CODE>.

</P>
<P>
The observer structure is

</P>
<P>
The following values are returned:

</P>
<DL COMPACT>

<DT><VAR>l</VAR>
<DD>
The observer gain, 
is stable.

<DT><VAR>m</VAR>
<DD>
The Riccati equation solution.

<DT><VAR>p</VAR>
<DD>
The estimate error covariance after the measurement update.

<DT><VAR>e</VAR>
<DD>
The closed loop poles of
</DL>
</DL>

<P>
<DL>
<DT><U>Function File:</U> [<VAR>k</VAR>, <VAR>p</VAR>, <VAR>e</VAR>] = <B>dlqr</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>q</VAR>, <VAR>r</VAR>, <VAR>z</VAR>)</I>
<DD><A NAME="IDX791"></A>
Construct the linear quadratic regulator for the discrete time system
to minimize the cost functional

</P>
<P>
<VAR>z</VAR> omitted or
<VAR>z</VAR> included.

</P>
<P>
The following values are returned:

</P>
<DL COMPACT>

<DT><VAR>k</VAR>
<DD>
The state feedback gain,
is stable.

<DT><VAR>p</VAR>
<DD>
The solution of algebraic Riccati equation.

<DT><VAR>e</VAR>
<DD>
The closed loop poles of
</DL>
</DL>

<P>
<DL>
<DT><U>Function File:</U>  <B>dlyap</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>)</I>
<DD><A NAME="IDX792"></A>
Solve the discrete-time Lyapunov equation
for square matrices <VAR>a</VAR>, <VAR>b</VAR>.  If <VAR>b</VAR> is not square, then the
function attempts to solve either
whichever is appropriate.

</P>
<P>
Uses Schur decomposition method as in Kitagawa 
International Journal of Control, Volume 25, Number 5, pages 745--753
(1977); column-by-column solution method as suggested in
Hammerling, <CITE>Numerical Solution of the Stable, Non-Negative
Definite Lyapunov Equation</CITE>, IMA Journal of Numerical Analysis, Volume
2, pages 303--323 (1982).
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>is_controllable</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>tol</VAR>)</I>
<DD><A NAME="IDX793"></A>
Return 1 if the pair (<VAR>a</VAR>, <VAR>b</VAR>) is controllable.  Otherwise,
return 0.

</P>
<P>
The optional argument <VAR>tol</VAR> is a roundoff parameter.  If it is
omitted, a value of <CODE>2*eps</CODE> is used.

</P>
<P>
Currently, <CODE>is_controllable</CODE> just constructs the controllability
matrix and checks rank.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>is_observable</B> <I>(<VAR>a</VAR>, <VAR>c</VAR>, <VAR>tol</VAR>)</I>
<DD><A NAME="IDX794"></A>

</P>
<P>
Return 1 if the pair (<VAR>a</VAR>, <VAR>c</VAR>) is observable.
Otherwise, return 0.

</P>
<P>
The optional argument <VAR>tol</VAR> is a roundoff parameter.  If it is
omitted, a value of <CODE>2*eps</CODE> is used.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U> [<VAR>k</VAR>, <VAR>p</VAR>, <VAR>e</VAR>] = <B>lqe</B> <I>(<VAR>a</VAR>, <VAR>g</VAR>, <VAR>c</VAR>, <VAR>sigw</VAR>, <VAR>sigv</VAR>, <VAR>z</VAR>)</I>
<DD><A NAME="IDX795"></A>
Construct the linear quadratic estimator (Kalman filter) for the
continuous time system
where <VAR>w</VAR> and <VAR>v</VAR> are zero-mean gaussian noise processes with
respective intensities

</P>

<PRE>
sigw = cov (w, w)
sigv = cov (v, v)
</PRE>

<P>
The optional argument <VAR>z</VAR> is the cross-covariance
<CODE>cov (<VAR>w</VAR>, <VAR>v</VAR>)</CODE>.  If it is omitted,
<CODE>cov (<VAR>w</VAR>, <VAR>v</VAR>) = 0</CODE> is assumed.

</P>
<P>
Observer structure is <CODE>dz/dt = A z + B u + k (y - C z - D u)</CODE>

</P>
<P>
The following values are returned:

</P>
<DL COMPACT>

<DT><VAR>k</VAR>
<DD>
The observer gain,
is stable.

<DT><VAR>p</VAR>
<DD>
The solution of algebraic Riccati equation.

<DT><VAR>e</VAR>
<DD>
The vector of closed loop poles of
</DL>
</DL>

<P>
<DL>
<DT><U>Function File:</U> [<VAR>k</VAR>, <VAR>p</VAR>, <VAR>e</VAR>] = <B>lqr</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>q</VAR>, <VAR>r</VAR>, <VAR>z</VAR>)</I>
<DD><A NAME="IDX796"></A>
construct the linear quadratic regulator for the continuous time system
to minimize the cost functional

</P>
<P>
<VAR>z</VAR> omitted or
<VAR>z</VAR> included.

</P>
<P>
The following values are returned:

</P>
<DL COMPACT>

<DT><VAR>k</VAR>
<DD>
The state feedback gain,
is stable.

<DT><VAR>p</VAR>
<DD>
The stabilizing solution of appropriate algebraic Riccati equation.

<DT><VAR>e</VAR>
<DD>
The vector of the closed loop poles of
</DL>
</DL>

<P>
<DL>
<DT><U>Function File:</U>  <B>lyap</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>c</VAR>)</I>
<DD><A NAME="IDX797"></A>
Solve the Lyapunov (or Sylvester) equation via the Bartels-Stewart
algorithm (Communications of the ACM, 1972).

</P>
<P>
If <VAR>a</VAR>, <VAR>b</VAR>, and <VAR>c</VAR> are specified, then <CODE>lyap</CODE> returns
the solution of the  Sylvester equation

</P>
<P>
If only <CODE>(a, b)</CODE> are specified, then <CODE>lyap</CODE> returns the
solution of the Lyapunov equation

</P>
<P>
If <VAR>b</VAR> is not square, then <CODE>lyap</CODE> returns the solution of either

</P>
<P>
or

</P>
<P>
whichever is appropriate.
</DL>

</P>
<P>
<DL>
<DT><U>Function File:</U>  <B>tzero</B> <I>(<VAR>a</VAR>, <VAR>b</VAR>, <VAR>c</VAR>, <VAR>d</VAR>, <VAR>opt</VAR>)</I>
<DD><A NAME="IDX798"></A>
Compute the transmission zeros of

</P>
<P>
The optional argument <VAR>opt</VAR> is passed to the eigenvalue balancing
routine.  If it is omitted, a value of <CODE>"B"</CODE> is assumed.
</DL>

</P>
<P><HR><P>
Go to the <A HREF="octave_1.html">first</A>, <A HREF="octave_25.html">previous</A>, <A HREF="octave_27.html">next</A>, <A HREF="octave_40.html">last</A> section, <A HREF="octave_toc.html">table of contents</A>.
</BODY>
</HTML>