File: invrs.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-- 579 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