summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorSerge Steer <serge.steer@scilab.org>2010-05-18 12:18:11 +0200
committerYann Collette <yann.collette@scilab.org>2010-05-19 12:54:09 +0200
commitf71da21a597e9e21c2b4ad9589b92b656f22dde0 (patch)
tree6c86beb00e50e34936196ac3d89d951f4d19b342 /scilab
parentb15638d54c98f8232372300c987eba4bb373bddd (diff)
downloadscilab-f71da21a597e9e21c2b4ad9589b92b656f22dde0.zip
scilab-f71da21a597e9e21c2b4ad9589b92b656f22dde0.tar.gz
to fix a problem introduced in 6829 bug fix
Change-Id: I974ec57882e0fb99a8dea41a33f025b0b9a6dc00
Diffstat (limited to 'scilab')
-rw-r--r--scilab/modules/cacsd/macros/kpure.sci14
1 files changed, 7 insertions, 7 deletions
diff --git a/scilab/modules/cacsd/macros/kpure.sci b/scilab/modules/cacsd/macros/kpure.sci
index 5df9503..3479f70 100644
--- a/scilab/modules/cacsd/macros/kpure.sci
+++ b/scilab/modules/cacsd/macros/kpure.sci
@@ -1,10 +1,10 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA - Serge Steer 2// Copyright (C) INRIA - Serge Steer
3// 3//
4// This file must be used under the terms of the CeCILL. 4// This file must be used under the terms of the CeCILL.
5// This source file is licensed as described in the file COPYING, which 5// This source file is licensed as described in the file COPYING, which
6// you should have received as part of this distribution. The terms 6// you should have received as part of this distribution. The terms
7// are also available at 7// are also available at
8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 9
10function [K,R]=kpure(sl,eps) 10function [K,R]=kpure(sl,eps)
@@ -16,7 +16,7 @@ function [K,R]=kpure(sl,eps)
16// and 16// and
17// P(-%i*q)=0 (2) 17// P(-%i*q)=0 (2)
18// because N and D are polynomials with real coefficients. 18// because N and D are polynomials with real coefficients.
19 19
20//Author: Serge Steer, INRIA 20//Author: Serge Steer, INRIA
21 y=[];R=[]; 21 y=[];R=[];
22 msg=_("%s: Wrong type for input argument #%d: Linear state space or a transfer function expected.\n") 22 msg=_("%s: Wrong type for input argument #%d: Linear state space or a transfer function expected.\n")
@@ -24,18 +24,18 @@ function [K,R]=kpure(sl,eps)
24 if size(eps,'*')==2 then eps=eps(2),end //compatibility 24 if size(eps,'*')==2 then eps=eps(2),end //compatibility
25 select typeof(sl) 25 select typeof(sl)
26 case 'rational' then 26 case 'rational' then
27 if size(sl.num,'*') <> 1 then 27 if size(sl.num,'*') <> 1 then
28 error(msprintf(msg,"kpure",1)) 28 error(msprintf(msg,"kpure",1))
29 end 29 end
30 case 'state-space' then 30 case 'state-space' then
31 if size(sl.D,'*') <> 1 then 31 if size(sl.D,'*') <> 1 then
32 error(msprintf(msg,"kpure",1)) 32 error(msprintf(msg,"kpure",1))
33 end 33 end
34 sl=ss2tf(sl) 34 sl=ss2tf(sl)
35 else 35 else
36 error(msprintf(msg,"kpure",1)) 36 error(msprintf(msg,"kpure",1))
37 end 37 end
38 38
39 //(1) give K(s)=-D(s)/N(s) 39 //(1) give K(s)=-D(s)/N(s)
40 s=poly(0,varn(sl.den)) 40 s=poly(0,varn(sl.den))
41 K=-sl.den/sl.num; 41 K=-sl.den/sl.num;
@@ -45,5 +45,5 @@ function [K,R]=kpure(sl,eps)
45 s=imag(s(abs(real(s))<eps)); 45 s=imag(s(abs(real(s))<eps));
46 R=(s(s>0).'*%i); 46 R=(s(s>0).'*%i);
47 //find the K(s) values K(s)=-D(s)/N(s) 47 //find the K(s) values K(s)=-D(s)/N(s)
48 K=-real(freq(den,num,R)) 48 K=-real(freq(sl.den,sl.num,R))
49endfunction 49endfunction