Overview
Comment:Allow state weighting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: b291e8d346575ffbc8feff0d59097f14a269a2fd614b0b1750d0a26508b2a57c
User & Date: gawthrop@users.sourceforge.net on 2005-04-20 13:50:40
Other Links: branch diff | manifest | tags
Context
2005-04-26
13:06:08
Tidied check-in: 9969a44b61 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2005-04-20
13:50:40
Allow state weighting check-in: b291e8d346 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2005-04-11
10:25:28
Additional argument to allow arbitary U*_0 check-in: 1206de24a5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/control/PPP/ppp_are.m from [36a7ac48d8] to [61fa06621b].

9
10
11
12
13
14
15





16
17
18

19






20
21
22
23
24
25
26
27
    return
  endif
  
  if nargin<7
    A_type = "feedback";
  endif
  






  ## Steady-state Linear Quadratic solution
  ## using Algebraic Riccati equation (ARE)

  Q_x =  C'*Q*C;			# Weighting on x






  [k, P, poles] = lqr (A, B, Q_x, R); # Algebraic Riccati solution

  ## Basis functions
  if strcmp(A_type,"companion")
    A_u = compan(poly(poles));
  elseif strcmp(A_type,"feedback")
    A_u = A-B*k;
  else







>
>
>
>
>
|


>
|
>
>
>
>
>
>
|







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
    return
  endif
  
  if nargin<7
    A_type = "feedback";
  endif
  
  [n_x,n_u,n_y] = abcddim(A,B,C,D); # Dimensions
  n_q = is_square(Q);		# Size of Q
  if n_q==0
    error("Q must be square");
  endif
  
  ## Steady-state Linear Quadratic solution
  ## using Algebraic Riccati equation (ARE)
  if n_q==n_y			# Output weight
    Q_x =  C'*Q*C;		# Weighting on x
  elseif n_q==n_x		# State weight
    Q_x = Q;
  else
    error(sprintf("Q (%ix%i) must be %ix%i or %ix%i",n_q,n_q,n_y,n_y,n_x,n_x));
  endif
  Q_x
  [k, P, poles] = lqr (A, B, Q_x, R) # Algebraic Riccati solution

  ## Basis functions
  if strcmp(A_type,"companion")
    A_u = compan(poly(poles));
  elseif strcmp(A_type,"feedback")
    A_u = A-B*k;
  else


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