3381
|
1 ## Copyright (C) 1996,1998 Auburn University. All Rights Reserved |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by the |
|
7 ## Free Software Foundation; either version 2, or (at your option) any |
|
8 ## later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 ## for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, write to the Free |
|
17 ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. |
3236
|
18 |
3381
|
19 ## I think that this m-file can be deleted |
|
20 ## a.s.hodel@eng.auburn.edu - 4 Dec. 1998 |
3228
|
21 |
3238
|
22 Ap = [0, 1;1960, 0]; |
3213
|
23 Bp = [0;-6261]; |
3238
|
24 Cp = [1, 0]; |
3213
|
25 Dp = 0; |
|
26 |
|
27 Gp = ss2sys(Ap,Bp,Cp,Dp,0,2,0,[],"delta_i","delta_y"); |
3228
|
28 Gp = syssetsignals(Gp,"st","delta_x1",1); |
|
29 Gp = syssetsignals(Gp,"st","delta_x2",2); |
3213
|
30 |
3238
|
31 Ak = [-20, 1;-22160, -200]; |
3213
|
32 Bk = [-20;-2160]; |
3238
|
33 Ck = [-3.5074, -0.0319]; |
3213
|
34 Dk = 0; |
|
35 |
|
36 Gk = ss2sys(Ak,Bk,Ck,Dk,0,2,0,[],"y","i"); |
3228
|
37 Gk = syssetsignals(Gk,"st","x1",1); |
|
38 Gk = syssetsignals(Gk,"st","x2",2); |
3213
|
39 |
|
40 Gc = sysgroup(Gp,Gk); |
|
41 |
3238
|
42 Gc = sysdup(Gc,[],[1, 2]); |
3381
|
43 ## Gc = sysscale(Gc,[],diag([1,1,1,1])); |
3213
|
44 |
3238
|
45 Gc = sysconnect(Gc,[1, 2],[4, 3]); |
|
46 Gc = sysprune(Gc,1,[1, 2]); |
3213
|
47 |
|
48 disp("after pruning, closed loop system is") |
|
49 sysout(Gc) |
|
50 |
3381
|
51 ## Gc = sysdup(Gc,[],2); |
|
52 ## Gc = sysconnect(Gc,1,3); |
|
53 ## Gc = sysprune(Gc,1,1); |
3213
|
54 |
|
55 is_stable(Gc) |
3228
|
56 Gca = sys2ss(Gc); |
|
57 eig(Gca) |
3213
|
58 |
3228
|
59 [Gpa,Gpb,Gpc,Gpd] = sys2ss(Gp); |
|
60 [Gka,Gkb,Gkc,Gkd] = sys2ss(Gk); |
|
61 Acl = [Gpa, -Gpb*Gkc; Gkb*Gpc, Gka] |
3213
|
62 eig(Acl) |