File: st_ility.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 (40 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
function [n,nc,u,sl]=st_ility(sl,tol)
//stabilizability test
// Copyright INRIA
[lhs,rhs]=argn(0)
[a,b,c,d,x0,dom]=sl(2:7);
if dom==[] then 
 dom='c';warning('st_ility: time domain not given => sl assumed continuous!');
end
typ='c';if dom<>'c' then typ='d',end
[na,na]=size(a);[nw,nb]=size(b);
// controllable part
if rhs==1 then 
  if [a,b]~=[] then reltol=1.d-10*norm([a,b],1);else reltol=0;end
  [a,b,u,n]=contr(a,b,[reltol,1.d-10])
         else [a,b,u,n]=contr(a,b,tol)
end;
n=sum(n);nc=n;
if lhs==4 then c=c*u;x0=u'*x0;end
if n<>na then
//order evals uncont. part
  nn=n+1:na
  [v,n1]=schur(a(nn,nn),part(typ,1))
  n=n+n1
//new realization
  if lhs>2 then
        u(:,nn)=u(:,nn)*v
        if lhs==4 then
            a(:,nn)=a(:,nn)*v;a(nn,nn)=v'*a(nn,nn)
            b(nn,:)=v'*b(nn,:)
            c(:,nn)=c(:,nn)*v
            x0(nn)=v'*x0(nn)
        end;
  end;
end;
//
if lhs==4 then sl=syslin(dom,a,b,c,d,x0),end