summaryrefslogtreecommitdiff
path: root/2048/DEPENDENCIES/cl.sci
blob: 561874cb87a78a6324655403b16f0ad145e39950 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Calculation of closed loop transfer functions
// 11.6

// function [Nu,dNu,Du,dDu,Ny,dNy,Dy,dDy,yvar,uvar] = ...
//    cl(A,dA,B,dB,C,dC,k,S,dS,R,dR,int)
// int>=1 means integrated noise and control law:
// delta u = - (S/R)y
// Evaluates the closed loop transfer function and 
// variances of input and output

function [Nu,dNu,Du,dDu,Ny,dNy,Dy,dDy,yvar,uvar] = ...
   cl(A,dA,B,dB,C,dC,k,S,dS,R,dR,int1)
[zk,dzk] = zpowk(k);

[BS,dBS] = polmul(B,dB,S,dS);
[zBS,dzBS] = polmul(zk,dzk,BS,dBS);
[RA,dRA] = polmul(R,dR,A,dA);
if int1>=1, [RA,dRA] = polmul(RA,dRA,[1 -1],1); end

[D,dD] = poladd(RA,dRA,zBS,dzBS);

[Ny,dNy] = polmul(C,dC,R,dR);
[Nu,dNu] = polmul(C,dC,S,dS);

[Nu,dNu,Du,dDu,uvar] = tfvar(Nu,dNu,D,dD);
[Ny,dNy,Dy,dDy,yvar] = tfvar(Ny,dNy,D,dD);

endfunction;