blob: cabb1b9ee1a66fe7b3a64438f9c14527bcccbaf2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//control systems by Nagoor Kani A
//Edition 3
//Year of publication 2015
//Scilab version 6.0.0
//operating systems windows 10
// Example 4.3
clc;
clear;
s=poly(0,'s')//defines s as poly nomial variable
h=syslin('c',(%e*(0.2*s)/(s*(s+2)*(s+8))))//the given transfer function assiganed to variable h assume K=1
scf(1)
bode(h,0.1,100)//frequency range
show_margins(h)
//calculation of K
K1=10^(30/20)
disp(K1 ,'when gain margin =2db ' )
K2=10^(24/20)
disp(K2,'the value of K when phase margin is 45')
|