next up previous
Next: Matlab to Scilab Translator Up: Signal Processing Previous: Wiegner filter

Bode plots

-->//First plot using state space representation
-->//
-->//   xd=-2*%pi*x+u
-->//    y=18*%pi*x+u
-->//
-->// h(s)=18*%pi/(s+2*%pi)
-->//
-->   a=-2*%pi;
-->   b=1;
-->   c=18*%pi;
 -->  d=1;
-->   sl=syslin('c',a,b,c,d);ssprint(sl)
.
x = |-6.2831853 |x + | 1 |u
y = | 56.548668 |x + | 1 |
-->   bode(sl,.1,100),
\fbox{\epsfig{file=foo0_70.eps,width=3.75in}}
-->//Second plot using poly
-->   s=poly(0,'s');
-->   h1=1/real((s+2*%pi*(15+100*%i))*(s+2*%pi*(15-100*%i)));
-->   h1=syslin('c',h1)
 h1  =
                1
    -------------------------
                              2
    403666.82 + 188.49556s + s
-->   bode(h1,10,1000,.01),
\fbox{\epsfig{file=foo0_71.eps,width=3.75in}}
//Third plot which combines the first two plots
   bode([h1;sl],.1,1000,.01);
\fbox{\epsfig{file=foo0_72.eps,width=3.75in}}
// series connection
   bode(h1*sl,.1,1000,.01);
\fbox{\epsfig{file=foo0_73.eps,width=3.75in}}



Scilab group