Overview
Comment:Handle constraints on multiple variables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 6279a162f803c18f663861938a395614fda2abcccccf11d99839280ec6fd9322
User & Date: gawthrop@users.sourceforge.net on 2002-09-11 14:27:37
Other Links: branch diff | manifest | tags
Context
2002-09-11
15:04:59
Optional boxing check-in: bc62022292 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:27:37
Handle constraints on multiple variables. check-in: 6279a162f8 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:24:02
Now correctly handles outputs with index >1 check-in: 128b9fc8ba user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/lib/control/PPP/ppp_input_constraints.m version [804cd7fa35].











































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function [Gamma,gamma] = ppp_input_constraints (A_u,Tau,Min,Max,Order)

  ## usage:  [Gamma,gamma] = ppp_input_constraints (A_u,Tau,Min,Max[,Order])
  ##
  ## Derives input copnstraint matrices Gamma and gamma 
  ## for multi-input systems.
  ## A_u Input-generating matrix
  ## Tau row vector of times at which constraints occur
  ## Max, Maximum and minimum values
  ## Limits at inf and -inf are discarded

  ## Sanity check
  [n_u,n_tau] = size(Min);
  [n,m] = size(Max);
  if (n!=n_u)||(m!=n_tau)
    error("Max and Min must have the same dimensions");
  endif
  
  [n,m] = size(Tau);
  if (m!=n_tau)
    error("Max and Min must have same number of columns as Tau");
  endif
  if (n>1)
    error("Tau must be a row vector");
  endif

  ##Defaults
  if nargin<5
    Order=zeros(1,n_tau);
  endif
  
  ## Stack up constraints for each input
  Gamma=[];
  gamma=[];
  for i_u=1:n_u
    [Gamma_i,gamma_i] = \
	ppp_input_constraint(A_u,Tau,Min(i_u,:),Max(i_u,:),Order,i_u,n_u);
    Gamma = [Gamma; Gamma_i];
    gamma = [gamma; gamma_i];
  endfor

endfunction

Added mttroot/mtt/lib/control/PPP/ppp_output_constraints.m version [b5e964eaca].








































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
function [Gamma,gamma] = ppp_output_constraints (A,B,C,D,x_0,A_u,Tau,Min,Max,Order)

  ## usage:
  ## [Gamma,gamma] = ppp_output_constraints(A,B,C,D,x_0,A_u,Tau,Min,Max,Order)
  ##
  ## 
  
  ## Sanity check
  [n_y,n_tau] = size(Min);
  [n,m] = size(Max);
  if (n!=n_y)||(m!=n_tau)
    error("Max and Min must have the same dimensions");
  endif
  
  [n,m] = size(Tau);
  if (m!=n_tau)
    error("Max and Min must have same number of columns as Tau");
  endif
  if (n>1)
    error("Tau must be a row vector");
  endif

  ##Defaults
  if nargin<10
    Order=zeros(n_y,n_tau);
  endif
  
  ## Stack up constraints for each input
  Gamma=[];
  gamma=[];
  for i_y=1:n_y
    [Gamma_i,gamma_i] = \
	ppp_output_constraint (A,B,C,D,x_0,A_u,Tau,\
			       Min(i_y,:),Max(i_y,:),Order(i_y,:),i_y);
    Gamma = [Gamma; Gamma_i];
    gamma = [gamma; gamma_i];
  endfor
  
endfunction


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]