6778
|
1 @c Copyright (C) 1996, 1997, 2007 John W. Eaton |
7018
|
2 @c |
|
3 @c This file is part of Octave. |
|
4 @c |
|
5 @c Octave is free software; you can redistribute it and/or modify it |
|
6 @c under the terms of the GNU General Public License as published by the |
|
7 @c Free Software Foundation; either version 3 of the License, or (at |
|
8 @c your option) any later version. |
|
9 @c |
|
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 @c for more details. |
|
14 @c |
|
15 @c You should have received a copy of the GNU General Public License |
|
16 @c along with Octave; see the file COPYING. If not, see |
|
17 @c <http://www.gnu.org/licenses/>. |
3294
|
18 |
4167
|
19 @node Control Theory |
3294
|
20 @chapter Control Theory |
|
21 |
5016
|
22 The Octave Control Systems Toolbox (@acronym{OCST}) was initially developed |
3294
|
23 by Dr.@: A. Scottedward Hodel |
|
24 @email{a.s.hodel@@eng.auburn.edu} with the assistance |
|
25 of his students |
|
26 @itemize @bullet |
|
27 @item R. Bruce Tenison @email{btenison@@dibbs.net}, |
|
28 @item David C. Clem, |
|
29 @item John E. Ingram @email{John.Ingram@@sea.siemans.com}, and |
|
30 @item Kristi McGowan. |
|
31 @end itemize |
5016
|
32 This development was supported in part by @acronym{NASA}'s Marshall Space Flight |
|
33 Center as part of an in-house @acronym{CACSD} environment. Additional important |
3294
|
34 contributions were made by Dr. Kai Mueller @email{mueller@@ifr.ing.tu-bs.de} |
|
35 and Jose Daniel Munoz Frias (@code{place.m}). |
|
36 |
3347
|
37 An on-line menu-driven tutorial is available via @code{DEMOcontrol}; |
5016
|
38 beginning @acronym{OCST} users should start with this program. |
3294
|
39 |
3347
|
40 @DOCSTRING(DEMOcontrol) |
|
41 |
3294
|
42 @menu |
3347
|
43 * sysstruct:: |
|
44 * sysinterface:: |
|
45 * sysdisp:: |
|
46 * blockdiag:: |
|
47 * numerical:: |
|
48 * sysprop:: |
|
49 * systime:: |
|
50 * sysfreq:: |
|
51 * cacsd:: |
|
52 * misc:: |
3294
|
53 @end menu |
|
54 |
4167
|
55 @node sysstruct |
3347
|
56 @section System Data Structure |
3294
|
57 |
|
58 @menu |
3347
|
59 * sysstructvars:: |
|
60 * sysstructtf:: |
|
61 * sysstructzp:: |
|
62 * sysstructss:: |
3294
|
63 @end menu |
3347
|
64 |
5016
|
65 The @acronym{OCST} stores all dynamic systems in |
3294
|
66 a single data structure format that can represent continuous systems, |
|
67 discrete-systems, and mixed (hybrid) systems in state-space form, and |
|
68 can also represent purely continuous/discrete systems in either |
|
69 transfer function or pole-zero form. In order to |
|
70 provide more flexibility in treatment of discrete/hybrid systems, the |
5016
|
71 @acronym{OCST} also keeps a record of which system outputs are sampled. |
3294
|
72 |
|
73 Octave structures are accessed with a syntax much like that used |
|
74 by the C programming language. For consistency in |
5016
|
75 use of the data structure used in the @acronym{OCST}, it is recommended that |
3402
|
76 the system structure access m-files be used (@pxref{sysinterface}). |
3294
|
77 Some elements of the data structure are absent depending on the internal |
|
78 system representation(s) used. More than one system representation |
5016
|
79 can be used for @acronym{SISO} systems; the @acronym{OCST} m-files ensure that all representations |
3294
|
80 used are consistent with one another. |
|
81 |
3346
|
82 @DOCSTRING(sysrepdemo) |
3294
|
83 |
4167
|
84 @node sysstructvars |
5016
|
85 @subsection Variables common to all @acronym{OCST} system formats |
3294
|
86 |
|
87 The data structure elements (and variable types) common to all system |
|
88 representations are listed below; examples of the initialization |
|
89 and use of the system data structures are given in subsequent sections and |
|
90 in the online demo @code{DEMOcontrol}. |
|
91 @table @var |
3402
|
92 @item n |
|
93 @itemx nz |
3294
|
94 The respective number of continuous and discrete states |
|
95 in the system (scalar) |
|
96 |
3402
|
97 @item inname |
|
98 @itemx outname |
3294
|
99 list of name(s) of the system input, output signal(s). (list of strings) |
|
100 |
|
101 @item sys |
3347
|
102 System status vector. (vector) |
3294
|
103 |
3347
|
104 This vector indicates both what representation was used to initialize |
|
105 the system data structure (called the primary system type) and which |
|
106 other representations are currently up-to-date with the primary system |
3402
|
107 type (@pxref{structaccess}). |
3294
|
108 |
3402
|
109 The value of the first element of the vector indicates the primary |
|
110 system type. |
3294
|
111 |
3402
|
112 @table @asis |
|
113 @item 0 |
|
114 for tf form (initialized with @code{tf2sys} or @code{fir2sys}) |
3294
|
115 |
3402
|
116 @item 1 |
|
117 for zp form (initialized with @code{zp2sys}) |
3294
|
118 |
3402
|
119 @item 2 |
|
120 for ss form (initialized with @code{ss2sys}) |
3294
|
121 @end table |
|
122 |
3402
|
123 The next three elements are boolean flags that indicate whether tf, zp, |
|
124 or ss, respectively, are ``up to date" (whether it is safe to use the |
|
125 variables associated with these representations). These flags are |
|
126 changed when calls are made to the @code{sysupdate} command. |
|
127 |
3294
|
128 @item tsam |
|
129 Discrete time sampling period (nonnegative scalar). |
|
130 @var{tsam} is set to 0 for continuous time systems. |
|
131 |
|
132 @item yd |
|
133 Discrete-time output list (vector) |
|
134 |
|
135 indicates which outputs are discrete time (i.e., |
|
136 produced by D/A converters) and which are continuous time. |
|
137 yd(ii) = 0 if output ii is continuous, = 1 if discrete. |
|
138 @end table |
|
139 |
|
140 The remaining variables of the system data structure are only present |
|
141 if the corresponding entry of the @code{sys} vector is true (=1). |
|
142 |
4167
|
143 @node sysstructtf |
3294
|
144 @subsection @code{tf} format variables |
|
145 |
|
146 @table @var |
|
147 @item num |
|
148 numerator coefficients (vector) |
|
149 |
|
150 @item den |
|
151 denominator coefficients (vector) |
|
152 |
|
153 @end table |
|
154 |
4167
|
155 @node sysstructzp |
3294
|
156 @subsection @code{zp} format variables |
3347
|
157 |
3294
|
158 @table @var |
|
159 @item zer |
|
160 system zeros (vector) |
|
161 |
|
162 @item pol |
|
163 system poles (vector) |
|
164 |
|
165 @item k |
|
166 leading coefficient (scalar) |
|
167 |
|
168 @end table |
|
169 |
4167
|
170 @node sysstructss |
3294
|
171 @subsection @code{ss} format variables |
3347
|
172 |
3294
|
173 @table @var |
3402
|
174 @item a |
|
175 @itemx b |
|
176 @itemx c |
|
177 @itemx d |
3294
|
178 The usual state-space matrices. If a system has both |
|
179 continuous and discrete states, they are sorted so that |
|
180 continuous states come first, then discrete states |
|
181 |
|
182 @strong{Note} some functions (e.g., @code{bode}, @code{hinfsyn}) |
|
183 will not accept systems with both discrete and continuous states/outputs |
|
184 |
|
185 @item stname |
|
186 names of system states (list of strings) |
|
187 |
|
188 @end table |
|
189 |
4167
|
190 @node sysinterface |
3294
|
191 @section System Construction and Interface Functions |
|
192 |
5016
|
193 Construction and manipulations of the @acronym{OCST} system data structure |
3402
|
194 (@pxref{sysstruct}) requires attention to many details in order |
3294
|
195 to ensure that data structure contents remain consistent. Users |
|
196 are strongly encouraged to use the system interface functions |
|
197 in this section. Functions for the formatted display in of system |
|
198 data structures are given in @ref{sysdisp}. |
|
199 |
|
200 @menu |
3347
|
201 * fir2sys:: |
|
202 * ss2sys:: |
|
203 * tf2sys:: |
|
204 * zp2sys:: |
|
205 * structaccess:: |
3294
|
206 @end menu |
|
207 |
4167
|
208 @node fir2sys |
3294
|
209 @subsection Finite impulse response system interface functions |
|
210 |
3346
|
211 @DOCSTRING(fir2sys) |
3294
|
212 |
3346
|
213 @DOCSTRING(sys2fir) |
3294
|
214 |
4167
|
215 @node ss2sys |
3294
|
216 @subsection State space system interface functions |
|
217 |
6551
|
218 @DOCSTRING(ss) |
|
219 |
3346
|
220 @DOCSTRING(ss2sys) |
3294
|
221 |
3346
|
222 @DOCSTRING(sys2ss) |
3294
|
223 |
4167
|
224 @node tf2sys |
3294
|
225 @subsection Transfer function system interface functions |
3347
|
226 |
6551
|
227 @DOCSTRING(tf) |
|
228 |
3346
|
229 @DOCSTRING(tf2sys) |
3294
|
230 |
3346
|
231 @DOCSTRING(sys2tf) |
3294
|
232 |
4167
|
233 @node zp2sys |
3294
|
234 @subsection Zero-pole system interface functions |
3347
|
235 |
6551
|
236 @DOCSTRING(zp) |
|
237 |
3346
|
238 @DOCSTRING(zp2sys) |
3294
|
239 |
3346
|
240 @DOCSTRING(sys2zp) |
3294
|
241 |
4167
|
242 @node structaccess |
3294
|
243 @subsection Data structure access functions |
|
244 |
3346
|
245 @DOCSTRING(syschnames) |
3294
|
246 |
3346
|
247 @DOCSTRING(syschtsam) |
3294
|
248 |
3346
|
249 @DOCSTRING(sysdimensions) |
3294
|
250 |
3346
|
251 @DOCSTRING(sysgetsignals) |
3294
|
252 |
3346
|
253 @DOCSTRING(sysgettype) |
3294
|
254 |
3346
|
255 @DOCSTRING(syssetsignals) |
3294
|
256 |
3346
|
257 @DOCSTRING(sysupdate) |
3294
|
258 |
3428
|
259 @DOCSTRING(minfo) |
|
260 |
|
261 @DOCSTRING(sysgettsam) |
|
262 |
4167
|
263 @node sysdisp |
3294
|
264 @section System display functions |
|
265 |
3346
|
266 @DOCSTRING(sysout) |
3294
|
267 |
3346
|
268 @DOCSTRING(tfout) |
3294
|
269 |
3346
|
270 @DOCSTRING(zpout) |
3294
|
271 |
4167
|
272 @node blockdiag |
3294
|
273 @section Block Diagram Manipulations |
|
274 |
3402
|
275 @xref{systime}. |
3294
|
276 |
|
277 Unless otherwise noted, all parameters (input,output) are |
|
278 system data structures. |
|
279 |
3346
|
280 @DOCSTRING(bddemo) |
3294
|
281 |
3346
|
282 @DOCSTRING(buildssic) |
3294
|
283 |
3346
|
284 @DOCSTRING(jet707) |
3294
|
285 |
3346
|
286 @DOCSTRING(ord2) |
3294
|
287 |
3346
|
288 @DOCSTRING(sysadd) |
3294
|
289 |
3346
|
290 @DOCSTRING(sysappend) |
3294
|
291 |
3346
|
292 @DOCSTRING(sysconnect) |
3294
|
293 |
3346
|
294 @DOCSTRING(syscont) |
3294
|
295 |
3346
|
296 @DOCSTRING(sysdisc) |
3294
|
297 |
3346
|
298 @DOCSTRING(sysdup) |
3294
|
299 |
3346
|
300 @DOCSTRING(sysgroup) |
3294
|
301 |
3346
|
302 @DOCSTRING(sysmult) |
3294
|
303 |
3346
|
304 @DOCSTRING(sysprune) |
3294
|
305 |
3346
|
306 @DOCSTRING(sysreorder) |
3294
|
307 |
3346
|
308 @DOCSTRING(sysscale) |
3294
|
309 |
3346
|
310 @DOCSTRING(syssub) |
3294
|
311 |
3346
|
312 @DOCSTRING(ugain) |
3294
|
313 |
3346
|
314 @DOCSTRING(wgt1o) |
3294
|
315 |
3428
|
316 @DOCSTRING(parallel) |
|
317 |
|
318 @DOCSTRING(sysmin) |
|
319 |
4167
|
320 @node numerical |
3294
|
321 @section Numerical Functions |
3347
|
322 |
3346
|
323 @DOCSTRING(are) |
3294
|
324 |
3346
|
325 @DOCSTRING(dare) |
3294
|
326 |
3428
|
327 @DOCSTRING(dre) |
|
328 |
3346
|
329 @DOCSTRING(dgram) |
3294
|
330 |
3346
|
331 @DOCSTRING(dlyap) |
3294
|
332 |
3346
|
333 @DOCSTRING(gram) |
3294
|
334 |
3346
|
335 @DOCSTRING(lyap) |
3294
|
336 |
3346
|
337 @DOCSTRING(qzval) |
3294
|
338 |
3346
|
339 @DOCSTRING(zgfmul) |
3347
|
340 |
3346
|
341 @DOCSTRING(zgfslv) |
3347
|
342 |
3346
|
343 @DOCSTRING(zginit) |
3347
|
344 |
3346
|
345 @DOCSTRING(zgreduce) |
3347
|
346 |
3346
|
347 @DOCSTRING(zgrownorm) |
3347
|
348 |
3346
|
349 @DOCSTRING(zgscal) |
3347
|
350 |
3346
|
351 @DOCSTRING(zgsgiv) |
3347
|
352 |
3346
|
353 @DOCSTRING(zgshsr) |
3294
|
354 |
5016
|
355 @strong{References} |
3294
|
356 @table @strong |
|
357 @item ZGEP |
5016
|
358 Hodel, @cite{Computation of Zeros with Balancing}, 1992, Linear Algebra |
3294
|
359 and its Applications |
|
360 @item @strong{Generalized CG} |
5016
|
361 Golub and Van Loan, @cite{Matrix Computations, 2nd ed} 1989. |
3294
|
362 @end table |
|
363 |
4167
|
364 @node sysprop |
3294
|
365 @section System Analysis-Properties |
|
366 |
3346
|
367 @DOCSTRING(analdemo) |
3294
|
368 |
3346
|
369 @DOCSTRING(abcddim) |
3294
|
370 |
3346
|
371 @DOCSTRING(ctrb) |
3294
|
372 |
3346
|
373 @DOCSTRING(h2norm) |
3294
|
374 |
3346
|
375 @DOCSTRING(hinfnorm) |
3294
|
376 |
3346
|
377 @DOCSTRING(obsv) |
3294
|
378 |
3346
|
379 @DOCSTRING(pzmap) |
3294
|
380 |
3346
|
381 @DOCSTRING(is_abcd) |
3294
|
382 |
3346
|
383 @DOCSTRING(is_controllable) |
3294
|
384 |
3346
|
385 @DOCSTRING(is_detectable) |
3294
|
386 |
3346
|
387 @DOCSTRING(is_dgkf) |
3294
|
388 |
3346
|
389 @DOCSTRING(is_digital) |
3294
|
390 |
3346
|
391 @DOCSTRING(is_observable) |
3294
|
392 |
3346
|
393 @DOCSTRING(is_sample) |
3294
|
394 |
3346
|
395 @DOCSTRING(is_siso) |
3294
|
396 |
3346
|
397 @DOCSTRING(is_stabilizable) |
3294
|
398 |
3346
|
399 @DOCSTRING(is_signal_list) |
3294
|
400 |
3346
|
401 @DOCSTRING(is_stable) |
3294
|
402 |
4167
|
403 @node systime |
3294
|
404 @section System Analysis-Time Domain |
|
405 |
3346
|
406 @DOCSTRING(c2d) |
3294
|
407 |
3346
|
408 @DOCSTRING(d2c) |
3294
|
409 |
3346
|
410 @DOCSTRING(dmr2d) |
3294
|
411 |
3346
|
412 @DOCSTRING(damp) |
3294
|
413 |
3346
|
414 @DOCSTRING(dcgain) |
3294
|
415 |
3346
|
416 @DOCSTRING(impulse) |
3294
|
417 |
3346
|
418 @DOCSTRING(step) |
3294
|
419 |
4167
|
420 @node sysfreq |
3294
|
421 @section System Analysis-Frequency Domain |
|
422 |
|
423 @strong{Demonstration/tutorial script} |
3346
|
424 @DOCSTRING(frdemo) |
3294
|
425 |
3346
|
426 @DOCSTRING(bode) |
3294
|
427 |
3346
|
428 @DOCSTRING(bode_bounds) |
3294
|
429 |
3346
|
430 @DOCSTRING(freqchkw) |
3294
|
431 |
3346
|
432 @DOCSTRING(ltifr) |
3294
|
433 |
3346
|
434 @DOCSTRING(nyquist) |
3294
|
435 |
6551
|
436 @DOCSTRING(nichols) |
|
437 |
3346
|
438 @DOCSTRING(tzero) |
3294
|
439 |
3346
|
440 @DOCSTRING(tzero2) |
3294
|
441 |
4167
|
442 @node cacsd |
3294
|
443 @section Controller Design |
|
444 |
3346
|
445 @DOCSTRING(dgkfdemo) |
3294
|
446 |
3346
|
447 @DOCSTRING(hinfdemo) |
3294
|
448 |
3346
|
449 @DOCSTRING(dlqe) |
3294
|
450 |
3346
|
451 @DOCSTRING(dlqr) |
3294
|
452 |
3705
|
453 @DOCSTRING(dkalman) |
|
454 |
3346
|
455 @DOCSTRING(h2syn) |
3294
|
456 |
3346
|
457 @DOCSTRING(hinf_ctr) |
3294
|
458 |
3346
|
459 @DOCSTRING(hinfsyn) |
3294
|
460 |
3346
|
461 @DOCSTRING(hinfsyn_chk) |
3294
|
462 |
3428
|
463 @DOCSTRING(hinfsyn_ric) |
|
464 |
3346
|
465 @DOCSTRING(lqe) |
3294
|
466 |
3346
|
467 @DOCSTRING(lqg) |
3294
|
468 |
3346
|
469 @DOCSTRING(lqr) |
3294
|
470 |
3346
|
471 @DOCSTRING(lsim) |
3294
|
472 |
3346
|
473 @DOCSTRING(place) |
3294
|
474 |
4167
|
475 @node misc |
3294
|
476 @section Miscellaneous Functions (Not yet properly filed/documented) |
|
477 |
3346
|
478 @DOCSTRING(axis2dlim) |
3294
|
479 |
3346
|
480 @DOCSTRING(moddemo) |
3294
|
481 |
3346
|
482 @DOCSTRING(prompt) |
3294
|
483 |
3346
|
484 @DOCSTRING(rldemo) |
3294
|
485 |
3346
|
486 @DOCSTRING(rlocus) |
3294
|
487 |
3346
|
488 @DOCSTRING(sortcom) |
3294
|
489 |
3346
|
490 @DOCSTRING(ss2tf) |
3294
|
491 |
3346
|
492 @DOCSTRING(ss2zp) |
3294
|
493 |
3346
|
494 @DOCSTRING(starp) |
3294
|
495 |
3346
|
496 @DOCSTRING(tf2ss) |
3294
|
497 |
3346
|
498 @DOCSTRING(tf2zp) |
3294
|
499 |
3346
|
500 @DOCSTRING(zp2ss) |
3294
|
501 |
3346
|
502 @DOCSTRING(zp2tf) |
3294
|
503 |