summaryrefslogtreecommitdiff
path: root/773/CH13/EX13.01/13_01.sci
blob: 6a775fc3b70882a77e917293991c1f0acfef39b8 (plain)
1
2
3
4
5
6
7
8
9
10
//polynomial//
s=poly(0,'s'); //Defines s as polynomial variable
F=syslin('c',[20/(s+2)]) //Creates transfer function in forward path
B=syslin('c',(1+0*s)/(1+0*s)) //Creates transfer function in backward path
OL=F*B //Calculates open-loop transfer function
fmin=0.1; //Min freq in Hz
fmax=100; //Max freq in Hz
scf(1);clf;
bode(OL,fmin,fmax); //Plots frequency response of open-loop system in Bode diagram
show_margins(OL) //display gain and phase margin and associated crossover frequencies