Mercurial > hg > octave-lyh
changeset 3422:9fc59b290856
[project @ 2000-01-13 06:58:27 by jwe]
author | jwe |
---|---|
date | Thu, 13 Jan 2000 06:58:30 +0000 |
parents | 251c444248bf |
children | 12f2097a2ed8 |
files | scripts/ChangeLog scripts/control/dlqg.m scripts/control/minfo.m scripts/control/packsys.m scripts/control/qzval.m scripts/control/swapcols.m scripts/control/swaprows.m scripts/control/unpacksys.m |
diffstat | 8 files changed, 11 insertions(+), 434 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,14 @@ +Thu Jan 13 00:56:57 2000 John W. Eaton <jwe@bahaha.che.wisc.edu> + + * control/obsolete: New directory + * control/obsolete/swaprows.m: Move here from control directory. + * control/obsolete/swapcols.m: Likewise. + * control/obsolete/dlqg.m: Likewise. + * control/obsolete/minfo.m: Likewise. + * control/obsolete/packsys.m: Likewise. + * control/obsolete/qzval.m: Likewise. + * control/obsolete/unpacksys.m: Likewise. + 2000-01-13 John W. Eaton <jwe@bevo.che.wisc.edu> * general/fliplr.m: Eliminate useless copy of arg.
deleted file mode 100644 --- a/scripts/control/dlqg.m +++ /dev/null @@ -1,124 +0,0 @@ -## Copyright (C) 1996 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## O B S O L E T E * * * D O N O T U S E! -## -## Use lqg instead. -## -## function [K,Q,P,Ee,Er] = dlqg(A,B,C,G,Sigw,Sigv,Q,R) -## function [K,Q,P,Ee,Er] = dlqg(Sys,Sigw,Sigv,Q,R) -## -## design a discrete-time linear quadratic gaussian optimal controller -## for the system -## -## x(k+1) = A x(k) + B u(k) + G w(k) [w]=N(0,[Sigw 0 ]) -## y(k) = C x(k) + v(k) [v] ( 0 Sigv ]) -## -## Outputs: -## K: system data structure format LQG optimal controller -## P: Solution of control (state feedback) algebraic Riccati equation -## Q: Solution of estimation algebraic Riccati equation -## Ee: estimator poles -## Es: controller poles -## inputs: -## A,B,C,G, or Sys: state space representation of system. -## Sigw, Sigv: covariance matrices of independent Gaussian noise processes -## (as above) -## Q, R: state, control weighting matrices for dlqr call respectively. -## -## See also: lqg, dlqe, dlqr - -## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> -## Created: August 1995 - -function [K, Q, P, Ee, Er] = dlqg (A, B, C, G, Sigw, Sigv, Q, R) - - warning("dlqg: obsolete. use lqg instead (system data structure format)"); - - if (nargin == 5) - ## system data structure format - - ## check that it really is system data structure - if(! is_struct(A) ) - error("dlqg: 5 arguments, first argument is not a system data structure structure") - endif - - sys = sysupdate(sys,"ss"); # make sure in proper form - [ncstates,ndstates,nin,nout] = sysdimensions(sys); - if(ndstates == -1) - error("this message should never appear: bad system dimensions"); - endif - - if(ncstates) - error("dlqg: system has continuous-time states (try lqg?)") - elseif(ndstates < 1) - error("dlqg: system has no discrete time states") - elseif(nin <= columns(Sigw)) - error(["dlqg: ",num2str(nin)," inputs provided, noise dimension is ", ... - num2str(columns(Sigw))]) - elseif(nout != columns(Sigv)) - error(["dlqg: number of outputs (",num2str(nout),") incompatible with ", ... - "dimension of Sigv (",num2str(columns(Sigv)),")"]) - endif - - ## put parameters into correct variables - R = Sigw; - Q = G; - Sigv = C; - Sigw = B; - [A,B,C,D] = sys2ss(Sys) - [n,m] = size(B) - m1 = columns(Sigw); - m2 = m1+1; - G = B(:,1:m1); - B = B(:,m2:m); - - elseif (nargin == 8) - ## state-space format - m = columns(B); - m1 = columns(G); - p = rows(C); - n = abcddim(A,B,C,zeros(p,m)); - n1 = abcddim(A,G,C,zeros(p,m1)); - if( (n == -1) || (n1 == -1)) - error("dlqg: A,B,C,G incompatibly dimensioned"); - elseif(p != columns(Sigv)) - error("dlqg: C, Sigv incompatibly dimensioned"); - elseif(m1 != columns(Sigw)) - error("dlqg: G, Sigw incompatibly dimensioned"); - endif - else - error("dlqg: illegal number of arguments") - endif - - if (! (is_square(Sigw) && is_square(Sigv) ) ) - error("dlqg: Sigw, Sigv must be square"); - endif - - ## now we can just do the design; call dlqr and dlqe, since all matrices - ## are not given in Cholesky factor form (as in h2syn case) - [Ks, P, Er] = dlqr(A,B,Q,R); - [Ke, Q, jnk, Ee] = dlqe(A,G,C,Sigw,Sigv); - Ac = A - Ke*C - B*Ks; - Bc = Ke; - Cc = -Ks; - Dc = zeros(rows(Cc),columns(Bc)); - K = ss2sys(Ac,Bc,Cc,Dc,1); - disp("HODEL: need to add names to this guy!") - -endfunction
deleted file mode 100644 --- a/scripts/control/minfo.m +++ /dev/null @@ -1,86 +0,0 @@ -## Copyright (C) 1996 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## function [systype, nout, nin, ncstates, ndstates] = minfo(inmat) -## -## MINFO: Determines the type of system matrix. INMAT can be -## a varying(*), system, constant, and empty matrix. -## -## Returns: -## systype can be one of: -## varying, system, constant, and empty -## nout is the number of outputs of the system -## nin is the number of inputs of the system -## ncstates is the number of continuous states of the system -## ndstates is the number of discrete states of the system - -## Author: R. Bruce Tenison <btenison@eng.auburn.edu> -## Created: July 29, 1994 -## Modified by David Clem November 13, 1994 -## Modified by A. S. Hodel July 1995 - -function [systype, nout, nin, ncstates, ndstates] = minfo (inmat) - - warning("minfo: obsolete. Use sys2ss, sys2tf, or sys2zp."); - - if (nargin ~= 1 ) - disp ("MINFO: Wrong number of arguments") - systype = nout = nin = ncstates = ndstates = []; - endif - - [rr,cc] = size(inmat); - - ## Check for empty matrix first! - if (isempty(inmat)) - systype = "empty"; - nout = nin = ncstates = ndstates = 0; - return - - ## Check for Constant matrix - - elseif (rr == 1 || cc == 1) - systype = "constant"; - nout = nin = ncstates = ndstates = 1; - return - - ## Check for system type matrix - elseif (inmat(rr,cc) == -Inf) - systype = "system"; - ncstates = inmat(1,cc); - ndstates = inmat(rr,1); - nstates = ncstates + ndstates; - nout = rr - nstates - 1; - nin = cc - nstates - 1; - - ## Check for Varying type matrix - elseif (inmat(rr,cc) == Inf) - systype = "varying"; - npoints = inmat(rr,cc-1); - nin = cc - 1; - nout = rr / npoints; - nstates = 0; - - ## Must be a standard matrix - else - systype = "constant"; - nin = cc; - nout = rr; - ncstates = 0; - ndstates = 0; - endif -endfunction
deleted file mode 100644 --- a/scripts/control/packsys.m +++ /dev/null @@ -1,71 +0,0 @@ -## Copyright (C) 1996 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## O B S O L E T E: use ss2sys instead. -## function Asys = packsys(a,b,c[,d,dflg]) -## -## dflg: 0 for continuous time system, 1 for discrete-time system. -## -## defaults: -## D: 0 matrix of appropriate dimension. -## dflg: 0 (continuous time) -## -## Note: discrete-state sampling time is not included! - -## Author: R. Bruce Tenison <btenison@eng.auburn.edu> -## Created: July 29, 1994 -## Modified by David Clem November 13, 1994 -## Modified by A. S. Hodel April 1995 - -function Asys = packsys (a, b, c, d, dflg) - - warning("packsys is obsolete! Use ss2sys instead."); - - if (nargin < 3 || nargin > 5) - disp("packsys: Invalid number of arguments") - endif - - ## check dflg - if(nargin == 5) - if( !is_scalar(dflg)) - [m,n] = size(dflg); - error(["packsys: dflg (",num2str(m),",",num2str(n), ... - ") must be a scalar."]); - elseif( (dflg != 0) && (dflg != 1)) - error(["packsys: dflg=",num2str(dflg),"must be 0 or 1"]); - endif - else - ## default condition - dflg = 0; - endif - - if (nargin == 3) - ## No D matrix. Form a zero one! - [brows,bcols] = size(b); - [crows,ccols] = size(c); - d = zeros(crows,bcols); - endif - - [n,m,p] = abcddim(a,b,c,d); - if (n == -1 || m == -1 || p == -1) - error("packsys: incompatible dimensions") - endif - - Asys = ss2sys(a,b,c,d,dflg); - -endfunction
deleted file mode 100644 --- a/scripts/control/qzval.m +++ /dev/null @@ -1,46 +0,0 @@ -## Copyright (C) 1998 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## -*- texinfo -*- -## @deftypefn {Function File } { @var{x} =} qzval (@var{A}, @var{B}) -## Compute generalized eigenvalues of the matrix pencil -## @ifinfo -## @example -## (A - lambda B). -## @end example -## @end ifinfo -## @iftex -## @tex -## $(A - \lambda B)$. -## @end tex -## @end iftex -## -## @var{A} and @var{B} must be real matrices. -## -## @strong{Note} @code{qzval} is obsolete; use @code{qz} instead. -## @end deftypefn - -## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> -## Created: July 1998 - -function lam = qzval (A, B) - - warning("qzval is obsolete; calling qz instead") - lam = qz(A,B); - -endfunction
deleted file mode 100644 --- a/scripts/control/swapcols.m +++ /dev/null @@ -1,38 +0,0 @@ -## Copyright (C) 1996 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## -*- texinfo -*- -## @deftypefn {Function File } { outputs =} swapcols ( inputs ) -## @format -## function B = swapcols(A) -## permute columns of A into reverse order -## @end format -## @end deftypefn - -## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> -## Created: July 23, 1992 -## Conversion to Octave R. Bruce Tenison July 4, 1994 - -function B = swapcols (A) - - m = length(A(1,:)); - idx = m:-1:1; - B = A(:,idx); - -endfunction -
deleted file mode 100644 --- a/scripts/control/swaprows.m +++ /dev/null @@ -1,38 +0,0 @@ -## Copyright (C) 1996 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## -*- texinfo -*- -## @deftypefn {Function File } { outputs =} swaprows ( inputs ) -## @format -## function B = swaprows(A) -## permute rows of A into reverse order -## @end format -## @end deftypefn - -## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu> -## Created: July 23, 1992 -## Conversion to Octave R. Bruce Tenison July 4, 1994 - -function B = swaprows (A) - - m = rows(A); - idx = m:-1:1; - B = A(idx,:); - -endfunction -
deleted file mode 100644 --- a/scripts/control/unpacksys.m +++ /dev/null @@ -1,31 +0,0 @@ -## Copyright (C) 1996 Auburn University. All rights reserved. -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by the -## Free Software Foundation; either version 2, or (at your option) any -## later version. -## -## Octave is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. - -## [a,b,c,d] = unpacksys(sys) -## Obsolete. Use sys2ss instead. - -## Author: David Clem -## Created: August 19, 1994 - -function [a, b, c, d] = unpacksys (syst) - - warning("unpacksys obsolete; calling sys2ss"); - [a,b,c,d] = sys2ss(syst); - -endfunction -