diff options
Diffstat (limited to '2048/DEPENDENCIES/imc_stable1.sci')
-rw-r--r-- | 2048/DEPENDENCIES/imc_stable1.sci | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/2048/DEPENDENCIES/imc_stable1.sci b/2048/DEPENDENCIES/imc_stable1.sci new file mode 100644 index 000000000..6b8dec788 --- /dev/null +++ b/2048/DEPENDENCIES/imc_stable1.sci @@ -0,0 +1,19 @@ +// Design of internal model controller
+// 10.4
+// Designs Discrete Internal Model Controller
+// for transfer function z^{-k}B(z^{-1})/A(z^{-1})
+// Numerator and Denominator of IMC HQ are outputs
+// Controller is also given in R,S form
+
+function [k,HiN,HiD] = imc_stable1(B,A,k,alpha)
+
+[Kp,d,Bg,Bnmp,Bm] = imcsplit(B,mtlb_logical(1));
+Bg = Kp * Bg;
+Bnmpr = flip(Bnmp);
+Bms = sum(Bm);
+HiN = A;
+HiD = Bms * convol(Bg,Bnmpr);
+k = k+d;
+endfunction;
+
+
|