From 8ac15bc5efafa2afc053c293152605b0e6ae60ff Mon Sep 17 00:00:00 2001 From: Siddharth Agarwal Date: Tue, 3 Sep 2019 18:27:40 +0530 Subject: Xcos examples from textbooks and for blocks --- Working_Examples/154/CH13/EX13.2/ch13_2.sce | 31 +++++++++++++++++++++++++++++ Working_Examples/154/CH13/EX13.7/ch13_7.sce | 21 +++++++++++++++++++ Working_Examples/154/CH13/EX13.8/ch13_8.sce | 21 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100755 Working_Examples/154/CH13/EX13.2/ch13_2.sce create mode 100755 Working_Examples/154/CH13/EX13.7/ch13_7.sce create mode 100755 Working_Examples/154/CH13/EX13.8/ch13_8.sce (limited to 'Working_Examples/154/CH13') diff --git a/Working_Examples/154/CH13/EX13.2/ch13_2.sce b/Working_Examples/154/CH13/EX13.2/ch13_2.sce new file mode 100755 index 0000000..b4b8409 --- /dev/null +++ b/Working_Examples/154/CH13/EX13.2/ch13_2.sce @@ -0,0 +1,31 @@ +clc +disp("Problem 13.2") +printf("\n") + +printf("Given") +disp("|Hv|=1/sqrt(2) (1)") +disp("Resistance R1=5kohm") +R1=5000; +disp("Hv(w)=1/1+%i*(w/wx) (2)") +//wx=1/(R1*C2) +//On solving we get +disp("wx=2*10^-4/C2 (3)") + +disp("a)") +C2=10*10^-9; +//Taking modulus of (2) +disp("|Hv(w)|=1/sqrt(1+(w/wx)^2)") +//Equating (1) and (2) +wx=2*10^-4/C2; +fx=(wx/(2*%pi))*10^-3 +printf("Frequency(a) is %3.2fkHz\n",fx) + +disp("b)") +C2b=1*10^-9; +//As frequency is inversely proportional to C2 (from (3)) +fx1=(C2/C2b)*fx +printf("Frequency(b) is %3.2fkHz\n",fx1) + + + + diff --git a/Working_Examples/154/CH13/EX13.7/ch13_7.sce b/Working_Examples/154/CH13/EX13.7/ch13_7.sce new file mode 100755 index 0000000..34dda83 --- /dev/null +++ b/Working_Examples/154/CH13/EX13.7/ch13_7.sce @@ -0,0 +1,21 @@ +clc +disp("Problem 13.7") +printf("\n") + +s=%s; +printf("Given") +H=(10*s)/(s^2+300*s+10^6) +disp(H,"H(s)=") +//From the above transfer function +//Comparing the denominator with s^2+a*s+b with w=sqrt(b) +a=300;b=10^6; +//Therefore center frequency is +w0=sqrt(10^6) +//The lower and upper frequencies are +wl=sqrt(a^2/4+b)-a/2 +wh=sqrt(a^2/4+b)+a/2 +B=wh-wl //It can be inferred that B=a +Q=sqrt(b)/a +printf("\nCenter frequency= %drad/s\n",w0); +printf("Low power frequency = %3.2frad/s\nHigh power frequency = %3.2frad/s\n",wl,wh); +printf("Bandwidth= %drad/s\nQuality factor =%3.2f\n",B,Q) diff --git a/Working_Examples/154/CH13/EX13.8/ch13_8.sce b/Working_Examples/154/CH13/EX13.8/ch13_8.sce new file mode 100755 index 0000000..a2b2331 --- /dev/null +++ b/Working_Examples/154/CH13/EX13.8/ch13_8.sce @@ -0,0 +1,21 @@ +clc +disp("Problem 13.8") +printf("\n") + +s=%s; +printf("Given") +H=(10*s)/(s^2+30*s+10^6) +disp(H,"H(s)=") +//From the above transfer function +//Comparing the denominator with s^2+a*s+b with w=sqrt(b) +a=30;b=10^6; +//Therefore center frequency is +w0=sqrt(10^6) +//The lower and upper frequencies are +wl=sqrt(a^2/4+b)-a/2 +wh=sqrt(a^2/4+b)+a/2 +B=wh-wl +Q=sqrt(b)/a +printf("\nCenter frequency= %drad/s\n",w0); +printf("Low power frequency = %3.2frad/s\nHigh power frequency = %3.2frad/s\n",wl,wh); +printf("Bandwidth= %drad/s\nQuality factor =%3.2f\n",B,Q) -- cgit