7017
|
1 ## Copyright (C) 1996, 2000, 2003, 2004, 2005, 2007 |
|
2 ## Auburn University. All rights reserved. |
3431
|
3 ## |
|
4 ## This file is part of Octave. |
|
5 ## |
|
6 ## Octave is free software; you can redistribute it and/or modify it |
7016
|
7 ## under the terms of the GNU General Public License as published by |
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
3431
|
10 ## |
7016
|
11 ## Octave is distributed in the hope that it will be useful, but |
|
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 ## General Public License for more details. |
3431
|
15 ## |
|
16 ## You should have received a copy of the GNU General Public License |
7016
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
3431
|
19 |
|
20 ## -*- texinfo -*- |
3500
|
21 ## @deftypefn {Function File} {} dgram (@var{a}, @var{b}) |
5016
|
22 ## Return controllability gramian of discrete time system |
|
23 ## @iftex |
|
24 ## @tex |
|
25 ## $$ x_{k+1} = ax_k + bu_k $$ |
|
26 ## @end tex |
|
27 ## @end iftex |
|
28 ## @ifinfo |
3431
|
29 ## @example |
|
30 ## x(k+1) = a x(k) + b u(k) |
|
31 ## @end example |
5016
|
32 ## @end ifinfo |
|
33 ## |
3431
|
34 ## @strong{Inputs} |
|
35 ## @table @var |
|
36 ## @item a |
|
37 ## @var{n} by @var{n} matrix |
|
38 ## @item b |
|
39 ## @var{n} by @var{m} matrix |
|
40 ## @end table |
|
41 ## |
5016
|
42 ## @strong{Output} |
|
43 ## @table @var |
|
44 ## @item m |
|
45 ## @var{n} by @var{n} matrix, satisfies |
|
46 ## @iftex |
|
47 ## @tex |
|
48 ## $$ ama^T - m + bb^T = 0 $$ |
|
49 ## @end tex |
|
50 ## @end iftex |
|
51 ## @ifinfo |
3431
|
52 ## @example |
|
53 ## a m a' - m + b*b' = 0 |
|
54 ## @end example |
5016
|
55 ## @end ifinfo |
|
56 ## @end table |
3431
|
57 ## @end deftypefn |
|
58 |
|
59 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> |
|
60 ## Created: July 1995 |
|
61 |
|
62 function m = dgram (a, b) |
|
63 |
7125
|
64 if (nargin != 2) |
|
65 print_usage(); |
|
66 endif |
|
67 |
3431
|
68 ## let dlyap do the error checking... |
4462
|
69 |
|
70 m = dlyap (a, b*b'); |
3431
|
71 |
|
72 endfunction |