90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
-
+
|
p_o.method = "continuous";
## p_o.method = "intermittent";
endif
## Check w.
[n_w,m_w] = size(w);
if ( (n_w<>n_y) || (m_w<>1) )
if ( (n_w!=n_y) || (m_w!=1) )
error(sprintf("ppp_lin_run: w must a column vector with %i elements",n_y));
endif
## Initialise
x_est = p_o.x_0;
## Initilise simulation state
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
-
+
|
= ppp_lin_quad (A,B,C,D,tau,p_c.Q,p_c.R);
else
error(sprintf("Control method %s not recognised", p_c.Method));
endif
##Sanity check A_u
[p_c.n_U,M_u] = size(p_c.A_u);
if (p_c.n_U<>M_u)
if (p_c.n_U!=M_u)
error("A_u must be square");
endif
U = K_w*w; # Initial control U
## Checks
|