Let's solve the following differential equation by scilab:
The Laplace transformed is:
What we would:
Let's get the Partial-fraction expansion using Scilab:
s=%s
num=2;
den=s^3*(s^2+2*s+10);
g=syslin('c',num/den);
gf=tf2ss(g);
se=pfss(gf);
Scilab Result:
se =
se(1)
2
0.2 - 0.04s - 0.012s
--------------------
3
s
se(2)
0.064 + 0.012s
--------------
2
10 + 2s + s
|
|
|
With us what the system is:
Let's break down first se(1) by scilab add more lines of code:
Lines to add in Scilab
r=roots(denom(se(1)));
a(3)=horner(s^3*se(1),r(1));
a(2)=horner(derivat(s^3*se(1)),r(1));
a(1)=horner(derivat(derivat(s^3*se(1))),r(1))/2;
for k=1:3,
ds1(k)=a(k)/s^k,
end;
Result in the development of se(1) by Scilab are:
ds1 =
ds1(1)
-0.012
-------
s
ds1(2)
-0.04
------
2
s
ds1(3)
0.2
----
3
s
|
|
|
Thereby partial-fraction expansion of se(1) remains:
The partial-fraction expansion of se2 get:
So the Laplace transformed, we would: