20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
## xs x*, one column for each time tau
## xu x_u, one column for each time tau
## AA The composite system matrix
## Copyright (C) 1999 by Peter J. Gawthrop
## $Id$
[n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions
no_system = n_x==0;
[n,m] = size(A_u); # Size of composite A_u matrix
square = (n==m); # Is A_u square?
n_U = m; # functions per input
|
|
|
>
>
>
>
>
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
## xs x*, one column for each time tau
## xu x_u, one column for each time tau
## AA The composite system matrix
## Copyright (C) 1999 by Peter J. Gawthrop
## $Id$
if (size(A)>0)
[n_x,n_u,n_y] = abcddim(A,B,C,D); # System dimensions
else
n_x = 0;
n_y = 0;
n_u = 0;
endif
no_system = n_x==0;
[n,m] = size(A_u); # Size of composite A_u matrix
square = (n==m); # Is A_u square?
n_U = m; # functions per input
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
n_xx = length(xx_0); # Length of composite state
## Compute the star variables
for t=tau
xxt = expm(AA*t)*xx_0; # Composite state
xst = xxt(1:n_x); # x star
xut = xxt(n_x+1:n_xx); # x star
yst = C*xst; # y star
ust = Utilde*xut; # u star
xs = [xs xst]; # x star
xu = [xu xut]; # x star
ys = [ys yst]; # y star
us = [us ust]; # u star
endfor
endfunction
|
>
|
>
>
>
>
|
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
n_xx = length(xx_0); # Length of composite state
## Compute the star variables
for t=tau
xxt = expm(AA*t)*xx_0; # Composite state
xst = xxt(1:n_x); # x star
xut = xxt(n_x+1:n_xx); # x star
if length(C)>0
yst = C*xst; # y star
else
yst = [];
endif
ust = Utilde*xut; # u star
xs = [xs xst]; # x star
xu = [xu xut]; # x star
ys = [ys yst]; # y star
us = [us ust]; # u star
endfor
endfunction
|