Mercurial > octave-nkf
comparison scripts/control/base/analdemo.m @ 4771:b8105302cfe8
[project @ 2004-02-16 17:45:50 by jwe]
author | jwe |
---|---|
date | Mon, 16 Feb 2004 17:45:50 +0000 |
parents | 02ca908056e9 |
children | bdbee5282954 |
comparison
equal
deleted
inserted
replaced
4770:ef5e598f099b | 4771:b8105302cfe8 |
---|---|
111 disp("a, b, c, d => state space system used as input argument"); | 111 disp("a, b, c, d => state space system used as input argument"); |
112 prompt | 112 prompt |
113 clc | 113 clc |
114 | 114 |
115 disp("Example #2, consider the state space system from example 1 again:"); | 115 disp("Example #2, consider the state space system from example 1 again:"); |
116 cmd = "sys = ss2sys(a,b,c,d);"; | 116 cmd = "sys = ss(a,b,c,d);"; |
117 disp(cmd); | 117 disp(cmd); |
118 eval(cmd); | 118 eval(cmd); |
119 sysout(sys); | 119 sysout(sys); |
120 disp("\nThe zeros of this system can also be calculated directly from the"); | 120 disp("\nThe zeros of this system can also be calculated directly from the"); |
121 disp("system variable:"); | 121 disp("system variable:"); |
135 prompt | 135 prompt |
136 | 136 |
137 clc | 137 clc |
138 disp("Continuous => Discrete and Discrete => Continuous conversions (c2d,d2c)"); | 138 disp("Continuous => Discrete and Discrete => Continuous conversions (c2d,d2c)"); |
139 disp("\nExample #1, consider the following continuous state space system"); | 139 disp("\nExample #1, consider the following continuous state space system"); |
140 cmd = "sys_cont = ss2sys([-11, 6; -15, 8], [1; 2], [2, -1], 0);"; | 140 cmd = "sys_cont = ss([-11, 6; -15, 8], [1; 2], [2, -1], 0);"; |
141 eval(cmd); | 141 eval(cmd); |
142 disp(cmd); | 142 disp(cmd); |
143 disp("Examine the poles and zeros of the continuous system:"); | 143 disp("Examine the poles and zeros of the continuous system:"); |
144 sysout(sys_cont,"all"); | 144 sysout(sys_cont,"all"); |
145 disp("\nTo convert this to a discrete system, a sampling time is needed:"); | 145 disp("\nTo convert this to a discrete system, a sampling time is needed:"); |
216 disp("--- Balanced realization: not yet implemented") | 216 disp("--- Balanced realization: not yet implemented") |
217 elseif (k == 6) | 217 elseif (k == 6) |
218 disp("--- Open loop balanced truncation: not yet implemented") | 218 disp("--- Open loop balanced truncation: not yet implemented") |
219 elseif (k == 7) | 219 elseif (k == 7) |
220 disp("SISO pole placement example:") | 220 disp("SISO pole placement example:") |
221 cmd = "sys=tf2sys(1, [1, -2, 1]);"; | 221 cmd = "sys=tf(1, [1, -2, 1]);"; |
222 run_cmd | 222 run_cmd |
223 disp("System in zero-pole form is:") | 223 disp("System in zero-pole form is:") |
224 cmd = "sysout(sys,\"zp\");"; | 224 cmd = "sysout(sys,\"zp\");"; |
225 run_cmd | 225 run_cmd |
226 disp("and in state space form:") | 226 disp("and in state space form:") |