<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br>]Im sorry, i forgot to tell you that every polynomial in my final script should be defined the same way that the first one... <br><br>But the corrected script i send you first should work fine<br><br><div><hr id="stopSpelling">From: pablo_f_7@hotmail.com<br>To: users@lists.scilab.org<br>Date: Thu, 27 Aug 2015 21:45:46 -0300<br>Subject: Re: [Scilab-users] Limit command<br><br>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr">Hi:<br>Limit IS a scimax function... i used your script and it worked with some modifications...<br><br>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"...<br>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:<br><br>z = %z;<br>Syms n z1;<br>z = z1<br>X =z *(3*z -(5/6) ) /((z -(1/4) )*(z -(1/3) ))<br>X1 = expand(denom (X));<br>X1=sym2poly(X1,'z1');<br>zp = roots(X1);<br>X1 = z1 *(3* z1 -(5/6) ) /(( z1 -(1/4) )*(z1 -(1/3) ))<br>F1 = X1 *( z1 ^(n -1) )*(z1 -zp (1) );<br>F2 = X1 *( z1 ^(n -1) )*(z1 -zp (2) );<br>h1 = limit (F1 ,z1 ,zp (1) );<br>disp (h1 , ' h1 [ n]= ' )<br>h2 = limit (F2 ,z1 ,zp (2) );<br>disp (h2 , ' h2 [ n]= ' )<br>h = h1+h2;<br>disp (h, ' h [ n]= ' )<br><br><div>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...<br><br>I would recommend you to define polynomials with the native scilab functions... scilab has enough functions for polynomials... the script would be:<br><br>X =poly([0 1],'z','coeff')*poly([-5/6 3],'z','coeff') /(poly([-1/4 1],'z','coeff')*poly([-1/3 1],'z','coeff') )<br>X1 = denom (X);<br>zp = roots(X1);<br>X1 = z1 *(3* z1 -(5/6) ) /(( z1 -(1/4) )*(z1 -(1/3) ))<br>F1 = X1 *( z1 ^(n -1) )*(z1 -zp (1) );<br>F2 = X1 *( z1 ^(n -1) )*(z1 -zp (2) );<br>h1 = limit (F1 ,z1 ,zp (1) );<br>disp (h1 , ' h1 [ n]= ' )<br>h2 = limit (F2 ,z1 ,zp (2) );<br>disp (h2 , ' h2 [ n]= ' )<br>h = h1+h2;<br>disp (h, ' h [ n]= ' )<br><br>and the only function from scimax is the "limit" command<br></div>                                        </div>
<br>_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users</div>                                        </div></body>
</html>