File: invrs.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (27 lines) | stat: -rw-r--r-- 581 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 [Sli]=invrs(Sl,alfa);
// Sli=invrs(Sl,alfa) computes Sli, the PSSD
// inverse of PSSD Sl.
//!
// Copyright INRIA
D=Sl(5);
if type(D)==2 then 
  s=poly(0,varn(D));
  Sl(5)=horner(Sl(5),s+alfa);
end
Sl(2)=Sl(2)-alfa*eye(Sl(2)); //Slnew(s)=Slold(s+alfa)

[Sreg,Wss]=rowregul(Sl,0,0);
if rcond(Sreg(5)) >1.d-6 then
  Sli=invsyslin(Sreg)*Wss;
else
  error('square but singular system');
end
[Q,M]=pbig(Sli(2),0.001,'d');
Sli=projsl(Sli,Q,M);//Remove poles at zero.

if Sli(2)~=[] then Sli(2)=Sli(2)+alfa*eye();end
if type(Sli(5))==2 then 
  Sli(5)=horner(Sli(5),s-alfa);
end