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