From: <par...@us...> - 2012-06-08 17:47:50
|
Revision: 10600 http://octave.svn.sourceforge.net/octave/?rev=10600&view=rev Author: paramaniac Date: 2012-06-08 17:47:43 +0000 (Fri, 08 Jun 2012) Log Message: ----------- control: remove cruft Removed Paths: ------------- trunk/octave-forge/main/control/devel/makefile_helpers.m trunk/octave-forge/main/control/devel/minreal.m trunk/octave-forge/main/control/devel/test_ctrbf.m trunk/octave-forge/main/control/devel/tf2ss_draft.m Deleted: trunk/octave-forge/main/control/devel/makefile_helpers.m =================================================================== --- trunk/octave-forge/main/control/devel/makefile_helpers.m 2012-06-08 16:45:39 UTC (rev 10599) +++ trunk/octave-forge/main/control/devel/makefile_helpers.m 2012-06-08 17:47:43 UTC (rev 10600) @@ -1,23 +0,0 @@ -## ============================================================================== -## Developer Makefile for OCT-files -## ============================================================================== -## USAGE: * fetch control from Octave-Forge by svn -## * add control/inst, control/src and control/devel to your Octave path -## * run makefile_* -## ============================================================================== - -homedir = pwd (); -develdir = fileparts (which ("makefile_helpers")); -srcdir = [develdir, "/../src"]; -cd (srcdir); - -mkoctfile is_real_scalar.cc - -mkoctfile is_real_vector.cc - -mkoctfile is_real_matrix.cc - -mkoctfile is_real_square_matrix.cc - -system ("rm *.o"); -cd (homedir); \ No newline at end of file Deleted: trunk/octave-forge/main/control/devel/minreal.m =================================================================== --- trunk/octave-forge/main/control/devel/minreal.m 2012-06-08 16:45:39 UTC (rev 10599) +++ trunk/octave-forge/main/control/devel/minreal.m 2012-06-08 17:47:43 UTC (rev 10600) @@ -1,45 +0,0 @@ -## Copyright (C) 2010 Benjamin Fernandez <ma...@be...> -## -## This program 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 of the License, or -## (at your option) any later version. -## -## This program 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, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn{Function File} {[@var{Amin}, @var{Bmin}, @var{Cmin}] =} ctrbf (@var{A}, @var{B}, @var{C}) -## @deftypefnx{Function File} {[@var{Amin}, @var{Bmin}, @var{Cmin}] =} ctrbf (@var{A}, @var{B}, @var{C}, @var{TOL}) -## Minimal realization of the system (A,B,C). -## If the system is controlable and observable, the syste es minimal. -## If the system is not controlable or/and observable, a new system created -## with the controlabe and observable subspace is equivalent -## which means that Cco(sI-Aco)^(-1)Bco = C(sI-A)^(-1)B. -## @end deftypefn - -## Author: Benjamin Fernandez <ma...@be...> -## Created: 2010-07-10 - -function [Amin,Bmin,Cmin] = minreal(A,B,C,TOL) - if(nargin<3 || nargin>4) - print_usage(); - endif - n = length(A); - if(nargin == 3) - TOL = n*norm(A,1)*eps; - endif - [Abar,Bbar,Cbar,T,K,Ac,Bc,Cc,Cnc,lc] = ctrbf(A,B,C); - [Abar,Bbar,Cbar,T,K,Amin,Bmin,Cmin,Cno,lo] = obsvf(Ac,Bc,Cc); - l = lc+lo; - disp('States reduced:'); - disp(l); - -endfunction - Deleted: trunk/octave-forge/main/control/devel/test_ctrbf.m =================================================================== --- trunk/octave-forge/main/control/devel/test_ctrbf.m 2012-06-08 16:45:39 UTC (rev 10599) +++ trunk/octave-forge/main/control/devel/test_ctrbf.m 2012-06-08 17:47:43 UTC (rev 10600) @@ -1,84 +0,0 @@ -a = [ -1.0 0.0 0.0 - -2.0 -2.0 -2.0 - -1.0 0.0 -3.0 ]; - -b = [ 1.0 0.0 0.0 - 0.0 2.0 1.0 ].'; - - -c = [ 0.0 2.0 1.0 - 1.0 0.0 0.0 ]; - - -[ac, bc, cc, z, ncont] = sltb01ud (a, b, c, 0.0) - -z\a*z - -a = [ 1 1 - 4 -2 ]; - -b = [ 1 -1 - 1 -1 ]; - -c = [ 1 0 - 0 1 ]; - -[ac, bc, cc, z, ncont] = sltb01ud (a, b, c, 0.0) - -%{ - The transformed state dynamics matrix of a controllable realization is - -3.0000 2.2361 - 0.0000 -1.0000 - - and the dimensions of its diagonal blocks are - 2 - - The transformed input/state matrix B of a controllable realization is - 0.0000 -2.2361 - 1.0000 0.0000 - - The transformed output/state matrix C of a controllable realization is - -2.2361 0.0000 - 0.0000 1.0000 - - The controllability index of the transformed system representation = 1 - - The similarity transformation matrix Z is - 0.0000 1.0000 0.0000 - -0.8944 0.0000 -0.4472 - -0.4472 0.0000 0.8944 -%} -%{ -A = - 1 1 - 4 -2 - -B = - 1 -1 - 1 -1 - -C = - 1 0 - 0 1 -and locate the uncontrollable mode. - -[Abar,Bbar,Cbar,T,k]=ctrbf(A,B,C) - -Abar = - -3.0000 0 - -3.0000 2.0000 - -Bbar = - 0.0000 0.0000 - 1.4142 -1.4142 - -Cbar = - -0.7071 0.7071 - 0.7071 0.7071 - -T = - -0.7071 0.7071 - 0.7071 0.7071 -k = - 1 0 -%} \ No newline at end of file Deleted: trunk/octave-forge/main/control/devel/tf2ss_draft.m =================================================================== --- trunk/octave-forge/main/control/devel/tf2ss_draft.m 2012-06-08 16:45:39 UTC (rev 10599) +++ trunk/octave-forge/main/control/devel/tf2ss_draft.m 2012-06-08 17:47:43 UTC (rev 10600) @@ -1,76 +0,0 @@ -function retsys = tf2ss_draft () - -num = {[1, 5, 7], [1]; [1, 7], [1, 5, 5]}; -den = {[1, 5, 6], [1, 2]; [1, 8, 6], [1, 3, 2]}; -sys = tf (num, den); - -%{ -sys = tf (1, [1, 0]) -sys = tf (1, [1, 1]) - -sys = tf (1, conv ([1, 1, 1], [1, 4, 6, 4, 1])) - -sys = tf () -sys = tf ("s") -%} - -sys = tf (WestlandLynx); -tol = sqrt (eps) - - [p, m] = size (sys); - [num, den] = tfdata (sys); - - numc = cell (p, m); - denc = cell (p, 1); - - ## multiply all denominators in a row and - ## update each numerator accordingly - for i = 1 : p - denc(i) = __conv__ (den{i,:}); - for j = 1 : m - idx = setdiff (1:m, j); - numc(i,j) = __conv__ (num{i,j}, den{i,idx}); - endfor - endfor - - len_numc = cellfun (@length, numc); - len_denc = cellfun (@length, denc); - - ## tfpoly ensures that there are no leading zeros - tmp = len_numc > repmat (len_denc, 1, m); - if (any (tmp(:))) - error ("tf: tf2ss: system must be proper"); - endif - - max_len_denc = max (len_denc(:)); - ucoeff = zeros (p, m, max_len_denc); - dcoeff = zeros (p, max_len_denc); - index = len_denc-1; - - for i = 1 : p - len = len_denc(i); - dcoeff(i, 1:len) = denc{i}; - for j = 1 : m - ucoeff(i, j, len-len_numc(i,j)+1 : len) = numc{i,j}; - endfor - endfor -index, prod (index), eps*prod (index) -min (sqrt (eps), eps*prod (index)) - [a, b, c, d] = sltd04ad (ucoeff, dcoeff, index, tol); - - retsys = ss (a, b, c, d); - -endfunction - - -function vec = __conv__ (vec, varargin) - - if (nargin == 1) - return; - else - for k = 1 : nargin-1 - vec = conv (vec, varargin{k}); - endfor - endif - -endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |