From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2414/CH2/EX2.7/Ex2_7.sce | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 2414/CH2/EX2.7/Ex2_7.sce (limited to '2414/CH2/EX2.7') 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); -- cgit