<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I do agree with you. That probably depends on kind of algorithm that function implements.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Actually, I am a teaching assistant in Digital Signal Processing course. I try to get benefit from Scilab to do invert z-Transform.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Specifically, given a rational polynomial, I need to decompose it so as some basic z-Transforms can be applied easily.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’m very grateful to your help!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regard!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Tin Nguyen<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose" target="_top" rel="nofollow" link="external"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></a></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Serge Steer [via Scilab / Xcos - Mailing Lists Archives] [mailto:<a href="/user/SendEmail.jtp?type=node&node=4031451&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>] <br><b>Sent:</b> Thursday, October 30, 2014 1:27 AM<br><b>To:</b> tinnguyen<br><b>Subject:</b> Re: Problem with partial fraction decomposition (dfss)<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Le 29/10/2014 17:01, Tin Nguyen a écrit :<o:p></o:p></p></div><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style='border:none;border-left:solid #CCCCCC 1.5pt;padding:0in 0in 0in 12.0pt;margin-top:5.0pt;margin-bottom:5.0pt'><pre>Thank you so much, Serge Steer!<o:p></o:p></pre><pre>Instead of finding a function like 'residuez' in Matlab, now I need to learn<o:p></o:p></pre><pre>many other things. It's not comfortable.<o:p></o:p></pre><pre>Hope Scilab will become more convenient for general users like me! :D<o:p></o:p></pre></blockquote><p class=MsoNormal>Take care that the Matlab function residuez does not produce exactly the same thing<br>first the residuez help pages states<br>"<i><span style='color:#3366FF'>Numerically, the partial fraction expansion of a ratio of polynomials is an ill-posed problem. If the denominator polynomial is near a polynomial with multiple roots, then small changes in the data, including roundoff errors, can cause arbitrarily large changes in the resulting poles and residues. You should use state-space (or pole-zero representations instead. </span></i>"<br>Moreover this function gives you the residual and you have to decide if some roots are equal or not, to be able to compute the fraction decomposition and this is not a simple thing to do. <br><br>If you do something like<br>P=poly(ones(1,6),'x','r') //(x-1)^6<br>r=roots(P);<br>clf;plot(real(r),imag(r),'*')<br>You can observe that the roots are not exactly equal to one but located on a circle of radius approx %eps^(1/6)~=0.002<br><br>As noticed in the residuez help page <b>the problem is ill-posed</b><br>to be convinced just compute the fraction decomposition of 1/(z-1)^6 using residuez and computing back the fraction<br>>> [r,p,k]=residuez(1,poly(ones(1,6)));<br><br>>> [b,a]=residuez(r,p,k)<br>b =<br> 1.0e+07 *<br> Columns 1 through 4<br> -0.5038 + 0.0008i 2.5335 - 0.0041i -5.0956 + 0.0081i 5.1243 - 0.0081i<br> Columns 5 through 6<br> -2.5765 + 0.0040i 0.5182 - 0.0008i<br>a =<br> 1.0000 -6.0000 15.0000 -20.0000 15.0000 -6.0000 1.0000<br><br><br><b>The problem is ill-posed,</b> <b>so it should be better to avoid its use</b> . What is the problem you want to solve?<br>Serge Steer<br><br><o:p></o:p></p><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: users [<a href="/user/SendEmail.jtp?type=node&node=4031450&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>] On Behalf Of Serge Steer<o:p></o:p></pre><pre>Sent: Thursday, October 23, 2014 2:22 AM<o:p></o:p></pre><pre>To: <a href="/user/SendEmail.jtp?type=node&node=4031450&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre>Subject: Re: [Scilab-users] Problem with partial fraction decomposition<o:p></o:p></pre><pre>(dfss)<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Now you are using a too big value for rmax<o:p></o:p></pre><pre>-->pf = pfss(h)<o:p></o:p></pre><pre> pf =<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre> pf(1)<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> 0.75 - 0.25s<o:p></o:p></pre><pre> ------------<o:p></o:p></pre><pre> 2<o:p></o:p></pre><pre> 1 - 2s + s<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> pf(2)<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> 0.25<o:p></o:p></pre><pre> ----<o:p></o:p></pre><pre> 1 + s<o:p></o:p></pre><pre>Some explanation<o:p></o:p></pre><pre>pfss converts the transfer function to state space representation and then<o:p></o:p></pre><pre>trie to diagonalize the state matrix using the bdiag function<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>-->S=tf2ss(h);<o:p></o:p></pre><pre>-->bdiag(S.A)<o:p></o:p></pre><pre> ans =<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> 1.0000000 - 1.2247449 0.<o:p></o:p></pre><pre> 0. 1. 0.<o:p></o:p></pre><pre> 0. 0. - 1.<o:p></o:p></pre><pre>You can see with result above that there is a 2 by 2 jordan block (for the<o:p></o:p></pre><pre>eigenvalue 1) which exhibits a coupling between the two states Now with<o:p></o:p></pre><pre>-->bdiag(S.A,1/%eps)<o:p></o:p></pre><pre>ans =<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> 1.0000000 0. 0.<o:p></o:p></pre><pre> 0. 1. 0.<o:p></o:p></pre><pre> 0. 0. - 1.<o:p></o:p></pre><pre> The Jordan block has been broken<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>[Ab,X]=bdiag(S.A,1/%eps);cond(X)<o:p></o:p></pre><pre> ans =<o:p></o:p></pre><pre><o:p> </o:p></pre><pre> 5.074D+14<o:p></o:p></pre><pre> bdiag has broken the jordan block using a singular "base change" so the<o:p></o:p></pre><pre>decomposition is a non-sense.<o:p></o:p></pre><pre>Serge Steer<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Le 21/10/2014 12:07, Tin Nguyen a écrit :<o:p></o:p></pre><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style='border:none;border-left:solid #CCCCCC 1.5pt;padding:0in 0in 0in 12.0pt;margin-top:5.0pt;margin-bottom:5.0pt'><pre>Dear Serge Steer,<o:p></o:p></pre><pre>Thank you very much for your response. Your code works fine.<o:p></o:p></pre><pre>However, I still have some problem with this pfss function. For <o:p></o:p></pre><pre>example, I try to decompose a fractional polynomial that has multi-order<o:p></o:p></pre></blockquote><pre>poles.<o:p></o:p></pre><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style='border:none;border-left:solid #CCCCCC 1.5pt;padding:0in 0in 0in 12.0pt;margin-top:5.0pt;margin-bottom:5.0pt'><pre>H(z) = 1 / { (1-s)^2 * (1+s) }<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>You can find following from my console:<o:p></o:p></pre><pre>-->s = poly(0,'s');<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>-->h = 1 / ( (1 + s) * (1 - s)^2)<o:p></o:p></pre><pre> h =<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> 1<o:p></o:p></pre><pre> -------------<o:p></o:p></pre><pre> 2 3<o:p></o:p></pre><pre> 1 - s - s + s<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>-->pf = pfss(h, 1/%eps)<o:p></o:p></pre><pre> pf =<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> <o:p></o:p></pre><pre> pf(1)<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> - 9420237.9<o:p></o:p></pre><pre> -------------<o:p></o:p></pre><pre> - 1.0000000 + s<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> pf(2)<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> 9420237.6<o:p></o:p></pre><pre> ---------<o:p></o:p></pre><pre> - 1 + s<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> pf(3)<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> 0.25<o:p></o:p></pre><pre> ----<o:p></o:p></pre><pre> 1 + s<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>I also checked:<o:p></o:p></pre><pre>-->pf(1)+pf(2)<o:p></o:p></pre><pre> ans =<o:p></o:p></pre><pre> <o:p></o:p></pre><pre> 0.75 - 0.25s<o:p></o:p></pre><pre> ------------<o:p></o:p></pre><pre> 2<o:p></o:p></pre><pre> 1 - 2s + s<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>I have no idea about this situation.<o:p></o:p></pre><pre>Can you help me out! Thank you in advance!<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>--Tin Nguyen<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: users [<a href="/user/SendEmail.jtp?type=node&node=4031450&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a>] On Behalf Of Serge <o:p></o:p></pre><pre>Steer<o:p></o:p></pre><pre>Sent: Tuesday, October 14, 2014 6:36 PM<o:p></o:p></pre><pre>To: <a href="/user/SendEmail.jtp?type=node&node=4031450&i=3" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre>Subject: Re: [Scilab-users] Problem with partial fraction <o:p></o:p></pre><pre>decomposition<o:p></o:p></pre><pre>(dfss)<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>You just need to tune the rmax optionnal parameter pf =<o:p></o:p></pre><pre>pfss(tf2ss(hz),5);length(pf)<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Serge Steer<o:p></o:p></pre><pre>Le 13/10/2014 10:12, tinnguyen a écrit :<o:p></o:p></pre><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style='border:none;border-left:solid #CCCCCC 1.5pt;padding:0in 0in 0in 12.0pt;margin-top:5.0pt;margin-bottom:5.0pt'><pre>Hi guys,<o:p></o:p></pre><pre>I'm having trouble using scilab's function pfss to decompose a <o:p></o:p></pre><pre>polynomial in order to do inverse Z transform. Following is my code:<o:p></o:p></pre><pre>--> z = poly(0,'z')<o:p></o:p></pre><pre>--> hz = z^2 / (1 - 6*z + 11*z^2 - 6*z^3) pf = pfss(tf2ss(hz))<o:p></o:p></pre><pre>--> length(pf)<o:p></o:p></pre><pre>The fourth command returns '1'. However, I believe it should be 3. I <o:p></o:p></pre><pre>also did the decomposition manually and got the result as: hz =<o:p></o:p></pre><pre>0.5/(1-z) + -1 /<o:p></o:p></pre><pre>(1-2*z) + 0.5/(1-3*z).<o:p></o:p></pre><pre>Nevertheless, if I change the numerator of hz from z^2 to z or z^3, <o:p></o:p></pre><pre>pfss works correctly. I definitely have no idea!!!? :D Please take a <o:p></o:p></pre><pre>look and correct me if i'm wrong.<o:p></o:p></pre><pre>Thank you so much!<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>--<o:p></o:p></pre><pre>View this message in context:<o:p></o:p></pre><pre><a href="http://mailinglists.scilab.org/Problem-with-partial-fraction-decompos" target="_top" rel="nofollow" link="external">http://mailinglists.scilab.org/Problem-with-partial-fraction-decompos</a><o:p></o:p></pre><pre>i tion-dfss-tp4031331.html Sent from the Scilab users - Mailing Lists <o:p></o:p></pre><pre>Archives mailing list archive at Nabble.com.<o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>users mailing list<o:p></o:p></pre><pre><a href="/user/SendEmail.jtp?type=node&node=4031450&i=4" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/users" target="_top" rel="nofollow" link="external">http://lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre><pre><o:p> </o:p></pre></blockquote><pre>_______________________________________________<o:p></o:p></pre><pre>users mailing list<o:p></o:p></pre><pre><a href="/user/SendEmail.jtp?type=node&node=4031450&i=5" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/users" target="_top" rel="nofollow" link="external">http://lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>users mailing list<o:p></o:p></pre><pre><a href="/user/SendEmail.jtp?type=node&node=4031450&i=6" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/users" target="_top" rel="nofollow" link="external">http://lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre><pre><o:p> </o:p></pre></blockquote><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>users mailing list<o:p></o:p></pre><pre><a href="/user/SendEmail.jtp?type=node&node=4031450&i=7" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/users" target="_top" rel="nofollow" link="external">http://lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>users mailing list<o:p></o:p></pre><pre><a href="/user/SendEmail.jtp?type=node&node=4031450&i=8" target="_top" rel="nofollow" link="external">[hidden email]</a><o:p></o:p></pre><pre><a href="http://lists.scilab.org/mailman/listinfo/users" target="_top" rel="nofollow" link="external">http://lists.scilab.org/mailman/listinfo/users</a><o:p></o:p></pre><pre><o:p> </o:p></pre><p class=MsoNormal style='margin-bottom:12.0pt'><br><br>_______________________________________________ <br>users mailing list <br><a href="/user/SendEmail.jtp?type=node&node=4031450&i=9" target="_top" rel="nofollow" link="external">[hidden email]</a> <br><a href="http://lists.scilab.org/mailman/listinfo/users" target="_top" rel="nofollow" link="external">http://lists.scilab.org/mailman/listinfo/users</a><br><br><o:p></o:p></p><div class=MsoNormal align=center style='text-align:center'><hr size=1 width="100%" noshade style='color:#CCCCCC' align=center></div><div><div><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";color:#444444'>If you reply to this email, your message will be added to the discussion below:<o:p></o:p></span></b></p></div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma","sans-serif";color:#444444'><a href="http://mailinglists.scilab.org/Problem-with-partial-fraction-decomposition-dfss-tp4031331p4031450.html" target="_top" rel="nofollow" link="external">http://mailinglists.scilab.org/Problem-with-partial-fraction-decomposition-dfss-tp4031331p4031450.html</a> <o:p></o:p></span></p></div><div style='margin-top:4.8pt'><p class=MsoNormal style='line-height:18.0pt'><span style='font-size:8.5pt;font-family:"Tahoma","sans-serif";color:#666666'>To unsubscribe from Problem with partial fraction decomposition (dfss), <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br><a href="http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" target="_top" rel="nofollow" link="external"><span style='font-size:7.0pt;font-family:"Times New Roman","serif"'>NAML</span></a> <o:p></o:p></span></p></div></div>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://mailinglists.scilab.org/Problem-with-partial-fraction-decomposition-dfss-tp4031331p4031451.html">RE: Problem with partial fraction decomposition (dfss)</a><br/>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">Scilab users - Mailing Lists Archives mailing list archive</a> at Nabble.com.<br/>