diff options
author | prashantsinalkar | 2018-02-03 11:01:52 +0530 |
---|---|---|
committer | prashantsinalkar | 2018-02-03 11:01:52 +0530 |
commit | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df (patch) | |
tree | 449d555969bfd7befe906877abab098c6e63a0e8 /2048/DEPENDENCIES/specfac.sci | |
parent | d1e070fe2d77c8e7f6ba4b0c57b1b42e26349059 (diff) | |
download | Scilab-TBC-Uploads-7bc77cb1ed33745c720952c92b3b2747c5cbf2df.tar.gz Scilab-TBC-Uploads-7bc77cb1ed33745c720952c92b3b2747c5cbf2df.tar.bz2 Scilab-TBC-Uploads-7bc77cb1ed33745c720952c92b3b2747c5cbf2df.zip |
Diffstat (limited to '2048/DEPENDENCIES/specfac.sci')
-rw-r--r-- | 2048/DEPENDENCIES/specfac.sci | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/2048/DEPENDENCIES/specfac.sci b/2048/DEPENDENCIES/specfac.sci new file mode 100644 index 000000000..1a8ff1332 --- /dev/null +++ b/2048/DEPENDENCIES/specfac.sci @@ -0,0 +1,34 @@ +// Spectral factorization, to solve Eq. 13.47 on page 471.
+// 13.3
+
+// function [r,b,dAFW] = ...
+// specfac(A,degA,B,degB,rho,V,degV,W,degW,F,degF)
+// Implements the spectral factorization for use with LQG control
+// design method of Ahlen and Sternard
+
+function [r,b,dAFW] = ...
+ specfac(A,degA,B,degB,rho,V,degV,W,degW,F,degF)
+AFW = convol(A,convol(W,F));
+dAFW = degA + degF + degW;
+AFWWFA = rho * convol(AFW,flip(AFW));
+BV = convol(B,V);
+dBV = degB + degV;
+BVVB = convol(BV,flip(BV));
+diff1 = dAFW - dBV;
+dBVVB = 2*dBV;
+for i = 1:diff1
+ [BVVB,dBVVB] = polmul(BVVB,dBVVB,[0 1],1);
+end
+[rbb,drbb] = poladd(AFWWFA,2*dAFW,BVVB,dBVVB);
+Rbb = polyno(rbb,'z');
+rts = roots(Rbb);
+rtsin = rts(dAFW+1:2*dAFW);
+b = 1;
+for i = 1:dAFW,
+ b = convol(b,[1 -rtsin(i)]);
+end
+b = real(b);
+br = flip(b);
+bbr = convol(b,br);
+r = rbb(1) / bbr(1);
+endfunction;
|