1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
function [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond);
## usage: [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond)
##
## Linear PPP (Predictive pole-placement) computation
## INPUTS:
## A,B,C,D: system matrices
## A_u: composite system matrix for U* generation
## one square matrix (A_ui) row for each system input
## each A_ui generates U*' for ith system input.
## OR
## A_u: square system matrix for U* generation
## same square matrix for each system input.
## A_w: composite system matrix for W* generation
## one square matrix (A_wi) row for each system output
## each A_wi generates W*' for ith system output.
## t: row vector of times for optimisation (equispaced in time)
## Q column vector of output weights (defaults to unity)
## OR
## Q matrix, each row corresponds to time-varying weight compatible with t
## max_cond: Maximum condition number of J_uu (def 1/eps)
## OUTPUTS:
## k_x: State feedback gain
## k_w: setpoint gain
## ie u(t) = k_w w(t) - k_x x(t)
## K_x, K_w: open loop gains
## Us0: Value of U* at tau=0
## J_uu, J_ux, J_uw, J_xx,J_xw,J_ww: cost derivatives
## cond_uu : Condition number of J_uu
## Copyright (C) 1999, 2000 by Peter J. Gawthrop
## $Id$
## Check some dimensions
[n_x,n_u,n_y] = abcddim(A,B,C,D);
if (n_x==-1)
return
endif
## Default Q (output weight)
if nargin<8
Q = ones(n_y,1);
endif
## Default R (input weight)
if nargin<9
|
>
|
>
>
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
function [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] = ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond);
## usage:
## [k_x,k_w,K_x,K_w,Us0,J_uu,J_ux,J_uw,J_xx,J_xw,J_ww,y_u,cond_uu] =
## ppp_lin(A,B,C,D,A_u,A_w,tau,Q,R,P,max_cond)
##
## Linear PPP (Predictive pole-placement) computation
## INPUTS:
## A,B,C,D: system matrices
## A_u: composite system matrix for U* generation
## one square matrix (A_ui) row for each system input
## each A_ui generates U*' for ith system input.
## OR
## A_u: square system matrix for U* generation
## same square matrix for each system input.
## A_w: composite system matrix for W* generation
## one square matrix (A_wi) row for each system output
## each A_wi generates W*' for ith system output.
## tau: row vector of times for optimisation (equispaced in time)
## Q column vector of output weights (defaults to unity)
## OR
## Q matrix, each row corresponds to time-varying weight compatible with t
## max_cond: Maximum condition number of J_uu (def 1/eps)
## OUTPUTS:
## k_x: State feedback gain
## k_w: setpoint gain
## ie u(t) = k_w w(t) - k_x x(t)
## K_x, K_w: open loop gains
## Us0: Value of U* at tau=0
## J_uu, J_ux, J_uw, J_xx,J_xw,J_ww: cost derivatives
## cond_uu : Condition number of J_uu
## Copyright (C) 1999, 2000 by Peter J. Gawthrop
## $Id$
## Check some dimensions
[n_x,n_u,n_y] = abcddim(A,B,C,D);
if (n_x==-1)
return
endif
## Default Q (output weight)
if nargin<8
Q = ones(n_y,1);
endif
## Default R (input weight)
if nargin<9
|