1
.TH rtitr G "April 1993" "Scilab Group" "Scilab Function"
4
rtitr - discrete time response (transfer matrix)
7
[y]=rtitr(Num,Den,u [,up,yp])
12
: polynomial matrices (resp. dimensions : \fVn\fRx\fVm\fR and \fVn\fRx\fVn\fR)
15
: real matrix (dimension \fVm\fRx\fV(t+1)\fR
18
: real matrices (\fVup\fR dimension \fVm\fRx\fV (maxi(degree(Den)))\fR (default values=\fV0\fR) , \fVyp\fR dimension \fVn\fRx\fV (maxi(degree(Den)))\fR)
23
\fVy=rtitr(Num,Den,u [,up,yp])\fR returns the time response of
24
the discrete time linear system with transfer matrix \fVDen^-1 Num\fR
25
for the input \fVu\fR, i.e \fVy\fR and \fVu\fR are such that \fVDen y = Num u\fR at t=0,1,...
27
If \fVd1=maxi(degree(Den))\fR, and \fVd2=maxi(degree(Num))\fR the polynomial
28
matrices \fVDen(z)\fR and \fVNum(z)\fR may be written respectively as:
30
D(z)= D_0 + D_1 z + ... + D_d1 z^d1
31
N(z)= N_0 + N_1 z + ... + N_d2 z^d2
33
and \fVDen y = Num u\fR is interpreted as the recursion:
35
D(0)y(t)+D(1)y(t+1)+...+ D(d1)y(t+d1)= N(0) u(t) +....+ N(d2) u(t+d2)
37
It is assumed that \fVD(d1)\fR is non singular.
39
The columns of u are the inputs of the system at t=0,1,...,T:
41
u=[u(0) , u(1),...,u(T)]
43
The outputs at \fVt=0,1,...,T+d1-d2\fR are the columns of the matrix \fVy\fR:
45
y=[y(0), y(1), .... y(T+d1-d2)]
47
\fVup\fR and \fVyp\fR define the initial conditions for t < 0 i.e
49
up=[u(-d1), ..., u(-1) ]
50
yp=[y(-d1), ... y(-1) ]
52
Depending on the relative values of \fVd1\fR and \fVd2\fR, some of the
53
leftmost components of \fVup\fR, \fVyp\fR are ignored.
54
The default values of \fVup\fR and \fVyp\fR are zero:
55
\fVup = 0*ones(m,d1), yp=0*ones(n,d1)\fR
59
Num=1+z;Den=1+z;u=[1,2,3,4,5];
64
n1=1;d1=poly([1 1],'z','coeff'); // y(j)=-y(j-1)+u(j-1)
65
r1=[0 1 0 1 0 1 0 1 0 1 0];
66
r=rtitr(n1,d1,ones(1,10));norm(r1-r,1)
68
r=rtitr(n1,d1,ones(1,9),1,0);norm(r1(2:11)-r)
70
n2=poly([1 1 1],'z','coeff');d2=d1; // y(j)=-y(j-1)+u(j-1)+u(j)+u(j+1)
71
r2=[2 1 2 1 2 1 2 1 2];
72
r=rtitr(n2,d2,ones(1,10));norm(r-r2,1)
74
r=rtitr(n2,d2,ones(1,9),1,2);norm(r2(2:9)-r,1)
78
d1=d1*diag([1 0.5]);n1=[1 3 1;2 4 1];r1=[5;14]*r1;
79
r=rtitr(n1,d1,ones(3,10));norm(r1-r,1)
81
r=rtitr(n1,d1,ones(3,9),[1;1;1],[0;0]);
83
//polynomial n1 (same ex.)
84
n1(1,1)=poly(1,'z','c');r=rtitr(n1,d1,ones(3,10));norm(r1-r,1)
86
r=rtitr(n1,d1,ones(3,9),[1;1;1],[0;0]);
89
d2=d1;n2=n2*n1;r2=[5;14]*r2;
90
r=rtitr(n2,d2,ones(3,10));norm(r2-r)
92
r=rtitr(n2,d2,ones(3,9),[1;1;1],[10;28]);
95
// State-space or transfer
96
a = [0.21 , 0.63 , 0.56 , 0.23 , 0.31
97
0.76 , 0.85 , 0.66 , 0.23 , 0.93
98
0 , 0.69 , 0.73 , 0.22 , 0.21
99
0.33 , 0.88 , 0.2 , 0.88 , 0.31
100
0.67 , 0.07 , 0.54 , 0.65 , 0.36];
101
b = [0.29 , 0.5 , 0.92
106
c = [0.28 , 0.78 , 0.11 , 0.15 , 0.84
107
0.13 , 0.21 , 0.69 , 0.7 , 0.41];
108
d = [0.41 , 0.11 , 0.56
110
s=syslin('d',a,b,c,d);
111
h=ss2tf(s);num=h('num');den=h('den');den=den(1,1)*eye(2,2);
112
u=1;u(3,10)=0;r3=flts(u,s);
113
r=rtitr(num,den,u);norm(r3-r,1)