summaryrefslogtreecommitdiff
path: root/1151/CH4
diff options
context:
space:
mode:
Diffstat (limited to '1151/CH4')
-rwxr-xr-x1151/CH4/EX4.1/example.sce21
-rwxr-xr-x1151/CH4/EX4.10/example10.sce14
-rwxr-xr-x1151/CH4/EX4.11/example11.sce14
-rwxr-xr-x1151/CH4/EX4.12/example12.sce14
-rwxr-xr-x1151/CH4/EX4.13/example13.sce14
-rwxr-xr-x1151/CH4/EX4.14/example14.sce14
-rwxr-xr-x1151/CH4/EX4.15/example15.sce27
-rwxr-xr-x1151/CH4/EX4.16/example16.sce22
-rwxr-xr-x1151/CH4/EX4.17/example17.sce21
-rwxr-xr-x1151/CH4/EX4.18/example18.sce13
-rwxr-xr-x1151/CH4/EX4.19/example19.sce10
-rwxr-xr-x1151/CH4/EX4.20/example20.sce12
-rwxr-xr-x1151/CH4/EX4.21/example21.sce14
-rwxr-xr-x1151/CH4/EX4.22/example22.sce6
-rwxr-xr-x1151/CH4/EX4.23/example23.sce14
-rwxr-xr-x1151/CH4/EX4.9/example9.sce14
16 files changed, 244 insertions, 0 deletions
diff --git a/1151/CH4/EX4.1/example.sce b/1151/CH4/EX4.1/example.sce
new file mode 100755
index 000000000..7bfde7a26
--- /dev/null
+++ b/1151/CH4/EX4.1/example.sce
@@ -0,0 +1,21 @@
+ // bode p l o t is given in the question we have to find transfer function
+s=%s;
+sys = syslin('c',20*s/((s+1)*(s +10)))
+bode(sys)
+show_margins (sys ,'bode')
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
+printf("a) First line has a slope of 20 db/decade indicating a term in numerator ");
+printf("b) At w=1 rad/sec slope changes from +20 db/decade to 0 db/decade indicating a term (s+1)in denominator(net change 0 bd/decade)");
+printf("c) At w=10 rad/sec slope changes from 0 db/decade to- 20b/decade indicating a term (1+s/10)in denominator");
+printf("e) its also mention 20 logK=6")
+k=2;
+disp(K,"K=");
+printf("the given transfer function is G(s)=20*s/((s+1)*(s +10)))");
diff --git a/1151/CH4/EX4.10/example10.sce b/1151/CH4/EX4.10/example10.sce
new file mode 100755
index 000000000..2e843ecff
--- /dev/null
+++ b/1151/CH4/EX4.10/example10.sce
@@ -0,0 +1,14 @@
+ // bode p l o t
+s=%s;
+sys = syslin('c',1000/(s*(0.1*s +1)*(0.001*s +1)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.11/example11.sce b/1151/CH4/EX4.11/example11.sce
new file mode 100755
index 000000000..5a940b02e
--- /dev/null
+++ b/1151/CH4/EX4.11/example11.sce
@@ -0,0 +1,14 @@
+ // bode p l o t
+s=%s;
+sys = syslin('c',16*(1+0.5*s)/(s^2*(0.125*s +1)*(0.1*s +1)))
+bode(sys)
+show_margins (sys ,' bode ' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.12/example12.sce b/1151/CH4/EX4.12/example12.sce
new file mode 100755
index 000000000..5ec83ef3c
--- /dev/null
+++ b/1151/CH4/EX4.12/example12.sce
@@ -0,0 +1,14 @@
+ // bode p l o t
+s=%s;
+sys = syslin('c',50/(s*(0.25*s +1)*(0.1*s +1)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.13/example13.sce b/1151/CH4/EX4.13/example13.sce
new file mode 100755
index 000000000..d589fa988
--- /dev/null
+++ b/1151/CH4/EX4.13/example13.sce
@@ -0,0 +1,14 @@
+ // bode p l o t
+s=%s;
+sys = syslin('c',23.7*(1+s)*(1+0.2*s)/(s*(0.1*s +1)*(3*s +1)*(1+0.5*s)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.14/example14.sce b/1151/CH4/EX4.14/example14.sce
new file mode 100755
index 000000000..16dbf1a7a
--- /dev/null
+++ b/1151/CH4/EX4.14/example14.sce
@@ -0,0 +1,14 @@
+ // bode p l o t
+s=%s;
+sys = syslin('c',512*(s+3)/(s*(s^2+16*s+256)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.15/example15.sce b/1151/CH4/EX4.15/example15.sce
new file mode 100755
index 000000000..58890eaf4
--- /dev/null
+++ b/1151/CH4/EX4.15/example15.sce
@@ -0,0 +1,27 @@
+ // bode p l o t is given already in the question w have to solve the folowing parts
+s=%s;
+sys = syslin('c',10^5/((0.2*s+1)*(0.025*s +1)*(0.01*s +1)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
+printf("a) At w=5 rad/sec slope changes -20 db/decade indicating a term (1+s/5)or(1+0.2*s)in denominator");
+printf("b) At w=40 rad/sec slope changes -60 db/decade indicating a term (1+s/40)^2in denominator(net change -40 bd/decade)");
+printf("c) At w=100 rad/sec slope changes - d80b/decade indicating a term (1+s/100)or(1+0.01*s)in denominator");
+printf("d) its also mention 20 logK=100")
+k=10^5;
+disp(K,"K=");
+printf("the given transfer function is G(s)=10^5/((0.2*s+1)*(0.025*s +1)*(0.01*s +1))");
+p1=-(atan(5*0.2)+2*atan(0.025*5)+atan(0.01*5));
+p2=-(atan(40*0.2)+2*atan(0.025*40)+atan(0.01*40));
+p3=-(atan(100*0.2)+2*atan(0.025*100)+atan(0.01*100));
+disp(p1," at w=5 rad /sec phase change is");
+disp(p2," at w=40 rad /sec phase change is");
+disp(p3," at w=5 rad /sec phase change is");
diff --git a/1151/CH4/EX4.16/example16.sce b/1151/CH4/EX4.16/example16.sce
new file mode 100755
index 000000000..29b86c783
--- /dev/null
+++ b/1151/CH4/EX4.16/example16.sce
@@ -0,0 +1,22 @@
+ // bode p l o t is given in the question we have to find transfer function
+s=%s;
+sys = syslin('c',48/(s*(s +20)*(s^2+2.52*s +16)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
+printf("a) At w=1 rad/sec slope changes -20 db/decade indicating a term K/s \n");
+printf("b) At w=4 rad/sec slope changes from -20 db/decade to -60 db/decade indicating a term (1+2d/w*s+s^2/w^2)in denominator(net change -40 bd/decade)\n ");
+printf("c) At w=10 rad/sec slope changes from -60 db/decade to- 40b/decade indicating a term (1+s/10)in numerator\n");
+printf("d) At w=20 rad/sec slope changes from --40 db/decade to- -60b/decade indicating a term (1+s/20)in denominator\n");
+printf("e) its also mention 20 logK=3.521")
+k=1.5;
+disp(K,"K=");
+printf("the given transfer function is G(s)=48/(s*(s +20)*(s^2+2.52*s +16))");
diff --git a/1151/CH4/EX4.17/example17.sce b/1151/CH4/EX4.17/example17.sce
new file mode 100755
index 000000000..23ffc89b9
--- /dev/null
+++ b/1151/CH4/EX4.17/example17.sce
@@ -0,0 +1,21 @@
+ // bode p l o t is given in the question we have to find transfer function
+s=%s;
+sys = syslin('c',20*s/((s+1)*(s +10)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
+printf("a) First line has a slope of 20 db/decade indicating a term in numerator \n");
+printf("b) At w=1 rad/sec slope changes from +20 db/decade to 0 db/decade indicating a term (s+1)in denominator(net change 0 bd/decade)\n");
+printf("c) At w=10 rad/sec slope changes from 0 db/decade to- 20b/decade indicating a term (1+s/10)in denominator\n");
+printf("e) its also mention 20 logK=6\n")
+k=2;
+disp(K,"K=");
+printf("the given transfer function is G(s)=20*s/((s+1)*(s +10)))\n");
diff --git a/1151/CH4/EX4.18/example18.sce b/1151/CH4/EX4.18/example18.sce
new file mode 100755
index 000000000..014d5efc6
--- /dev/null
+++ b/1151/CH4/EX4.18/example18.sce
@@ -0,0 +1,13 @@
+// given g(s)=100/s(s+6.54)
+printf("given G(s)=g(s)=100/s(s+6.54) \n H(s)=1 \n C(s)/R(s)=G(s)/(1+G(s)*H(s)) \n =100/(s^2+6.54*s+100)");
+printf("compare with w^2/(s^2+2*d*w*s+w^2)");
+w=sqrt(100);
+d=6.54/(2*w);
+wr=w*sqrt(1-2*d^2);
+mr=1/(2*d*sqrt(1-d^2));
+b=w*sqrt(1-2*d^2+sqrt(2-4*d^2+4*d^4));
+disp(w,"undamped natural frequency (in rad/sec)=")
+disp(d,"damping ratio=")
+disp(wr,"resonant frequency (in rad/sec)=")
+disp(mr,"resonance peak=")
+disp(b,"bandwidth of closed loop system(in rad/sec)=")
diff --git a/1151/CH4/EX4.19/example19.sce b/1151/CH4/EX4.19/example19.sce
new file mode 100755
index 000000000..fbaf74fd2
--- /dev/null
+++ b/1151/CH4/EX4.19/example19.sce
@@ -0,0 +1,10 @@
+//givenC(s)/R(s)=G(s)/(1+G(s)*H(s))=w^2/(s^2+2*d*w*s+w^2)
+printf("given R(s)=G(s)/(1+G(s)*H(s))=w^2/(s^2+2*d*w*s+w^2)\n its also given maximum overshoot should not exceed 30 percent ");
+d1=log(0.3);
+d=sqrt(d1^2/(d1^2+%pi^2));
+mr=1/(2*d*sqrt(1-d^2));
+w=10;
+b=w*sqrt(1-2*d^2+sqrt(2-4*d^2+4*d^4));
+disp(d,"damping ratio=")
+disp(mr,"resonance peak=")
+disp(b,"bandwidth of closed loop system(in rad/sec)=")
diff --git a/1151/CH4/EX4.20/example20.sce b/1151/CH4/EX4.20/example20.sce
new file mode 100755
index 000000000..aa7395b6f
--- /dev/null
+++ b/1151/CH4/EX4.20/example20.sce
@@ -0,0 +1,12 @@
+//find %overshoot and peak time
+printf("given mr=1.4 and wr=3 rad/sec");
+p1=poly([1 -1 0.1275],'x','c')
+r=roots(p1)
+disp(r)
+d=sqrt(0.1505)
+mo=exp((-%pi*d)/sqrt(1-d^2))*100;
+disp(mo,"maximum overshoot(in %)")
+wr=3
+w=wr/sqrt(1-2*d^2);
+pt=%pi/(w*sqrt(1-d^2));
+disp(pt,"peak time (in sec)=");
diff --git a/1151/CH4/EX4.21/example21.sce b/1151/CH4/EX4.21/example21.sce
new file mode 100755
index 000000000..962d7bcf0
--- /dev/null
+++ b/1151/CH4/EX4.21/example21.sce
@@ -0,0 +1,14 @@
+ // bode p l o t
+s=%s;
+sys = syslin('c',10/(s*(0.2*s +1)*(0.05*s +1)))
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.22/example22.sce b/1151/CH4/EX4.22/example22.sce
new file mode 100755
index 000000000..434847bca
--- /dev/null
+++ b/1151/CH4/EX4.22/example22.sce
@@ -0,0 +1,6 @@
+printf("given G(s)H(s)=(as+1)/s^2 \n we have to find the value of a for which phase margin is 45 degree\n");
+printf("G(jw)H(jw)=(1+ajw)/(jw)^2 and <G(jw))H(jw)=-180+atan aw\n")
+aw=tan(45);
+a=sqrt(1/sqrt(2));
+printf("the value of a is");
+disp(a);
diff --git a/1151/CH4/EX4.23/example23.sce b/1151/CH4/EX4.23/example23.sce
new file mode 100755
index 000000000..46a5faee8
--- /dev/null
+++ b/1151/CH4/EX4.23/example23.sce
@@ -0,0 +1,14 @@
+ // bode p l o t %e^(-0.3*s)/(s*(1+s)
+s=%s;
+sys = syslin('c',1/(s*(1+s))) //%e^(-0.3*s) has no effect on bode plot
+bode(sys)
+show_margins (sys ,'bode' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" system is unstable ")
+else
+printf (" system is stable ")
+end
diff --git a/1151/CH4/EX4.9/example9.sce b/1151/CH4/EX4.9/example9.sce
new file mode 100755
index 000000000..eabe34b97
--- /dev/null
+++ b/1151/CH4/EX4.9/example9.sce
@@ -0,0 +1,14 @@
+// bode p l o t
+s=%s;
+sys = syslin('c',2500/(s*(s +5)*(s +50)))
+bode(sys)
+show_margins (sys ,' bode ' )
+gm= g_margin (sys)
+pm= p_margin (sys)
+disp (gm ," g a in margin=")
+disp (pm ," phas e margin=")
+if (gm <=0 | pm <=0)
+printf (" sys t em i s u n s t a b l e ")
+else
+printf (" sys t em i s s t a b l e ")
+end