[Scilab-users] Limit command

Pablo Fonovich pablo_f_7 at hotmail.com
Fri Aug 28 02:52:23 CEST 2015


]Im sorry, i forgot to tell you that every polynomial in my final script should be defined the same way that the first one... 

But the corrected script i send you first should work fine

From: pablo_f_7 at hotmail.com
To: users at lists.scilab.org
Date: Thu, 27 Aug 2015 21:45:46 -0300
Subject: Re: [Scilab-users] Limit command




Hi:
Limit IS a scimax function... i used your script and it worked with some modifications...

First of all, the scilab function "roots" need a variable type polinomial as argument... and the symbolic polynomial made by scimas is not this type of variable, so we need to use scimax's function "sym2poly"...
However, sym2poly needs an expanded polynomial as argument... so we first need to use "expand" on the polynomial we want to calculate the roots... So your final script should be:

z = %z;
Syms n z1;
z = z1
X =z *(3*z -(5/6) ) /((z -(1/4) )*(z -(1/3) ))
X1 = expand(denom (X));
X1=sym2poly(X1,'z1');
zp = roots(X1);
X1 = z1 *(3* z1 -(5/6) ) /(( z1 -(1/4) )*(z1 -(1/3) ))
F1 = X1 *( z1 ^(n -1) )*(z1 -zp (1) );
F2 = X1 *( z1 ^(n -1) )*(z1 -zp (2) );
h1 = limit (F1 ,z1 ,zp (1) );
disp (h1 , ' h1 [ n]= ' )
h2 = limit (F2 ,z1 ,zp (2) );
disp (h2 , ' h2 [ n]= ' )
h = h1+h2;
disp (h, ' h [ n]= ' )

Now, the differences in your script and mine could be because the version of scilab or scimax in which the author programmed that script may not be the lasts ones...

I would recommend you to define polynomials with the native scilab functions... scilab has enough functions for polynomials... the script would be:

X =poly([0 1],'z','coeff')*poly([-5/6 3],'z','coeff') /(poly([-1/4 1],'z','coeff')*poly([-1/3 1],'z','coeff') )
X1 = denom (X);
zp = roots(X1);
X1 = z1 *(3* z1 -(5/6) ) /(( z1 -(1/4) )*(z1 -(1/3) ))
F1 = X1 *( z1 ^(n -1) )*(z1 -zp (1) );
F2 = X1 *( z1 ^(n -1) )*(z1 -zp (2) );
h1 = limit (F1 ,z1 ,zp (1) );
disp (h1 , ' h1 [ n]= ' )
h2 = limit (F2 ,z1 ,zp (2) );
disp (h2 , ' h2 [ n]= ' )
h = h1+h2;
disp (h, ' h [ n]= ' )

and the only function from scimax is the "limit" command
 		 	   		  

_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150827/2289fb9f/attachment.htm>


More information about the users mailing list