I don't get results doing partial fractions in scilab

65 views Asked by At

I'm starting with scilab. I can't do partial fractions. How can I solve that?

this is my code:

Thanks in advance

num = 22801+4406.18*%s + 382.37*%s^2 + 21.02*%s^3;
den = 22952.25 + 4117.77*%s + 490.63*%s^2 + 33.06*%s^3 + %s^4; // degree(den)>degree(num)
h2 = syslin('c',num/den)
disp(h2)
d = pfss(h2)
disp(d)

and I get this in the console:

     22801 +4406.18s +382.37s^2 +21.02s^3      
   --------------------------------------------  
   22952.25 +4117.77s +490.63s^2 +33.06s^3 +s^4  

  (1) : [1x1 rational] of s
  (2) : [1x1 rational] of s
1

There are 1 answers

0
Stéphane Mottelet On BEST ANSWER

You don't need to build a syslin and the output of pfss is a list, hence you have to type:

d=pfss(num/den);
disp(d(1))
disp(d(2))

which yields

--> d=pfss(num/den);

--> disp(d(1))

   146.58082 +17.508697s  
   ---------------------  
       225 +27s +s^2      

--> disp(d(2))

   34.881291 +3.5113031s  
   ---------------------  
    102.01 +6.06s +s^2