File: macglov.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (27 lines) | stat: -rw-r--r-- 604 bytes parent folder | download
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
function [P,r]=macglov(Sl)
//[P,r]=macglov(Sl)
//Standard plant for the Glover-McFarlane problem:
// for this problem mu_optimal = 1-hankel_norm([N,M])
// with [N,M]=LCF(Sl) (Normalized coprime factorization)
// gama_optimal = 1/sqrt(mu_optimal)
//!
//FD.
// Copyright INRIA
flag=0;Sl1=Sl(1);
if Sl1(1)=='r' then Sl=tf2ss(Sl),flag=1;end
[A,B,C,D]=Sl(2:5);[n,nb]=size(B);[nc,n]=size(C);
r=size(D);
[Z,H]=gfare(Sl);
R1=eye+D*D';
R12=sqrtm(R1);
Ap=A;
Bp=[-H*R12,B];
Cp=[C;0*ones(nb,n);C];
Dp=[R12,0*C*B;
    0*ones(nb,nc),eye(nb,nb);
    R12,D];
P=syslin('c',Ap,Bp,Cp,Dp);
if flag==1 then P=ss2tf(P);end