From: <par...@us...> - 2010-04-20 15:33:04
|
Revision: 7212 http://octave.svn.sourceforge.net/octave/?rev=7212&view=rev Author: paramaniac Date: 2010-04-20 15:32:57 +0000 (Tue, 20 Apr 2010) Log Message: ----------- control: style fixes Modified Paths: -------------- trunk/octave-forge/main/control/inst/@lti/norm.m trunk/octave-forge/main/control/inst/__freqbounds__.m trunk/octave-forge/main/control/inst/__timeresp__.m trunk/octave-forge/main/control/inst/hsvd.m trunk/octave-forge/main/control/inst/lsim.m trunk/octave-forge/main/control/inst/place.m trunk/octave-forge/main/control/src/slab13ad.cc trunk/octave-forge/main/control/src/slab13bd.cc trunk/octave-forge/main/control/src/slab13dd.cc trunk/octave-forge/main/control/src/slsb01bd.cc trunk/octave-forge/main/control/src/slsb02od.cc trunk/octave-forge/main/control/src/slsb03md.cc trunk/octave-forge/main/control/src/slsg03ad.cc Modified: trunk/octave-forge/main/control/inst/@lti/norm.m =================================================================== --- trunk/octave-forge/main/control/inst/@lti/norm.m 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/inst/@lti/norm.m 2010-04-20 15:32:57 UTC (rev 7212) @@ -66,12 +66,12 @@ if (isstable (sys)) [a, b, c, d] = ssdata (sys); - digital = ! isct (sys); + discrete = ! isct (sys); - if (! digital && ! all (all (d == 0))) # continuous and non-zero feedthrough + if (! discrete && ! all (all (d == 0))) # continuous and non-zero feedthrough gain = inf; else - [gain, iwarn] = slab13bd (a, b, c, d, digital); + [gain, iwarn] = slab13bd (a, b, c, d, discrete); if (iwarn) warning ("lti: norm: slab13bd: iwarn = %d", iwarn); @@ -87,13 +87,13 @@ function [gain, wpeak] = linfnorm (sys, tol = 0.01) [a, b, c, d, tsam] = ssdata (sys); - digital = ! isct (sys); + discrete = ! isct (sys); tol = max (tol, 100*eps); - [fpeak, gpeak] = slab13dd (a, b, c, d, digital, tol); + [fpeak, gpeak] = slab13dd (a, b, c, d, discrete, tol); if (fpeak(2) > 0) - if (digital) + if (discrete) wpeak = fpeak(1) / tsam; else wpeak = fpeak(1); Modified: trunk/octave-forge/main/control/inst/__freqbounds__.m =================================================================== --- trunk/octave-forge/main/control/inst/__freqbounds__.m 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/inst/__freqbounds__.m 2010-04-20 15:32:57 UTC (rev 7212) @@ -42,14 +42,14 @@ zer = zero (sys); pol = pole (sys); tsam = get (sys, "tsam"); - digital = (tsam > 0); # static gains (tsam = -1) are continuous + discrete = (tsam > 0); # static gains (tsam = -1) are continuous ## make sure zer, pol are row vectors pol = pol(:).'; zer = zer(:).'; ## check for natural frequencies away from omega = 0 - if (digital) + if (discrete) ## The 2nd conditions prevents log(0) in the next log command iiz = find (abs(zer-1) > norm(zer)*eps && abs(zer) > norm(zer)*eps); iip = find (abs(pol-1) > norm(pol)*eps && abs(pol) > norm(pol)*eps); @@ -114,8 +114,8 @@ error ("freqbounds: second argument invalid"); endswitch - ## run digital frequency all the way to pi - if (digital) + ## run discrete frequency all the way to pi + if (discrete) dec_max = log10 (pi/tsam); endif Modified: trunk/octave-forge/main/control/inst/__timeresp__.m =================================================================== --- trunk/octave-forge/main/control/inst/__timeresp__.m 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/inst/__timeresp__.m 2010-04-20 15:32:57 UTC (rev 7212) @@ -35,19 +35,19 @@ [A, B, C, D, tsam] = ssdata (sys); - digital = ! isct (sys); # static gains are treated as analog systems + discrete = ! isct (sys); # static gains are treated as analog systems - if (digital) + if (discrete) if (! isempty (dt)) - warning ("timeresp: argument dt has no effect on sampling time of digital system"); + warning ("timeresp: argument dt has no effect on sampling time of discrete system"); endif dt = tsam; endif - [tfinal, dt] = __simhorizon__ (A, digital, tfinal, dt); + [tfinal, dt] = __simhorizon__ (A, discrete, tfinal, dt); - if (! digital) + if (! discrete) sys = c2d (sys, dt, "zoh"); endif @@ -119,7 +119,7 @@ u = zeros (m, 1); u(j) = 1; - if (digital) + if (discrete) x = zeros (n, 1); # zero by definition y(1, :, j) = D * u / dt; x_arr(1, :, j) = x; @@ -139,7 +139,7 @@ endfor endfor - if (digital) + if (discrete) y *= dt; x_arr *= dt; endif @@ -170,7 +170,7 @@ cols = m; endif - if (digital) # discrete system + if (discrete) # discrete system for k = 1 : p for j = 1 : cols @@ -230,7 +230,7 @@ endfunction -function [tfinal, dt] = __simhorizon__ (A, digital, tfinal, Ts) +function [tfinal, dt] = __simhorizon__ (A, discrete, tfinal, Ts) ## code based on __stepimp__.m of Kai P. Mueller and A. Scottedward Hodel @@ -243,7 +243,7 @@ n = rows (A); eigw = eig (A); - if (digital) + if (discrete) ## perform bilinear transformation on poles in z for k = 1 : n pol = eigw(k); @@ -269,14 +269,14 @@ tfinal = T_DEF; endif - if (! digital) + if (! discrete) dt = tfinal / N_DEF; endif else eigw = eigw(find (eigw)); eigw_max = max (abs (eigw)); - if (! digital) + if (! discrete) dt = 0.2 * pi / eigw_max; endif @@ -289,7 +289,7 @@ tfinal = yy * ceil (tfinal / yy); endif - if (! digital) + if (! discrete) N = tfinal / dt; if (N < N_MIN) Modified: trunk/octave-forge/main/control/inst/hsvd.m =================================================================== --- trunk/octave-forge/main/control/inst/hsvd.m 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/inst/hsvd.m 2010-04-20 15:32:57 UTC (rev 7212) @@ -44,15 +44,15 @@ [a, b, c] = ssdata (sys); - digital = ! isct (sys); + discrete = ! isct (sys); - if (digital) + if (discrete) alpha = 1 - val; else alpha = - val; endif - [hsv, ns] = slab13ad (a, b, c, digital, alpha); + [hsv, ns] = slab13ad (a, b, c, discrete, alpha); idx = 1 : ns; hsv = hsv (idx); Modified: trunk/octave-forge/main/control/inst/lsim.m =================================================================== --- trunk/octave-forge/main/control/inst/lsim.m 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/inst/lsim.m 2010-04-20 15:32:57 UTC (rev 7212) @@ -39,12 +39,12 @@ [A, B, C, D, tsam] = ssdata (sys); - digital = ! isct (sys); # static gains are treated as analog systems + discrete = ! isct (sys); # static gains are treated as analog systems urows = rows (u); ucols = columns (u); - if (digital) # discrete system + if (discrete) # discrete system if (isempty (t)) dt = tsam; tfinal = tsam * (urows - 1); @@ -52,7 +52,7 @@ dt = tsam; tfinal = t; else - warning ("lsim: spacing of time vector has no effect on sampling time of digital system"); + warning ("lsim: spacing of time vector has no effect on sampling time of discrete system"); dt = tsam; tfinal = t(end); endif @@ -116,7 +116,7 @@ outname = __markemptynames__ (outname); endif - if (digital) # discrete system + if (discrete) # discrete system for k = 1 : p subplot (p, 1, k); stairs (t, y(:, k)); Modified: trunk/octave-forge/main/control/inst/place.m =================================================================== --- trunk/octave-forge/main/control/inst/place.m 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/inst/place.m 2010-04-20 15:32:57 UTC (rev 7212) @@ -84,7 +84,7 @@ p = b; sys = a; [a, b] = ssdata (sys); - digital = ! isct (sys); # treat tsam = -1 as continuous system + discrete = ! isct (sys); # treat tsam = -1 as continuous system endif else # place (a, b, p), place (a, b, p, alpha), place (a, b, p, alpha, tol) if (nargin < 3) # nargin > 5 already tested @@ -93,7 +93,7 @@ if (! isnumeric (a) || ! isnumeric (b) || ! issquare (a) || rows (a) != rows (b)) error ("place: matrices a and b not conformal"); endif - digital = 0; # assume continuous system + discrete = 0; # assume continuous system endif endif @@ -114,7 +114,7 @@ endif if (isempty (alpha)) - if (digital) + if (discrete) alpha = 0; else alpha = - norm (a, inf); @@ -125,7 +125,7 @@ tol = 0; endif - [f, iwarn, nfp, nap, nup] = slsb01bd (a, b, wr, wi, digital, alpha, tol); + [f, iwarn, nfp, nap, nup] = slsb01bd (a, b, wr, wi, discrete, alpha, tol); f = -f; # A + B*F --> A - B*F if (iwarn) Modified: trunk/octave-forge/main/control/src/slab13ad.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13ad.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slab13ad.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -64,10 +64,10 @@ Matrix a = args(0).matrix_value (); Matrix b = args(1).matrix_value (); Matrix c = args(2).matrix_value (); - int digital = args(3).int_value (); + int discrete = args(3).int_value (); double alpha = args(4).double_value (); - if (digital == 0) + if (discrete == 0) dico = 'C'; else dico = 'D'; Modified: trunk/octave-forge/main/control/src/slab13bd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13bd.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slab13bd.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -66,9 +66,9 @@ Matrix b = args(1).matrix_value (); Matrix c = args(2).matrix_value (); Matrix d = args(3).matrix_value (); - int digital = args(4).int_value (); + int discrete = args(4).int_value (); - if (digital == 0) + if (discrete == 0) dico = 'C'; else dico = 'D'; Modified: trunk/octave-forge/main/control/src/slab13dd.cc =================================================================== --- trunk/octave-forge/main/control/src/slab13dd.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slab13dd.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -73,10 +73,10 @@ Matrix c = args(2).matrix_value (); Matrix d = args(3).matrix_value (); double* e = 0; - int digital = args(4).int_value (); + int discrete = args(4).int_value (); double tol = args(5).double_value (); - if (digital == 0) + if (discrete == 0) dico = 'C'; else dico = 'D'; Modified: trunk/octave-forge/main/control/src/slsb01bd.cc =================================================================== --- trunk/octave-forge/main/control/src/slsb01bd.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slsb01bd.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -66,11 +66,11 @@ Matrix b = args(1).matrix_value (); ColumnVector wr = args(2).column_vector_value (); ColumnVector wi = args(3).column_vector_value (); - int digital = args(4).int_value (); + int discrete = args(4).int_value (); double alpha = args(5).double_value (); double tol = args(6).double_value (); - if (digital == 1) + if (discrete == 1) dico = 'D'; else dico = 'C'; Modified: trunk/octave-forge/main/control/src/slsb02od.cc =================================================================== --- trunk/octave-forge/main/control/src/slsb02od.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slsb02od.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -81,10 +81,10 @@ Matrix q = args(2).matrix_value (); Matrix r = args(3).matrix_value (); Matrix l = args(4).matrix_value (); - int digital = args(5).int_value (); + int discrete = args(5).int_value (); int ijobl = args(6).int_value (); - if (digital == 0) + if (discrete == 0) dico = 'C'; else dico = 'D'; Modified: trunk/octave-forge/main/control/src/slsb03md.cc =================================================================== --- trunk/octave-forge/main/control/src/slsb03md.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slsb03md.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -67,9 +67,9 @@ Matrix a = args(0).matrix_value (); Matrix c = args(1).matrix_value (); - int dt = args(2).int_value (); + int discrete = args(2).int_value (); - if (dt == 0) + if (discrete == 0) dico = 'C'; else dico = 'D'; Modified: trunk/octave-forge/main/control/src/slsg03ad.cc =================================================================== --- trunk/octave-forge/main/control/src/slsg03ad.cc 2010-04-20 03:57:28 UTC (rev 7211) +++ trunk/octave-forge/main/control/src/slsg03ad.cc 2010-04-20 15:32:57 UTC (rev 7212) @@ -73,9 +73,9 @@ Matrix a = args(0).matrix_value (); Matrix e = args(1).matrix_value (); Matrix x = args(2).matrix_value (); - int dt = args(3).int_value (); + int discrete = args(3).int_value (); - if (dt == 0) + if (discrete == 0) dico = 'C'; else dico = 'D'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |