Application examples solved using both
Ch Control Systems Toolkit and MATLAB Control Systems Toolbox
can be found
here.
Selected
Syntax Comparison of Ch® Control System Toolkit with MATLAB®
Control System Toolbox
MATLAB Control Toolbox | Ch Control Toolkit |
k = acker(A,b,p) | sys.model("ss", A, b, NULL, NULL); k = sys.acker(A, b, p); |
sys = append(sys1,sys2,...,sysN) | sys = sys1.append(sys2, ..., sysN); |
asys = augstate(sys) | asys = sys.augstate(); |
fb = bandwidth(sys) | fb = sys.bandwidth(); |
bodemag(sys) | sys.bodemag(plot, NULL, NULL); |
bodemag(sys,{wmin, wmax}) | sys.bodemag(plot, NULL, NULL, wmin, wmax); |
w={wmin, wmax}; bodemag(sys, w) | sys.bodemag(plot, NULL, NULL, wmin, wmax); |
bode(sys) | sys.bode(plot, NULL, NULL, NULL); |
bode(sys,{wmin, wmax}) | sys.bode(plot, NULL, NULL, NULL, wmin, wmax); |
w={wmin, wmax}; bode(sys, w)
(NOTE: For function bode(), the argument
in MATLAB could be either {wmin,wmax} to focus
on the particular frequency interval [wmin,wmax],
or a vector of desired frequencies to use particular
frequency points.
In Ch, they have different prototypes.) | sys.bode(plot, NULL, NULL, NULL, wmin, wmax); |
w=[w0,w1,w2, ..., wn]; bode(sys, w) | double w[]={w0,w1,w2, ..., wn}; sys.bode(plot, NULL, NULL, NULL, w); |
w=logspace(wmin, wmax); bode(sys, w) | logspace(w,wmin,wmax); sys.bode(plot, NULL, NULL, NULL, w); |
w=logspace(wmin, wmax, n); bode(sys, w) | array double w[n]; logspace(w, wmin, wmax); sys.bode(plot, NULL, NULL, NULL, w); |
[mag,phase,wout]=bode(sys) | sys.bode(NULL, mag, phase, wout); |
[mag,phase,wout]=bode(sys, {wmin, wmax}) | sys.bode(NULL, mag, phase, wout, wmin, wmax); |
[mag,phase]=bode(sys, w) | sys.bode(NULL, mag, phase, NULL, w); |
sysd = c2d(sys, Ts, method) | sysd = sys.c2d(Ts, method); |
csys = canon(sys) | csys = sys.canon(NULL); |
[csys, T] = canon(sys) | csys = sys.canon(T); |
csys = canon(sys, 'type') | csys = sys.canon(NULL, 'type'); |
[csys, T] = canon(sys, 'type') | csys = sys.canon(T, 'type'); |
sysc = connect(sys,[]) | sysc = sys.connect(NULL, NULL, NULL); |
sysc = connect(sys,Q) | sysc = sys.connect(Q, NULL, NULL); |
sysc = connect(sys,Q,inputs,outputs) | sysc = sys.connect(Q, inputs, outputs); |
co = ctrb(sys) | sys.ctrb(co); |
co = ctrb(A, B) | sys.model("ss", A, B, NULL, NULL); sys.ctrb(co); |
[Abar,Bbar,Cbar,T,k] = ctrbf(A,B,C) | sys.model("ss", A, NULL, NULL, NULL); sys.ctrbf(Abar, Bbar, Cbar, T, k, A, B, C); |
[Abar,Bbar,Cbar,T,k] = ctrbf(A,B,C,tol) | sys.model("ss", A, NULL, NULL, NULL); sys.ctrbf(Abar, Bbar, Cbar, T, k, A, B, C, tol); |
sysc = d2c(sysd) | sysc = sysd.d2c(); |
sysc = d2c(sysd,method) | sysc = sysd.d2c(method);
(NOTE:Only method 'zoh' is available for now.) |
sys1 = d2d(sys,ts) | sys1 = sys.d2d(ts); |
damp(sys) | sys.damp(); |
[wn,z] = damp(sys) | sys.damp(wn, z); |
[wn,z,p] = damp(sys) | sys.damp(wn, z, p); |
K = dcgain(sys) | K = sys.dcgain(); |
[k,s,e] = dlqr(a,b,q,r) | sys.model("ss", a, b, NULL, NULL); sys.dlqr(k, s, e, q, r); |
[k,s,e] = dlqr(a,b,q,r,n) | sys.model("ss", a, b, NULL, NULL); sys.dlqr(k, s, e, q, r, n); |
x = dlyap(a, q) | sys.dlyap(x, a, q); |
sys = drss(n) | sys.model("drss", n); |
sys = drss(n,p) | sys.model("drss", n, p); |
sys = drss(n,p,m) | sys.model("drss", n, p, m); |
s = dsort(p) | sys.model("zpk", z, p, k, -1); s = sys.dsort(); |
s = esort(p) | sys.model("zpk", z, p, k); s = sys.esort(); |
est = estim(sys,l) | est = sys.estim(l); |
est = estim(sys,l,sensors,known) | est = sys.estim(l, sensors, known); |
sys = feedback(sys1,sys2) | sys = sys1.feedback(sys2); |
sys = feedback(sys1,sys2,sign) | sys = sys1.feedback(sys2, sign); |
sys = feedback(sys1,sys2, feedin, feedout, sign) | sys = sys1.feedback(sys2, feedin, feedout, sign); |
grid on | sys.grid(1); |
grid off | sys.grid(0); |
grid | sys.grid(0); or sys.grid(1); |
impulse(sys) | sys.impulse(plot, NULL, NULL, NULL); |
impulse(sys, tf) | sys.impulse(plot, NULL, NULL, NULL, tf); |
yout = impulse(sys) | sys.impulse(NULL, yout, NULL, NULL); |
[y, tout] = impulse(sys) | sys.impulse(NULL, yout, tout, NULL); |
[y, tout, xout] = impulse(sys) | sys.impulse(NULL, yout, tout, xout); |
yout = impulse(sys, tf) | sys.impulse(NULL, yout, NULL, NULL, tf); |
yout = impulse(sys, 0:dt:tf) | double y[tf/dt+1]; sys.impulse(NULL, yout, NULL, NULL, tf); |
initial(sys, x0) | sys.initial(plot, NULL, NULL, NULL, x0); |
initial(sys, x0, 0:dt:tf) | sys.initial(plot, NULL, NULL, NULL, x0, tf); |
yout = initial(sys, x0) | sys.initial(NULL, yout, NULL, NULL, x0); |
yout = initial(sys, x0, 0:dt:tf) | sys.initial(NULL, yout, NULL, NULL, x0, tf); |
[yout, tout] = initial(sys, x0) | sys.initial(NULL, yout, tout, NULL, x0); |
[yout, tout] = initial(sys, x0, 0:dt:tf) | sys.initial(NULL, yout, tout, NULL, x0, tf); |
[yout, tout, xout] = initial(sys, x0) | sys.initial(NULL, yout, tout, xout, x0); |
[yout, tout, xout] = initial(sys, x0, 0:dt:tf) | sys.initial(NULL, yout, tout, xout, x0, tf); |
r = input('message to user') | char s[30]; double r; printf("message to user"); scanf("%s", s); or getline(_stdio, s, 30); r = streval(s); |
r = input('message to user', 's') | char r[30]; printf("message to user"); scanf("%s", r); or getline(_stdio, r, 30); |
[l,p,e] = lqe(a,g,c,q,r) | sys.model("ss", a, NULL, c, NULL); sys.lqe(l, p, e, g, q, r); |
[l,p,e] = lqe(a,g,c,q,r,n) | sys.model("ss", a, NULL, c, NULL); sys.lqe(l, p, e, g, q, r, n); |
[k,s,e] = lqr(a,b,q,r) | sys.model("ss", a, b, NULL, NULL); sys.lqr(k, s, e, q, r); |
[k,s,e] = lqr(a,b,q,r,n) | sys.model("ss", a, b, NULL, NULL); sys.lqr(k, s, e, q, r, n); |
lsim(sys, u, 0:dt:tf) | array double u[tf/dt+1]; sys.lsim(plot, NULL, NULL, NULL, u, tf); |
lsim(sys, u, t) | sys.lsim(plot, NULL, NULL, NULL, u, tf); |
lsim(sys, u, t, x0) | sys.lsim(plot, NULL, NULL, NULL, u, tf, x0); |
y = lsim(sys, u, t, x0) | sys.lsim(plot, y, NULL, NULL, u, tf, x0); |
[y, tout] = lsim(sys, u, t) | sys.lsim(plot, y, tout, NULL, u, tf); |
[y, tout] = lsim(sys, u, t, x0) | sys.lsim(plot, y, tout, NULL, u, tf, x0); |
[y, tout, xout] = lsim(sys, u, t) | sys.lsim(plot, y, tout, xout, u, tf); |
[y, tout, xout] = lsim(sys, u, t, x0) | sys.lsim(plot, y, tout, xout, u, tf, x0); |
margin(sys) | sys.margin(plot, NULL, NULL, NULL, NULL); |
[gm,pm,wcg,wcp] = margin(sys) | sys.margin(NULL, gm, pm, wcg, wcp); |
[Gm,Pm,Wcg,Wcp] = margin(mag,phase,w) | sys.margin(NULL, gm, pm, wcg, wcp, mag, phase, w); |
[Am,Bm,Cm,Dm] = minreal(A,B,C,D) | sys.model("ss", A, B, C, D); sys2 = sys.minreal(NULL); sys2->ssdata(Am, Bm, Cm, Dm); |
sysr = minreal(sys) | sys.model("ss", A, B, C, NULL); sys2 = sys.minreal(NULL); sys2 = sys.pzcancel(); |
sysr = minreal(sys, tol) | sys.model("ss", A, B, C, NULL); sys2 = sys.minreal(NULL, tol); sys2 = sys.pzcancel(tol) |
[sysr, u] = minreal(sys, tol) | sys.model("ss", A, B, C, NULL); sys2 = sys.minreal(u, tol); |
wc = gram(sys,'c') | sys.model("ss", A, B, NULL, NULL); sys.gram(wc, 'c'); |
wo = gram(sys,'o') | sys.model("ss", A, NULL, C, NULL); sys.gram(wo, 'o'); |
ngrid | sys.ngrid(1); |
ngrid('new') | sys.ngrid(1); |
nichols(H); ngrid | sys.ngrid(1); sys.nichols(); |
ngrid('new'); nichols(H) | sys.ngrid(1); sys.nichols(); |
nichols(sys) | sys.nichols(plot, NULL, NULL, NULL); |
nichols(sys,{wmin, wmax}) | sys.nichols(plot, NULL, NULL, NULL, wmin, wmax); |
w={wmin, wmax}; nichols(sys, w) | sys.nichols(plot, NULL, NULL, NULL, wmin, wmax); |
w=[w0,w1,w2, ..., wn]; nichols(sys, w) | double w[]={w0,w1,w2, ..., wn}; sys.nichols(plot, NULL, NULL, NULL, w); |
w=logspace(wmin, wmax); nichols(sys, w) | logspace(w,wmin,wmax); sys.nichols(plot, NULL, NULL, NULL, w); |
w=logspace(wmin, wmax, n); nichols(sys, w) | array double w[n]; logspace(w, wmin, wmax); sys.nichols(plot, NULL, NULL, NULL, w); |
[mag,phase,wout]=nichols(sys) | sys.nichols(NULL, mag, phase, wout); |
[mag,phase,wout]=nichols(sys, {wmin, wmax}) | sys.nichols(NULL, mag, phase, wout, wmin, wmax); |
[mag,phase]=nichols(sys, w) | sys.nichols(NULL, mag, phase, NULL, w); |
nyquist(sys) | sys.nyquist(plot, NULL, NULL, NULL); |
nyquist(sys,w) | sys.nyquist(plot, NULL, NULL, NULL, w); |
[re,im,wout] = nyquist(sys) | sys.nyquist(NULL, re, im, wout); |
[re,im] = nyquist(sys,w) | sys.nyquist(NULL, w, re, NULL, w); |
ob = obsv(sys) | sys.obsv(ob); |
ob = obsv(A, C) | sys.model("ss", A, NULL, C, NULL); sys.obsv(ob); |
[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C) | sys.model("ss", A, B, C, NULL); sys.obsvf(Abar, Bbar, Cbar, T, k, A, B, C); |
[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C,tol) | sys.model("ss", A, B, C, NULL); sys.obsvf(Abar, Bbar, Cbar, T, k, A, B, C, tol); |
sys = parallel(sys1, sys2) | sys = sys1.parallel(sys2); |
sys = parallel(sys1, sys2, inp1, inp2, out1, out2) | sys = sys1.parallel(sys2, input1, input2, output1, output2); |
k = place(A,B,p) | sys.model("ss", A, B, NULL, NULL); sys.place(k, p); |
p = pole(sys) | sys.pole(p); |
N/A | sys.printss(); |
N/A | sys.printSystem(); |
N/A | sys.printtf(); |
N/A | sys.printzpk(); |
pzmap(sys) | sys.pzmap(plot, NULL, NULL); |
[p,z]=pzmap(sys) | sys.pzmap(NULL, p, z); |
N/A | sys.pzmap(plot, p, z); |
rlocus(sys) | sys.rlocus(plot, NULL, NULL); |
rlocus(sys,k) | sys.rlocus(plot, NULL, NULL, k); |
[r,kout] = rlocus(sys) | sys.rlocus(NULL, r, kout); |
[r] = rlocus(sys, k) | sys.rlocus(NULL, r, NULL, k); |
N/A | sys.rlocus(plot, r, kout); |
N/A | sys.rlocus(plot, r, NULL, k); |
rlocfind(sys, p) | sys.rlocfind(NULL, NULL, p); |
[k, poles] = rlocfind(sys, p) | sys.rlocfind(k, poles, p); |
sys = rss(n) | sys.model("rss", n); |
sys = rss(n,p) | sys.model("rss", n, p); |
sys = rss(n,p,m) | sys.model("rss", n, p, m); |
sys = series(sys1, sys2) | sys = sys1.series(sys2); |
sys = series(sys1, sys2, out1, inp2) | sys = sys1.series(sys2, output1, input2); |
sgrid | sys.sgrid(1);
(NOTE: Only apply to functions pzmap() and rlocus().) |
sgrid('new') | sys.sgrid(1); |
sgrid(z, wn) | sys.sgrid(1, z, wn); |
sgrid(z, wn, 'new') | sys.sgrid(1, z, wn); |
pzmap(H); sgrid | sys.sgrid(1); sys.pzmap(); |
sgrid('new'); pzmap(H) | sys.sgrid(1); sys.pzmap();
(NOTE: z and wn can be intelligently generated.) |
pzmap(H); sgrid(z, wn) | sys.sgrid(1, z, wn); sys.pzmap(); |
sgrid(z, wn, 'new'); pzmap(H) | sys.sgrid(1, z, wn); sys.pzmap(); |
nx = size(sys, 'order') | nx = sys.size('x'); |
ny = size(sys, 1) | ny = sys.size('y'); |
nu = size(sys, 2) | nu = sys.size('u'); |
N/A | nn = sys.size('n'); |
N/A | nd = sys.size('d'); |
N/A | nz = sys.size('z'); |
N/A | np = sys.size('p'); |
N/A | nk = sys.size('k'); |
[A,B,C,D] = ssdata(sys) | int nx, ny, nu; nx = sys.size('x'); ny = sys.size('y'); nu = sys.size('u'); array double A[nx][nx], B[nx][nu], C[ny][nx], D[ny][nu]; sys.ssdata(A, B, C, D); |
step(sys) | sys.step(plot, NULL, NULL, NULL); |
step(sys, tf) | sys.step(plot, NULL, NULL, NULL, tf); |
[yout, tout] = step(sys) | sys.step(NULL, yout, tout, NULL); |
[yout, tout, xout] = step(sys) | sys.step(NULL, yout, tout, xout); |
yout = step(sys, tf) | sys.step(NULL, yout, NULL, NULL, tf); |
yout = step(sys, 0:dt:tf) | double y[tf/dt+1]; sys.step(NULL, yout, NULL, NULL, tf); |
N/A | sys.step(plot, yout, NULL, NULL); |
N/A | sys.step(plot, yout, NULL, NULL, tf); |
step(sys) | sys.step(plot, NULL); |
step(sys, tf) | sys.step(plot, NULL, tf); |
y = step(sys) | sys.step(NULL, y); |
y = step(sys, tf) | sys.step(NULL, y, tf); |
y = step(sys, 0:dt:tf) | double y[tf/dt+1]; sys.step(NULL, y, tf); |
N/A | sys.step(plot, y); |
N/A | sys.step(plot, y, tf); |
S = stepinfo(sys) |
sys.stepinfo(risetime, settlingtime, overshoot,
peakvalue, peaktime, undershoot, settlingmin,
settlingmax); |
S = stepinfo(sys, 'SettlingTimeThreadshold',
ts_percentage);
|
sys.stepinfo(risetime, settlingtime, overshoot,
peakvalue, peaktime, undershoot, settlingmin,
settlingmax, ts_percentage, NULL, NULL); |
rt[1] = tr_lowerlimit
rt[2] = tr_upperlimit
S = stepinfo(sys, 'RiseTimeLimits', rt); |
sys.stepinfo(risetime, settlingtime, overshoot,
peakvalue, peaktime, undershoot, settlingmin,
settlingmax, NULL, tr_lowerlimit, tr_upperlimit); |
sys = ss(A, B, C, D) | sys.model("ss", A, B, C, D); |
sysT = ss2ss(sys,T) | sysT = sys.ss2ss(T); |
[num,den] = ss2tf(A,B,C,D) | sys.model("ss", A, B, C, D); sys.tfdata(num, den); |
[z, p, k] = ss2zp(A,B,C,D) | sys.model("ss", A, B, C, D); sys.zpkdata(z, p, k); |
sys = tf(num, den) | sys.model("tf", num, den); |
sys = tf(num, den, Ts) | sys.model("tf", num, den, Ts); |
[num, den] = tfdata(sys) | int nnum, nden; nnum = sys.size('n'); nden = sys.size('d'); array double num[nnum], den[nden]; sys.tfdata(num, den); |
[A,B,C,D] = tf2ss(num,den) | sys.model("tf", num, den); sys.ssdata(A,B,C,D); |
[z, p, k] = tf2zp(num,den) | sys.model("tf", num, den); sys.zpkdata(z, p, k); |
z = tzero(sys) | nz = sys.size('z'); array double complex z[nz]; sys.tzero(z); |
[z,gain] = tzero(sys) | nz = sys.size('z'); array double complex z[nz]; double gain; sys.tzero(z, &gain); |
z = tzero(A,B,C,D) | sys.model("ss", A, B, C, D); nz = sys.size('z'); array double complex z[nz]; double gain; sys.tzero(z, &gain); |
zgrid | sys.zgrid(1);
(NOTE: Only apply to functions pzmap() and rlocus().) |
zgrid('new') | sys.zgrid(1); |
zgrid(z, wn) | zgrid(1, z, wn); |
zgrid(z, wn, 'new') | zgrid(1, z, wn); |
pzmap(H); zgrid | zgrid(1); sys.pzmap(); |
zgrid('new'); pzmap(H) | sys.zgrid(1); sys.pzmap();
|
pzmap(H); zgrid(z, wn) | zgrid(1, z, wn); sys.pzmap();
|
zgrid(z, wn, 'new'); pzmap(H) | zgrid(1, z, wn); sys.pzmap(); |
[A,B,C,D] = zp2ss(z, p, k) | sys.model("zpk", z, p, k); sys.ssdata(A,B,C,D); |
[num, den] = zp2tf(z, p, k) | sys.model("zpk", z, p, k); sys.tfdata(num, den); |
sys = zpk(z, p, k) | sys.model("zpk", z, p, k); |
[z,p,k] = zpkdata(sys) | int nz, np; double k; nz = sys.size('z'); np = sys.size('p'); array double complex z[nz], p[np]; sys.zpkdata(z, p, &k); |
References:
-
Ch Control System Toolkit
User's Guide, Version 1.0,
SoftIntegration, Inc., September 2002.
-
MATLAB Control System Toolbox User's Guide, Version 5, The MathWorks, Inc., 2001.
Note: MATLAB is a registered trademark of The MathWorks, Inc.
|
|