From: <par...@us...> - 2012-05-12 16:41:44
|
Revision: 10428 http://octave.svn.sourceforge.net/octave/?rev=10428&view=rev Author: paramaniac Date: 2012-05-12 16:41:38 +0000 (Sat, 12 May 2012) Log Message: ----------- control-devel: sort variables alphabetically Modified Paths: -------------- trunk/octave-forge/extra/control-devel/src/slident.cc Added Paths: ----------- trunk/octave-forge/extra/control-devel/devel/Destillation_combinations.m trunk/octave-forge/extra/control-devel/devel/PowerPlant_combinations.m trunk/octave-forge/extra/control-devel/devel/ident_combinations.m Added: trunk/octave-forge/extra/control-devel/devel/Destillation_combinations.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/Destillation_combinations.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/Destillation_combinations.m 2012-05-12 16:41:38 UTC (rev 10428) @@ -0,0 +1,90 @@ +%{ +This file describes the data in the destill.dat file. +1. Contributed by: + Peter Van Overschee + K.U.Leuven - ESAT - SISTA + K. Mercierlaan 94 + 3001 Heverlee + Pet...@es... +2. Process/Description: + Data of a simulation (not real !) related to the identification + of an ethane-ethylene destillationcolumn. The series consists of 4 + series: + U_dest, Y_dest: without noise (original series) + U_dest_n10, Y_dest_n10: 10 percent additive white noise + U_dest_n20, Y_dest_n20: 20 percent additive white noise + U_dest_n30, Y_dest_n30: 30 percent additive white noise +3. Sampling time + 15 min. +4. Number of samples: + 90 samples +5. Inputs: + a. ratio between the reboiler duty and the feed flow + b. ratio between the reflux rate and the feed flow + c. ratio between the distillate and the feed flow + d. input ethane composition + e. top pressure +6. Outputs: + a. top ethane composition + b. bottom ethylene composition + c. top-bottom differential pressure. +7. References: + R.P. Guidorzi, M.P. Losito, T. Muratori, The range error test in the + structural identification of linear multivariable systems, + IEEE transactions on automatic control, Vol AC-27, pp 1044-1054, oct. + 1982. +8. Known properties/peculiarities + +9. Some MATLAB-code to retrieve the data + !gunzip destill.dat.Z + load destill.dat + U=destill(:,1:20); + Y=destill(:,21:32); + U_dest=U(:,1:5); + U_dest_n10=U(:,6:10); + U_dest_n20=U(:,11:15); + U_dest_n30=U(:,16:20); + Y_dest=Y(:,1:3); + Y_dest_n10=Y(:,4:6); + Y_dest_n20=Y(:,7:9); + Y_dest_n30=Y(:,10:12); +%} + +clear all, close all, clc + +% DaISy code is wrong, +% first column is sample number +load destill.dat +U=destill(:,2:21); +Y=destill(:,22:33); +U_dest=U(:,1:5); +U_dest_n10=U(:,6:10); +U_dest_n20=U(:,11:15); +U_dest_n30=U(:,16:20); +Y_dest=Y(:,1:3); +Y_dest_n10=Y(:,4:6); +Y_dest_n20=Y(:,7:9); +Y_dest_n30=Y(:,10:12); + + +dat = iddata (Y_dest, U_dest); + +err = zeros (3, 3); + +for meth = 0:2 + for alg = 0:2 + [sys, x0] = ident_combinations (dat, 5, 4, meth, alg); % s=5, n=4 + [y, t] = lsim (sys, U_dest, [], x0); + err(meth+1, alg+1) = norm (Y_dest - y, 1) / norm (Y_dest, 1); + endfor +endfor + +err + +%{ +figure (1) +%plot (t, Y_dest, 'b') +plot (t, Y_dest, 'b', t, y, 'r') +legend ('y measured', 'y simulated', 'location', 'southeast') +%} + Added: trunk/octave-forge/extra/control-devel/devel/PowerPlant_combinations.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/PowerPlant_combinations.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/PowerPlant_combinations.m 2012-05-12 16:41:38 UTC (rev 10428) @@ -0,0 +1,92 @@ +%{ +This file describes the data in the powerplant.dat file. +1. Contributed by: + Peter Van Overschee + K.U.Leuven - ESAT - SISTA + K. Mercierlaan 94 + 3001 Heverlee + Pet...@es... +2. Process/Description: + data of a power plant (Pont-sur-Sambre (France)) of 120 MW +3. Sampling time + 1228.8 sec +4. Number of samples: + 200 samples +5. Inputs: + 1. gas flow + 2. turbine valves opening + 3. super heater spray flow + 4. gas dampers + 5. air flow +6. Outputs: + 1. steam pressure + 2. main stem temperature + 3. reheat steam temperature +7. References: + a. R.P. Guidorzi, P. Rossi, Identification of a power plant from normal + operating records. Automatic control theory and applications (Canada, + Vol 2, pp 63-67, sept 1974. + b. Moonen M., De Moor B., Vandenberghe L., Vandewalle J., On- and + off-line identification of linear state-space models, International + Journal of Control, Vol. 49, Jan. 1989, pp.219-232 +8. Known properties/peculiarities + +9. Some MATLAB-code to retrieve the data + !gunzip powerplant.dat.Z + load powerplant.dat + U=powerplant(:,1:5); + Y=powerplant(:,6:8); + Yr=powerplant(:,9:11); + +%} + +clear all, close all, clc + +% NB: the code from DaISy is wrong: +% powerplant(:,1) is just the sample number +% therefore increase indices by one +% it took me weeks to find that silly mistake ... +load powerplant.dat +U=powerplant(:,2:6); +Y=powerplant(:,7:9); +Yr=powerplant(:,10:12); + +inname = {'gas flow', + 'turbine valves opening', + 'super heater spray flow', + 'gas dampers', + 'air flow'}; + +outname = {'steam pressure', + 'main steam temperature', + 'reheat steam temperature'}; + +tsam = 1228.8; + +dat = iddata (Y, U, tsam, 'outname', outname, 'inname', inname) + + +err = zeros (3, 3); + +for meth = 0:2 + for alg = 0:2 + [sys, x0] = ident_combinations (dat, 10, 8, meth, alg); % s=10, n=8 + [y, t] = lsim (sys, U, [], x0); + err(meth+1, alg+1) = norm (Y - y, 1) / norm (Y, 1); + endfor +endfor + +err + +%{ +figure (1) +p = columns (Y); +for k = 1 : p + subplot (3, 1, k) + plot (t, Y(:,k), 'b', t, y(:,k), 'r') +endfor +%title ('DaISy: Power Plant') +%legend ('y measured', 'y simulated', 'location', 'southeast') + +st = isstable (sys) +%} Added: trunk/octave-forge/extra/control-devel/devel/ident_combinations.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident_combinations.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/ident_combinations.m 2012-05-12 16:41:38 UTC (rev 10428) @@ -0,0 +1,54 @@ +function [sys, x0] = ident_combinations (dat, s = [], n = [], meth, alg) + + + + %nobr = 15; +% meth = 1; % 2 % geht: meth/alg 1/1, +% alg = 2; % 0 % geht nicht: meth/alg 0/1 + jobd = 1; + batch = 3; + conct = 1; + ctrl = 0; %1; + rcond = 0.0; + tol = -1.0; % 0; + + [ns, l, m, e] = size (dat); + + if (isempty (s) && isempty (n)) + nsmp = ns(1); + nobr = fix ((nsmp+1)/(2*(m+l+1))); + ctrl = 0; # confirm system order estimate + n = 0; + % nsmp >= 2*(m+l+1)*nobr - 1 + % nobr <= (nsmp+1)/(2*(m+l+1)) + elseif (isempty (s)) + s = min (2*n, n+10); + nsmp = ns(1); + nobr = fix ((nsmp+1)/(2*(m+l+1))); + nobr = min (nobr, s); + ctrl = 1; # no confirmation + elseif (isempty (n)) + nobr = s; + ctrl = 0; # confirm system order estimate + n = 0; + else # s & n non-empty + nsmp = ns(1); + nobr = fix ((nsmp+1)/(2*(m+l+1))); + if (s > nobr) + error ("ident: s > nobr"); + endif + nobr = s; + ctrl = 1; + ## TODO: specify n for IB01BD + endif + + %nsmp = ns(1) + %nobr = fix ((nsmp+1)/(2*(m+l+1))) + % nsmp >= 2*(m+l+1)*nobr - 1 + % nobr <= (nsmp+1)/(2*(m+l+1)) +%nobr = 10 + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol); + + sys = ss (a, b, c, d, dat.tsam{1}); + +endfunction Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-12 15:32:53 UTC (rev 10427) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-12 16:41:38 UTC (rev 10428) @@ -137,16 +137,16 @@ switch (imeth) { case 0: + meth_a = 'M'; meth_b = 'M'; - meth_a = 'M'; break; case 1: + meth_a = 'N'; meth_b = 'N'; - meth_a = 'N'; break; case 2: + meth_a = 'N'; // no typo here meth_b = 'C'; - meth_a = 'N'; // no typo here break; default: error ("slib01ad: argument 'meth' invalid"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-15 13:58:23
|
Revision: 10442 http://octave.svn.sourceforge.net/octave/?rev=10442&view=rev Author: paramaniac Date: 2012-05-15 13:58:12 +0000 (Tue, 15 May 2012) Log Message: ----------- control-devel: use svd for multi-experiment data Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m trunk/octave-forge/extra/control-devel/inst/arx.m Modified: trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m 2012-05-15 12:51:58 UTC (rev 10441) +++ trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m 2012-05-15 13:58:12 UTC (rev 10442) @@ -51,7 +51,7 @@ dat = iddata (Y, U) % [sys, x0] = ident (dat, 15, 8) % s=15, n=8 -sys = arx (dat, 4, [4 4]) +sys = arx (dat, 4, 4) %[y, t] = lsim (sys, U, [], x0); %[y, t] = lsim (sys(:,1:2), U); Modified: trunk/octave-forge/extra/control-devel/inst/arx.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-15 12:51:58 UTC (rev 10441) +++ trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-15 13:58:12 UTC (rev 10442) @@ -102,25 +102,7 @@ if (ex == 1) ## single-experiment dataset - - ## solve linear least squares problem by pseudoinverse - ## the pseudoinverse is computed by singular value decomposition - ## M = U S V* ---> M+ = V S+ U* - ## Th = Ph \ Y = Ph+ Y - ## Th = V S+ U* Y, S+ = 1 ./ diag (S) - - [U, S, V] = svd (phi{1}, 0); # 0 for "economy size" decomposition - S = diag (S); # extract main diagonal - r = sum (S > eps*S(1)); - if (r < length (S)) - warning ("arx: rank-deficient coefficient matrix"); - warning ("sampling time too small"); - warning ("persistence of excitation"); - endif - V = V(:, 1:r); - S = S(1:r); - U = U(:, 1:r); - theta = V * (S .\ (U' * y{1}(n(i)+1:end, i))); # U' is the conjugate transpose + theta = __ls_svd__ (phi{1}, y{1}(n(i)+1:end, i)); else ## multi-experiment dataset ## TODO: find more sophisticated formula than @@ -136,7 +118,31 @@ PhiTY = plus (tmp{:}); ## pseudoinverse Theta = C \ Phi'Y - theta = C \ PhiTY; + theta = __ls_svd__ (C, PhiTY); endif endfunction + + +function x = __ls_svd__ (A, b) + + ## solve linear least squares problem by pseudoinverse + ## the pseudoinverse is computed by singular value decomposition + ## M = U S V* ---> M+ = V S+ U* + ## Th = Ph \ Y = Ph+ Y + ## Th = V S+ U* Y, S+ = 1 ./ diag (S) + + [U, S, V] = svd (A, 0); # 0 for "economy size" decomposition + S = diag (S); # extract main diagonal + r = sum (S > eps*S(1)); + if (r < length (S)) + warning ("arx: rank-deficient coefficient matrix"); + warning ("sampling time too small"); + warning ("persistence of excitation"); + endif + V = V(:, 1:r); + S = S(1:r); + U = U(:, 1:r); + x = V * (S .\ (U' * b)); # U' is the conjugate transpose + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-18 15:02:07
|
Revision: 10456 http://octave.svn.sourceforge.net/octave/?rev=10456&view=rev Author: paramaniac Date: 2012-05-18 15:01:56 +0000 (Fri, 18 May 2012) Log Message: ----------- control-devel: remove parameter jobd Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/ident.m trunk/octave-forge/extra/control-devel/devel/ident_combinations.m trunk/octave-forge/extra/control-devel/devel/makefile_devel.m trunk/octave-forge/extra/control-devel/inst/moesp.m trunk/octave-forge/extra/control-devel/inst/n4sid.m trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/devel/ident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 14:23:03 UTC (rev 10455) +++ trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 15:01:56 UTC (rev 10456) @@ -5,7 +5,6 @@ %nobr = 15; meth = 2; % 2 % geht: meth/alg 1/1, alg = 0; % 0 % geht nicht: meth/alg 0/1 - jobd = 1; batch = 3; conct = 1; ctrl = 0; %1; @@ -47,7 +46,7 @@ % nsmp >= 2*(m+l+1)*nobr - 1 % nobr <= (nsmp+1)/(2*(m+l+1)) %nobr = 10 - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); Modified: trunk/octave-forge/extra/control-devel/devel/ident_combinations.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident_combinations.m 2012-05-18 14:23:03 UTC (rev 10455) +++ trunk/octave-forge/extra/control-devel/devel/ident_combinations.m 2012-05-18 15:01:56 UTC (rev 10456) @@ -5,7 +5,6 @@ %nobr = 15; % meth = 1; % 2 % geht: meth/alg 1/1, % alg = 2; % 0 % geht nicht: meth/alg 0/1 - jobd = 1; batch = 3; conct = 1; ctrl = 0; %1; @@ -47,7 +46,7 @@ % nsmp >= 2*(m+l+1)*nobr - 1 % nobr <= (nsmp+1)/(2*(m+l+1)) %nobr = 10 - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); Modified: trunk/octave-forge/extra/control-devel/devel/makefile_devel.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/makefile_devel.m 2012-05-18 14:23:03 UTC (rev 10455) +++ trunk/octave-forge/extra/control-devel/devel/makefile_devel.m 2012-05-18 15:01:56 UTC (rev 10456) @@ -14,7 +14,7 @@ ## system ("make realclean"); # recompile slicotlibrary.a system ("make clean"); -system ("make -j4 all"); +system ("make -j1 all"); system ("rm *.o"); cd (homedir); \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/inst/moesp.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/moesp.m 2012-05-18 14:23:03 UTC (rev 10455) +++ trunk/octave-forge/extra/control-devel/inst/moesp.m 2012-05-18 15:01:56 UTC (rev 10456) @@ -17,7 +17,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{dat} =} moesp (@var{dat}, @var{s}, @var{n}) -## MOESP. +## MOESP: Multivariable Output Error State sPace. ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> Modified: trunk/octave-forge/extra/control-devel/inst/n4sid.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/n4sid.m 2012-05-18 14:23:03 UTC (rev 10455) +++ trunk/octave-forge/extra/control-devel/inst/n4sid.m 2012-05-18 15:01:56 UTC (rev 10456) @@ -17,7 +17,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {@var{dat} =} n4sid (@var{dat}, @var{s}, @var{n}) -## N4SID. +## N4SID: Numerical algorithm for Subspace State Space System IDentification. ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 14:23:03 UTC (rev 10455) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 15:01:56 UTC (rev 10456) @@ -95,7 +95,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 12) + if (nargin != 11) { print_usage (); } @@ -121,18 +121,16 @@ const int imeth = args(4).int_value (); const int ialg = args(5).int_value (); - const int ijobd = args(6).int_value (); - const int ibatch = args(7).int_value (); - const int iconct = args(8).int_value (); - const int ictrl = args(9).int_value (); + const int ibatch = args(6).int_value (); + const int iconct = args(7).int_value (); + const int ictrl = args(8).int_value (); - double rcond = args(10).double_value (); - double tol_a = args(11).double_value (); + double rcond = args(9).double_value (); + double tol_a = args(10).double_value (); double tol_b = rcond; double tol_c = rcond; - //double tol_b = args(10).double_value (); // tol_b = rcond - + switch (imeth) { @@ -166,14 +164,12 @@ default: error ("slib01ad: argument 'alg' invalid"); } - - if (meth_b == 'C') - jobd = 'N'; - else if (ijobd == 0) + + if (meth_a == 'M') jobd = 'M'; - else - jobd = 'N'; - + else // meth_a == 'N' + jobd = 'N'; // IB01AD.f says: This parameter is not relevant for METH = 'N' + switch (ibatch) { case 0: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-18 18:23:34
|
Revision: 10458 http://octave.svn.sourceforge.net/octave/?rev=10458&view=rev Author: paramaniac Date: 2012-05-18 18:23:28 +0000 (Fri, 18 May 2012) Log Message: ----------- control-devel: get multi-experiment identification working (fingers crossed) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/ident.m trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/devel/ident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 16:04:20 UTC (rev 10457) +++ trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 18:23:28 UTC (rev 10458) @@ -46,7 +46,7 @@ % nsmp >= 2*(m+l+1)*nobr - 1 % nobr <= (nsmp+1)/(2*(m+l+1)) %nobr = 10 - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 16:04:20 UTC (rev 10457) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 18:23:28 UTC (rev 10458) @@ -184,10 +184,10 @@ ctrl = 'N'; - int n_exp = y_cell.nelem (); // number of experiments - - int m = u_cell.elem(0).columns (); // m: number of inputs - int l = y_cell.elem(0).columns (); // l: number of outputs + int n_exp = y_cell.nelem (); // number of experiments + int m = u_cell.elem(0).columns (); // m: number of inputs + int l = y_cell.elem(0).columns (); // l: number of outputs + int nsmpl = 0; // total number of samples // arguments out int n; @@ -221,6 +221,7 @@ //int m = u.columns (); // m: number of inputs //int l = y.columns (); // l: number of outputs int nsmp = y.rows (); // nsmp: number of samples + nsmpl += nsmp; // y.rows == u.rows is checked by iddata class // TODO: check minimal nsmp size @@ -448,7 +449,7 @@ char job = 'A'; char jobck = 'K'; - int nsmpl = nsmp; + //int nsmpl = nsmp; if (nsmpl < 2*(m+l)*nobr) error ("slident: nsmpl (%d) < 2*(m+l)*nobr (%d)", nsmpl, nobr); @@ -623,7 +624,7 @@ // TODO: use only one iwork and dwork for all three slicot routines // ldwork = max (ldwork_a, ldwork_b, ldwork_c) - +/* // arguments in char jobx0 = 'X'; char comuse = 'U'; @@ -700,7 +701,7 @@ error_msg ("ident: IB01CD", info_c, 2, err_msg_c); warning_msg ("ident: IB01CD", iwarn_c, 6, warn_msg_c); - +*/ // return values retval(0) = a; @@ -713,7 +714,8 @@ retval(6) = s; retval(7) = k; - retval(8) = x0; + // retval(8) = x0; + retval(8) = octave_value (0); } return retval; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-18 20:25:41
|
Revision: 10459 http://octave.svn.sourceforge.net/octave/?rev=10459&view=rev Author: paramaniac Date: 2012-05-18 20:25:34 +0000 (Fri, 18 May 2012) Log Message: ----------- control-devel: initial state vectors for multi-experiment identification Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/ident.m trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/devel/ident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 18:23:28 UTC (rev 10458) +++ trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 20:25:34 UTC (rev 10459) @@ -49,5 +49,9 @@ [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); + + if (numel (x0) == 1) + x0 = x0{1}; + endif endfunction Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 18:23:28 UTC (rev 10458) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 20:25:34 UTC (rev 10459) @@ -621,87 +621,103 @@ // SLICOT IB01CD - estimating the initial state // //////////////////////////////////////////////////////////////////////////////////// -// TODO: use only one iwork and dwork for all three slicot routines -// ldwork = max (ldwork_a, ldwork_b, ldwork_c) - -/* // arguments in char jobx0 = 'X'; char comuse = 'U'; char jobbd = 'D'; // arguments out - int ldv = max (1, n); + Cell x0_cell (n_exp, 1); - ColumnVector x0 (n); - Matrix v (ldv, n); + for (int i = 0; i < n_exp; i++) + { + Matrix y = y_cell.elem(i).matrix_value (); + Matrix u = u_cell.elem(i).matrix_value (); + + int nsmp = y.rows (); // nsmp: number of samples + int ldv = max (1, n); + + int ldu; - // workspace - int liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C' - int ldwork_c; - int t = nsmp; + if (m == 0) + ldu = 1; + else // m > 0 + ldu = nsmp; + + int ldy = nsmp; + + + ColumnVector x0 (n); + Matrix v (ldv, n); + + // workspace + int liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C' + int ldwork_c; + int t = nsmp; - int ldw1_c = 2; - int ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n); - int ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n); + int ldw1_c = 2; + int ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n); + int ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n); - ldwork_c = ldw1_c + n*( n + m + l ) + max (5*n, ldw1_c, min (ldw2_c, ldw3_c)); - - OCTAVE_LOCAL_BUFFER (int, iwork_c, liwork_c); - OCTAVE_LOCAL_BUFFER (double, dwork_c, ldwork_c); + ldwork_c = ldw1_c + n*( n + m + l ) + max (5*n, ldw1_c, min (ldw2_c, ldw3_c)); - // error indicators - int iwarn_c = 0; - int info_c = 0; - + OCTAVE_LOCAL_BUFFER (int, iwork_c, liwork_c); + OCTAVE_LOCAL_BUFFER (double, dwork_c, ldwork_c); - // SLICOT routine IB01CD - F77_XFCN (ib01cd, IB01CD, - (jobx0, comuse, jobbd, - n, m, l, - nsmp, - a.fortran_vec (), lda, - b.fortran_vec (), ldb, - c.fortran_vec (), ldc, - d.fortran_vec (), ldd, - u.fortran_vec (), ldu, - y.fortran_vec (), ldy, - x0.fortran_vec (), - v.fortran_vec (), ldv, - tol_c, - iwork_c, - dwork_c, ldwork_c, - iwarn_c, info_c)); + // error indicators + int iwarn_c = 0; + int info_c = 0; + // SLICOT routine IB01CD + F77_XFCN (ib01cd, IB01CD, + (jobx0, comuse, jobbd, + n, m, l, + nsmp, + a.fortran_vec (), lda, + b.fortran_vec (), ldb, + c.fortran_vec (), ldc, + d.fortran_vec (), ldd, + u.fortran_vec (), ldu, + y.fortran_vec (), ldy, + x0.fortran_vec (), + v.fortran_vec (), ldv, + tol_c, + iwork_c, + dwork_c, ldwork_c, + iwarn_c, info_c)); - if (f77_exception_encountered) - error ("ident: exception in SLICOT subroutine IB01CD"); - static const char* err_msg_c[] = { - "0: OK", - "1: the QR algorithm failed to compute all the " - "eigenvalues of the matrix A (see LAPACK Library " - "routine DGEES); the locations DWORK(i), for " - "i = g+1:g+N*N, contain the partially converged " - "Schur form", - "2: the singular value decomposition (SVD) algorithm did " - "not converge"}; + if (f77_exception_encountered) + error ("ident: exception in SLICOT subroutine IB01CD"); - static const char* warn_msg_c[] = { - "0: OK", - "1: warning message not specified", - "2: warning message not specified", - "3: warning message not specified", - "4: the least squares problem to be solved has a " - "rank-deficient coefficient matrix", - "5: warning message not specified", - "6: the matrix A is unstable; the estimated x(0) " - "and/or B and D could be inaccurate"}; + static const char* err_msg_c[] = { + "0: OK", + "1: the QR algorithm failed to compute all the " + "eigenvalues of the matrix A (see LAPACK Library " + "routine DGEES); the locations DWORK(i), for " + "i = g+1:g+N*N, contain the partially converged " + "Schur form", + "2: the singular value decomposition (SVD) algorithm did " + "not converge"}; + static const char* warn_msg_c[] = { + "0: OK", + "1: warning message not specified", + "2: warning message not specified", + "3: warning message not specified", + "4: the least squares problem to be solved has a " + "rank-deficient coefficient matrix", + "5: warning message not specified", + "6: the matrix A is unstable; the estimated x(0) " + "and/or B and D could be inaccurate"}; - error_msg ("ident: IB01CD", info_c, 2, err_msg_c); - warning_msg ("ident: IB01CD", iwarn_c, 6, warn_msg_c); -*/ + + error_msg ("ident: IB01CD", info_c, 2, err_msg_c); + warning_msg ("ident: IB01CD", iwarn_c, 6, warn_msg_c); + + x0_cell.elem(i) = x0; + } + // return values retval(0) = a; @@ -714,8 +730,7 @@ retval(6) = s; retval(7) = k; - // retval(8) = x0; - retval(8) = octave_value (0); + retval(8) = x0_cell; } return retval; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-18 20:40:02
|
Revision: 10460 http://octave.svn.sourceforge.net/octave/?rev=10460&view=rev Author: paramaniac Date: 2012-05-18 20:39:56 +0000 (Fri, 18 May 2012) Log Message: ----------- control-devel: remove obsolete variables Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/ident.m trunk/octave-forge/extra/control-devel/devel/ident_combinations.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m trunk/octave-forge/extra/control-devel/src/slident.cc Modified: trunk/octave-forge/extra/control-devel/devel/ident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 20:25:34 UTC (rev 10459) +++ trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-18 20:39:56 UTC (rev 10460) @@ -5,7 +5,6 @@ %nobr = 15; meth = 2; % 2 % geht: meth/alg 1/1, alg = 0; % 0 % geht nicht: meth/alg 0/1 - batch = 3; conct = 1; ctrl = 0; %1; rcond = 0.0; @@ -46,7 +45,7 @@ % nsmp >= 2*(m+l+1)*nobr - 1 % nobr <= (nsmp+1)/(2*(m+l+1)) %nobr = 10 - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); Modified: trunk/octave-forge/extra/control-devel/devel/ident_combinations.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident_combinations.m 2012-05-18 20:25:34 UTC (rev 10459) +++ trunk/octave-forge/extra/control-devel/devel/ident_combinations.m 2012-05-18 20:39:56 UTC (rev 10460) @@ -5,7 +5,6 @@ %nobr = 15; % meth = 1; % 2 % geht: meth/alg 1/1, % alg = 2; % 0 % geht nicht: meth/alg 0/1 - batch = 3; conct = 1; ctrl = 0; %1; rcond = 0.0; @@ -41,13 +40,12 @@ ## TODO: specify n for IB01BD endif - %nsmp = ns(1) - %nobr = fix ((nsmp+1)/(2*(m+l+1))) - % nsmp >= 2*(m+l+1)*nobr - 1 - % nobr <= (nsmp+1)/(2*(m+l+1)) -%nobr = 10 - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, batch, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); + + if (numel (x0) == 1) + x0 = x0{1}; + endif endfunction Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-18 20:25:34 UTC (rev 10459) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-18 20:39:56 UTC (rev 10460) @@ -11,10 +11,7 @@ error ("ident: invalid method"); # should never happen endswitch -% meth = 2; % 2 % geht: meth/alg 1/1, - alg = 0; % 0 % geht nicht: meth/alg 0/1 - jobd = 1; - batch = 3; + alg = 0; conct = 1; ctrl = 0; %1; rcond = 0.0; @@ -50,8 +47,12 @@ ## TODO: specify n for IB01BD endif - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol); + [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); sys = ss (a, b, c, d, dat.tsam{1}); + if (numel (x0) == 1) + x0 = x0{1}; + endif + endfunction Modified: trunk/octave-forge/extra/control-devel/src/slident.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 20:25:34 UTC (rev 10459) +++ trunk/octave-forge/extra/control-devel/src/slident.cc 2012-05-18 20:39:56 UTC (rev 10460) @@ -96,7 +96,7 @@ int nargin = args.length (); octave_value_list retval; - if (nargin != 11) + if (nargin != 10) { print_usage (); } @@ -117,19 +117,16 @@ const Cell y_cell = args(0).cell_value (); const Cell u_cell = args(1).cell_value (); - //Matrix y = args(0).matrix_value (); - //Matrix u = args(1).matrix_value (); int nobr = args(2).int_value (); int nuser = args(3).int_value (); const int imeth = args(4).int_value (); const int ialg = args(5).int_value (); - // const int ibatch = args(6).int_value (); // löschen - const int iconct = args(7).int_value (); - const int ictrl = args(8).int_value (); + const int iconct = args(6).int_value (); + const int ictrl = args(7).int_value (); - double rcond = args(9).double_value (); - double tol_a = args(10).double_value (); + double rcond = args(8).double_value (); + double tol_a = args(9).double_value (); double tol_b = rcond; double tol_c = rcond; @@ -244,21 +241,7 @@ ldu = nsmp; int ldy = nsmp; -/* - // arguments out - int n; - int ldr; - - if (meth_a == 'M' && jobd == 'M') - ldr = max (2*(m+l)*nobr, 3*m*nobr); - else if (meth_a == 'N' || (meth_a == 'M' && jobd == 'N')) - ldr = 2*(m+l)*nobr; - else - error ("slib01ad: could not handle 'ldr' case"); - - Matrix r (ldr, 2*(m+l)*nobr); - ColumnVector sv (l*nobr); -*/ + // workspace int liwork_a; @@ -272,7 +255,6 @@ // TODO: Handle 'k' for DWORK int ldwork_a; - //int ns = nsmp - 2*nobr + 1; if (alg == 'C') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-21 13:03:12
|
Revision: 10473 http://octave.svn.sourceforge.net/octave/?rev=10473&view=rev Author: paramaniac Date: 2012-05-21 13:03:02 +0000 (Mon, 21 May 2012) Log Message: ----------- control-devel: work on identification user functions Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/CDplayer.m trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m trunk/octave-forge/extra/control-devel/devel/pH.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Modified: trunk/octave-forge/extra/control-devel/devel/CDplayer.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/CDplayer.m 2012-05-21 09:45:39 UTC (rev 10472) +++ trunk/octave-forge/extra/control-devel/devel/CDplayer.m 2012-05-21 13:03:02 UTC (rev 10473) @@ -50,7 +50,7 @@ dat = iddata (Y, U) -[sys, x0] = ident (dat, 15, 8) % s=15, n=8 +[sys, x0] = moen4 (dat, 8) % s=15, n=8 [y, t] = lsim (sys, U, [], x0); Modified: trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m 2012-05-21 09:45:39 UTC (rev 10472) +++ trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m 2012-05-21 13:03:02 UTC (rev 10473) @@ -48,7 +48,7 @@ dat = iddata (Y, U) -[sys, x0] = ident (dat, 10, 5) % s=10, n=5 +[sys, x0] = moen4 (dat, 5) % s=10, n=5 [y, t] = lsim (sys, U, [], x0); Modified: trunk/octave-forge/extra/control-devel/devel/pH.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/pH.m 2012-05-21 09:45:39 UTC (rev 10472) +++ trunk/octave-forge/extra/control-devel/devel/pH.m 2012-05-21 13:03:02 UTC (rev 10473) @@ -51,7 +51,7 @@ dat = iddata (Y, U) -[sys, x0] = ident (dat, 15, 6) % s=15, n=6 +[sys, x0] = moen4 (dat, 6) % s=15, n=6 [y, t] = lsim (sys, U, [], x0); Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-21 09:45:39 UTC (rev 10472) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-21 13:03:02 UTC (rev 10473) @@ -1,4 +1,4 @@ -function [sys, x0] = __slicot_identification__ (method, dat, s = [], n = []) +function [sys, x0] = __slicot_identification__ (method, dat, n = []) switch (method) case "moesp" @@ -15,14 +15,25 @@ error ("%s: first argument must be an 'iddata' dataset", method); endif + ## default arguments alg = 0; - conct = 1; - ctrl = 0; %1; + conct = 1; # no connection between experiments + ctrl = 1; # don't confirm order n rcond = 0.0; tol = -1.0; % 0; [ns, l, m, e] = size (dat); + s = min (2*n, n+10); # upper bound for n + nsmp = sum (ns); # total number of samples + nobr = fix ((nsmp+1)/(2*(m+l+1))); + if (e > 1) + nobr = min (nobr, fix (min (ns) / 2)); + endif + nobr = min (nobr, s) + +%{ + if (isempty (s) && isempty (n)) nsmp = ns(1); nobr = fix ((nsmp+1)/(2*(m+l+1))); @@ -50,6 +61,7 @@ ctrl = 1; ## TODO: specify n for IB01BD endif +%} [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-21 15:16:36
|
Revision: 10475 http://octave.svn.sourceforge.net/octave/?rev=10475&view=rev Author: paramaniac Date: 2012-05-21 15:16:30 +0000 (Mon, 21 May 2012) Log Message: ----------- control-devel: handle properties for identification backend Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/PowerPlant.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Modified: trunk/octave-forge/extra/control-devel/devel/PowerPlant.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/PowerPlant.m 2012-05-21 13:40:38 UTC (rev 10474) +++ trunk/octave-forge/extra/control-devel/devel/PowerPlant.m 2012-05-21 15:16:30 UTC (rev 10475) @@ -65,7 +65,7 @@ dat = iddata (Y, U, tsam, 'outname', outname, 'inname', inname) -[sys, x0] = ident (dat, 10, 8) % s=10, n=8 +[sys, x0] = moen4 (dat, 's', 10, 'n', 8) % s=10, n=8 [y, t] = lsim (sys, U, [], x0); Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-21 13:40:38 UTC (rev 10474) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-21 15:16:30 UTC (rev 10475) @@ -61,8 +61,8 @@ ## default arguments alg = 0; - conct = 1; # no connection between experiments - ctrl = 1; # don't confirm order n + conct = 1; # no connection between experiments + ctrl = 1; # don't confirm order n rcond = 0.0; tol = -1.0; % 0; s = []; @@ -89,49 +89,36 @@ endswitch endfor - - - s = min (2*n, n+10); # upper bound for n + + ## handle s/nobr and n nsmp = sum (ns); # total number of samples nobr = fix ((nsmp+1)/(2*(m+l+1))); if (e > 1) nobr = min (nobr, fix (min (ns) / 2)); endif - nobr = min (nobr, s) - -%{ if (isempty (s) && isempty (n)) - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - ctrl = 0; # confirm system order estimate + ctrl = 0; # confirm system order estimate n = 0; - % nsmp >= 2*(m+l+1)*nobr - 1 - % nobr <= (nsmp+1)/(2*(m+l+1)) elseif (isempty (s)) - s = min (2*n, n+10); - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); + s = min (2*n, n+10); # upper bound for n nobr = min (nobr, s); - ctrl = 1; # no confirmation elseif (isempty (n)) - nobr = s; - ctrl = 0; # confirm system order estimate + nobr = __check_s__ (s, nobr, method); + ctrl = 0; # confirm system order estimate n = 0; - else # s & n non-empty - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - if (s > nobr) - error ("ident: s > nobr"); + else # s & n non-empty + nobr = __check_s__ (s, nobr, method); + if (n >= nobr) + error ("%s: n=%d, but require n < %d (s)", method, n, nobr); endif - nobr = s; - ctrl = 1; - ## TODO: specify n for IB01BD endif -%} + + ## perform system identification [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); + ## assemble model sys = ss (a, b, c, d, dat.tsam{1}); if (numel (x0) == 1) @@ -139,3 +126,14 @@ endif endfunction + + +function nobr = __check_s__ (s, nobr, method) + + if (s <= nobr) + nobr = s; + else + error ("%s: require upper bound s <= %d, but the requested s is %d", method, nobr, s); + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-21 17:32:38
|
Revision: 10480 http://octave.svn.sourceforge.net/octave/?rev=10480&view=rev Author: paramaniac Date: 2012-05-21 17:32:29 +0000 (Mon, 21 May 2012) Log Message: ----------- control-devel: touch up manual Modified Paths: -------------- trunk/octave-forge/extra/control-devel/DESCRIPTION trunk/octave-forge/extra/control-devel/INDEX trunk/octave-forge/extra/control-devel/devel/pdfdoc/control-devel.tex Modified: trunk/octave-forge/extra/control-devel/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/control-devel/DESCRIPTION 2012-05-21 16:11:14 UTC (rev 10479) +++ trunk/octave-forge/extra/control-devel/DESCRIPTION 2012-05-21 17:32:29 UTC (rev 10480) @@ -1,6 +1,6 @@ Name: Control-Devel -Version: 0.1.51 -Date: 2012-02-28 +Version: 0.2.0 +Date: 2012-05-21 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Developer's Playground Modified: trunk/octave-forge/extra/control-devel/INDEX =================================================================== --- trunk/octave-forge/extra/control-devel/INDEX 2012-05-21 16:11:14 UTC (rev 10479) +++ trunk/octave-forge/extra/control-devel/INDEX 2012-05-21 17:32:29 UTC (rev 10480) @@ -5,15 +5,25 @@ @iddata/cat @iddata/detrend @iddata/diff + @iddata/fft @iddata/get @iddata/horzcat + @iddata/ifft @iddata/merge @iddata/plot @iddata/set @iddata/size @iddata/vertcat System Identification + arx fitfrd + moen4 moesp n4sid - +Overloaded Operators + @iddata/horzcat + @iddata/subsasgn + @iddata/subsref + @iddata/vertcat +Miscellaneous + test_devel \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/devel/pdfdoc/control-devel.tex =================================================================== --- trunk/octave-forge/extra/control-devel/devel/pdfdoc/control-devel.tex 2012-05-21 16:11:14 UTC (rev 10479) +++ trunk/octave-forge/extra/control-devel/devel/pdfdoc/control-devel.tex 2012-05-21 17:32:29 UTC (rev 10480) @@ -1,13 +1,34 @@ \input texinfo @c -*-texinfo-*- @c %**start of header -@setfilename control.info +@setfilename control-devel.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 0.1.50 +@set VERSION 0.2.0 @finalout @c @afourwide @c %**end of header + +@c The following macro is used for the on-line help system, but we don't +@c want lots of `See also: foo, bar, and baz' strings cluttering the +@c printed manual (that information should be in the supporting text for +@c each group of functions and variables). + +@macro seealso {args} +@iftex +@vskip 2pt +@end iftex +@ifnottex +@c Texinfo @sp should work but in practice produces ugly results for HTML. +@c A simple blank line produces the correct behavior. +@c @sp 1 + +@end ifnottex +@noindent +@strong{See also:} \args\. +@end macro + + @c %*** Start of TITLEPAGE @titlepage @title control-devel @value{VERSION} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-22 08:10:14
|
Revision: 10489 http://octave.svn.sourceforge.net/octave/?rev=10489&view=rev Author: paramaniac Date: 2012-05-22 08:10:02 +0000 (Tue, 22 May 2012) Log Message: ----------- control-devel: compute initial state vector for arx models (in state-space, of course) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m trunk/octave-forge/extra/control-devel/inst/arx.m trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc Added Paths: ----------- trunk/octave-forge/extra/control-devel/src/slib01cd.cc Modified: trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m 2012-05-22 06:31:46 UTC (rev 10488) +++ trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m 2012-05-22 08:10:02 UTC (rev 10489) @@ -71,14 +71,18 @@ dat = iddata (Y, U) -[sys, x0] = ident (dat, 5, 4) % s=5, n=4 +[sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 sys2 = arx (dat, 4, 4); +[sys2, x02] = arx (dat, 4, 4); x0=x0{1}; +x02=x02{1}; [y, t] = lsim (sys, U_dest, [], x0); -[y2, t2] = lsim (sys(:, 1:5), U_dest); +%[y2, t2] = lsim (sys2(:, 1:5), U_dest); +[y2, t2] = lsim (sys2, U_dest, [], x02); + % ARX has no initial conditions, therefore the bad results err = norm (Y_dest - y, 1) / norm (Y_dest, 1) Modified: trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m 2012-05-22 06:31:46 UTC (rev 10488) +++ trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m 2012-05-22 08:10:02 UTC (rev 10489) @@ -76,11 +76,14 @@ % s=15, n=7 [sys1, x0] = moen4 (dat, 's', 15, 'n', 7) -sys2 = arx (dat, 7, 7) % normally na = nb +%sys2 = arx (dat, 7, 7) % normally na = nb +[sys2, x02] = arx (dat, 7, 7); [y1, t1] = lsim (sys1, U, [], x0); -[y2, t] = lsim (sys2(:, 1), U); +%[y2, t] = lsim (sys2(:, 1), U); +[y2, t] = lsim (sys2, U, [], x02); + err1 = norm (Y - y1, 1) / norm (Y, 1) err2 = norm (Y - y2, 1) / norm (Y, 1) Modified: trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m 2012-05-22 06:31:46 UTC (rev 10488) +++ trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m 2012-05-22 08:10:02 UTC (rev 10489) @@ -76,14 +76,18 @@ 'outname', {'a. dissolved oxygen'; 'b. algae'}) -[sys, x0] = ident (dat, 5, 4) % s=5, n=4 -sys2 = arx (dat, 4, 4) +[sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 +% sys2 = arx (dat, 4, 4) +[sys2, x02] = arx (dat, 4, 4) x0=x0{1}; +x02=x02{1}; [y, t] = lsim (sys, U_erie, [], x0); -[y2, t2] = lsim (sys2(:, 1:5), U_erie); +% [y2, t2] = lsim (sys2(:, 1:5), U_erie); +[y2, t2] = lsim (sys2, U_erie, [], x02); + err = norm (Y_erie - y, 1) / norm (Y_erie, 1) err2 = norm (Y_erie - y2, 1) / norm (Y_erie, 1) Modified: trunk/octave-forge/extra/control-devel/inst/arx.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-22 06:31:46 UTC (rev 10488) +++ trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-22 08:10:02 UTC (rev 10489) @@ -24,7 +24,7 @@ ## Created: April 2012 ## Version: 0.1 -function sys = arx (dat, na, nb) +function [sys, varargout] = arx (dat, na, nb) ## TODO: delays @@ -101,6 +101,17 @@ ## the corresponding transfer function has common row denominators. sys = filt (num, den, tsam); + + if (nargout > 1) + sys = prescale (ss (sys(:,1:m))); + x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0) + ## return x0 as vector for single-experiment data + ## instead of a cell containing one vector + if (numel (x0) == 1) + x0 = x0{1}; + endif + varargout{1} = x0; + endif endfunction Modified: trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-05-22 06:31:46 UTC (rev 10488) +++ trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-05-22 08:10:02 UTC (rev 10489) @@ -1,6 +1,7 @@ -// #include "slib01ad.cc" // preprocess the input-output data -#include "slident.cc" // system identification -#include "slitest.cc" // debug system identification +// #include "slib01ad.cc" // preprocess the input-output data +#include "slident.cc" // system identification +#include "slib01cd.cc" // compute initial state vector +// #include "slitest.cc" // debug system identification #include "slident_a.cc" #include "slident_b.cc" #include "slident_c.cc" \ No newline at end of file Added: trunk/octave-forge/extra/control-devel/src/slib01cd.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slib01cd.cc (rev 0) +++ trunk/octave-forge/extra/control-devel/src/slib01cd.cc 2012-05-22 08:10:02 UTC (rev 10489) @@ -0,0 +1,200 @@ +/* + +Copyright (C) 2012 Lukas F. Reichlin + +This file is part of LTI Syncope. + +LTI Syncope 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 3 of the License, or +(at your option) any later version. + +LTI Syncope 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 LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +Compute initial state vector x0 +Uses IB01CD by courtesy of NICONET e.V. +<http://www.slicot.org> + +Author: Lukas Reichlin <luk...@gm...> +Created: May 2012 +Version: 0.1 + +*/ + +#include <octave/oct.h> +#include <octave/f77-fcn.h> +#include <octave/Cell.h> +#include "common.h" + +extern "C" +{ + int F77_FUNC (ib01cd, IB01CD) + (char& JOBX0, char& COMUSE, char& JOB, + int& N, int& M, int& L, + int& NSMP, + double* A, int& LDA, + double* B, int& LDB, + double* C, int& LDC, + double* D, int& LDD, + double* U, int& LDU, + double* Y, int& LDY, + double* X0, + double* V, int& LDV, + double& TOL, + int* IWORK, + double* DWORK, int& LDWORK, + int& IWARN, int& INFO); +} + +// PKG_ADD: autoload ("slib01cd", "devel_slicot_functions.oct"); +DEFUN_DLD (slib01cd, args, nargout, + "-*- texinfo -*-\n\ +Slicot IB01CD Release 5.0\n\ +No argument checking.\n\ +For internal use only.") +{ + int nargin = args.length (); + octave_value_list retval; + + if (nargin != 7) + { + print_usage (); + } + else + { + // arguments in + char jobx0 = 'X'; + char comuse = 'U'; + char jobbd = 'D'; + + const Cell y_cell = args(0).cell_value (); + const Cell u_cell = args(1).cell_value (); + + Matrix a = args(2).matrix_value (); + Matrix b = args(3).matrix_value (); + Matrix c = args(4).matrix_value (); + Matrix d = args(5).matrix_value (); + + double rcond = args(6).double_value (); + double tol_c = rcond; + + int n = a.rows (); // n: number of states + int m = b.columns (); // m: number of inputs + int l = c.rows (); // l: number of outputs + + int lda = max (1, n); + int ldb = max (1, n); + int ldc = max (1, l); + int ldd = max (1, l); + + // m and l are equal for all experiments, checked by iddata class + int n_exp = y_cell.nelem (); // number of experiments + + + // arguments out + Cell x0_cell (n_exp, 1); // cell of initial state vectors x0 + + // repeat for every experiment in the dataset + // compute individual initial state vector x0 for every experiment + for (int i = 0; i < n_exp; i++) + { + Matrix y = y_cell.elem(i).matrix_value (); + Matrix u = u_cell.elem(i).matrix_value (); + + int nsmp = y.rows (); // nsmp: number of samples + int ldv = max (1, n); + + int ldu; + + if (m == 0) + ldu = 1; + else // m > 0 + ldu = nsmp; + + int ldy = nsmp; + + // arguments out + ColumnVector x0 (n); + Matrix v (ldv, n); + + // workspace + int liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C' + int ldwork_c; + int t = nsmp; + + int ldw1_c = 2; + int ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n); + int ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n); + + ldwork_c = ldw1_c + n*( n + m + l ) + max (5*n, ldw1_c, min (ldw2_c, ldw3_c)); + + OCTAVE_LOCAL_BUFFER (int, iwork_c, liwork_c); + OCTAVE_LOCAL_BUFFER (double, dwork_c, ldwork_c); + + // error indicators + int iwarn_c = 0; + int info_c = 0; + + // SLICOT routine IB01CD + F77_XFCN (ib01cd, IB01CD, + (jobx0, comuse, jobbd, + n, m, l, + nsmp, + a.fortran_vec (), lda, + b.fortran_vec (), ldb, + c.fortran_vec (), ldc, + d.fortran_vec (), ldd, + u.fortran_vec (), ldu, + y.fortran_vec (), ldy, + x0.fortran_vec (), + v.fortran_vec (), ldv, + tol_c, + iwork_c, + dwork_c, ldwork_c, + iwarn_c, info_c)); + + + if (f77_exception_encountered) + error ("slib01cd: exception in SLICOT subroutine IB01CD"); + + static const char* err_msg_c[] = { + "0: OK", + "1: the QR algorithm failed to compute all the " + "eigenvalues of the matrix A (see LAPACK Library " + "routine DGEES); the locations DWORK(i), for " + "i = g+1:g+N*N, contain the partially converged " + "Schur form", + "2: the singular value decomposition (SVD) algorithm did " + "not converge"}; + + static const char* warn_msg_c[] = { + "0: OK", + "1: warning message not specified", + "2: warning message not specified", + "3: warning message not specified", + "4: the least squares problem to be solved has a " + "rank-deficient coefficient matrix", + "5: warning message not specified", + "6: the matrix A is unstable; the estimated x(0) " + "and/or B and D could be inaccurate"}; + + + error_msg ("slib01cd", info_c, 2, err_msg_c); + warning_msg ("slib01cd", iwarn_c, 6, warn_msg_c); + + x0_cell.elem(i) = x0; // add x0 from the current experiment to cell of initial state vectors + } + + + // return values + retval(0) = x0_cell; + } + + return retval; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-23 17:31:58
|
Revision: 10506 http://octave.svn.sourceforge.net/octave/?rev=10506&view=rev Author: paramaniac Date: 2012-05-23 17:31:49 +0000 (Wed, 23 May 2012) Log Message: ----------- control-devel: remove some cruft Modified Paths: -------------- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc Removed Paths: ------------- trunk/octave-forge/extra/control-devel/devel/GlassFurnace_a.m trunk/octave-forge/extra/control-devel/devel/PowerPlantTest.m trunk/octave-forge/extra/control-devel/devel/data_ib01ad.m trunk/octave-forge/extra/control-devel/devel/ident.m trunk/octave-forge/extra/control-devel/devel/ident_a.m trunk/octave-forge/extra/control-devel/devel/identtest.m trunk/octave-forge/extra/control-devel/devel/overview.txt trunk/octave-forge/extra/control-devel/devel/test_slident.m trunk/octave-forge/extra/control-devel/src/slib01ad.cc trunk/octave-forge/extra/control-devel/src/slib01bd.cc trunk/octave-forge/extra/control-devel/src/slitest.cc Deleted: trunk/octave-forge/extra/control-devel/devel/GlassFurnace_a.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/GlassFurnace_a.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/GlassFurnace_a.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,66 +0,0 @@ -%{ -This file describes the data in the glassfurnace.dat file. -1. Contributed by: - Peter Van Overschee - K.U.Leuven - ESAT - SISTA - K. Mercierlaan 94 - 3001 Heverlee - Pet...@es... -2. Process/Description: - Data of a glassfurnace (Philips) -3. Sampling time - -4. Number of samples: - 1247 samples -5. Inputs: - a. heating input - b. cooling input - c. heating input -6. Outputs: - a. 6 outputs from temperature sensors in a cross section of the - furnace -7. References: - a. Van Overschee P., De Moor B., N4SID : Subspace Algorithms for - the Identification of Combined Deterministic-Stochastic Systems, - Automatica, Special Issue on Statistical Signal Processing and Control, - Vol. 30, No. 1, 1994, pp. 75-93 - b. Van Overschee P., "Subspace identification : Theory, - Implementation, Application" , Ph.D. Thesis, K.U.Leuven, February 1995. -8. Known properties/peculiarities - -9. Some MATLAB-code to retrieve the data - !gunzip glassfurnace.dat.Z - load glassfurnace.dat - T=glassfurnace(:,1); - U=glassfurnace(:,2:4); - Y=glassfurnace(:,5:10); - -%} - - close all, clc - -load glassfurnace.dat -T=glassfurnace(:,1); -U=glassfurnace(:,2:4); -Y=glassfurnace(:,5:10); - - -dat = iddata (Y, U) - -[sys, x0] = ident_a (dat, 10, 5) % s=10, n=5 - - -[y, t] = lsim (sys, U, [], x0); - -err = norm (Y - y, 1) / norm (Y, 1) - -figure (1) -p = columns (Y); -for k = 1 : p - subplot (3, 2, k) - plot (t, Y(:,k), 'b', t, y(:,k), 'r') -endfor -%title ('DaISy: Glass Furnace') -%legend ('y measured', 'y simulated', 'location', 'southeast') - - Deleted: trunk/octave-forge/extra/control-devel/devel/PowerPlantTest.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/PowerPlantTest.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/PowerPlantTest.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,87 +0,0 @@ -%{ -This file describes the data in the powerplant.dat file. -1. Contributed by: - Peter Van Overschee - K.U.Leuven - ESAT - SISTA - K. Mercierlaan 94 - 3001 Heverlee - Pet...@es... -2. Process/Description: - data of a power plant (Pont-sur-Sambre (France)) of 120 MW -3. Sampling time - 1228.8 sec -4. Number of samples: - 200 samples -5. Inputs: - 1. gas flow - 2. turbine valves opening - 3. super heater spray flow - 4. gas dampers - 5. air flow -6. Outputs: - 1. steam pressure - 2. main stem temperature - 3. reheat steam temperature -7. References: - a. R.P. Guidorzi, P. Rossi, Identification of a power plant from normal - operating records. Automatic control theory and applications (Canada, - Vol 2, pp 63-67, sept 1974. - b. Moonen M., De Moor B., Vandenberghe L., Vandewalle J., On- and - off-line identification of linear state-space models, International - Journal of Control, Vol. 49, Jan. 1989, pp.219-232 -8. Known properties/peculiarities - -9. Some MATLAB-code to retrieve the data - !gunzip powerplant.dat.Z - load powerplant.dat - U=powerplant(:,1:5); - Y=powerplant(:,6:8); - Yr=powerplant(:,9:11); - -%} - -clear all, close all, clc - -load powerplant.dat -U=powerplant(:,1:5); -Y=powerplant(:,6:8); -Yr=powerplant(:,9:11); - -inname = {'gas flow', - 'turbine valves opening', - 'super heater spray flow', - 'gas dampers', - 'air flow'}; - -outname = {'steam pressure', - 'main steam temperature', - 'reheat steam temperature'}; - -tsam = 1228.8; - -dat = iddata (Y, U, tsam, 'outname', outname, 'inname', inname); - - -% ldwork = [401, 802, 1203, 1604] -% warning: implicit conversion from real matrix to real scalar - -% ldwork = [802, 1203, 1604, 3000, 1e4, 1e5] -ldwork = [30000, 60000, 90000, 120000, 150000, 300000] -% ldwork = [60000, 90000, 120000, 150000, 300000, 600000] - - -r = arrayfun (@(x) identtest (dat, 10, 8, x), ldwork, 'uniformoutput', false); - - % s=10, n=8 - -l = length (ldwork); - -err = cell (l-1, 1); - -for k = 2 : l - err(k-1) = norm (abs(r{1}) - abs(r{k}), 1); - % err(k-1) = norm (r{1} - r{k}, 1); - % err(k-1) = norm (abs(abs(r{1}) - abs(r{k})), 1); -endfor - -err Deleted: trunk/octave-forge/extra/control-devel/devel/data_ib01ad.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/data_ib01ad.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/data_ib01ad.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,2040 +0,0 @@ -% IB01AD EXAMPLE PROGRAM DATA -% 15 0 1 1 1000 0.0 -1.0 M C N O N N -% nobr, n, m, l, nsmp, rcond, tol, meth, alg, jobd, batch,conct,ctrl - - -U = [ - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 -]; - -Y = [ - 4.766099 - 4.763659 - 4.839359 - 5.002979 - 5.017629 - 5.056699 - 5.154379 - 5.361949 - 5.425439 - 5.569519 - 5.681849 - 5.742899 - 5.803949 - 5.918729 - 5.821049 - 5.447419 - 5.061589 - 4.629349 - 4.267939 - 4.011519 - 3.850349 - 3.711159 - 3.569519 - 3.518239 - 3.652549 - 3.818609 - 3.862559 - 4.011519 - 4.353409 - 4.705049 - 5.083559 - 5.344859 - 5.274039 - 5.127519 - 4.761219 - 4.451089 - 4.221539 - 4.045709 - 3.874769 - 3.730689 - 3.662319 - 3.576849 - 3.542659 - 3.479169 - 3.454749 - 3.359509 - 3.298459 - 3.225199 - 3.200779 - 3.225199 - 3.227639 - 3.274039 - 3.457189 - 3.867449 - 4.321659 - 4.492599 - 4.431549 - 4.243519 - 4.050599 - 3.857679 - 3.730689 - 3.791739 - 3.921169 - 3.955359 - 3.847909 - 3.725809 - 3.611039 - 3.716039 - 4.092109 - 4.480389 - 4.814939 - 5.054259 - 5.303339 - 5.486489 - 5.672089 - 5.779529 - 5.799069 - 5.664759 - 5.291129 - 4.880879 - 4.558529 - 4.184909 - 3.889419 - 3.708719 - 3.623249 - 3.569519 - 3.718479 - 4.033499 - 4.412009 - 4.629349 - 4.558529 - 4.394919 - 4.180019 - 4.197119 - 4.431549 - 4.714819 - 4.961459 - 5.300899 - 5.567079 - 5.681849 - 5.545099 - 5.188569 - 4.883319 - 4.600049 - 4.270379 - 4.038389 - 3.838139 - 3.711159 - 3.591499 - 3.535329 - 3.486489 - 3.476729 - 3.425439 - 3.381489 - 3.369279 - 3.364389 - 3.347299 - 3.381489 - 3.420559 - 3.413229 - 3.452309 - 3.635459 - 4.038389 - 4.375379 - 4.727029 - 5.056699 - 5.298459 - 5.532889 - 5.466959 - 5.195899 - 4.885759 - 4.763659 - 4.875989 - 5.042049 - 5.283809 - 5.491379 - 5.596379 - 5.672089 - 5.772209 - 5.830819 - 5.933379 - 5.899189 - 5.935819 - 5.894309 - 5.918729 - 5.994429 - 5.957799 - 6.031059 - 6.062809 - 6.040829 - 6.096999 - 6.123859 - 6.162929 - 6.040829 - 5.845469 - 5.772209 - 5.799069 - 5.923609 - 5.928499 - 6.001759 - 6.001759 - 6.060369 - 5.882099 - 5.510909 - 5.322879 - 5.371719 - 5.454749 - 5.437649 - 5.159269 - 4.902859 - 4.587839 - 4.502369 - 4.595159 - 4.824709 - 5.064029 - 5.271599 - 5.466959 - 5.615919 - 5.528009 - 5.254499 - 4.883319 - 4.517019 - 4.197119 - 4.001759 - 3.806399 - 3.904079 - 3.923609 - 3.869889 - 3.806399 - 3.720929 - 3.818609 - 4.140949 - 4.529229 - 4.805179 - 5.086009 - 5.339969 - 5.532889 - 5.576849 - 5.667199 - 5.791739 - 5.850349 - 5.923609 - 5.921169 - 5.977339 - 5.740459 - 5.388809 - 5.000539 - 4.849129 - 4.944369 - 5.173919 - 5.369279 - 5.447419 - 5.603709 - 5.730689 - 5.850349 - 5.979779 - 5.991989 - 6.084789 - 5.940709 - 5.803949 - 5.791739 - 5.603709 - 5.264269 - 4.946809 - 4.619579 - 4.514579 - 4.433989 - 4.285029 - 4.121419 - 3.945589 - 3.984659 - 4.219099 - 4.546319 - 4.873549 - 5.154379 - 5.388809 - 5.613479 - 5.835699 - 5.884539 - 5.955359 - 5.762439 - 5.459629 - 5.061589 - 4.707499 - 4.458409 - 4.267939 - 4.053039 - 3.943149 - 3.825929 - 3.967569 - 4.280149 - 4.480389 - 4.492599 - 4.390039 - 4.197119 - 4.111649 - 3.982219 - 3.867449 - 3.767319 - 3.872329 - 4.236189 - 4.663539 - 4.971229 - 5.066469 - 4.902859 - 4.675749 - 4.392479 - 4.099439 - 4.114089 - 4.326539 - 4.643999 - 4.971229 - 5.159269 - 5.388809 - 5.576849 - 5.652549 - 5.803949 - 5.913839 - 5.886979 - 5.799069 - 5.730689 - 5.762439 - 5.813719 - 5.821049 - 5.928499 - 6.013969 - 5.764879 - 5.413229 - 5.098219 - 4.678189 - 4.372939 - 4.392479 - 4.590279 - 4.919949 - 5.017629 - 4.858899 - 4.675749 - 4.619579 - 4.834479 - 5.090889 - 5.376599 - 5.681849 - 5.823489 - 5.952919 - 6.062809 - 6.089669 - 6.075019 - 6.026179 - 5.994429 - 6.077459 - 5.857679 - 5.701389 - 5.730689 - 5.784419 - 5.823489 - 5.894309 - 5.762439 - 5.415679 - 4.961459 - 4.595159 - 4.331429 - 4.297239 - 4.582949 - 4.861339 - 5.173919 - 5.166589 - 4.919949 - 4.607369 - 4.370499 - 4.182469 - 4.038389 - 4.145839 - 4.431549 - 4.556089 - 4.480389 - 4.375379 - 4.370499 - 4.558529 - 4.858899 - 4.895529 - 4.741679 - 4.744129 - 4.875989 - 5.105539 - 5.239849 - 5.518239 - 5.652549 - 5.723369 - 5.855239 - 5.962679 - 5.984659 - 5.984659 - 6.055479 - 6.062809 - 6.055479 - 6.070129 - 5.784419 - 5.440099 - 5.056699 - 4.941929 - 5.010299 - 5.134849 - 5.313109 - 5.479169 - 5.623249 - 5.562199 - 5.330209 - 5.010299 - 4.665979 - 4.414459 - 4.201999 - 4.048159 - 4.079899 - 4.189789 - 4.131179 - 4.004199 - 3.916289 - 3.960239 - 4.199559 - 4.624469 - 4.883319 - 5.137289 - 5.379049 - 5.623249 - 5.762439 - 5.833259 - 5.686739 - 5.366839 - 5.225199 - 5.239849 - 5.354629 - 5.508469 - 5.596379 - 5.752669 - 5.874769 - 5.906519 - 5.894309 - 5.742899 - 5.447419 - 5.024959 - 4.883319 - 4.885759 - 4.893089 - 4.714819 - 4.451089 - 4.233749 - 4.043269 - 3.864999 - 3.757559 - 3.669639 - 3.593939 - 3.547539 - 3.506029 - 3.454749 - 3.398579 - 3.361949 - 3.339969 - 3.374159 - 3.520679 - 3.713599 - 3.757559 - 3.779529 - 3.696509 - 3.777089 - 3.886979 - 3.904079 - 3.850349 - 3.965129 - 4.282589 - 4.521899 - 4.714819 - 4.971229 - 5.220319 - 5.532889 - 5.652549 - 5.781979 - 5.955359 - 6.035939 - 6.118969 - 6.133629 - 6.153159 - 6.192229 - 6.143389 - 6.167809 - 5.991989 - 5.652549 - 5.459629 - 5.437649 - 5.339969 - 5.098219 - 4.785639 - 4.492599 - 4.236189 - 4.067689 - 3.933379 - 3.823489 - 3.730689 - 3.611039 - 3.564639 - 3.549989 - 3.557309 - 3.513359 - 3.515799 - 3.694059 - 4.072579 - 4.480389 - 4.705049 - 4.612259 - 4.385149 - 4.201999 - 4.026179 - 3.904079 - 3.774649 - 3.691619 - 3.845469 - 4.201999 - 4.585399 - 4.902859 - 5.256949 - 5.510909 - 5.640339 - 5.843029 - 5.974889 - 5.935819 - 5.821049 - 5.528009 - 5.171479 - 4.810059 - 4.453529 - 4.380269 - 4.565859 - 4.805179 - 5.125079 - 5.354629 - 5.589059 - 5.764879 - 5.923609 - 5.940709 - 5.857679 - 5.694059 - 5.486489 - 5.149499 - 4.844249 - 4.541439 - 4.267939 - 4.060369 - 3.960239 - 3.789299 - 3.642779 - 3.525569 - 3.498699 - 3.454749 - 3.408349 - 3.379049 - 3.376599 - 3.361949 - 3.359509 - 3.369279 - 3.398579 - 3.579289 - 3.948029 - 4.412009 - 4.585399 - 4.514579 - 4.343639 - 4.155599 - 3.984659 - 4.043269 - 4.307009 - 4.421779 - 4.353409 - 4.223979 - 4.053039 - 3.940709 - 3.838139 - 3.730689 - 3.652549 - 3.611039 - 3.564639 - 3.496259 - 3.462069 - 3.454749 - 3.425439 - 3.379049 - 3.432769 - 3.623249 - 3.974889 - 4.380269 - 4.714819 - 5.073799 - 5.369279 - 5.603709 - 5.745349 - 5.652549 - 5.401019 - 5.015189 - 4.709939 - 4.416899 - 4.236189 - 4.236189 - 4.248399 - 4.221539 - 4.297239 - 4.590279 - 4.893089 - 5.134849 - 5.427889 - 5.379049 - 5.364389 - 5.452309 - 5.567079 - 5.672089 - 5.769769 - 5.830819 - 5.923609 - 5.965129 - 6.057919 - 6.050599 - 6.072579 - 6.111649 - 6.070129 - 5.896749 - 5.755109 - 5.718479 - 5.821049 - 6.001759 - 6.001759 - 5.901629 - 5.557309 - 5.173919 - 4.800289 - 4.431549 - 4.194679 - 4.006639 - 3.850349 - 3.747789 - 3.642779 - 3.591499 - 3.569519 - 3.528009 - 3.537779 - 3.554869 - 3.493819 - 3.447419 - 3.440099 - 3.408349 - 3.410789 - 3.452309 - 3.681849 - 4.060369 - 4.441319 - 4.854019 - 5.154379 - 5.425439 - 5.596379 - 5.586619 - 5.354629 - 5.027399 - 4.863779 - 4.761219 - 4.570739 - 4.368059 - 4.397359 - 4.573189 - 4.841809 - 5.203219 - 5.452309 - 5.652549 - 5.855239 - 5.906519 - 5.952919 - 5.828369 - 5.791739 - 5.799069 - 5.813719 - 5.877209 - 5.955359 - 5.781979 - 5.518239 - 5.127519 - 4.763659 - 4.492599 - 4.233749 - 4.011519 - 3.855239 - 3.691619 - 3.635459 - 3.818609 - 4.155599 - 4.590279 - 4.988329 - 5.076239 - 4.907739 - 4.648889 - 4.377829 - 4.216649 - 4.287469 - 4.590279 - 4.846689 - 5.139729 - 5.388809 - 5.689179 - 5.884539 - 6.043269 - 6.170259 - 6.211769 - 6.250839 - 6.209329 - 6.013969 - 5.701389 - 5.469399 - 5.479169 - 5.557309 - 5.728249 - 5.882099 - 5.984659 - 5.901629 - 5.581729 - 5.371719 - 5.418119 - 5.510909 - 5.667199 - 5.791739 - 5.698949 - 5.484049 - 5.154379 - 4.980999 - 5.061589 - 5.195899 - 5.359509 - 5.615919 - 5.762439 - 5.857679 - 5.948029 - 5.835699 - 5.706269 - 5.498699 - 5.188569 - 5.117749 - 5.191009 - 5.315549 - 5.532889 - 5.444979 - 5.396139 - 5.274039 - 5.027399 - 4.744129 - 4.668419 - 4.651329 - 4.514579 - 4.267939 - 4.260609 - 4.263049 - 4.189789 - 4.277699 - 4.600049 - 4.932159 - 5.283809 - 5.528009 - 5.740459 - 5.874769 - 5.955359 - 5.991989 - 5.845469 - 5.528009 - 5.061589 - 4.734359 - 4.534109 - 4.534109 - 4.697729 - 4.744129 - 4.619579 - 4.643999 - 4.832039 - 5.132399 - 5.410789 - 5.625689 - 5.603709 - 5.315549 - 4.961459 - 4.619579 - 4.358289 - 4.155599 - 4.033499 - 3.886979 - 3.772209 - 3.640339 - 3.532889 - 3.435209 - 3.427889 - 3.422999 - 3.398579 - 3.603709 - 4.023729 - 4.451089 - 4.792969 - 4.902859 - 4.780759 - 4.590279 - 4.336309 - 4.145839 - 4.216649 - 4.433989 - 4.714819 - 5.098219 - 5.359509 - 5.569519 - 5.772209 - 5.921169 - 6.055479 - 5.962679 - 5.642779 - 5.435209 - 5.388809 - 5.537779 - 5.681849 - 5.701389 - 5.615919 - 5.667199 - 5.740459 - 5.803949 - 5.882099 - 5.950469 - 6.072579 - 6.148279 - 6.116529 - 6.177579 - 6.201999 - 6.206889 - 5.991989 - 5.564639 - 5.178799 - 4.998089 - 5.051819 - 5.232529 - 5.484049 - 5.686739 - 5.899189 - 5.869889 - 5.977339 - 6.053039 - 6.079899 - 6.128739 - 6.079899 - 6.167809 - 6.194679 - 6.236189 - 6.053039 - 5.652549 - 5.274039 - 4.858899 - 4.534109 - 4.455969 - 4.619579 - 4.866229 - 5.117749 - 5.166589 - 5.056699 - 5.002979 - 5.098219 - 5.325319 - 5.567079 - 5.466959 - 5.252059 - 4.946809 - 4.880879 - 4.980999 - 5.225199 - 5.459629 - 5.723369 - 5.791739 - 5.906519 - 5.991989 - 5.835699 - 5.528009 - 5.142169 - 4.775869 - 4.490159 - 4.236189 - 4.023729 - 3.886979 - 3.752669 - 3.681849 - 3.806399 - 4.145839 - 4.600049 - 5.002979 - 5.303339 - 5.552429 - 5.615919 - 5.523119 - 5.611039 - 5.713599 - 5.845469 - 5.899189 - 5.994429 - 6.092109 - 6.092109 - 6.143389 - 6.153159 - 6.233749 - 6.187349 - 6.013969 - 5.835699 - 5.774649 - 5.686739 - 5.537779 - 5.327759 - 5.054259 - 4.700169 - 4.394919 - 4.180019 - 4.043269 - 3.877209 - 3.752669 - 3.728249 - 3.869889 - 4.206889 - 4.355849 - 4.426669 - 4.453529 - 4.521899 - 4.392479 - 4.155599 - 3.965129 - 3.877209 - 3.970009 - 4.258169 - 4.421779 - 4.336309 - 4.299679 - 4.392479 - 4.675749 - 4.761219 - 4.658659 - 4.490159 - 4.307009 - 4.126299 - 3.972449 - 4.077459 - 4.372939 - 4.741679 - 5.088449 - 5.186129 - 5.037169 - 4.785639 - 4.563419 - 4.534109 - 4.705049 - 4.741679 - 4.648889 - 4.431549 - 4.238629 - 4.065249 - 3.943149 - 3.811279 - 3.691619 - 3.652549 - 3.825929 - 4.223979 - 4.424219 - 4.429109 - 4.319219 - 4.138509 - 3.965129 - 3.886979 - 3.801509 - 3.701389 - 3.640339 - 3.767319 - 4.150719 - 4.648889 - 4.990769 - 5.088449 - 5.022509 - 4.783199 - 4.685519 - 4.665979 - 4.707499 - 4.912619 - 5.195899 - 5.415679 - 5.623249 - 5.740459 - 5.899189 - 5.928499 - 6.050599 - 6.153159 - 5.965129 - 5.586619 - 5.381489 - 5.371719 - 5.486489 - 5.567079 - 5.821049 - 5.913839 - 5.994429 - 6.011519 - 5.999309 - 6.018849 - 5.821049 - 5.728249 - 5.740459 - 5.764879 - 5.882099 - 5.926049 - 5.750229 - 5.415679 - 4.995649 - 4.861339 - 4.902859 - 5.103099 - 5.364389 - 5.596379 - 5.752669 - 5.845469 - 5.928499 - 6.006639 - 5.840579 - 5.518239 - 5.173919 - 4.739239 - 4.458409 - 4.426669 - 4.602489 - 4.822269 - 5.183689 - 5.430329 - 5.652549 - 5.821049 - 5.706269 - 5.369279 - 5.027399 - 4.705049 - 4.414459 - 4.145839 - 3.965129 - 4.033499 - 4.372939 - 4.683079 -]; - -dat = iddata (Y, U) - -% IB01AD EXAMPLE PROGRAM DATA -% 15 0 1 1 1000 0.0 -1.0 M C N O N N -% nobr, n, m, l, nsmp, rcond, tol, meth, alg, jobd, batch,conct,ctrl - -nobr = 15; -meth = 0; -alg = 0; -jobd = 1; -batch = 3; -conct = 1; -ctrl = 1; -rcond = 0.0; -tol = -1.0; - -[n, r, sv] = slib01ad (Y, U, nobr, meth, alg, jobd, batch, conct, ctrl, rcond, tol); - -n -sv - -%{ - IB01AD EXAMPLE PROGRAM RESULTS - - The order of the system is 4 - The singular values are - 69.8841 14.9963 3.6675 1.9677 0.3000 0.2078 0.1651 0.1373 - 0.1133 0.1059 0.0856 0.0784 0.0733 0.0678 0.0571 -%} Deleted: trunk/octave-forge/extra/control-devel/devel/ident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/ident.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,56 +0,0 @@ -function [sys, x0] = ident (dat, s = [], n = []) - - - - %nobr = 15; - meth = 2; % 2 % geht: meth/alg 1/1, - alg = 0; % 0 % geht nicht: meth/alg 0/1 - conct = 1; - ctrl = 0; %1; - rcond = 0.0; - tol = -1.0; % 0; - - [ns, l, m, e] = size (dat); - - if (isempty (s) && isempty (n)) - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - ctrl = 0; # confirm system order estimate - n = 0; - % nsmp >= 2*(m+l+1)*nobr - 1 - % nobr <= (nsmp+1)/(2*(m+l+1)) - elseif (isempty (s)) - s = min (2*n, n+10); - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - nobr = min (nobr, s); - ctrl = 1; # no confirmation - elseif (isempty (n)) - nobr = s; - ctrl = 0; # confirm system order estimate - n = 0; - else # s & n non-empty - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - if (s > nobr) - warning ("ident: s > nobr"); - endif - nobr = s; - ctrl = 1; - ## TODO: specify n for IB01BD - endif - - %nsmp = ns(1) - %nobr = fix ((nsmp+1)/(2*(m+l+1))) - % nsmp >= 2*(m+l+1)*nobr - 1 - % nobr <= (nsmp+1)/(2*(m+l+1)) -%nobr = 10 - [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); - - sys = ss (a, b, c, d, dat.tsam{1}); - - if (numel (x0) == 1) - x0 = x0{1}; - endif - -endfunction Deleted: trunk/octave-forge/extra/control-devel/devel/ident_a.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/ident_a.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/ident_a.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,61 +0,0 @@ -function [sys, x0] = ident_a (dat, s = [], nn = []) - -n=nn; - - %nobr = 15; - meth = 2; % 2 % geht: meth/alg 1/1, - alg = 0; % 0 % geht nicht: meth/alg 0/1 - jobd = 1; - batch = 3; - conct = 1; - ctrl = 0; %1; - rcond = 0.0; - tol = -1.0; % 0; - - [ns, l, m, e] = size (dat); - - if (isempty (s) && isempty (n)) - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - ctrl = 0; # confirm system order estimate - n = 0; - % nsmp >= 2*(m+l+1)*nobr - 1 - % nobr <= (nsmp+1)/(2*(m+l+1)) - elseif (isempty (s)) - s = min (2*n, n+10); - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - nobr = min (nobr, s); - ctrl = 1; # no confirmation - elseif (isempty (n)) - nobr = s; - ctrl = 0; # confirm system order estimate - n = 0; - else # s & n non-empty - nsmp = ns(1); - nobr = fix ((nsmp+1)/(2*(m+l+1))); - if (s > nobr) - error ("ident: s > nobr"); - endif - nobr = s; - ctrl = 1; - ## TODO: specify n for IB01BD - endif - - %nsmp = ns(1) - %nobr = fix ((nsmp+1)/(2*(m+l+1))) - % nsmp >= 2*(m+l+1)*nobr - 1 - % nobr <= (nsmp+1)/(2*(m+l+1)) -%nobr = 10 - [r, sv, n] = slident_a (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol); -n -n = nn; - [a, b, c, d, q, ry, s, k] = slident_b (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol, \ - r, sv, n); - - x0 = slident_c (dat.y{1}, dat.u{1}, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol, \ - a, b, c, d); - - sys = ss (a, b, c, d, -1); - -endfunction Deleted: trunk/octave-forge/extra/control-devel/devel/identtest.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/identtest.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/identtest.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,5 +0,0 @@ -function [r, sv, n] = identtest (dat, s = [], n = [], ldwork) - - [r, sv, n] = slitest (dat.y{1}, dat.u{1}, s, ldwork); - -endfunction Deleted: trunk/octave-forge/extra/control-devel/devel/overview.txt =================================================================== --- trunk/octave-forge/extra/control-devel/devel/overview.txt 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/overview.txt 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,10 +0,0 @@ -Working -- CDplayer -- Evaporator -- GlassFurnace -- HeatingSystem - -Broken -- Destillation -- PowerPlant -- pH \ No newline at end of file Deleted: trunk/octave-forge/extra/control-devel/devel/test_slident.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/test_slident.m 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/devel/test_slident.m 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,2158 +0,0 @@ -% IB01AD EXAMPLE PROGRAM DATA -% 15 0 1 1 1000 0.0 -1.0 M C N O N N -% nobr, n, m, l, nsmp, rcond, tol, meth, alg, jobd, batch,conct,ctrl - -% IB01BD EXAMPLE PROGRAM DATA -% 15 0 1 1 1000 0.0 -1.0 C C N O N N A K - - -U = [ - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 3.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 - 6.41 -]; - -Y = [ - 4.766099 - 4.763659 - 4.839359 - 5.002979 - 5.017629 - 5.056699 - 5.154379 - 5.361949 - 5.425439 - 5.569519 - 5.681849 - 5.742899 - 5.803949 - 5.918729 - 5.821049 - 5.447419 - 5.061589 - 4.629349 - 4.267939 - 4.011519 - 3.850349 - 3.711159 - 3.569519 - 3.518239 - 3.652549 - 3.818609 - 3.862559 - 4.011519 - 4.353409 - 4.705049 - 5.083559 - 5.344859 - 5.274039 - 5.127519 - 4.761219 - 4.451089 - 4.221539 - 4.045709 - 3.874769 - 3.730689 - 3.662319 - 3.576849 - 3.542659 - 3.479169 - 3.454749 - 3.359509 - 3.298459 - 3.225199 - 3.200779 - 3.225199 - 3.227639 - 3.274039 - 3.457189 - 3.867449 - 4.321659 - 4.492599 - 4.431549 - 4.243519 - 4.050599 - 3.857679 - 3.730689 - 3.791739 - 3.921169 - 3.955359 - 3.847909 - 3.725809 - 3.611039 - 3.716039 - 4.092109 - 4.480389 - 4.814939 - 5.054259 - 5.303339 - 5.486489 - 5.672089 - 5.779529 - 5.799069 - 5.664759 - 5.291129 - 4.880879 - 4.558529 - 4.184909 - 3.889419 - 3.708719 - 3.623249 - 3.569519 - 3.718479 - 4.033499 - 4.412009 - 4.629349 - 4.558529 - 4.394919 - 4.180019 - 4.197119 - 4.431549 - 4.714819 - 4.961459 - 5.300899 - 5.567079 - 5.681849 - 5.545099 - 5.188569 - 4.883319 - 4.600049 - 4.270379 - 4.038389 - 3.838139 - 3.711159 - 3.591499 - 3.535329 - 3.486489 - 3.476729 - 3.425439 - 3.381489 - 3.369279 - 3.364389 - 3.347299 - 3.381489 - 3.420559 - 3.413229 - 3.452309 - 3.635459 - 4.038389 - 4.375379 - 4.727029 - 5.056699 - 5.298459 - 5.532889 - 5.466959 - 5.195899 - 4.885759 - 4.763659 - 4.875989 - 5.042049 - 5.283809 - 5.491379 - 5.596379 - 5.672089 - 5.772209 - 5.830819 - 5.933379 - 5.899189 - 5.935819 - 5.894309 - 5.918729 - 5.994429 - 5.957799 - 6.031059 - 6.062809 - 6.040829 - 6.096999 - 6.123859 - 6.162929 - 6.040829 - 5.845469 - 5.772209 - 5.799069 - 5.923609 - 5.928499 - 6.001759 - 6.001759 - 6.060369 - 5.882099 - 5.510909 - 5.322879 - 5.371719 - 5.454749 - 5.437649 - 5.159269 - 4.902859 - 4.587839 - 4.502369 - 4.595159 - 4.824709 - 5.064029 - 5.271599 - 5.466959 - 5.615919 - 5.528009 - 5.254499 - 4.883319 - 4.517019 - 4.197119 - 4.001759 - 3.806399 - 3.904079 - 3.923609 - 3.869889 - 3.806399 - 3.720929 - 3.818609 - 4.140949 - 4.529229 - 4.805179 - 5.086009 - 5.339969 - 5.532889 - 5.576849 - 5.667199 - 5.791739 - 5.850349 - 5.923609 - 5.921169 - 5.977339 - 5.740459 - 5.388809 - 5.000539 - 4.849129 - 4.944369 - 5.173919 - 5.369279 - 5.447419 - 5.603709 - 5.730689 - 5.850349 - 5.979779 - 5.991989 - 6.084789 - 5.940709 - 5.803949 - 5.791739 - 5.603709 - 5.264269 - 4.946809 - 4.619579 - 4.514579 - 4.433989 - 4.285029 - 4.121419 - 3.945589 - 3.984659 - 4.219099 - 4.546319 - 4.873549 - 5.154379 - 5.388809 - 5.613479 - 5.835699 - 5.884539 - 5.955359 - 5.762439 - 5.459629 - 5.061589 - 4.707499 - 4.458409 - 4.267939 - 4.053039 - 3.943149 - 3.825929 - 3.967569 - 4.280149 - 4.480389 - 4.492599 - 4.390039 - 4.197119 - 4.111649 - 3.982219 - 3.867449 - 3.767319 - 3.872329 - 4.236189 - 4.663539 - 4.971229 - 5.066469 - 4.902859 - 4.675749 - 4.392479 - 4.099439 - 4.114089 - 4.326539 - 4.643999 - 4.971229 - 5.159269 - 5.388809 - 5.576849 - 5.652549 - 5.803949 - 5.913839 - 5.886979 - 5.799069 - 5.730689 - 5.762439 - 5.813719 - 5.821049 - 5.928499 - 6.013969 - 5.764879 - 5.413229 - 5.098219 - 4.678189 - 4.372939 - 4.392479 - 4.590279 - 4.919949 - 5.017629 - 4.858899 - 4.675749 - 4.619579 - 4.834479 - 5.090889 - 5.376599 - 5.681849 - 5.823489 - 5.952919 - 6.062809 - 6.089669 - 6.075019 - 6.026179 - 5.994429 - 6.077459 - 5.857679 - 5.701389 - 5.730689 - 5.784419 - 5.823489 - 5.894309 - 5.762439 - 5.415679 - 4.961459 - 4.595159 - 4.331429 - 4.297239 - 4.582949 - 4.861339 - 5.173919 - 5.166589 - 4.919949 - 4.607369 - 4.370499 - 4.182469 - 4.038389 - 4.145839 - 4.431549 - 4.556089 - 4.480389 - 4.375379 - 4.370499 - 4.558529 - 4.858899 - 4.895529 - 4.741679 - 4.744129 - 4.875989 - 5.105539 - 5.239849 - 5.518239 - 5.652549 - 5.723369 - 5.855239 - 5.962679 - 5.984659 - 5.984659 - 6.055479 - 6.062809 - 6.055479 - 6.070129 - 5.784419 - 5.440099 - 5.056699 - 4.941929 - 5.010299 - 5.134849 - 5.313109 - 5.479169 - 5.623249 - 5.562199 - 5.330209 - 5.010299 - 4.665979 - 4.414459 - 4.201999 - 4.048159 - 4.079899 - 4.189789 - 4.131179 - 4.004199 - 3.916289 - 3.960239 - 4.199559 - 4.624469 - 4.883319 - 5.137289 - 5.379049 - 5.623249 - 5.762439 - 5.833259 - 5.686739 - 5.366839 - 5.225199 - 5.239849 - 5.354629 - 5.508469 - 5.596379 - 5.752669 - 5.874769 - 5.906519 - 5.894309 - 5.742899 - 5.447419 - 5.024959 - 4.883319 - 4.885759 - 4.893089 - 4.714819 - 4.451089 - 4.233749 - 4.043269 - 3.864999 - 3.757559 - 3.669639 - 3.593939 - 3.547539 - 3.506029 - 3.454749 - 3.398579 - 3.361949 - 3.339969 - 3.374159 - 3.520679 - 3.713599 - 3.757559 - 3.779529 - 3.696509 - 3.777089 - 3.886979 - 3.904079 - 3.850349 - 3.965129 - 4.282589 - 4.521899 - 4.714819 - 4.971229 - 5.220319 - 5.532889 - 5.652549 - 5.781979 - 5.955359 - 6.035939 - 6.118969 - 6.133629 - 6.153159 - 6.192229 - 6.143389 - 6.167809 - 5.991989 - 5.652549 - 5.459629 - 5.437649 - 5.339969 - 5.098219 - 4.785639 - 4.492599 - 4.236189 - 4.067689 - 3.933379 - 3.823489 - 3.730689 - 3.611039 - 3.564639 - 3.549989 - 3.557309 - 3.513359 - 3.515799 - 3.694059 - 4.072579 - 4.480389 - 4.705049 - 4.612259 - 4.385149 - 4.201999 - 4.026179 - 3.904079 - 3.774649 - 3.691619 - 3.845469 - 4.201999 - 4.585399 - 4.902859 - 5.256949 - 5.510909 - 5.640339 - 5.843029 - 5.974889 - 5.935819 - 5.821049 - 5.528009 - 5.171479 - 4.810059 - 4.453529 - 4.380269 - 4.565859 - 4.805179 - 5.125079 - 5.354629 - 5.589059 - 5.764879 - 5.923609 - 5.940709 - 5.857679 - 5.694059 - 5.486489 - 5.149499 - 4.844249 - 4.541439 - 4.267939 - 4.060369 - 3.960239 - 3.789299 - 3.642779 - 3.525569 - 3.498699 - 3.454749 - 3.408349 - 3.379049 - 3.376599 - 3.361949 - 3.359509 - 3.369279 - 3.398579 - 3.579289 - 3.948029 - 4.412009 - 4.585399 - 4.514579 - 4.343639 - 4.155599 - 3.984659 - 4.043269 - 4.307009 - 4.421779 - 4.353409 - 4.223979 - 4.053039 - 3.940709 - 3.838139 - 3.730689 - 3.652549 - 3.611039 - 3.564639 - 3.496259 - 3.462069 - 3.454749 - 3.425439 - 3.379049 - 3.432769 - 3.623249 - 3.974889 - 4.380269 - 4.714819 - 5.073799 - 5.369279 - 5.603709 - 5.745349 - 5.652549 - 5.401019 - 5.015189 - 4.709939 - 4.416899 - 4.236189 - 4.236189 - 4.248399 - 4.221539 - 4.297239 - 4.590279 - 4.893089 - 5.134849 - 5.427889 - 5.379049 - 5.364389 - 5.452309 - 5.567079 - 5.672089 - 5.769769 - 5.830819 - 5.923609 - 5.965129 - 6.057919 - 6.050599 - 6.072579 - 6.111649 - 6.070129 - 5.896749 - 5.755109 - 5.718479 - 5.821049 - 6.001759 - 6.001759 - 5.901629 - 5.557309 - 5.173919 - 4.800289 - 4.431549 - 4.194679 - 4.006639 - 3.850349 - 3.747789 - 3.642779 - 3.591499 - 3.569519 - 3.528009 - 3.537779 - 3.554869 - 3.493819 - 3.447419 - 3.440099 - 3.408349 - 3.410789 - 3.452309 - 3.681849 - 4.060369 - 4.441319 - 4.854019 - 5.154379 - 5.425439 - 5.596379 - 5.586619 - 5.354629 - 5.027399 - 4.863779 - 4.761219 - 4.570739 - 4.368059 - 4.397359 - 4.573189 - 4.841809 - 5.203219 - 5.452309 - 5.652549 - 5.855239 - 5.906519 - 5.952919 - 5.828369 - 5.791739 - 5.799069 - 5.813719 - 5.877209 - 5.955359 - 5.781979 - 5.518239 - 5.127519 - 4.763659 - 4.492599 - 4.233749 - 4.011519 - 3.855239 - 3.691619 - 3.635459 - 3.818609 - 4.155599 - 4.590279 - 4.988329 - 5.076239 - 4.907739 - 4.648889 - 4.377829 - 4.216649 - 4.287469 - 4.590279 - 4.846689 - 5.139729 - 5.388809 - 5.689179 - 5.884539 - 6.043269 - 6.170259 - 6.211769 - 6.250839 - 6.209329 - 6.013969 - 5.701389 - 5.469399 - 5.479169 - 5.557309 - 5.728249 - 5.882099 - 5.984659 - 5.901629 - 5.581729 - 5.371719 - 5.418119 - 5.510909 - 5.667199 - 5.791739 - 5.698949 - 5.484049 - 5.154379 - 4.980999 - 5.061589 - 5.195899 - 5.359509 - 5.615919 - 5.762439 - 5.857679 - 5.948029 - 5.835699 - 5.706269 - 5.498699 - 5.188569 - 5.117749 - 5.191009 - 5.315549 - 5.532889 - 5.444979 - 5.396139 - 5.274039 - 5.027399 - 4.744129 - 4.668419 - 4.651329 - 4.514579 - 4.267939 - 4.260609 - 4.263049 - 4.189789 - 4.277699 - 4.600049 - 4.932159 - 5.283809 - 5.528009 - 5.740459 - 5.874769 - 5.955359 - 5.991989 - 5.845469 - 5.528009 - 5.061589 - 4.734359 - 4.534109 - 4.534109 - 4.697729 - 4.744129 - 4.619579 - 4.643999 - 4.832039 - 5.132399 - 5.410789 - 5.625689 - 5.603709 - 5.315549 - 4.961459 - 4.619579 - 4.358289 - 4.155599 - 4.033499 - 3.886979 - 3.772209 - 3.640339 - 3.532889 - 3.435209 - 3.427889 - 3.422999 - 3.398579 - 3.603709 - 4.023729 - 4.451089 - 4.792969 - 4.902859 - 4.780759 - 4.590279 - 4.336309 - 4.145839 - 4.216649 - 4.433989 - 4.714819 - 5.098219 - 5.359509 - 5.569519 - 5.772209 - 5.921169 - 6.055479 - 5.962679 - 5.642779 - 5.435209 - 5.388809 - 5.537779 - 5.681849 - 5.701389 - 5.615919 - 5.667199 - 5.740459 - 5.803949 - 5.882099 - 5.950469 - 6.072579 - 6.148279 - 6.116529 - 6.177579 - 6.201999 - 6.206889 - 5.991989 - 5.564639 - 5.178799 - 4.998089 - 5.051819 - 5.232529 - 5.484049 - 5.686739 - 5.899189 - 5.869889 - 5.977339 - 6.053039 - 6.079899 - 6.128739 - 6.079899 - 6.167809 - 6.194679 - 6.236189 - 6.053039 - 5.652549 - 5.274039 - 4.858899 - 4.534109 - 4.455969 - 4.619579 - 4.866229 - 5.117749 - 5.166589 - 5.056699 - 5.002979 - 5.098219 - 5.325319 - 5.567079 - 5.466959 - 5.252059 - 4.946809 - 4.880879 - 4.980999 - 5.225199 - 5.459629 - 5.723369 - 5.791739 - 5.906519 - 5.991989 - 5.835699 - 5.528009 - 5.142169 - 4.775869 - 4.490159 - 4.236189 - 4.023729 - 3.886979 - 3.752669 - 3.681849 - 3.806399 - 4.145839 - 4.600049 - 5.002979 - 5.303339 - 5.552429 - 5.615919 - 5.523119 - 5.611039 - 5.713599 - 5.845469 - 5.899189 - 5.994429 - 6.092109 - 6.092109 - 6.143389 - 6.153159 - 6.233749 - 6.187349 - 6.013969 - 5.835699 - 5.774649 - 5.686739 - 5.537779 - 5.327759 - 5.054259 - 4.700169 - 4.394919 - 4.180019 - 4.043269 - 3.877209 - 3.752669 - 3.728249 - 3.869889 - 4.206889 - 4.355849 - 4.426669 - 4.453529 - 4.521899 - 4.392479 - 4.155599 - 3.965129 - 3.877209 - 3.970009 - 4.258169 - 4.421779 - 4.336309 - 4.299679 - 4.392479 - 4.675749 - 4.761219 - 4.658659 - 4.490159 - 4.307009 - 4.126299 - 3.972449 - 4.077459 - 4.372939 - 4.741679 - 5.088449 - 5.186129 - 5.037169 - 4.785639 - 4.563419 - 4.534109 - 4.705049 - 4.741679 - 4.648889 - 4.431549 - 4.238629 - 4.065249 - 3.943149 - 3.811279 - 3.691619 - 3.652549 - 3.825929 - 4.223979 - 4.424219 - 4.429109 - 4.319219 - 4.138509 - 3.965129 - 3.886979 - 3.801509 - 3.701389 - 3.640339 - 3.767319 - 4.150719 - 4.648889 - 4.990769 - 5.088449 - 5.022509 - 4.783199 - 4.685519 - 4.665979 - 4.707499 - 4.912619 - 5.195899 - 5.415679 - 5.623249 - 5.740459 - 5.899189 - 5.928499 - 6.050599 - 6.153159 - 5.965129 - 5.586619 - 5.381489 - 5.371719 - 5.486489 - 5.567079 - 5.821049 - 5.913839 - 5.994429 - 6.011519 - 5.999309 - 6.018849 - 5.821049 - 5.728249 - 5.740459 - 5.764879 - 5.882099 - 5.926049 - 5.750229 - 5.415679 - 4.995649 - 4.861339 - 4.902859 - 5.103099 - 5.364389 - 5.596379 - 5.752669 - 5.845469 - 5.928499 - 6.006639 - 5.840579 - 5.518239 - 5.173919 - 4.739239 - 4.458409 - 4.426669 - 4.602489 - 4.822269 - 5.183689 - 5.430329 - 5.652549 - 5.821049 - 5.706269 - 5.369279 - 5.027399 - 4.705049 - 4.414459 - 4.145839 - 3.965129 - 4.033499 - 4.372939 - 4.683079 -]; - -dat = iddata (Y, U) - -% IB01AD EXAMPLE PROGRAM DATA -% 15 0 1 1 1000 0.0 -1.0 M C N O N N -% nobr, n, m, l, nsmp, rcond, tol, meth, alg, jobd, batch,conct,ctrl - -% IB01BD EXAMPLE PROGRAM DATA -% 15 0 1 1 1000 0.0 -1.0 C C N O N N A K - -nobr = 15; -meth = 2; -alg = 0; -jobd = 1; -batch = 3; -conct = 1; -ctrl = 1; -rcond = 0.0; -tol = -1.0; -n = 0; - -% [a, b, c, d, q, ry, s, k, x0] = slident (Y, U, nobr, n, meth, alg, jobd, batch, conct, ctrl, rcond, tol) -[a, b, c, d, q, ry, s, k, x0] = slident (dat.Y, dat.U, nobr, n, meth, alg, conct, ctrl, rcond, tol) - - -ae = [ 0.8924 0.3887 0.1285 0.1716 - -0.0837 0.6186 -0.6273 -0.4582 - 0.0052 0.1307 0.6685 -0.6755 - 0.0055 0.0734 -0.2148 0.4788 ]; - -ce = [ -0.4442 0.6663 0.3961 0.4102 ]; - -be = [ -0.2142 - -0.1968 - 0.0525 - 0.0361 ]; - -de = [ -0.0041 ]; - -ke = [ -1.9513 - -0.1867 - 0.6348 - -0.3486 ]; - -qe = [ 0.0052 0.0005 -0.0017 0.0009 - 0.0005 0.0000 -0.0002 0.0001 - -0.0017 -0.0002 0.0006 -0.0003 - 0.0009 0.0001 -0.0003 0.0002 ]; - -rye = [ 0.0012 ]; - -se = [ -0.0025 - -0.0002 - 0.0008 - -0.0005 ]; - -assert (a, ae, 1e-4); -assert (b, be, 1e-4); -assert (c, ce, 1e-4); -assert (d, de, 1e-4); -assert (k, ke, 1e-4); -assert (q, qe, 1e-4); -assert (ry, rye, 1e-4); -assert (s, se, 1e-4); - - - - -% figure (1) -% plot (Y) - -P = ss (a, b, c, d, 1); - -% figure (2) -% lsim (P, U) -% lsim (P, U, [], x0) % initial values dependent on realization, IB01BD != IB01CD - - -% [y, t] = lsim (P, U); -[y, t] = lsim (P, U, [], x0{1}); - -err = norm (Y - y, 1) / norm (Y, 1) - -figure (3) -plot (t, Y, 'b', t, y, 'r') -legend ('y measured', 'y simulated', 'location', 'southeast') -%axis tight - -% print -depsc2 ident.eps - -%n -%sv - -%{ - IB01AD EXAMPLE PROGRAM RESULTS - - The order of the system is 4 - The singular values are - 69.8841 14.9963 3.6675 1.9677 0.3000 0.2078 0.1651 0.1373 - 0.1133 0.1059 0.0856 0.0784 0.0733 0.0678 0.0571 - - - IB01BD EXAMPLE PROGRAM RESULTS - - - The system state matrix A is - 0.8924 0.3887 0.1285 0.1716 - -0.0837 0.6186 -0.6273 -0.4582 - 0.0052 0.1307 0.6685 -0.6755 - 0.0055 0.0734 -0.2148 0.4788 - - The system output matrix C is - -0.4442 0.6663 0.3961 0.4102 - - The system input matrix B is - -0.2142 - -0.1968 - 0.0525 - 0.0361 - - The system input-output matrix D is - -0.0041 - - The Kalman gain matrix K is - -1.9513 - -0.1867 - 0.6348 - -0.3486 - - The state covariance matrix Q is - 0.0052 0.0005 -0.0017 0.0009 - 0.0005 0.0000 -0.0002 0.0001 - -0.0017 -0.0002 0.0006 -0.0003 - 0.0009 0.0001 -0.0003 0.0002 - - The output covariance matrix Ry is - 0.0012 - - The state-output cross-covariance matrix S is - -0.0025 - -0.0002 - 0.0008 - -0.0005 - -%} Modified: trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,7 +1,7 @@ // #include "slib01ad.cc" // preprocess the input-output data #include "slident.cc" // system identification #include "slib01cd.cc" // compute initial state vector -// #include "slitest.cc" // debug system identification + #include "slident_a.cc" #include "slident_b.cc" #include "slident_c.cc" \ No newline at end of file Deleted: trunk/octave-forge/extra/control-devel/src/slib01ad.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/slib01ad.cc 2012-05-23 14:20:14 UTC (rev 10505) +++ trunk/octave-forge/extra/control-devel/src/slib01ad.cc 2012-05-23 17:31:49 UTC (rev 10506) @@ -1,367 +0,0 @@ -/* - -Copyright (C) 2012 Lukas F. Reichlin - -This file is part of LTI Syncope. - -LTI Syncope 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 3 of the License, or -(at your option) any later version. - -LTI Syncope is distributed in the hope that it will be useful, -bu... [truncated message content] |
From: <par...@us...> - 2012-05-24 11:20:32
|
Revision: 10515 http://octave.svn.sourceforge.net/octave/?rev=10515&view=rev Author: paramaniac Date: 2012-05-24 11:20:26 +0000 (Thu, 24 May 2012) Log Message: ----------- control-devel: check for equal sampling times Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Added Paths: ----------- trunk/octave-forge/extra/control-devel/devel/subsref_problem.m Added: trunk/octave-forge/extra/control-devel/devel/subsref_problem.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/subsref_problem.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/subsref_problem.m 2012-05-24 11:20:26 UTC (rev 10515) @@ -0,0 +1,10 @@ +DestillationME + +tsam = dat.tsam +tsam{:} + + +dat.tsam +dat.tsam{:} % only 1 times -1 instead of 4 + +a(1:4) = tsam{:} \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-24 07:24:35 UTC (rev 10514) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-24 11:20:26 UTC (rev 10515) @@ -58,7 +58,15 @@ endif [ns, l, m, e] = size (dat); # dataset dimensions + tsam = dat.tsam + ## multi-experiment data requires equal sampling times + if (e > 1 && ! isequal (tsam{:})) + error ("%s: require equally sampled experiments", method); + else + tsam = tsam{1}; + endif + ## default arguments alg = 0; conct = 1; # no connection between experiments @@ -125,7 +133,7 @@ [a, b, c, d, q, ry, s, k, x0] = slident (dat.y, dat.u, nobr, n, meth, alg, conct, ctrl, rcond, tol); ## assemble model - sys = ss (a, b, c, d, dat.tsam{1}); + sys = ss (a, b, c, d, tsam); ## return x0 as vector for single-experiment data ## instead of a cell containing one vector This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-27 18:22:28
|
Revision: 10524 http://octave.svn.sourceforge.net/octave/?rev=10524&view=rev Author: paramaniac Date: 2012-05-27 18:22:21 +0000 (Sun, 27 May 2012) Log Message: ----------- control-devel: recursive least squares seems to work Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m trunk/octave-forge/extra/control-devel/devel/rarx.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Added Paths: ----------- trunk/octave-forge/extra/control-devel/devel/HeatingSystemRLS.m Modified: trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m 2012-05-26 01:07:07 UTC (rev 10523) +++ trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m 2012-05-27 18:22:21 UTC (rev 10524) @@ -51,8 +51,11 @@ dat = iddata (Y, U) % [sys, x0] = ident (dat, 15, 8) % s=15, n=8 -sys = arx (dat, 4, 4) +[sys, x0] = arx (dat, 8, 8) +[y, t] = lsim (sys, U, [], x0); + +%{ %[y, t] = lsim (sys, U, [], x0); %[y, t] = lsim (sys(:,1:2), U); @@ -65,6 +68,7 @@ y = [y1, y2]; t = 0:length(U)-1; +%} err = norm (Y - y, 1) / norm (Y, 1) Added: trunk/octave-forge/extra/control-devel/devel/HeatingSystemRLS.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/HeatingSystemRLS.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/HeatingSystemRLS.m 2012-05-27 18:22:21 UTC (rev 10524) @@ -0,0 +1,102 @@ +%{ +1. Contributed by: + + Roy Smith + Dept. of Electrical & Computer Engineering + University of California, + Santa Barbara, CA 93106 + U.S.A. + ro...@ec... + +2. Process/Description: + + The experiment is a simple SISO heating system. + The input drives a 300 Watt Halogen lamp, suspended + several inches above a thin steel plate. The output + is a thermocouple measurement taken from the back of + the plate. + +3. Sampling interval: + + 2.0 seconds + +4. Number of samples + + 801 + +5. Inputs: + + u: input drive voltage + ... +6. Outputs: + + y: temperature (deg. C) + ... +7. References: + + The use of this experiment and data for robust + control model validation is described in: + + "Sampled Data Model Validation: an Algorithm and + Experimental Application," Geir Dullerud & Roy Smith, + International Journal of Robust and Nonlinear Control, + Vol. 6, No. 9/10, pp. 1065-1078, 1996. + +8. Known properties/peculiarities + + The data (and nominal model) is the above paper have the + output expressed in 10's deg. C. This has been rescaled + to the original units of deg. C. in the DaISy data set. + There is also a -1 volt offset in u in the data shown plotted + in the original paper. This has been removed in the + DaISy dataset. + + The data shows evidence of discrepancies. One of the + issues studied in the above paper is the size of these + discrepancies - measured in this case in terms of the norm + of the smallest perturbation required to account for the + difference between the nominal model and the data. + + The steady state input (prior to the start of the experiment) + is u = 6.0 Volts. + +%} + +clear all, close all, clc + +load heating_system.dat +U=heating_system(:,2); +Y=heating_system(:,3); + + +dat = iddata (Y, U, 2.0, 'inname', 'input drive voltage', \ + 'inunit', 'Volt', \ + 'outname', 'temperature', \ + 'outunit', '°C') + +% s=15, n=7 +[sys1, x0] = moen4 (dat, 's', 15, 'n', 7) +%sys2 = arx (dat, 7, 7) % normally na = nb +[sys2, x02] = arx (dat, 7, 7); +[sys3, x03] = rarx (dat, 7, 7); + +[y1, t1] = lsim (sys1, U, [], x0); +%[y2, t] = lsim (sys2(:, 1), U); +[y2, t] = lsim (sys2, U, [], x02); +[y3, t] = lsim (sys3, U, [], x02); + + +err1 = norm (Y - y1, 1) / norm (Y, 1) +err2 = norm (Y - y2, 1) / norm (Y, 1) +err2 = norm (Y - y3, 1) / norm (Y, 1) + +figure (1) +plot (t, Y, t, y1, t, y2, t, y3) +title ('DaISy: Heating System [99-001]') +xlim ([t(1), t(end)]) +xlabel ('Time [s]') +ylabel ('Temperature [Degree Celsius]') +legend ('measured', 'simulated subspace', 'simulated ARX', 'simulated RLS', 'location', 'southeast') + + + Modified: trunk/octave-forge/extra/control-devel/devel/rarx.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/rarx.m 2012-05-26 01:07:07 UTC (rev 10523) +++ trunk/octave-forge/extra/control-devel/devel/rarx.m 2012-05-27 18:22:21 UTC (rev 10524) @@ -131,16 +131,16 @@ if (numel (Phi) == 1) # single-experiment dataset % recursive least-squares with efficient matrix inversion - lambda = default 1 - Theta = ? - P = ? - for t = - phi = Phi{1}(t,:); - y = Y{1}(t?offset n(i), :); - ## note phi != phi.' + [pr, pc] = size (Phi{1}); + lambda = 1; % default 1 + Theta = zeros (pc, 1); + P = 10 * eye (pc); + for t = 1 : pr + phi = Phi{1}(t,:); # note that my phi is Ljung's phi.' + y = Y{1}(t+n(i), :); den = lambda + phi*P*phi.'; - L = P * phi / den; - P = (P - (P * phi.' * phi * P) / den) / lambda + L = P * phi.' / den; + P = (P - (P * phi.' * phi * P) / den) / lambda; Theta += L * (y - phi*Theta); endfor %{ Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-26 01:07:07 UTC (rev 10523) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-27 18:22:21 UTC (rev 10524) @@ -58,7 +58,7 @@ endif [ns, l, m, e] = size (dat); # dataset dimensions - tsam = dat.tsam + tsam = dat.tsam; ## multi-experiment data requires equal sampling times if (e > 1 && ! isequal (tsam{:})) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-27 20:04:04
|
Revision: 10527 http://octave.svn.sourceforge.net/octave/?rev=10527&view=rev Author: paramaniac Date: 2012-05-27 20:03:58 +0000 (Sun, 27 May 2012) Log Message: ----------- control-devel: add missing semicolons Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/armax.m trunk/octave-forge/extra/control-devel/devel/rarx.m trunk/octave-forge/extra/control-devel/inst/arx.m Modified: trunk/octave-forge/extra/control-devel/devel/armax.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/armax.m 2012-05-27 19:41:24 UTC (rev 10526) +++ trunk/octave-forge/extra/control-devel/devel/armax.m 2012-05-27 20:03:58 UTC (rev 10527) @@ -113,7 +113,7 @@ ## this makes only sense for state-space models, therefore convert TF to SS if (nargout > 1) sys = prescale (ss (sys(:,1:m))); - x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0) + x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0); ## return x0 as vector for single-experiment data ## instead of a cell containing one vector if (numel (x0) == 1) Modified: trunk/octave-forge/extra/control-devel/devel/rarx.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/rarx.m 2012-05-27 19:41:24 UTC (rev 10526) +++ trunk/octave-forge/extra/control-devel/devel/rarx.m 2012-05-27 20:03:58 UTC (rev 10527) @@ -113,7 +113,7 @@ ## this makes only sense for state-space models, therefore convert TF to SS if (nargout > 1) sys = prescale (ss (sys(:,1:m))); - x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0) + x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0); ## return x0 as vector for single-experiment data ## instead of a cell containing one vector if (numel (x0) == 1) Modified: trunk/octave-forge/extra/control-devel/inst/arx.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-27 19:41:24 UTC (rev 10526) +++ trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-27 20:03:58 UTC (rev 10527) @@ -113,7 +113,7 @@ ## this makes only sense for state-space models, therefore convert TF to SS if (nargout > 1) sys = prescale (ss (sys(:,1:m))); - x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0) + x0 = slib01cd (Y, U, sys.a, sys.b, sys.c, sys.d, 0.0); ## return x0 as vector for single-experiment data ## instead of a cell containing one vector if (numel (x0) == 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-27 20:31:37
|
Revision: 10528 http://octave.svn.sourceforge.net/octave/?rev=10528&view=rev Author: paramaniac Date: 2012-05-27 20:31:31 +0000 (Sun, 27 May 2012) Log Message: ----------- control-devel: handle key/value pairs for are Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m trunk/octave-forge/extra/control-devel/devel/GlassFurnaceARX.m trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m trunk/octave-forge/extra/control-devel/devel/pHarx.m trunk/octave-forge/extra/control-devel/inst/arx.m Modified: trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/devel/CDplayerARX.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -51,7 +51,7 @@ dat = iddata (Y, U) % [sys, x0] = ident (dat, 15, 8) % s=15, n=8 -[sys, x0] = arx (dat, 8, 8) +[sys, x0] = arx (dat, 'na', 8, 'nb', 8) [y, t] = lsim (sys, U, [], x0); Modified: trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/devel/DestillationMEarx.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -72,8 +72,8 @@ dat = iddata (Y, U) [sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 -sys2 = arx (dat, 4, 4); -[sys2, x02] = arx (dat, 4, 4); +sys2 = arx (dat, 'na', 4, 'nb', 4); +[sys2, x02] = arx (dat, 'na', 4, 'nb', 4); x0=x0{1}; x02=x02{1}; Modified: trunk/octave-forge/extra/control-devel/devel/GlassFurnaceARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/GlassFurnaceARX.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/devel/GlassFurnaceARX.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -49,7 +49,7 @@ dat = iddata (Y, U) %[sys, x0] = ident (dat, 10, 5) % s=10, n=5 -sys = arx (dat, 5, 5) +sys = arx (dat, 5) %[y, t] = lsim (sys, U, [], x0); [y, t] = lsim (sys(:, 1:3), U); Modified: trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -77,7 +77,7 @@ % s=15, n=7 [sys1, x0] = moen4 (dat, 's', 15, 'n', 7) %sys2 = arx (dat, 7, 7) % normally na = nb -[sys2, x02] = arx (dat, 7, 7); +[sys2, x02] = arx (dat, 7); [y1, t1] = lsim (sys1, U, [], x0); %[y2, t] = lsim (sys2(:, 1), U); Modified: trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -78,7 +78,7 @@ [sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 % sys2 = arx (dat, 4, 4) -[sys2, x02] = arx (dat, 4, 4) +[sys2, x02] = arx (dat, 4) x0=x0{1}; x02=x02{1}; Modified: trunk/octave-forge/extra/control-devel/devel/pHarx.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/pHarx.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/devel/pHarx.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -52,7 +52,7 @@ dat = iddata (Y, U) % [sys, x0] = ident (dat, 15, 6) % s=15, n=6 -sys = arx (dat, 6, 6) % normally na = nb +sys = arx (dat, 6) % normally na = nb % [y, t] = lsim (sys, U, [], x0); [y, t] = lsim (sys(:, 1:2), U); Modified: trunk/octave-forge/extra/control-devel/inst/arx.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-27 20:03:58 UTC (rev 10527) +++ trunk/octave-forge/extra/control-devel/inst/arx.m 2012-05-27 20:31:31 UTC (rev 10528) @@ -24,11 +24,11 @@ ## Created: April 2012 ## Version: 0.1 -function [sys, varargout] = arx (dat, na, nb) +function [sys, varargout] = arx (dat, varargin) ## TODO: delays - if (nargin != 3) + if (nargin < 2) print_usage (); endif @@ -36,8 +36,24 @@ error ("arx: first argument must be an iddata dataset"); endif +% if (nargin > 2) # arx (dat, ...) + if (is_real_scalar (varargin{1})) # arx (dat, n, ...) + varargin = horzcat (varargin(2:end), {"na"}, varargin(1), {"nb"}, varargin(1)); + endif + if (isstruct (varargin{1})) # arx (dat, opt, ...), arx (dat, n, opt, ...) + varargin = horzcat (__opt2cell__ (varargin{1}), varargin(2:end)); + endif +% endif + + nkv = numel (varargin); # number of keys and values + + if (rem (nkv, 2)) + error ("arx: keys and values must come in pairs"); + endif + + ## p: outputs, m: inputs, ex: experiments - [~, p, m, ex] = size (dat); + [~, p, m, ex] = size (dat); # dataset dimensions ## extract data Y = dat.y; @@ -50,8 +66,31 @@ else tsam = tsam{1}; endif + + + ## default arguments + na = []; + nb = []; % ??? + nk = []; - + ## handle keys and values + for k = 1 : 2 : nkv + key = lower (varargin{k}); + val = varargin{k+1}; + switch (key) + ## TODO: proper argument checking + case "na" + na = val; + case "nb" + nb = val; + case "nk" + error ("nk"); + otherwise + warning ("arx: invalid property name '%s' ignored", key); + endswitch + endfor + + if (is_real_scalar (na, nb)) na = repmat (na, p, 1); # na(p-by-1) nb = repmat (nb, p, m); # nb(p-by-m) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-05-31 12:31:43
|
Revision: 10546 http://octave.svn.sourceforge.net/octave/?rev=10546&view=rev Author: paramaniac Date: 2012-05-31 12:31:34 +0000 (Thu, 31 May 2012) Log Message: ----------- control-devel: return scaling L Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Modified: trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m 2012-05-31 06:04:54 UTC (rev 10545) +++ trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m 2012-05-31 12:31:34 UTC (rev 10546) @@ -48,9 +48,12 @@ dat = iddata (Y, U) -[sys, x0] = moen4 (dat, 's', 10, 'n', 5) % s=10, n=5 +[sys, x0, info] = n4sid (dat, 's', 10, 'n', 5) % s=10, n=5 +L = chol (info.Ry, 'lower') +Be = info.K * L + [y, t] = lsim (sys, U, [], x0); err = norm (Y - y, 1) / norm (Y, 1) Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-31 06:04:54 UTC (rev 10545) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-05-31 12:31:34 UTC (rev 10546) @@ -146,7 +146,8 @@ ## state covariance matrix Q ## output covariance matrix Ry ## state-output cross-covariance matrix S - info = struct ("K", k, "Q", q, "Ry", ry, "S", s); + ## L L' = Ry, e = L v, v becomes white noise with identity covariance matrix + info = struct ("K", k, "Q", q, "Ry", ry, "S", s, "L", chol (ry, "lower")); endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-22 09:08:17
|
Revision: 10657 http://octave.svn.sourceforge.net/octave/?rev=10657&view=rev Author: paramaniac Date: 2012-06-22 09:08:11 +0000 (Fri, 22 Jun 2012) Log Message: ----------- control-devel: specify common tsam for all experiments, improve doc Modified Paths: -------------- trunk/octave-forge/extra/control-devel/INDEX trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m trunk/octave-forge/extra/control-devel/inst/__adjust_iddata_tsam__.m Modified: trunk/octave-forge/extra/control-devel/INDEX =================================================================== --- trunk/octave-forge/extra/control-devel/INDEX 2012-06-22 05:34:37 UTC (rev 10656) +++ trunk/octave-forge/extra/control-devel/INDEX 2012-06-22 09:08:11 UTC (rev 10657) @@ -7,13 +7,11 @@ @iddata/diff @iddata/fft @iddata/get - @iddata/horzcat @iddata/ifft @iddata/merge @iddata/plot @iddata/set @iddata/size - @iddata/vertcat System Identification arx fitfrd Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m 2012-06-22 05:34:37 UTC (rev 10656) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m 2012-06-22 09:08:11 UTC (rev 10657) @@ -42,6 +42,10 @@ ## and n(i) the individual number of samples for each experiment. ## @item tsam ## Sampling time. If not specified, default value -1 (unspecified) is taken. +## For multi-experiment data, @var{tsam} becomes a +## e-by-1 or 1-by-e cell vector containing individual +## sampling times for each experiment. If a scalar @var{tsam} +## is provided, then all experiments have the same sampling time. ## @item @dots{} ## Optional pairs of properties and values. ## @end table Modified: trunk/octave-forge/extra/control-devel/inst/__adjust_iddata_tsam__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__adjust_iddata_tsam__.m 2012-06-22 05:34:37 UTC (rev 10656) +++ trunk/octave-forge/extra/control-devel/inst/__adjust_iddata_tsam__.m 2012-06-22 09:08:11 UTC (rev 10657) @@ -40,9 +40,13 @@ error ("iddata: invalid sampling time"); endif - if (numel (tsam) != e) + nt = numel (tsam); + + if (nt == 1 && e > 1) + tsam = repmat (tsam, e, 1); + elseif (nt != e) error ("iddata: there are %d experiments, but only %d sampling times", \ - e, numel (tsam)); + e, nt); endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-25 14:56:59
|
Revision: 10691 http://octave.svn.sourceforge.net/octave/?rev=10691&view=rev Author: paramaniac Date: 2012-06-25 14:56:49 +0000 (Mon, 25 Jun 2012) Log Message: ----------- control-devel: use kalman predictor for simulation Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/Destillation.m trunk/octave-forge/extra/control-devel/devel/Evaporator.m trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m trunk/octave-forge/extra/control-devel/devel/pH.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m trunk/octave-forge/extra/control-devel/inst/moen4.m Added Paths: ----------- trunk/octave-forge/extra/control-devel/devel/HeatingSystemKP.m trunk/octave-forge/extra/control-devel/devel/PowerPlantKP.m Modified: trunk/octave-forge/extra/control-devel/devel/Destillation.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/Destillation.m 2012-06-25 12:57:13 UTC (rev 10690) +++ trunk/octave-forge/extra/control-devel/devel/Destillation.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -66,13 +66,16 @@ Y_dest_n20=Y(:,7:9); Y_dest_n30=Y(:,10:12); +Y = {Y_dest; Y_dest_n10; Y_dest_n20; Y_dest_n30}; +U = {U_dest; U_dest_n10; U_dest_n20; U_dest_n30}; -dat = iddata (Y_dest, U_dest) +dat = iddata (Y, U) -[sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 +[sys, x0] = moen4 (dat, 's', 5, 'n', 4, 'noise', 'k') % s=5, n=4 +x0=x0{1}; -[y, t] = lsim (sys, U_dest, [], x0); +[y, t] = lsim (sys, [U_dest, Y_dest], [], x0); %[y, t] = lsim (sys, U_dest); err = norm (Y_dest - y, 1) / norm (Y_dest, 1) Modified: trunk/octave-forge/extra/control-devel/devel/Evaporator.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/Evaporator.m 2012-06-25 12:57:13 UTC (rev 10690) +++ trunk/octave-forge/extra/control-devel/devel/Evaporator.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -51,10 +51,10 @@ dat = iddata (Y, U) -[sys, x0] = moen4 (dat, 's', 10, 'n', 4) % s=10, n=4 +[sys, x0] = moen4 (dat, 's', 10, 'n', 4, 'noise', 'k') % s=10, n=4 -[y, t] = lsim (sys, U, [], x0); +[y, t] = lsim (sys, [U, Y], [], x0); err = norm (Y - y, 1) / norm (Y, 1) Modified: trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m 2012-06-25 12:57:13 UTC (rev 10690) +++ trunk/octave-forge/extra/control-devel/devel/GlassFurnace.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -48,10 +48,10 @@ dat = iddata (Y, U) -[sys, x0, info] = moen4 (dat, 's', 10, 'n', 5) % s=10, n=5 +[sys, x0, info] = moen4 (dat, 's', 10, 'n', 5, 'noise', 'k') % s=10, n=5 -[y, t] = lsim (sys, U, [], x0); +[y, t] = lsim (sys, [U, Y], [], x0); err = norm (Y - y, 1) / norm (Y, 1) Added: trunk/octave-forge/extra/control-devel/devel/HeatingSystemKP.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/HeatingSystemKP.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/HeatingSystemKP.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -0,0 +1,103 @@ +%{ +1. Contributed by: + + Roy Smith + Dept. of Electrical & Computer Engineering + University of California, + Santa Barbara, CA 93106 + U.S.A. + ro...@ec... + +2. Process/Description: + + The experiment is a simple SISO heating system. + The input drives a 300 Watt Halogen lamp, suspended + several inches above a thin steel plate. The output + is a thermocouple measurement taken from the back of + the plate. + +3. Sampling interval: + + 2.0 seconds + +4. Number of samples + + 801 + +5. Inputs: + + u: input drive voltage + ... +6. Outputs: + + y: temperature (deg. C) + ... +7. References: + + The use of this experiment and data for robust + control model validation is described in: + + "Sampled Data Model Validation: an Algorithm and + Experimental Application," Geir Dullerud & Roy Smith, + International Journal of Robust and Nonlinear Control, + Vol. 6, No. 9/10, pp. 1065-1078, 1996. + +8. Known properties/peculiarities + + The data (and nominal model) is the above paper have the + output expressed in 10's deg. C. This has been rescaled + to the original units of deg. C. in the DaISy data set. + There is also a -1 volt offset in u in the data shown plotted + in the original paper. This has been removed in the + DaISy dataset. + + The data shows evidence of discrepancies. One of the + issues studied in the above paper is the size of these + discrepancies - measured in this case in terms of the norm + of the smallest perturbation required to account for the + difference between the nominal model and the data. + + The steady state input (prior to the start of the experiment) + is u = 6.0 Volts. + +%} + +clear all, close all, clc + +load heating_system.dat +U=heating_system(:,2); +Y=heating_system(:,3); + + +dat = iddata (Y, U, 2.0, 'inname', 'input drive voltage', \ + 'inunit', 'Volt', \ + 'outname', 'temperature', \ + 'outunit', '°C') + +% s=15, n=7 +%[sys1, x0] = moen4 (dat, 's', 15, 'n', 7) +[sys1, x0] = moen4 (dat, 's', 15, 'n', 7, 'noise', 'k') + +%sys2 = arx (dat, 7, 7) % normally na = nb +[sys2, x02] = arx (dat, 7); + +%[y1, t1] = lsim (sys1, U, [], x0); +[y1, t1] = lsim (sys1, [U, Y], [], x0); + +%[y2, t] = lsim (sys2(:, 1), U); +[y2, t] = lsim (sys2, U, [], x02); + + +err1 = norm (Y - y1, 1) / norm (Y, 1) +err2 = norm (Y - y2, 1) / norm (Y, 1) + +figure (1) +plot (t, Y, t, y1, t, y2) +title ('DaISy: Heating System [99-001]') +xlim ([t(1), t(end)]) +xlabel ('Time [s]') +ylabel ('Temperature [Degree Celsius]') +legend ('measured', 'simulated subspace', 'simulated ARX', 'location', 'southeast') + + + Added: trunk/octave-forge/extra/control-devel/devel/PowerPlantKP.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/PowerPlantKP.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/PowerPlantKP.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -0,0 +1,84 @@ +%{ +This file describes the data in the powerplant.dat file. +1. Contributed by: + Peter Van Overschee + K.U.Leuven - ESAT - SISTA + K. Mercierlaan 94 + 3001 Heverlee + Pet...@es... +2. Process/Description: + data of a power plant (Pont-sur-Sambre (France)) of 120 MW +3. Sampling time + 1228.8 sec +4. Number of samples: + 200 samples +5. Inputs: + 1. gas flow + 2. turbine valves opening + 3. super heater spray flow + 4. gas dampers + 5. air flow +6. Outputs: + 1. steam pressure + 2. main stem temperature + 3. reheat steam temperature +7. References: + a. R.P. Guidorzi, P. Rossi, Identification of a power plant from normal + operating records. Automatic control theory and applications (Canada, + Vol 2, pp 63-67, sept 1974. + b. Moonen M., De Moor B., Vandenberghe L., Vandewalle J., On- and + off-line identification of linear state-space models, International + Journal of Control, Vol. 49, Jan. 1989, pp.219-232 +8. Known properties/peculiarities + +9. Some MATLAB-code to retrieve the data + !gunzip powerplant.dat.Z + load powerplant.dat + U=powerplant(:,1:5); + Y=powerplant(:,6:8); + Yr=powerplant(:,9:11); + +%} + +clear all, close all, clc + +% NB: the code from DaISy is wrong: +% powerplant(:,1) is just the sample number +% therefore increase indices by one +% it took me weeks to find that silly mistake ... +load powerplant.dat +U=powerplant(:,2:6); +Y=powerplant(:,7:9); +Yr=powerplant(:,10:12); + +inname = {'gas flow', + 'turbine valves opening', + 'super heater spray flow', + 'gas dampers', + 'air flow'}; + +outname = {'steam pressure', + 'main steam temperature', + 'reheat steam temperature'}; + +tsam = 1228.8; + +dat = iddata (Y, U, tsam, 'outname', outname, 'inname', inname) + +[sys, x0] = moen4 (dat, 's', 10, 'n', 8, 'noise', 'k') % s=10, n=8 + +[y, t] = lsim (sys, [U, Y], [], x0); + +err = norm (Y - y, 1) / norm (Y, 1) + +figure (1) +p = columns (Y); +for k = 1 : p + subplot (3, 1, k) + plot (t, Y(:,k), 'b', t, y(:,k), 'r') +endfor +%title ('DaISy: Power Plant') +%legend ('y measured', 'y simulated', 'location', 'southeast') + +st = isstable (sys) + Modified: trunk/octave-forge/extra/control-devel/devel/pH.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/pH.m 2012-06-25 12:57:13 UTC (rev 10690) +++ trunk/octave-forge/extra/control-devel/devel/pH.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -51,10 +51,10 @@ dat = iddata (Y, U) -[sys, x0] = moen4 (dat, 's', 15, 'n', 6) % s=15, n=6 +[sys, x0] = moen4 (dat, 's', 15, 'n', 6, 'noise', 'k') % s=15, n=6 -[y, t] = lsim (sys, U, [], x0); +[y, t] = lsim (sys, [U, Y], [], x0); err = norm (Y - y, 1) / norm (Y, 1) st = isstable (sys) Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-06-25 12:57:13 UTC (rev 10690) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -154,6 +154,11 @@ in_v = __labels__ (outname, "y"); in_v = cellfun (@(x) ["v@", x], in_v, "uniformoutput", false); inname = [in_u; in_v]; + elseif (strncmpi (noise, "k", 1)) # Kalman predictor + sys = ss ([a-k*c], [b-k*d, k], c, [d, zeros(p)], tsam); + in_u = __labels__ (inname, "u"); + in_y = __labels__ (outname, "y"); + inname = [in_u; in_y]; else # no error inputs, default sys = ss (a, b, c, d, tsam); endif Modified: trunk/octave-forge/extra/control-devel/inst/moen4.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/moen4.m 2012-06-25 12:57:13 UTC (rev 10690) +++ trunk/octave-forge/extra/control-devel/inst/moen4.m 2012-06-25 14:56:49 UTC (rev 10691) @@ -71,6 +71,7 @@ ## @table @var ## @item 'n' ## The desired order of the resulting state-space system @var{sys}. +## @var{s} > @var{n} > 0. ## ## @item 's' ## The number of block rows @var{s} in the input and output This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-25 19:24:59
|
Revision: 10694 http://octave.svn.sourceforge.net/octave/?rev=10694&view=rev Author: paramaniac Date: 2012-06-25 19:24:52 +0000 (Mon, 25 Jun 2012) Log Message: ----------- control-devel: change to Kalman predictor Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/CDplayer.m trunk/octave-forge/extra/control-devel/devel/LakeErie.m trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m Modified: trunk/octave-forge/extra/control-devel/devel/CDplayer.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/CDplayer.m 2012-06-25 16:41:32 UTC (rev 10693) +++ trunk/octave-forge/extra/control-devel/devel/CDplayer.m 2012-06-25 19:24:52 UTC (rev 10694) @@ -50,11 +50,15 @@ dat = iddata (Y, U) -[sys, x0] = moen4 (dat, 8, 's', 15) % s=15, n=8 +% [sys, x0] = moen4 (dat, 8, 's', 15) % s=15, n=8 +[sys, x0] = moen4 (dat, 8, 's', 15, 'noise', 'k') % s=15, n=8 -[y, t] = lsim (sys, U, [], x0); +%[y, t] = lsim (sys, U, [], x0); +[y, t] = lsim (sys, [U, Y], [], x0); + + err = norm (Y - y, 1) / norm (Y, 1) figure (1) Modified: trunk/octave-forge/extra/control-devel/devel/LakeErie.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/LakeErie.m 2012-06-25 16:41:32 UTC (rev 10693) +++ trunk/octave-forge/extra/control-devel/devel/LakeErie.m 2012-06-25 19:24:52 UTC (rev 10694) @@ -76,11 +76,14 @@ 'outname', {'a. dissolved oxygen'; 'b. algae'}) -[sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 +% [sys, x0] = moen4 (dat, 's', 5, 'n', 4) % s=5, n=4 +[sys, x0] = moen4 (dat, 's', 5, 'n', 4, 'noise', 'k') % s=5, n=4 + x0=x0{1}; -[y, t] = lsim (sys, U_erie, [], x0); +[y, t] = lsim (sys, [U_erie, Y_erie], [], x0); +%[y, t] = lsim (sys, U_erie, [], x0); %[y, t] = lsim (sys, U_erie); err = norm (Y_erie - y, 1) / norm (Y_erie, 1) Modified: trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-06-25 16:41:32 UTC (rev 10693) +++ trunk/octave-forge/extra/control-devel/inst/__slicot_identification__.m 2012-06-25 19:24:52 UTC (rev 10694) @@ -97,6 +97,7 @@ case "confirm" conf = logical (val); case "noise" + ## FIXME: find a more speaking name than 'noise' for this option noise = val; otherwise warning ("%s: invalid property name '%s' ignored", method, key); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-06-29 06:08:38
|
Revision: 10702 http://octave.svn.sourceforge.net/octave/?rev=10702&view=rev Author: paramaniac Date: 2012-06-29 06:08:32 +0000 (Fri, 29 Jun 2012) Log Message: ----------- control-devel: work on draft code Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/arx.m trunk/octave-forge/extra/control-devel/src/Makefile Added Paths: ----------- trunk/octave-forge/extra/control-devel/src/is_matrix.cc Modified: trunk/octave-forge/extra/control-devel/inst/arx.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/arx.m 2012-06-29 06:07:27 UTC (rev 10701) +++ trunk/octave-forge/extra/control-devel/inst/arx.m 2012-06-29 06:08:32 UTC (rev 10702) @@ -16,8 +16,65 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{sys} =} arx (@var{dat}, @var{na}, @var{nb}) +## @deftypefn {Function File} {[@var{sys}, @var{x0}] =} arx (@var{dat}, @var{n}, @dots{}) +## @deftypefnx {Function File} {[@var{sys}, @var{x0}] =} arx (@var{dat}, @var{n}, @var{opt}, @dots{}) +## @deftypefnx {Function File} {[@var{sys}, @var{x0}] =} arx (@var{dat}, @var{opt}, @dots{}) +## @deftypefnx {Function File} {[@var{sys}, @var{x0}] =} arx (@var{dat}, @var{'na'}, @var{na}, @var{'nb'}, @var{nb}) ## ARX +## +## @strong{Inputs} +## @table @var +## @item dat +## iddata set containing the measurements. +## @item n +## The desired order of the resulting model @var{sys}. +## @item @dots{} +## Optional pairs of keys and values. @code{'key1', value1, 'key2', value2}. +## @item opt +## Optional struct with keys as field names. +## Struct @var{opt} can be created directly or +## by command @command{options}. @code{opt.key1 = value1, opt.key2 = value2}. +## @end table +## +## +## @strong{Outputs} +## @table @var +## @item sys +## Discrete-time transfer function model. +## If the second output argument @var{x0} is returned, +## @var{sys} becomes a state-space model. +## @item x0 +## Initial state vector. If @var{dat} is a multi-experiment dataset, +## @var{x0} becomes a cell vector containing an initial state vector +## for each experiment. +## @end table +## +## +## +## @strong{Option Keys and Values} +## @table @var +## @item 'na' +## The desired order of the resulting state-space system @var{sys}. +## @var{s} > @var{n} > 0. +## +## @item 'nb' +## The desired order of the resulting state-space system @var{sys}. +## @var{s} > @var{n} > 0. +## @end table +## +## +## @strong{Algorithm}@* +## Uses the formulae given in [1] on pages 318-319, +## 'Solving for the LS Estimate by QR Factorization'. +## For the initial conditions, SLICOT IB01CD is used by courtesy of +## @uref{http://www.slicot.org, NICONET e.V.} +## +## @strong{References}@* +## [1] Ljung, L. (1999) +## System Identification - Theory for the User +## Second Edition +## Prentice Hall, New Jersey. +## ## @end deftypefn ## Author: Lukas Reichlin <luk...@gm...> @@ -36,15 +93,14 @@ error ("arx: first argument must be an iddata dataset"); endif -% if (nargin > 2) # arx (dat, ...) - if (is_real_scalar (varargin{1})) # arx (dat, n, ...) - varargin = horzcat (varargin(2:end), {"na"}, varargin(1), {"nb"}, varargin(1)); - endif - if (isstruct (varargin{1})) # arx (dat, opt, ...), arx (dat, n, opt, ...) - varargin = horzcat (__opt2cell__ (varargin{1}), varargin(2:end)); - endif -% endif + if (is_real_scalar (varargin{1})) # arx (dat, n, ...) + varargin = horzcat (varargin(2:end), {"na"}, varargin(1), {"nb"}, varargin(1)); + endif + if (isstruct (varargin{1})) # arx (dat, opt, ...), arx (dat, n, opt, ...) + varargin = horzcat (__opt2cell__ (varargin{1}), varargin(2:end)); + endif + nkv = numel (varargin); # number of keys and values if (rem (nkv, 2)) Modified: trunk/octave-forge/extra/control-devel/src/Makefile =================================================================== --- trunk/octave-forge/extra/control-devel/src/Makefile 2012-06-29 06:07:27 UTC (rev 10701) +++ trunk/octave-forge/extra/control-devel/src/Makefile 2012-06-29 06:08:32 UTC (rev 10702) @@ -2,7 +2,8 @@ # BLAS_LIBS := $(shell mkoctfile -p BLAS_LIBS) FLIBS := $(shell mkoctfile -p FLIBS) -all: devel_slicot_functions.oct +all: devel_slicot_functions.oct \ + is_matrix.oct # unpack and compile SLICOT library slicotlibrary.a: slicot.tar.gz @@ -27,6 +28,10 @@ mkoctfile devel_slicot_functions.cc common.cc slicotlibrary.a lapacklibrary.a \ ${FLIBS} +# helpers +is_matrix.oct: is_matrix.cc + mkoctfile is_matrix.cc + clean: rm -rf *.o core octave-core *.oct *~ *.f slicot lapack-3.4.1 Added: trunk/octave-forge/extra/control-devel/src/is_matrix.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/is_matrix.cc (rev 0) +++ trunk/octave-forge/extra/control-devel/src/is_matrix.cc 2012-06-29 06:08:32 UTC (rev 10702) @@ -0,0 +1,60 @@ +/* + +Copyright (C) 2012 Lukas F. Reichlin + +This file is part of LTI Syncope. + +LTI Syncope 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 3 of the License, or +(at your option) any later version. + +LTI Syncope 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 LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +Return true if argument is a real matrix. + +Author: Lukas Reichlin <luk...@gm...> +Created: June 2012 +Version: 0.1 + +*/ + +#include <octave/oct.h> + +DEFUN_DLD (is_matrix, args, nargout, + "-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {} is_matrix (@var{a}, @dots{})\n\ +Return true if argument is a matrix.\n\ +@var{[]} is a valid matrix.\n\ +Avoid nasty stuff like @code{true = isreal (\"a\")}\n\ +@seealso{is_real_matrix, is_real_square_matrix, is_real_vector, is_real_scalar}\n\ +@end deftypefn") +{ + octave_value retval = true; + int nargin = args.length (); + + if (nargin == 0) + { + print_usage (); + } + else + { + for (int i = 0; i < nargin; i++) + { + if (args(i).ndims () != 2 || ! args(i).is_numeric_type () + || ! (args(i).is_complex_type () || args(i).is_real_type ())) + { + retval = false; + break; + } + } + } + + return retval; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-07-01 18:50:22
|
Revision: 10710 http://octave.svn.sourceforge.net/octave/?rev=10710&view=rev Author: paramaniac Date: 2012-07-01 18:50:12 +0000 (Sun, 01 Jul 2012) Log Message: ----------- control-devel: add nkshift iddata method Modified Paths: -------------- trunk/octave-forge/extra/control-devel/INDEX Added Paths: ----------- trunk/octave-forge/extra/control-devel/inst/@iddata/nkshift.m Modified: trunk/octave-forge/extra/control-devel/INDEX =================================================================== --- trunk/octave-forge/extra/control-devel/INDEX 2012-06-30 18:46:04 UTC (rev 10709) +++ trunk/octave-forge/extra/control-devel/INDEX 2012-07-01 18:50:12 UTC (rev 10710) @@ -9,6 +9,7 @@ @iddata/get @iddata/ifft @iddata/merge + @iddata/nkshift @iddata/plot @iddata/set @iddata/size Added: trunk/octave-forge/extra/control-devel/inst/@iddata/nkshift.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/nkshift.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/nkshift.m 2012-07-01 18:50:12 UTC (rev 10710) @@ -0,0 +1,55 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope 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 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope 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 LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{dat} =} nkshift (@var{dat}, @var{nk}) +## @deftypefnx {Function File} {@var{dat} =} detrend (@var{dat}, @var{nk} @var{'append'}) +## Detrend outputs and inputs of dataset @var{dat} by +## removing the best fit of a polynomial of order @var{ord}. +## If @var{ord} is not specified, default value 0 is taken. +## This corresponds to removing a constant. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: July 2012 +## Version: 0.1 + +function dat = nkshift (dat, nk = 0) + + if (nargin != 2) + print_usage (); + endif + + if (! is_real_scalar (nk)) + error ("iddata: nkshift: "); + endif + + ## TODO: - nk per inputs + ## - padding with zeros + + snk = sign (nk); + nk = abs (nk); + + if (snk >= 0) + dat.y = cellfun (@(y) y(nk+1:end, :), dat.y, "uniformoutput", false); + dat.u = cellfun (@(u) u(1:end-nk, :), dat.u, "uniformoutput", false); + else + dat.y = cellfun (@(y) y(1:end-nk, :), dat.y, "uniformoutput", false); + dat.u = cellfun (@(u) u(nk+1:end, :), dat.u, "uniformoutput", false); + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-07-02 12:24:41
|
Revision: 10711 http://octave.svn.sourceforge.net/octave/?rev=10711&view=rev Author: paramaniac Date: 2012-07-02 12:24:31 +0000 (Mon, 02 Jul 2012) Log Message: ----------- control-devel: use weaker kalman matrix in pH example Modified Paths: -------------- trunk/octave-forge/extra/control-devel/INDEX trunk/octave-forge/extra/control-devel/inst/@iddata/resample.m Added Paths: ----------- trunk/octave-forge/extra/control-devel/devel/pH2.m Modified: trunk/octave-forge/extra/control-devel/INDEX =================================================================== --- trunk/octave-forge/extra/control-devel/INDEX 2012-07-01 18:50:12 UTC (rev 10710) +++ trunk/octave-forge/extra/control-devel/INDEX 2012-07-02 12:24:31 UTC (rev 10711) @@ -11,6 +11,7 @@ @iddata/merge @iddata/nkshift @iddata/plot + @iddata/resample @iddata/set @iddata/size System Identification Added: trunk/octave-forge/extra/control-devel/devel/pH2.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/pH2.m (rev 0) +++ trunk/octave-forge/extra/control-devel/devel/pH2.m 2012-07-02 12:24:31 UTC (rev 10711) @@ -0,0 +1,74 @@ +%{ +Contributed by: + Jairo Espinosa + K.U.Leuven ESAT-SISTA + K.Mercierlaan 94 + B3001 Heverlee + Jai...@es... + +Description: + Simulation data of a pH neutralization process in a constant volume + stirring tank. + Volume of the tank 1100 liters + Concentration of the acid solution (HAC) 0.0032 Mol/l + Concentration of the base solution (NaOH) 0,05 Mol/l +Sampling: + 10 sec +Number: + 2001 +Inputs: + u1: Acid solution flow in liters + u2: Base solution flow in liters + +Outputs: + y: pH of the solution in the tank + +References: + T.J. Mc Avoy, E.Hsu and S.Lowenthal, Dynamics of pH in controlled + stirred tank reactor, Ind.Eng.Chem.Process Des.Develop.11(1972) + 71-78 + +Properties: + Highly non-linear system. + +Columns: + Column 1: time-steps + Column 2: input u1 + Column 3: input u2 + Column 4: output y + +Category: + Process industry systems + +%} + +clear all, close all, clc + +load pHdata.dat +U=pHdata(:,2:3); +Y=pHdata(:,4); + + +dat = iddata (Y, U) + +[sys, x0, info] = moen4 (dat, 's', 15, 'n', 6) % s=15, n=6 + +l = lqe (sys, info.Q, 100*info.Ry) + +[a, b, c, d] = ssdata (sys); + +sys = ss ([a-l*c], [b-l*d, l], c, [d, 0], -1) + + +[y, t] = lsim (sys, [U, Y], [], x0); + +err = norm (Y - y, 1) / norm (Y, 1) +st = isstable (sys) + +figure (1) +plot (t, Y(:,1), 'b', t, y(:,1), 'r') +ylim ([0, 15]) +title ('DaISy [96-014]: pH neutralization process in a stirring tank - highly non-linear') +legend ('y measured', 'y simulated', 'location', 'southeast') + + Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/resample.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/resample.m 2012-07-01 18:50:12 UTC (rev 10710) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/resample.m 2012-07-02 12:24:31 UTC (rev 10711) @@ -16,8 +16,8 @@ ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{dat} =} diff (@var{dat}) -## @deftypefnx {Function File} {@var{dat} =} diff (@var{dat}, @var{k}) +## @deftypefn {Function File} {@var{dat} =} resample (@var{dat}, @var{p}, @var{q}) +## @deftypefnx {Function File} {@var{dat} =} resample (@var{dat}, @var{p}, @var{q}, @var{n}) ## Return @var{k}-th difference of outputs and inputs of dataset @var{dat}. ## If @var{k} is not specified, default value 1 is taken. ## @end deftypefn @@ -32,6 +32,8 @@ print_usage (); endif + ## requires signal package + h = fir1 (n, 1/q); dat.y = cellfun (@(y) resample (y, p, q, h), dat.y, "uniformoutput", false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-07-29 13:17:45
|
Revision: 10783 http://octave.svn.sourceforge.net/octave/?rev=10783&view=rev Author: paramaniac Date: 2012-07-29 13:17:39 +0000 (Sun, 29 Jul 2012) Log Message: ----------- control-devel: minor changes Modified Paths: -------------- trunk/octave-forge/extra/control-devel/INDEX trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m Modified: trunk/octave-forge/extra/control-devel/INDEX =================================================================== --- trunk/octave-forge/extra/control-devel/INDEX 2012-07-29 12:09:22 UTC (rev 10782) +++ trunk/octave-forge/extra/control-devel/INDEX 2012-07-29 13:17:39 UTC (rev 10783) @@ -26,4 +26,5 @@ @iddata/subsref @iddata/vertcat Miscellaneous + options test_devel \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m 2012-07-29 12:09:22 UTC (rev 10782) +++ trunk/octave-forge/extra/control-devel/devel/HeatingSystem.m 2012-07-29 13:17:39 UTC (rev 10783) @@ -72,7 +72,7 @@ dat = iddata (Y, U, 2.0, 'inname', 'input drive voltage', \ 'inunit', 'Volt', \ 'outname', 'temperature', \ - 'outunit', '°C') + 'outunit', 'Degree Celsius') % s=15, n=7 [sys1, x0] = moen4 (dat, 's', 15, 'n', 7) Modified: trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m 2012-07-29 12:09:22 UTC (rev 10782) +++ trunk/octave-forge/extra/control-devel/devel/LakeErieARX.m 2012-07-29 13:17:39 UTC (rev 10783) @@ -150,6 +150,6 @@ xlabel ('Time [months]') xlim ([0, 56]) -legend ('measurement DaISy', 'Kalman Predictor', 'Kalman Predictor weak', 'location', 'northeast') +legend ('Measurement DaISy', 'MOEN4 Kalman Predictor', 'MOEN4 Kalman Predictor (weak)', 'location', 'northeast') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-03 15:38:55
|
Revision: 10805 http://octave.svn.sourceforge.net/octave/?rev=10805&view=rev Author: paramaniac Date: 2012-08-03 15:38:45 +0000 (Fri, 03 Aug 2012) Log Message: ----------- control-devel: add filter method Modified Paths: -------------- trunk/octave-forge/extra/control-devel/INDEX Added Paths: ----------- trunk/octave-forge/extra/control-devel/inst/@iddata/filter.m Modified: trunk/octave-forge/extra/control-devel/INDEX =================================================================== --- trunk/octave-forge/extra/control-devel/INDEX 2012-08-03 15:19:41 UTC (rev 10804) +++ trunk/octave-forge/extra/control-devel/INDEX 2012-08-03 15:38:45 UTC (rev 10805) @@ -6,6 +6,7 @@ @iddata/detrend @iddata/diff @iddata/fft + @iddata/filter @iddata/get @iddata/ifft @iddata/merge Added: trunk/octave-forge/extra/control-devel/inst/@iddata/filter.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/filter.m (rev 0) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/filter.m 2012-08-03 15:38:45 UTC (rev 10805) @@ -0,0 +1,59 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope 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 3 of the License, or +## (at your option) any later version. +## +## LTI Syncope 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 LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{dat} =} filter (@var{dat}, @var{sys}) +## @deftypefnx {Function File} {@var{dat} =} filter (@var{dat}, @var{b}, @var{a}) +## Detrend outputs and inputs of dataset @var{dat} by +## removing the best fit of a polynomial of order @var{ord}. +## If @var{ord} is not specified, default value 0 is taken. +## This corresponds to removing a constant. +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: April 2012 +## Version: 0.1 + +function dat = filter (dat, b, a = [], si = []) + + if (nargin < 2 || nargin > 4 || ! isa (dat, "iddata")) + print_usage (); + endif + + if (isa (b, "lti") && issiso (b)) + si = a; + if (isct (b)) + tsam = dat.tsam; + b = c2d (b, tsam{1}); # does this make sense? + endif + [b, a] = filtdata (b, "vector"); + endif + + dat.y = cellfun (@(y) filter (b, a, y, si, 1), dat.y, "uniformoutput", false); + dat.u = cellfun (@(u) filter (b, a, u, si, 1), dat.u, "uniformoutput", false); + +endfunction + + +%!shared DATD, Z +%! DAT = iddata ({[(1:10).', (1:2:20).'], [(10:-1:1).', (20:-2:1).']}, {[(41:50).', (46:55).'], [(61:70).', (-66:-1:-75).']}); +%! DATD = detrend (DAT, "linear"); +%! Z = zeros (10, 2); +%!assert (DATD.y{1}, Z, 1e-10); +%!assert (DATD.y{2}, Z, 1e-10); +%!assert (DATD.u{1}, Z, 1e-10); +%!assert (DATD.u{2}, Z, 1e-10); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-14 20:23:48
|
Revision: 10869 http://octave.svn.sourceforge.net/octave/?rev=10869&view=rev Author: paramaniac Date: 2012-08-14 20:23:42 +0000 (Tue, 14 Aug 2012) Log Message: ----------- control-devel: remove system identification stuff Modified Paths: -------------- trunk/octave-forge/extra/control-devel/DESCRIPTION trunk/octave-forge/extra/control-devel/src/Makefile trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc Modified: trunk/octave-forge/extra/control-devel/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/control-devel/DESCRIPTION 2012-08-14 20:18:25 UTC (rev 10868) +++ trunk/octave-forge/extra/control-devel/DESCRIPTION 2012-08-14 20:23:42 UTC (rev 10869) @@ -1,6 +1,6 @@ Name: Control-Devel -Version: 0.2.0 -Date: 2012-05-21 +Version: 0.3.0 +Date: 2012-08-14 Author: Lukas Reichlin <luk...@gm...> Maintainer: Lukas Reichlin <luk...@gm...> Title: Control Systems Developer's Playground Modified: trunk/octave-forge/extra/control-devel/src/Makefile =================================================================== --- trunk/octave-forge/extra/control-devel/src/Makefile 2012-08-14 20:18:25 UTC (rev 10868) +++ trunk/octave-forge/extra/control-devel/src/Makefile 2012-08-14 20:23:42 UTC (rev 10869) @@ -11,8 +11,7 @@ endif LFLAGS := $(shell $(MKOCTFILE) -p LFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -all: devel_slicot_functions.oct \ - is_matrix.oct +all: devel_slicot_functions.oct # unpack and compile SLICOT library slicotlibrary.a: slicot.tar.gz Modified: trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc =================================================================== --- trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-08-14 20:18:25 UTC (rev 10868) +++ trunk/octave-forge/extra/control-devel/src/devel_slicot_functions.cc 2012-08-14 20:23:42 UTC (rev 10869) @@ -1,7 +1,3 @@ -#include "slident.cc" // system identification -#include "slib01cd.cc" // compute initial state vector -#include "slib01ad.cc" // compute singular values - #include "slident_a.cc" #include "slident_b.cc" #include "slident_c.cc" \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |