summaryrefslogtreecommitdiff
path: root/2414/CH2/EX2.7/Ex2_7.sce
diff options
context:
space:
mode:
Diffstat (limited to '2414/CH2/EX2.7/Ex2_7.sce')
-rwxr-xr-x2414/CH2/EX2.7/Ex2_7.sce29
1 files changed, 29 insertions, 0 deletions
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);