errc
errc

Reputation: 1

How can I get the simplify fraction on Scilab?

I was working with the function F(s)=1/s5+5*s4+9*s3+7*s2+2*s and I want to get the individual fractions to apply Laplace.

s= %s
n2=1
d2=s^5+5*s^4+9*s^3+7*s^2+2*s
sist2=syslin('c',n2/d2)
sist2desc=pfss(sist2)


sist2desc  =

   sist2desc(1)

0.5   
---   
 s    

   sist2desc(2)

 0.5    
-----   
2 + s   

   sist2desc(3)

            2     
- 2 - 2s - s      
--------------    
           2   3  
1 + 3s + 3s + s   

This is the output that I get with that code, but I want to get 0.5/s + 0.5/(s+2) -1/s+1 -1/(s+1)

Upvotes: 0

Views: 764

Answers (1)

Stéphane Mottelet
Stéphane Mottelet

Reputation: 3004

Your fraction is a difficult one for Scilab, which uses floating points arithmetics when dealing with polynomials and fractions, as multiple roots degrade the precision of classical root finding method (eigenvalues of companion matrix). Here your denominator has -1 as triple root and triple multiplicity is already too much, as it is shown by

--> roots((s+1)^3*(s+2)*s)
 ans  =

  -2.  
  -1.0000109  
  -0.9999945 + 0.0000095i
  -0.9999945 - 0.0000095i
   0.  

See the discussion @ http://bugzilla.scilab.org/show_bug.cgi?id=15349 for alternative root finding methods. This behavior shows that using Scilab for such academic stuff is a bad idea. It is ok for linear algebra, but not for symbolic calculus.

Upvotes: 1

Related Questions