diff options
Diffstat (limited to '2414/CH2')
-rwxr-xr-x | 2414/CH2/EX2.1/Ex2_1.sce | 13 | ||||
-rwxr-xr-x | 2414/CH2/EX2.2/Ex2_2.sce | 14 | ||||
-rwxr-xr-x | 2414/CH2/EX2.3/Ex2_3.sce | 11 | ||||
-rwxr-xr-x | 2414/CH2/EX2.4/Ex2_4.sce | 17 | ||||
-rwxr-xr-x | 2414/CH2/EX2.5/Ex2_5.sce | 31 | ||||
-rwxr-xr-x | 2414/CH2/EX2.6/Ex2_6.sce | 12 | ||||
-rwxr-xr-x | 2414/CH2/EX2.7/Ex2_7.sce | 29 | ||||
-rwxr-xr-x | 2414/CH2/EX2.8/Ex2_8.sce | 35 | ||||
-rwxr-xr-x | 2414/CH2/EX2.9/Ex2_9.sce | 40 |
9 files changed, 202 insertions, 0 deletions
diff --git a/2414/CH2/EX2.1/Ex2_1.sce b/2414/CH2/EX2.1/Ex2_1.sce new file mode 100755 index 000000000..2c6ca9830 --- /dev/null +++ b/2414/CH2/EX2.1/Ex2_1.sce @@ -0,0 +1,13 @@ +clc;
+
+//page no 31
+//problem 2.1
+//v(t)=12coos(2pi*2000t)
+A=12; //in volts
+disp('V',A,'(a) The amplitude is idetified as');
+w=2*%pi*2000;
+disp('rad/s',w,'(b) The radian frequincy is');
+f=w/(2*%pi);
+disp('Hz',f,'(c) The cyclic frequency is');
+T=1/f;
+disp('s',T,'(d) The period is');
diff --git a/2414/CH2/EX2.2/Ex2_2.sce b/2414/CH2/EX2.2/Ex2_2.sce new file mode 100755 index 000000000..54a0d91d0 --- /dev/null +++ b/2414/CH2/EX2.2/Ex2_2.sce @@ -0,0 +1,14 @@ +clc;
+
+//page no 32
+//problem 2.2
+//i(t)=4cos50t + 3sin50t
+A=4;
+B=3;
+C=sqrt(A^2+B^2); //right triangle
+theta=-1*atan(3/4); //in rad
+disp('rad',theta,'(a) The current is expressed as 5cos(50t + theta),where theta is');
+phi=acot(3/4); //from figure 2.5 in radian
+disp('rad',phi,'(b) The current is expressed as 5sin(50t+phi), where phi is');
+phi=phi*180/%pi;
+disp('degree',phi,'or');
diff --git a/2414/CH2/EX2.3/Ex2_3.sce b/2414/CH2/EX2.3/Ex2_3.sce new file mode 100755 index 000000000..4aacb4b92 --- /dev/null +++ b/2414/CH2/EX2.3/Ex2_3.sce @@ -0,0 +1,11 @@ +clc;
+
+//page no 37
+//problem 2.3
+T=12.5*10^-6; //in sec
+f0=0; //dc
+f1=1/T*10^-3; //in kHz
+f2=f0+2*f1;
+f3=f0+3*f1;
+f4=f0+4*f1;
+disp('kHz',f4,f3,f2,f1,f0,'The lowest five frequencies are (in kH)');
diff --git a/2414/CH2/EX2.4/Ex2_4.sce b/2414/CH2/EX2.4/Ex2_4.sce new file mode 100755 index 000000000..49453e520 --- /dev/null +++ b/2414/CH2/EX2.4/Ex2_4.sce @@ -0,0 +1,17 @@ +clc;
+
+//page no 40
+//problem 2.4
+//all frequencies are in Hz
+f=0;
+f1=500; //fundamental freq.
+f2=1000; f3=1500; //harmonics
+disp(f3,f2,f1,f,'(a) The frequencies in signal are');
+//for plot
+fHz=[0:1600];
+Cn=[5 zeros(1:f1-1) 8 zeros(f1+1:f2-1) 6 zeros(f2+1:f3-1) 3 zeros(f3+1:1600)]
+clf
+plot2d(fHz,Cn,[3],rect=[-0.5,0,1550,10])
+xtitle('Linear amplitude spectrum','f,Hz','Cn(V)')
+xgrid
+disp('(c) The required bandwidth is 1500 Hz');
diff --git a/2414/CH2/EX2.5/Ex2_5.sce b/2414/CH2/EX2.5/Ex2_5.sce new file mode 100755 index 000000000..50ff39f40 --- /dev/null +++ b/2414/CH2/EX2.5/Ex2_5.sce @@ -0,0 +1,31 @@ +clc;
+
+//page no 43
+//problem 2.5
+//All voltages are in V
+//All power in watts
+R=5; //ohm
+C0=5; //dc value
+C1=8;
+C2=6;
+C3=3; //volts
+Vrms=sqrt(C0^2+0.5*(C1^2+C2^2+C3^2)); //rms voltage
+disp(Vrms,'(a) The rms value of voltage is');
+P=Vrms^2/R; //watts
+disp('W',P,'(b) The average power dissipated in resistor is')
+P0=C0^2/R;
+disp(P0,'(c) The dc power is ');
+P1=C1^2/(2*R);
+disp(P1,'The power in fundamental is');
+P2=C2^2/(2*R);
+P3=C3^2/(2*R);
+disp(P3,P2,'The second and third harmonics are');
+//for plot
+fHz=[0:1600];
+f1=500; //fundamental freq.
+f2=1000; f3=1500;
+Pn=[P0 zeros(1:f1-1) P1 zeros(f1+1:f2-1) P2 zeros(f2+1:f3-1) P3 zeros(f3+1:1600)]
+clf
+plot2d(fHz,Pn,[3],rect=[0,0,1600,8])
+xtitle('Power spectrum','f,Hz','Pn(W)')
+xgrid
diff --git a/2414/CH2/EX2.6/Ex2_6.sce b/2414/CH2/EX2.6/Ex2_6.sce new file mode 100755 index 000000000..bd07058f2 --- /dev/null +++ b/2414/CH2/EX2.6/Ex2_6.sce @@ -0,0 +1,12 @@ +clc;
+
+//page no 48
+//problem 2.6
+//All frequencies in Hz
+//There is no dc component
+T=4*10^-3;
+f1=1/T;
+disp(f1,'The fundmental frequency is');
+//The function have only odd numbered components
+disp(9*f1,7*f1,5*f1,3*f1,f1,'The five lowest frequencies are ');
+disp('(b) The rolloff rate is -6dB/octave');
diff --git a/2414/CH2/EX2.7/Ex2_7.sce b/2414/CH2/EX2.7/Ex2_7.sce new file mode 100755 index 000000000..764a5be4b --- /dev/null +++ b/2414/CH2/EX2.7/Ex2_7.sce @@ -0,0 +1,29 @@ +clc;
+
+//page no 51
+//problem 2.7
+//All frequencies in kHz
+//The time is in ms
+//Power in WATTS
+//All voltage in volts
+T=0.2; //ms
+f1=1/T;
+disp(f1,'The fundamental frequency is');
+//There are only odd numbered harmonics
+Ap2p=40; // peak to peak
+R=50; //ohm
+A=Ap2p/2;
+C1=4*A/%pi;
+C3=4*A/(3*%pi);
+C5=4*A/(5*%pi);
+disp('respectively',C5,C3,C1,'The magnitude of fundamental , third and fifth harmonics are ');
+function [Pn]=Power(Cn,R)
+ Pn=Cn^2/(2*R);
+endfunction
+P1=Power(C1,R);
+P3=Power(C3,R);
+P5=Power(C5,R);
+//power is calculated using the function Power defined above
+disp('Frequency Amplitude Power')
+table={f1,C1,P1;3*f1,C3,P3;5*f1,C5,P5};
+disp(table);
diff --git a/2414/CH2/EX2.8/Ex2_8.sce b/2414/CH2/EX2.8/Ex2_8.sce new file mode 100755 index 000000000..3ed483d56 --- /dev/null +++ b/2414/CH2/EX2.8/Ex2_8.sce @@ -0,0 +1,35 @@ +clc;
+
+//page no 52
+//problem 2.8
+//All frequencies in kHz
+//The time is in ms
+//Power in WATTS
+//All voltage in volts
+//following values are copied from Ex2-7
+T=0.2; //ms
+f1=1/T;
+//There are only odd numbered harmonics
+Ap2p=40; // peak to peak
+R=50; //ohm
+A=Ap2p/2;
+C1=4*A/%pi;
+C3=4*A/(3*%pi);
+C5=4*A/(5*%pi);
+function [Pn]=Power(Cn,R)
+ Pn=Cn^2/(2*R);
+endfunction
+P1=Power(C1,R);
+P3=Power(C3,R);
+P5=Power(C5,R);
+
+
+//Ex2-8
+Vrms=A;
+P=Vrms^2/R;
+disp('W',P,'Total power is');
+P135=P1+P3+P5
+disp(P135,'Power of fundamental , third and fifth harmonics is');
+prcnt=P135/P*100;
+disp(prcnt,'The percent of power is ');
+
diff --git a/2414/CH2/EX2.9/Ex2_9.sce b/2414/CH2/EX2.9/Ex2_9.sce new file mode 100755 index 000000000..b945c092e --- /dev/null +++ b/2414/CH2/EX2.9/Ex2_9.sce @@ -0,0 +1,40 @@ +clc;
+clear all;
+//page no 54
+//problem 2.9
+f0=0;
+f1=500; //fundamental freq.
+f2=1000; f3=1500; //harmonics
+
+//Values from ex 2.4
+C=[5 8 6 3]// Values in Volts
+//Values from ex 2.5
+P=[5 6.4 3.6 .9]; //poweer in watts
+clf;
+// plot two sided linear amplitude spectrum
+fHz=-1510:10^-2:1510; //x-axis matrix
+//Y-axis matrix
+Cn=[C(1)]
+for i=2:4
+ Cn=[zeros(-500+10^-2:10^-2:0-10^-2) Cn zeros(0+10^-2:10^-2:500-10^-2)]
+ Cn=[C(i)/2 Cn C(i)/2];
+end
+Cn=[zeros(-10+10^-2:10^-2:0) Cn zeros(0:10^-2:10-10^-2)]
+subplot(211)
+plot2d(fHz,Cn,[2],rect=[-2000,0,2000,6])
+xtitle('Two-sided Linear amplitude spectrum','f,Hz','Vn(V)')
+xgrid
+
+// plot two power spectrum
+fHz=-1510:10^-2:1510; //x-axis matrix
+//Y-axis matrix
+Pn=[P(1)]
+for i=2:4
+ Pn=[zeros(-500+10^-2:10^-2:0-10^-2) Pn zeros(0+10^-2:10^-2:500-10^-2)]
+ Pn=[P(i)/2 Pn P(i)/2];
+end
+Pn=[zeros(-10+10^-2:10^-2:0) Pn zeros(0:10^-2:10-10^-2)]
+subplot(212)
+plot2d(fHz,Pn,[6],rect=[-2000,0,2000,6])
+xtitle('Two-sided power] spectrum','f,Hz','Pn(W)')
+xgrid
|