summaryrefslogtreecommitdiff
path: root/2048/DEPENDENCIES/imc_stable1.sci
blob: 6b8dec788e2c045c73f7e2e01115132e2da1c543 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;