summaryrefslogtreecommitdiff
path: root/887/CH6/EX6.1/6_1.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /887/CH6/EX6.1/6_1.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '887/CH6/EX6.1/6_1.sce')
-rwxr-xr-x887/CH6/EX6.1/6_1.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/887/CH6/EX6.1/6_1.sce b/887/CH6/EX6.1/6_1.sce
new file mode 100755
index 000000000..5165ac650
--- /dev/null
+++ b/887/CH6/EX6.1/6_1.sce
@@ -0,0 +1,20 @@
+clc
+//ex 6.1
+// given V_in(t)=2*cos(2000*%pi*t+A), A=40*%pi/180
+w=2000*%pi; //omega
+f=w/(2*%pi); //frequency
+A=40*%pi/180; //40 degrees in radians
+//equation of straight line of H_magnitude vs f is x+1000*y-4000=0
+H_max=(4000-f)/1000; //magnitude of H(traansfer function)
+//equation of straight line of H_phase angle vs f is 6000*y=%pi*x (phase angle in radians)
+H_phi=%pi*f/6000; //phase angle of H
+H=H_max*complex(cos(H_phi),sin(H_phi));
+V_in=2*complex(cos(A),sin(A)); //input voltage phasor
+V_out=H*V_in; //output voltage phasor
+V_out_R=real(V_out); //real part
+V_out_I=imag(V_out); //imaginary part
+V_out_max=sqrt((V_out_R^2)+(V_out_I^2)); //peak value
+V_out_phi=atan(V_out_I/V_out_R);
+disp(V_out_max,'peak value of Vout in volts')
+disp(V_out_phi*180/%pi,'phase angle of Vout in degrees')
+disp(f,'with frequency equal to')