diff options
Diffstat (limited to '1445/CH2')
51 files changed, 413 insertions, 555 deletions
diff --git a/1445/CH2/EX2.1/Ex2_1.sce b/1445/CH2/EX2.1/Ex2_1.sce index 5e008ab00..9d1060542 100644 --- a/1445/CH2/EX2.1/Ex2_1.sce +++ b/1445/CH2/EX2.1/Ex2_1.sce @@ -1,30 +1,21 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 1 +clc; disp("CHAPTER 2"); disp("EXAMPLE 1"); -//Find the Form Factor of the half-wave rectified sine wave as shown in Fig 2.20 -//Peak value of voltage is Vm -//Period is 2pi -//v=Vm sinwt for 0<wt<pi -//v=0 for pi<wt<2pi - //SOLUTION -//average value Vav by integrating v over 0 to pi and pi to 2pi and dividing by 2pi -//assume Vm=1, as value not given -//The second term of integration not computed as v=0 on the range pi to 2pi +//average value v_av=(integrate('sin(x)','x',0,%pi))/(2*%pi); -//rms value -//assume Vm=1, as value not given +//rms value v_rms=(integrate('sin(x)^2','x',0,%pi))/(2*%pi); v_rms=sqrt(v_rms); ff=v_rms/v_av; -//truncate the answer to 3 digits while displaying: -disp(sprintf("The form factor is %4.3f",ff));//The answer in the textbook is wrongly shown as 1.572 +disp(sprintf("The form factor is %f",ff)); //END diff --git a/1445/CH2/EX2.10/Ex2_10.sce b/1445/CH2/EX2.10/Ex2_10.sce index a4136861e..971167bbd 100644 --- a/1445/CH2/EX2.10/Ex2_10.sce +++ b/1445/CH2/EX2.10/Ex2_10.sce @@ -1,14 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 10 +clc; disp("CHAPTER 2"); disp("EXAMPLE 10"); -//Equations -//If z1, z2 || then net impedance is Z=z1.z2/(z1+z2) -//V=IZ -//Power drawn is = V.I. cos (phi) - //VARIABLE INITIALIZATION v=230; //in Volts z1=3+(%i*4); //impedance in rectangular form in Ohms @@ -26,10 +22,7 @@ endfunction; z=(z1*z2)/(z1+z2); I=v/z; angle=-angle1; //as angle1=angle2 -// -disp(sprintf("The current drawn from the circuit is %2.0f Amp",I)); -disp(sprintf("The net current lags net voltage by %4.2f and ckt is inductive in nature",-angle)); p=v*I*cos(angle*%pi/180); //to convert the angle from degrees to radians -disp(sprintf("The power drawn from the source is %5.3f kW",p/1000)); +disp(sprintf("The power drawn from the source is %f kW",p/1000)); //END diff --git a/1445/CH2/EX2.11/Ex2_11.sce b/1445/CH2/EX2.11/Ex2_11.sce index ba0618572..2ac6e7fd2 100644 --- a/1445/CH2/EX2.11/Ex2_11.sce +++ b/1445/CH2/EX2.11/Ex2_11.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 11 +clc; disp("CHAPTER 2"); disp("EXAMPLE 11"); @@ -8,29 +9,17 @@ disp("EXAMPLE 11"); vdc=100; //DC voltage in Volts vac=100; //AC voltage in Volts f=50; //in Hertz -Idc=10; //dc current in Amperes -Iac=5; //ac current in Amperes - -// coil means a unit of resistence and inductance both -//Impedence Z=R+jXl -//when DC supply is connected to coil, it behaves like a short circuit -//Xl=2.pi.f.L -//since f=0 in DC, Xl=0 ohms -//Therefore, R=Vdc/I - -//Equation to be used -//Z^2=R^2+Xl^2 +I1=10; //in Amperes +I2=5; //in Amperes //SOLUTION -r=vdc/Idc; //resistance of the coil in dc circuit -z=vac/Iac; //impedance of the coil in Ac supply -xl=sqrt((z^2)-(r^2)); // inductive reactance of coil -L=xl/(2*%pi*f); //inductance of the coil -pf=r/z; // power factor pf=R/Z -// -disp(sprintf("The inductive reactance of the coil is %5.2f Ohm",xl)); -disp(sprintf("The inductance of the coil is %4.2f H",L));//text book answer is 0.05 H -disp(sprintf("The power factor of the coil is %3.1f (lagging)",pf)); +r=vdc/I1; +z=vac/I2; +xl=sqrt((z^2)-(r^2)); +L=xl/(2*%pi*f); +pf=r/z; +disp(sprintf("The inductance of the coil is %f H",L)); +disp(sprintf("The power factor of the coil is %f (lagging)",pf)); //END diff --git a/1445/CH2/EX2.13/Ex2_13.sce b/1445/CH2/EX2.13/Ex2_13.sce index 7d6d5143c..fce8566d7 100644 --- a/1445/CH2/EX2.13/Ex2_13.sce +++ b/1445/CH2/EX2.13/Ex2_13.sce @@ -1,49 +1,36 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 13 +clc; disp("CHAPTER 2"); disp("EXAMPLE 13"); -//given -//load of impedance 1+j.1 ohm connected AC Voltage -//AC Voltage represented by V=20.sqrt(2).cos(wt+10) volt - -//to find -//current in form of i=Im.sin(wt+phi) A -// real power - -//Equations to be used -//real Power pr=Vrms.Irms.cos (phi) -// =(Vm/sqrt(2)).(Im/sqrt(2)).cos(phi) -// apparent power pa=Vrms.Irms -// =(Vm/sqrt(2)).(Im/sqrt(2)) -// //VARIABLE INITIALIZATION -z1=1+(%i*1); //impedance in rectangular form in Ohms -v=20*sqrt(2); //amplitude of rms value of voltage in Volts +z=1+(%i*1); //load impedance in rectangular form in Ohms +v=20*sqrt(2); //amplitude of rms value of voltage in Volts //SOLUTION -function [z,angle]=rect2pol(x,y); -z=sqrt((x^2)+(y^2)); //z is impedance & the resultant of x and y -angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees +function [zp,angle]=rect2pol(x,y); //function 'rect2pol()' converts impedance in rectangular form to polar form +zp=sqrt((x^2)+(y^2)); //z= (x) + j(y)= (1)+ j(1); 'zp' is in polar form +angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; //solution (i) -[z,angle]=rect2pol(1,1); +[zp,angle]=rect2pol(1,1); //since x=1 and y=1 v=v/sqrt(2); -angle_v=100; //v=(20/sqrt(2))*sin(ωt+100) -I=v/z; //RMS value of current +angle_v=100; //v=(20/sqrt(2))*sin(ωt+100) +I=v/zp; //RMS value of current angle_I=angle_v-angle; Im=I*sqrt(2); disp(sprintf("(i) The current in load is i = %d sin(ωt+%d) A",Im,angle_I)); //solution (ii) -pr=(v/sqrt(2))*(I*sqrt(2))*cos(angle*(%pi/180)); -disp(sprintf("(ii) The real power is %4.0f W",pr)); +p=(v/sqrt(2))*(I*sqrt(2))*cos(angle*(%pi/180)); +disp(sprintf("(ii) The real power is %f W",p)); //solution (iii) pa=(v/sqrt(2))*(I*sqrt(2)); -disp(sprintf("(ii) The apparent power is %6.2f VAR",pa)); +disp(sprintf("(ii) The apparent power is %f VAR",pa)); //END diff --git a/1445/CH2/EX2.14/Ex2_14.sce b/1445/CH2/EX2.14/Ex2_14.sce index 2a46b86fd..c9eeeb76c 100644 --- a/1445/CH2/EX2.14/Ex2_14.sce +++ b/1445/CH2/EX2.14/Ex2_14.sce @@ -1,13 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 14 +clc; disp("CHAPTER 2"); disp("EXAMPLE 14"); -//given -//EMF e=100.sin(314.t-pi/4) V -//current i=20.sin (314.t-1.5808) Amp - //VARIABLE INITIALIZATION v=100; //amplitude of rms value of voltage in Volts I=20; //amplitude of rms value of current in Amperes @@ -15,42 +12,27 @@ I=20; //amplitude of rms value of current in Amperes //SOLUTION //solution(i) -w=314; //angular frequency in radian/sec, given w.t=314.t +w=314; //angular frequency in radian/sec f=w/(2*%pi); //as w=2*(%pi)*f f=ceil(f); disp(sprintf("(i) The frequency is %d Hz",f)); //solution (ii) E=v/sqrt(2); -angle_E=-45; //in degrees, given in emf equation +angle_E=-45; //in degrees I=I/sqrt(2); -angle_I=-(1.5808*180/%pi); //converting the given angle value in current equation - // to degrees - //text book assumes it to be 90 degrees - // actually the value comes to 90.573168 +angle_I=-90; //in degrees z=E/I; angle=angle_E-angle_I; -disp(sprintf("(ii) The impedance is %d Ω, %d degrees",z,angle));// text book answer is 45 deg - // the value comes to 45.573168 deg - // hence shall use floor() to round -// -//Equation -//Z=R+j.Xl -//Z=Z.cos (phi)+j.Zsin(phi) +disp(sprintf("(ii) The impedance is %d Ω, %d degrees",z,angle)); function [x,y]=pol2rect(mag,angle1); x=mag*cos(angle1*(%pi/180)); //to convert the angle from degrees to radian y=mag*sin(angle1*(%pi/180)); endfunction; -//round the angle value first using floor -angle=floor(angle); -//disp(sprintf(" The angle is %f Degree",angle)); //testing value of angle [r,x]=pol2rect(z,angle); L=x/(2*%pi*f); -// -disp(sprintf(" The resistance is %f Ohm",r));//text book uses format as 5/sqrt(2) -disp(sprintf(" The reactance is %f Ohm",x));//text book uses format as 5/sqrt(2) -disp(sprintf(" The inductance is %6.5f H",L));//text book answer is 0.01126 H +disp(sprintf(" The inductance is %f H",L)); //END diff --git a/1445/CH2/EX2.15/Ex2_15.sce b/1445/CH2/EX2.15/Ex2_15.sce index 4a6ab9086..02d922e8a 100644 --- a/1445/CH2/EX2.15/Ex2_15.sce +++ b/1445/CH2/EX2.15/Ex2_15.sce @@ -1,46 +1,43 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 15 +clc; disp("CHAPTER 2"); disp("EXAMPLE 15"); -//GIVEN -//choke coil takes current of 2 Amp 60 deg lagging -//Applied voltage 200 V 50Hz - //VARIABLE INITIALIZATION -I=2; //in Amperes -angle_I=60; //in degrees -v1=200; //in Volts -f=50; //in Hertz - -//SOLUTION (i) -z1=v1/I; +I=2; //in Amperes +angle_I=60; //in degrees +v1=200; //in Volts +f1=50; //in Hertz +v2=100; //in Volts +f2=25; //in Hertz + +//SOLUTION + +//solution (i): when supply is 200V and frequency is 50 Hz +z1=v1/I; +disp(sprintf("(i) When the supply is 200V and frequency is 50 Hz:")); disp(sprintf("The impedance is %d Ω, %d degrees",z1,angle_I)); -//function to convert from polar form to rectangular form -function [x,y]=pol2rect(mag,angle); -x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians +function [x,y]=pol2rect(mag,angle); //function 'pol2rect()' converts impedance in polar form to rectangular form +x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians y=mag*sin(angle*(%pi/180)); endfunction; [r,x1]=pol2rect(z1,angle_I); disp(sprintf("The resistance is %d Ω",r)); -L=x1/(2*%pi*f); -disp(sprintf("The inductance is %5.3f H",L)); - -//SOLUTION (ii) -//Choke is now connected to 100 V 25 hz power supply -//Howevetr, R and L of the choke will remain the same -//Reactance will change -v2=100; // in volts -f2=25; // in Hz -x2=2*%pi*f2*L; // inductive reactance in the new system -z2=sqrt((r^2)+(x2^2)); // impedance in the new system +L=x1/(2*%pi*f1); +disp(sprintf("The inductance is %f H",L)); + +//solution (ii): when supply is 100V and frequency is 25 Hz +x2=2*%pi*f2*L; +z2=sqrt((r^2)+(x2^2)); angle=atan(x2/r); -I1=v2/z2; // current in the new system -p=v2*I1*cos(-angle); //power consumed -// -//disp(sprintf("The angle is %5.4f ",angle));// text book value is assumed 0.75 -disp(sprintf("The power consumed is %5.1f W",p)); +I1=v2/z2; +p=v2*I1*cos(-angle); +disp(sprintf("(ii) When supply is 100V and frequency is 25 Hz:")); +disp(sprintf("The power consumed is %f W",p)); + +//Answer may be slightly different due to precision of floating point numbers //END diff --git a/1445/CH2/EX2.16/Ex2_16.sce b/1445/CH2/EX2.16/Ex2_16.sce index 1de5edbc7..a838f2925 100644 --- a/1445/CH2/EX2.16/Ex2_16.sce +++ b/1445/CH2/EX2.16/Ex2_16.sce @@ -1,16 +1,17 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 16 +clc; disp("CHAPTER 2"); disp("EXAMPLE 16"); //VARIABLE INITIALIZATION -r1=5; //in Ohms -r2=10; //in Ohms -L1=0.04; //in Henry -L2=0.05; //in Henry -v=200; //in Volts -f=50; //in Hertz +r1=5; //in Ohms +r2=10; //in Ohms +L1=0.04; //in Henry +L2=0.05; //in Henry +v=200; //in Volts +f=50; //in Hertz //SOLUTION @@ -19,32 +20,30 @@ xl1=L1*(2*%pi*f); xl2=L2*(2*%pi*f); z1=r1+(%i*xl1); z2=r2+(%i*xl2); -//function to convert from rectangular form to polar form -function [z,angle]=rect2pol(x,y); -z=sqrt((x^2)+(y^2)); //z is impedance & the resultant of x and y -angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees +function [z,angle]=rect2pol(x,y); //function 'rect2pol()' converts impedance in rectangular form to polar form +z=sqrt((x^2)+(y^2)); //z=(x) + j(y) where 'x' represents resistance and 'y' represents inductive reactance +angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; [z1,angle1]=rect2pol(r1,xl1); [z2,angle2]=rect2pol(r2,xl2); -Y1=1/z1; //admittance +Y1=1/z1; //admittance Y2=1/z2; -//function to convert from polar form to rectangular form -function [x,y]=pol2rect(mag,angle); -x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians +function [x,y]=pol2rect(mag,angle); //function 'pol2rect()' converts admittance in polar form to rectangular form +x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians y=mag*sin(angle*(%pi/180)); endfunction; [G1,B1]=pol2rect(Y1,angle1); [G2,B2]=pol2rect(Y2,angle2); disp("......................................"); disp("SOLUTION (i)"); -disp(sprintf("Conductance of 1st coil is %5.3f S",G1)); -disp(sprintf("Conductance of 2nd coil is %5.3f S",G2)); +disp(sprintf("Conductance of 1st coil is %f S",G1)); +disp(sprintf("Conductance of 2nd coil is %f S",G2)); disp(" "); -disp(sprintf("Susceptance of 1st coil is %5.3f S",B1)); -disp(sprintf("Susceptance of 2nd coil is %5.3f S",B2)); +disp(sprintf("Susceptance of 1st coil is %f S",B1)); +disp(sprintf("Susceptance of 2nd coil is %f S",B2)); disp(" "); -disp(sprintf("Admittance of 1st coil is %5.3f S",Y1)); -disp(sprintf("Admittance of 2nd coil is %5.3f S",Y2)); +disp(sprintf("Admittance of 1st coil is %f S",Y1)); +disp(sprintf("Admittance of 2nd coil is %f S",Y2)); disp("......................................"); //solution (ii) @@ -54,14 +53,14 @@ B=B1+B2; I=v*Y; pf=cos((angle)*(%pi/180)); disp("SOLUTION (ii)"); -disp(sprintf("Total current drawn by the circuit is %5.3f A, %.2f degrees",I,-angle)); -disp(sprintf("Power factor of the circuit is %5.3f (lagging)",pf)); +disp(sprintf("Total current drawn by the circuit is %f A, %f degrees",I,-angle)); +disp(sprintf("Power factor of the circuit is %f (lagging)",pf)); disp("......................................"); //solution (iii) p=v*I*pf; disp("SOLUTION (iii)"); -disp(sprintf("Power absorbed by the circuit is %5.3f kW",p/1000));// text book answer is 2.256 kW +disp(sprintf("Power absorbed by the circuit is %f kW",p/1000)); disp("......................................"); //solution (iv) @@ -73,8 +72,8 @@ endfunction; [r,x]=pol2rect(z,angle); L=x/(2*%pi*f); disp("SOLUTION (iv)"); -disp(sprintf("Resitance of single coil is %5.3f Ω",r));// -disp(sprintf("Inductance of single coil is %5.3f H",L));//inductance not worked out i the etx book +disp(sprintf("Resitance of single coil is %f Ω",r)); +disp(sprintf("Inductance of single coil is %f H",L)); disp("......................................"); //END diff --git a/1445/CH2/EX2.17/Ex2_17.sce b/1445/CH2/EX2.17/Ex2_17.sce index 9b4c7c29e..614c7b42a 100644 --- a/1445/CH2/EX2.17/Ex2_17.sce +++ b/1445/CH2/EX2.17/Ex2_17.sce @@ -1,18 +1,13 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 17 +clc; disp("CHAPTER 2"); disp("EXAMPLE 17"); - -//Given -//AC Voltage e(t)=141.4.sin (120.t) -//Current in the circuit is -//i(t)=14.14.sin (120.t+7.07.cos (120.t+30) - //VARIABLE INITIALIZATION -e=141.4; //in Volts -E=141.4/sqrt(2); //in Volts +e=141.4; //amplitude of e(t) in Volts +E=141.4/sqrt(2); //RMS value of e(t) in Volts angle_E=0; //in degrees //i(t)=(14.14<0)+(7.07<120) i1=14.14; //in Amperes @@ -21,16 +16,16 @@ i2=7.07; //in Amperes angle_i2=120; //in degrees //SOLUTION -//function to convert from polar form to rectangular form -function [x,y]=pol2rect(mag,angle); +function [x,y]=pol2rect(mag,angle); //function 'pol2rect()' converts current in polar form to rectangular form x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians y=mag*sin(angle*(%pi/180)); endfunction; -[i1_x,i1_y]=pol2rect(i1,angle_i1); -[i2_x,i2_y]=pol2rect(i2,angle_i2); +//the given current i(t) is composed of two currents i1(t) and i2(t) +//i1(t) and i2(t) are not mentioned in the book but are considered for the sake of convenience +[i1_x,i1_y]=pol2rect(i1,angle_i1); //i1(t)= 14.14 sin(120t) +[i2_x,i2_y]=pol2rect(i2,angle_i2); //i2(t)=7.07 cos(120t+30) i=(i1_x+i2_x)+(%i*(i1_y+i2_y)); -//function to convert from rectangular form to polar form -function [mag,angle]=rect2pol(x,y); +function [mag,angle]=rect2pol(x,y); //function 'rect2pol()' converts current in rectangular form to polar form mag=sqrt((x^2)+(y^2)); angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; @@ -43,15 +38,15 @@ angle_z=angle_E-angle_I; [r,xc]=pol2rect(z,angle_z); f=50; c=1/(2*%pi*f*(-xc)); -disp(sprintf("(i) The value of resistance is %5.3f Ω",r)); -disp(sprintf(" The value of capacitance is %6.4f μF",c*10^6)); +disp(sprintf("(i) The value of resistance is %f Ω",r)); +disp(sprintf(" The value of capacitance is %f μF",c*10^6)); //solution (ii) pf=cos(angle_z*(%pi/180)); -disp(sprintf("(ii) The power factor is %4.3f ",pf)); +disp(sprintf("(ii) The power factor is %f ",pf)); //solution (iii) p=E*I*pf; -disp(sprintf("(iii) The power absorbed by the source is %d W",p)); +disp(sprintf("(iii) The power absorbed by the source is %f W",p)); //END diff --git a/1445/CH2/EX2.18/Ex2_18.sce b/1445/CH2/EX2.18/Ex2_18.sce index 3f09f083a..b29c61a43 100644 --- a/1445/CH2/EX2.18/Ex2_18.sce +++ b/1445/CH2/EX2.18/Ex2_18.sce @@ -1,15 +1,16 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 18 +clc; disp("CHAPTER 2"); disp("EXAMPLE 18"); //VARIABLE INITIALIZATION -r=10; //in Ohms -v=200; //in Volts -f=50; //in Hertz -I=10; //in Amperes -rc=2; //resistance of coil in Ohms +r=10; //in Ohms +v=200; //in Volts +f=50; //in Hertz +I=10; //in Amperes +rc=2; //resistance of coil in Ohms //SOLUTION @@ -17,21 +18,19 @@ rc=2; //resistance of coil in Ohms z=v/I; xl=sqrt((z^2)-((r+rc)^2)); L=xl/(2*%pi*f); -//disp(sprintf("(i) The Xl of the coil is %3.1f ",xl)); -disp(sprintf("(i) The inductance of the coil is %3.1f H",L*1000));//converting to milli henry +disp(sprintf("(i) The inductance of the coil is %f H",L)); //solution (ii) pf=(r+rc)/z; -disp(sprintf("(ii) The power factor is %3.1f",pf)); +disp(sprintf("(ii) The power factor is %f",pf)); //solution (iii) vl=I*(rc+(%i*xl)); -//function to convert from rectangular form to polar form -function [mag,angle]=rect2pol(x,y); +function [mag,angle]=rect2pol(x,y);//function 'rect2pol()' converts voltage in rectangular form to polar form mag=sqrt((x^2)+(y^2)); angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; [vl,angle_vl]=rect2pol(real(vl),imag(vl)); -disp(sprintf("(iii) The voltage across the coil is %7.3f V, %5.2f degrees",vl,angle_vl)); +disp(sprintf("(iii) The voltage across the coil is %f V, %f degrees",vl,angle_vl)); //END diff --git a/1445/CH2/EX2.19/Ex2_19.sce b/1445/CH2/EX2.19/Ex2_19.sce index 32395bf13..015f1ab16 100644 --- a/1445/CH2/EX2.19/Ex2_19.sce +++ b/1445/CH2/EX2.19/Ex2_19.sce @@ -1,50 +1,51 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 19 +clc; disp("CHAPTER 2"); disp("EXAMPLE 19"); //VARIABLE INITIALIZATION -z1=4+(%i*3); //impedance in rectangular form in Ohms -z2=6-(%i*8); //impedance in rectangular form in Ohms -z3=1.6+(%i*7.2); //impedance in rectangular form in Ohms -v=100 //in volts +z1=4+(%i*3); //impedance in rectangular form in Ohms +z2=6-(%i*8); //impedance in rectangular form in Ohms +z3=1.6+(%i*7.2); //impedance in rectangular form in Ohms +v=100 //in volts //SOLUTION -//solution (i) -//Admittance of each parallel branch Y1 and Y2 +//SOLUTION (i) + +//Y1 and Y2 are admittances of each parallel branch Y1=1/z1; Y2=1/z2; disp("SOLUTION (i)"); -disp(sprintf("Admittance parallel branch 1 is %3.3f %3.3fj S", real(Y1), imag(Y1))); -disp(sprintf("Admittance parallel branch 2 is %3.3f+%3.3fj S", real(Y2), imag(Y2))); +disp(sprintf("Admittance parallel branch 1 is %3f %3fj S", real(Y1), imag(Y1))); +disp(sprintf("Admittance parallel branch 2 is %3f+%3fj S", real(Y2), imag(Y2))); disp(" "); -//solution (ii) -//Total circuit impedance Z=(Z1||Z2)+Z3 -z=z3+(z2*z1)/(z1+z2) +//SOLUTION (ii) + +z=z3+(z2*z1)/(z1+z2) //series and parallel combination of impedances disp("SOLUTION (ii)"); -disp(sprintf("Total circuit impedance is %3.3f %3.3fj S", real(z), imag(z))); -//solution in the book is wrong as there is a total mistake in imaginery part 7.2+0.798=11.598 -// -//solution (iii) -//Supply current I=V/Z -i=v/z; -function [z,angle]=rect2pol(x,y); -z0=sqrt((x^2)+(y^2)); //z is impedance & the resultant of x and y -angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees +disp(sprintf("Total circuit impedance is %3f %3fj S", real(z), imag(z))); +//solution given in the book is wrong as j(7.2+0.798) cannot be equal to j11.598 + +//SOLUTION (iii) + +I=v/z; +function [Z,angle]=rect2pol(x,y); //function 'rect2pol()' converts impedance in rectangular form to polar form +Z=sqrt((x^2)+(y^2)); //z is impedance & the resultant of x and y +angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; -[z, angle]=rect2pol(real(i), imag(i)); +[Z, angle]=rect2pol(real(I), imag(I)); //disp(sprintf("%f, %f",z,angle)); -//disp(sprintf("%f, %f",real(i), imag(i))); +//disp(sprintf("%f, %f",real(I), imag(I))); pf=cos(angle*%pi/180); - disp("SOLUTION (iii)"); -disp(sprintf("The power factor is %4.2f",pf)); -//solution (iv) -//Power supplied by source = VI cosΦ or I^2 . R -P=v*real(i)*pf; +disp(sprintf("The power factor is %f",pf)); + +//SOLUTION (iv) +P=v*real(I)*pf; //power supplied by source is either (VI cosΦ) or (I^2 . R) disp("SOLUTION (iv)"); -disp(sprintf("The power supplied by source is %d watt",P)); -//END +disp(sprintf("The power supplied by source is %f watt",P)); +//END
\ No newline at end of file diff --git a/1445/CH2/EX2.20/Ex2_20.sce b/1445/CH2/EX2.20/Ex2_20.sce index 77d5ad76a..74c8f035b 100644 --- a/1445/CH2/EX2.20/Ex2_20.sce +++ b/1445/CH2/EX2.20/Ex2_20.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 20 // read it as example 19 in the book on page 2.72 +clc; disp("CHAPTER 2"); disp("EXAMPLE 20"); @@ -14,26 +15,26 @@ R=25 //in ohms //Resonance frequency f = (1/2π)sqrt((1/LC)-R^2/L^2) fr=(1/(2*%pi))*sqrt((1/(L*C*10^-6))-(R^2)/(L^2)); disp("SOLUTION (i)"); -disp(sprintf("For parallel circuit,Resonant frquency is %3.2f Hz", fr)); +disp(sprintf("For parallel circuit,Resonant frquency is %3f Hz", fr)); disp(" "); //solution (ii) //Total circuit impedance at resonance is Z=L/RC z=L/(R*C*10^-6); disp("SOLUTION (ii)"); -disp(sprintf("Total impedence at resonance is %3.0f kΩ", z/1000)); +disp(sprintf("Total impedence at resonance is %3f kΩ", z/1000)); // //solution (iii) //Bandwidth (f2-f1)=R/(2.π.L) bw=R/(2*%pi*L); disp("SOLUTION (iii)"); -disp(sprintf("Bandwidth is %3.2f Hz", bw)); +disp(sprintf("Bandwidth is %3f Hz", bw)); // //solution (iv) //Quality factor Q=1/R.sqrt(L/C) Q=(1/R)*sqrt(L/(C*10^-6)); disp("SOLUTION (iv)"); -disp(sprintf("Quality Factor is %3.2f", Q)); +disp(sprintf("Quality Factor is %3f", Q)); //solution in the book is wrong as there is a total mistake in imaginery part 7.2+0.798=11.598 // //END diff --git a/1445/CH2/EX2.22/Ex2_22.sce b/1445/CH2/EX2.22/Ex2_22.sce index 5a3d218e3..992d68318 100644 --- a/1445/CH2/EX2.22/Ex2_22.sce +++ b/1445/CH2/EX2.22/Ex2_22.sce @@ -1,39 +1,33 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT -//Example 22 // read it as example 21 in the book on page 2.75 +//Example 22 (mentioned as 'example 21' in the book) +clc; disp("CHAPTER 2"); disp("EXAMPLE 22"); //VARIABLE INITIALIZATION L=0.1 //in Henry -C=8 //in mf, multiply by 10^-6 to convert to f -R=10 //in ohms +C=8*10^-6 //in Farad +R=10 //in Ohms //SOLUTION //solution (i) -//Resonance frequency for a series RLC circuitf = 1/2.π.sqrt(LC) -fr=1/(2*%pi*sqrt(L*C*10^-6)); +fr=1/(2*%pi*sqrt(L*C)); //resonant frequency disp("SOLUTION (i)"); -disp(sprintf("For series circuit,Resonant frquency is %3.2f Hz", fr)); +disp(sprintf("For series circuit, resonant frquency is %3f Hz", fr)); disp(" "); //solution (ii) -//Q-factor is Q=w.L/R= 2.π,fr.L/R w=2*%pi*fr; Q=w*L/R; disp("SOLUTION (ii)"); -disp(sprintf("The Q-factor at resonance is %3.2f kΩ", Q)); -// +disp(sprintf("The Q-factor at resonance is %3f kΩ", Q)); + //solution (iii) -//Bandwidth, BW, (f2-f1)=R/(2.π.L), where f1,f2 half power frequencies -//f1=fr-BW/2 -//f2=fr+BW/2 bw=R/(2*%pi*L); -f1=fr-bw/2; -f2=fr+bw/2; +f1=fr+bw/2; disp("SOLUTION (iii)"); -disp(sprintf("half frequency 1 is %3.2f Hz", f1)); -disp(sprintf("half frequency 2 is %3.2f Hz", f2));// -// +disp(sprintf("Half power frequencies are %3f Hz and %3f Hz", f1,fr)); + //END diff --git a/1445/CH2/EX2.23/Ex2_23.sce b/1445/CH2/EX2.23/Ex2_23.sce index 7ff187786..c570e9471 100644 --- a/1445/CH2/EX2.23/Ex2_23.sce +++ b/1445/CH2/EX2.23/Ex2_23.sce @@ -1,38 +1,32 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT -//Example 22 // read it as example 22 in the book on page 2.76 +//Example 22 (mentioned as 'example 22' in the book) +clc; disp("CHAPTER 2"); disp("EXAMPLE 23"); -//Given -//Equation of an Ac current with respect to origin -//i=100.sin2.pi.50t -//i=100.sin 100.pi.t -// //VARIABLE INITIALIZATION -A=100 //Amplitude in Amps -f=50 //frquency in Hz -t1=1/600 //sec after wave becomes zero again -a1=86.6 //amplitude at some time t after start +A=100 //amplitude in Amperes +f=50 //frequency in Hz +t1=1/600 //time in seconds after wave becomes zero again +a1=86.6 //amplitude in Amperes at some time 't' after start + //SOLUTION //solution (a) //Amplitude at 1/600 second after it becomes zero -// w=f*2*%pi; //angular speed hp=1/(2*f); //half period, the point where sine beomes zero again after origin -//The hald period , hp, needs to be added to 1/600 sec t=hp+t1; a2=A*sin(w*t); disp("SOLUTION (a)"); -disp(sprintf("Amplitude after 1/600 sec is %3.0f A", a2)); +disp(sprintf("Amplitude after 1/600 sec is %3f A", a2)); disp(" "); //solution (b) //since A=A0.sinwt, t=asin(A/A0)/w t2=(asin(a1/A))/w; disp("SOLUTION (b)"); -disp(sprintf("The time at which amp would be %3.2f is %3.3f sec", a1,t2));//text book answer is 1/300 sec -// +disp(sprintf("The time at which amp would be %f is %3f sec", a1,t2)); //END diff --git a/1445/CH2/EX2.24/Ex2_24.sce b/1445/CH2/EX2.24/Ex2_24.sce index ceb0d8ce0..7d2c67727 100644 --- a/1445/CH2/EX2.24/Ex2_24.sce +++ b/1445/CH2/EX2.24/Ex2_24.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 22 // read it as example 23 in the book on page 2.77 +clc; disp("CHAPTER 2"); disp("EXAMPLE 24"); @@ -17,11 +18,11 @@ rms=Im/2; Iav=Im/%pi; //average current ff=rms/Iav; disp("SOLUTION"); -disp(sprintf("RMS value of current is %3.0f A", rms)); -disp(sprintf("Average value of current is %3.2f A", Iav)); -disp(sprintf("Form Factor of current is %3.2f A", ff)); +disp(sprintf("RMS value of current is %3f A", rms)); +disp(sprintf("Average value of current is %3f A", Iav)); +disp(sprintf("Form Factor of current is %3f A", ff)); disp(" "); -// + //END diff --git a/1445/CH2/EX2.25/Ex2_25.sce b/1445/CH2/EX2.25/Ex2_25.sce index 9ac4777b9..0d45038ac 100644 --- a/1445/CH2/EX2.25/Ex2_25.sce +++ b/1445/CH2/EX2.25/Ex2_25.sce @@ -1,23 +1,23 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 25 // read it as example 24 in the book on page 2.78 +clc; disp("CHAPTER 2"); disp("EXAMPLE 25"); //VARIABLE INITIALIZATION V=350 //Amplitude in Volts -f=50 //frquency in Hz +f=50 //frequency in Hz t1=0.005 //sec after wave becomes zero again -t2=0.008 //sec after waves passes tgrough 0 in -ve direction +t2=0.008 //sec after waves passes through 0 in -ve direction //SOLUTION -//e=E.sin(wt) - +//e=Esinwt //solution (a) -// +//RAmplitude at 1/600 second after it becomes zero w=f*2*%pi; //angular speed v1=V*sin(w*t1); disp("SOLUTION (a)"); -disp(sprintf("Voltage after %.3f sec is %3d V", t1,v1)); +disp(sprintf("Voltage after %f sec is %3f A", t1,v1)); disp(" "); //solution (b) //since wave will pass in -ve direction after half period @@ -25,7 +25,7 @@ hp=1/(2*f); //half period, the point where sine beomes zero t=hp+t2; v2=V*sin(w*t); disp("SOLUTION (b)"); -disp(sprintf("The voltage would be %5.2f V in %.3f sec", v2,t)); +disp(sprintf("The voltage would be %f V %3f sec", v2,t)); // //END diff --git a/1445/CH2/EX2.26/Ex2_26.sce b/1445/CH2/EX2.26/Ex2_26.sce index 05ce350d7..99705bbcd 100644 --- a/1445/CH2/EX2.26/Ex2_26.sce +++ b/1445/CH2/EX2.26/Ex2_26.sce @@ -1,29 +1,30 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 26 // read it as example 25 in the book on page 2.79 +clc; disp("CHAPTER 2"); disp("EXAMPLE 26"); //VARIABLE INITIALIZATION A=100 //Amplitude in Amps f=25 //frquency in Hz -a1=20 //value of current in Amps to be achieved in certain time -a2=100 //value of current in Amps tobe achieved in certain time +a1=20 //svalue in Amps to be achieved in certain time +a2=100 //in Amps //SOLUTION -//i=Im.sin(wt) +//i=Isinwt //solution (a) -// +//RAmplitude at 1/600 second after it becomes zero w=f*2*%pi; //angular speed -//when current attains 20 amp means instantaneous value of i=20 Amp t1=(asin(a1/A))/w; disp("SOLUTION (a)"); -disp(sprintf("The time to reach value %d A is %3.5f sec", a1,t1)); +disp(sprintf("The time to reach value %f A is %3f sec", a1,t1)); disp(" "); -//solution (b)//when current attains 100 amp means instantaneous value of i=100 Amp +//solution (b) +//since wave will pass in -ve direction after half period t2=(asin(a2/A))/w; disp("SOLUTION (a)"); -disp(sprintf("The time to reach value %d A is %3.2f sec", a2,t2)); +disp(sprintf("The time to reach value %f A is %3f sec", a2,t2)); disp(" "); // //END diff --git a/1445/CH2/EX2.27/Ex2_27.sce b/1445/CH2/EX2.27/Ex2_27.sce index a88d01676..a8113eea2 100644 --- a/1445/CH2/EX2.27/Ex2_27.sce +++ b/1445/CH2/EX2.27/Ex2_27.sce @@ -1,15 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 27 // read it as example 26 in the book on page 2.79 +clc; disp("CHAPTER 2"); disp("EXAMPLE 27"); -// Given -//Voltage across the circuit -//v=250.sin (314.t-10) -//current is given by -//i=10.sin(314.t+50) -// //VARIABLE INITIALIZATION V=250; //Amplitude in Volts w=314; //angular spped @@ -41,13 +36,13 @@ angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; [mag,angle]=rect2pol(real(Z),imag(Z)); disp("SOLUTION (a)"); -disp(sprintf("The impedance is %d < %3d Deg", mag,angle));//text book answer is -60 deg +disp(sprintf("The impedance is %f < %3f Deg", mag,angle)); //disp(" "); //power factor=cos(angle) pf=cos(-1*angle*%pi/180); //convert to radians and change sign -disp(sprintf("The power factor is %2.1f", pf)); +disp(sprintf("The power factor is %f", pf)); //Z=R-jXc by comparing real and imag paarts we get -disp(sprintf("The resistance is %3.1fΩ and Reactance is %4.2fΩ", real(Z), imag(Z))); +disp(sprintf("The resistance is %fΩ and Reactance is %3fΩ", real(Z), imag(Z))); disp(" "); // //END diff --git a/1445/CH2/EX2.28/Ex2_28.sce b/1445/CH2/EX2.28/Ex2_28.sce index ce41fd503..daea93794 100644 --- a/1445/CH2/EX2.28/Ex2_28.sce +++ b/1445/CH2/EX2.28/Ex2_28.sce @@ -1,10 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 28 // read it as example 27 in the book on page 2.80 +clc; disp("CHAPTER 2"); disp("EXAMPLE 28"); -// -//Circuit diagram given with 3 branches + //VARIABLE INITIALIZATION z1=2+(%i*3); //impedance in rectangular form in Ohms z2=1-(%i*5); //impedance in rectangular form in Ohms @@ -16,51 +16,43 @@ v=10; //in volts //Total impedance //Total circuit impedance Z=(Z1||Z2)+Z3 z=z1+(z2*z3)/(z2+z3); -//define function +disp("SOLUTION (i)"); +disp(sprintf("Total circuit impedance is %3f %3fj S", real(z), imag(z))); +//Total supply current I=V/Z +//solution (b) +i=v/z; function [mag,angle]=rect2pol(x,y); mag=sqrt((x^2)+(y^2)); //z is impedance & the resultant of x and y angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; -[magZ, angleZ]=rect2pol(real(z),imag(z)); -disp("SOLUTION (i)"); -disp(sprintf("Total circuit impedance is %3.2f+%3.1fj S", real(z), imag(z)));// in rectangula rform -disp(sprintf("Total circuit impedance is %3.2f %3.1f S", magZ, angleZ)); //in polar form - -//solution (b) -//Total supply current I=V/Z -i=v/z; [mag, angle]=rect2pol(real(i), imag(i)); disp("SOLUTION (b)"); -disp(sprintf("Total current is %3.2f <%3.1f Amp",mag,angle)); +disp(sprintf("Total current is %f<%f Amp",mag,angle)); //solution (c) //Vbc=I.Zbc where Zbc=(z2*z3)/(z2+z3) Vbc=i*((z2*z3)/(z2+z3)); [mag1, angle1]=rect2pol(real(Vbc), imag(Vbc)); disp("SOLUTION (c)"); -disp(sprintf("The voltage across the || circuit is %3.2f-%3.2fj",real(Vbc), imag(Vbc))); -disp(sprintf("The voltage across the || circuit is %3.2f <%3.1f",mag1, angle1)); -disp(sprintf("The voltage Vbc lags circuit by %3.2f Deg",angle-angle1)); +disp(sprintf("The voltage across the || circuit is %f<%f",mag1, angle1)); +disp(sprintf("The voltage Vbc lags circuit by %f Deg",angle-angle1)); //solution (d) //i2=Vbc/z2, i3=Vbc/z3 i2=Vbc/z2; i3=Vbc/z3; [mag2, angle2]=rect2pol(real(i2), imag(i2)); [mag3, angle3]=rect2pol(real(i3), imag(i3)); -disp("SOLUTION (d)"); -disp(sprintf("The current across fist branch of || circuit is %3.2f <%3.1f",mag2, angle2)); -disp(sprintf("The current across second branch of || circuit is %3.2f <%3.1f",mag3, angle3)); +disp(sprintf("The current across fist branch of || circuit is %f<%f",mag2, angle2)); +disp(sprintf("The current across second branch of || circuit is %f<%f",mag3, angle3)); //solution (e) pf=cos(-1*angle*%pi/180); disp("SOLUTION (e)"); -disp(sprintf("The power factor is %.3f",pf)); +disp(sprintf("The power factor is %f",pf)); //solution (iv) //Apparent power s=VI, True Power, tp I^2R, Reactive Power, rp=I^2X or VISSin(angle) -s=v*mag; //apparent power -tp=(mag^2)*magZ;//true power -rp=v*mag*sin(-1*angle*%pi/180);//reactive power +s=v*mag; +tp=mag*mag*real(z); +rp=v*mag*sin(-1*angle*%pi/180); disp("SOLUTION (f)"); -disp(sprintf("The Apparent power is %.2f VA",s)); -disp(sprintf("The True power is %.2f W",tp));//text book answer is 16.32 may be due to truncation -disp(sprintf("The Reactive power is %.1f vars",rp)); +disp(sprintf("The Apparent power is %f VA, True power is %f W , Reactive power is %f vars",s,tp,rp)); disp(" "); //END diff --git a/1445/CH2/EX2.29/Ex2_29.sce b/1445/CH2/EX2.29/Ex2_29.sce index e09038cf4..0f2920b3b 100644 --- a/1445/CH2/EX2.29/Ex2_29.sce +++ b/1445/CH2/EX2.29/Ex2_29.sce @@ -1,10 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 29 // read it as example 28 in the book on page 2.83 +clc; disp("CHAPTER 2"); disp("EXAMPLE 29"); -// -//i=120.si(2.pi.f.t) + //VARIABLE INITIALIZATION I=120; //Amplitude in Amps f=60; //Hz @@ -16,11 +16,11 @@ i2=96; //in Amps ,2 to find time taken to reach this w=2*%pi*f; i=I*sin(w*t1); disp("SOLUTION (a)"); -disp(sprintf("The amplitude at time %.3f sec is %.1f Amp", t1,i)); +disp(sprintf("The amplitude at time %f sec is %f Amp", t1,i)); //solution (b) t2=(asin(i2/I))/w; disp("SOLUTION (b)"); -disp(sprintf("The time taken to reach %2.0f Amp is %.5f Sec", i2,t2)); +disp(sprintf("The time taken to reach %f Amp is %f Sec", i2,t2)); disp(" "); // //END diff --git a/1445/CH2/EX2.3/Ex2_3.sce b/1445/CH2/EX2.3/Ex2_3.sce index a6ea8cb77..cb6e00086 100644 --- a/1445/CH2/EX2.3/Ex2_3.sce +++ b/1445/CH2/EX2.3/Ex2_3.sce @@ -1,25 +1,18 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 3 +clc; disp("CHAPTER 2"); disp("EXAMPLE 3"); -//To find average and rms value rectified sine wave shown in Fig. 2.22 - //VARIABLE INITIALIZATION -//Time period T=pi v_m=5; //peak value of voltage in Volts - //SOLUTION -//average value Vav by integrating v over 0 to pi and dividing by pi v_av=(integrate('v_m*sin(x)','x',0,%pi))/(%pi); -//first v squre rms v_rms=(integrate('(v_m*sin(x))^2','x',0,%pi))/(%pi); -//then V rms: The previous variable reused v_rms=sqrt(v_rms); -//truncating display to 3 digits -disp(sprintf("Average value of full wave rectifier sine wave is %4.3f V",v_av));// answer is wrongly shown as 3.185 in the book -//truncating display to 2 digits -disp(sprintf("Effective value of full wave rectifier sine wave is %4.2f V",v_rms)); +disp(sprintf("Average value of full wave rectifier sine wave is %f V",v_av)); +disp(sprintf("Effective value of full wave rectifier sine wave is %f V",v_rms)); + //END diff --git a/1445/CH2/EX2.30/Ex2_30.sce b/1445/CH2/EX2.30/Ex2_30.sce index 7f36ea719..ebe06388b 100644 --- a/1445/CH2/EX2.30/Ex2_30.sce +++ b/1445/CH2/EX2.30/Ex2_30.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 30 // read it as example 29 in the book on page 2.83 +clc; disp("CHAPTER 2"); disp("EXAMPLE 30"); @@ -15,21 +16,21 @@ i3=14.14; //in Amps, to find time when will it occur a //solution (a) w=2*%pi*f; Im=rms*sqrt(2); -disp(sprintf("The equation would be i=%.2f. sin(%f.t)", Im,w)); +disp(sprintf("The equation would be i=%f. sin(%f.t)", Im,w)); t0=(asin(1)/w); //time to reach maxima in +ve direction i=Im*sin(w*t1); disp("SOLUTION (a)"); -disp(sprintf("The amplitude at time %f sec is %.2f Amp", t1,i)); +disp(sprintf("The amplitude at time %f sec is %f Amp", t1,i)); //solution (b) tx=t0+t2; i2=Im*sin(w*tx); disp("SOLUTION (b)"); -disp(sprintf("The amplitude at time %.5f sec is %.2f Amp", t2,i2)); +disp(sprintf("The amplitude at time %f sec is %f Amp", t2,i2)); //solution (c) ty=(asin(i3/Im))/w; t3=t0-ty; //since ty is the time starting from 0, the origin needs to be shifted to maxima disp("SOLUTION (c)"); -disp(sprintf("The amplitude of %.2f Amp would be reached in %.5f Sec", i3,t3)); +disp(sprintf("The amplitude of %f Amp would be reached in %f Sec", i3,t3)); disp(" "); // //END diff --git a/1445/CH2/EX2.31/Ex2_31.sce b/1445/CH2/EX2.31/Ex2_31.sce index 870c20204..a462adcc7 100644 --- a/1445/CH2/EX2.31/Ex2_31.sce +++ b/1445/CH2/EX2.31/Ex2_31.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 31 // read it as example 30 in the book on page 2.84 +clc; disp("CHAPTER 2"); disp("EXAMPLE 31"); @@ -11,10 +12,10 @@ disp("EXAMPLE 31"); //say T=1; // 1 sec Yav=(1/T)*integrate('(10+10*t/T)', 't', 0, 1); -disp(sprintf("The average value of waveform is %.0f", Yav)); +disp(sprintf("The average value of waveform is %f", Yav)); //RMS value Yrms=(1/T).Integral(y^2.dt) from 0 to T Yms=(1/T)*integrate('(10+10*t/T)^2', 't', 0, 1); -disp(sprintf("The RMS value of waveform is %.2f", sqrt(Yms))); +disp(sprintf("The RMS value of waveform is %f", sqrt(Yms))); disp(" "); // //END diff --git a/1445/CH2/EX2.32/Ex2_32.sce b/1445/CH2/EX2.32/Ex2_32.sce index dcbdbaf4a..a48c72871 100644 --- a/1445/CH2/EX2.32/Ex2_32.sce +++ b/1445/CH2/EX2.32/Ex2_32.sce @@ -1,16 +1,15 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 32 // read it as example 31 in the book on page 2.85 +clc; disp("CHAPTER 2"); disp("EXAMPLE 32"); //VARIABLE INITIALIZATION //function of the waveform is deduced to be i=Im.sinΘ //SOLUTION -//Average value of current is Iav=area of rectified wave/interval -//Can be achieved by integration //Iav=(1/2.π).Integral(ydΘ) from 0 to π, and π to 2.π is zero, interval is 2.π -//need to assume values, let Im=1 +// //say Im=1; // in Amp Iav=(1/(2*%pi))*integrate('(Im*sin(th))', 'th', 0, %pi); @@ -19,7 +18,7 @@ Iav=(1/(2*%pi))*integrate('(Im*sin(th))', 'th', 0, %pi); Ims=(1/(2*%pi))*integrate('(Im*sin(th))^2', 'th', 0, %pi); //disp(sprintf("The RMS value of waveform is %f", sqrt(Ims))); ff=sqrt(Ims)/Iav; -disp(sprintf("The form factor of waveform is %.2f",ff)); +disp(sprintf("The form factor of waveform is %f",ff)); disp(" "); // //END diff --git a/1445/CH2/EX2.33/Ex2_33.sce b/1445/CH2/EX2.33/Ex2_33.sce index 3897c5fcc..132e1b1b0 100644 --- a/1445/CH2/EX2.33/Ex2_33.sce +++ b/1445/CH2/EX2.33/Ex2_33.sce @@ -1,9 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 33 // read it as example 32 in the book on page 2.86 +clc; disp("CHAPTER 2"); disp("EXAMPLE 33"); -//Three coils of resistance 20,30,40 ohms and inductance 0.5,0.3 and 0.2 H are connected in series + //VARIABLE INITIALIZATION r1=20; //in Ω r2=30; // @@ -16,17 +17,17 @@ f=50; //Hz //coils connected in series // //SOLUTION -R=r1+r2+r3; //Total resistance -L=l1+l2+l3; //Total inductance -XL=2*%pi*f*L;//inductive reactance +R=r1+r2+r3; +L=l1+l2+l3; +XL=2*%pi*f*L; //impedence Z=sqrt(R*2 +XL^2) Z=sqrt(R^2 +XL^2); I=V/Z; pf=R/Z; pc=V*I*pf; -disp(sprintf("The total current is %.3f Amp", I)); -disp(sprintf("The Power Factor is %.3f lagging", pf)); -disp(sprintf("The Power consumed in the circuit is %.1f W", pc)); +disp(sprintf("The total current is %f Amp", I)); +disp(sprintf("The Power Factor is %f lagging", pf)); +disp(sprintf("The Power consumed in the circuit is %f W", pc)); disp(" "); // //END diff --git a/1445/CH2/EX2.34/Ex2_34.sce b/1445/CH2/EX2.34/Ex2_34.sce index 560d4657d..aecd5a669 100644 --- a/1445/CH2/EX2.34/Ex2_34.sce +++ b/1445/CH2/EX2.34/Ex2_34.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 34 // read it as example 33 in the book on page 2.87 +clc; disp("CHAPTER 2"); disp("EXAMPLE 34"); @@ -11,15 +12,15 @@ V=400; // volts f=50; //Hz // //SOLUTION -XC=1/(2*%pi*f*c); //capacitative reactance +XC=1/(2*%pi*f*c); //impedence Z=sqrt(R^2 +XL^2) Z=sqrt(r^2 +XC^2); I=V/Z; pf=r/Z; pc=V*I*pf; -disp(sprintf("The total current is %.2f Amp", I)); -disp(sprintf("The Power Factor is %.3f leading", pf)); -disp(sprintf("The Power consumed in the circuit is %.0f W",pc)); +disp(sprintf("The total current is %f Amp", I)); +disp(sprintf("The Power Factor is %f leading", pf)); +disp(sprintf("The Power consumed in the circuit is %f W",pc)); disp(" "); // //END diff --git a/1445/CH2/EX2.35/Ex2_35.sce b/1445/CH2/EX2.35/Ex2_35.sce index 6d46b1c66..c205d94bf 100644 --- a/1445/CH2/EX2.35/Ex2_35.sce +++ b/1445/CH2/EX2.35/Ex2_35.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 35 // read it as example 34 in the book on page 2.88 +clc; disp("CHAPTER 2"); disp("EXAMPLE 35"); @@ -19,27 +20,27 @@ XC=1/(2*%pi*f*C); X=XL-XC; Z=sqrt(R^2 +X^2); disp("SOLUTION (a)"); -disp(sprintf("The total impedence is %d Ω", Z)); +disp(sprintf("The total impedence is %f Ω", Z)); I=V/Z; disp("SOLUTION (b)"); -disp(sprintf("The total current is %.3f Amp", I)); +disp(sprintf("The total current is %f Amp", I)); Vr=I*R; Vi=I*XL; Vc=I*XC; disp("SOLUTION (c)"); -disp(sprintf("The voltage across resistance is %.1f V",Vr)); -disp(sprintf("The voltage across inductance is %.1f V",Vi)); -disp(sprintf("The voltage across capacitance is %.1f V",Vc)); +disp(sprintf("The voltage across resistance is %f V",Vr)); +disp(sprintf("The voltage across inductance is %f V",Vi)); +disp(sprintf("The voltage across capacitance is %f V",Vc)); pf=R/Z; pc=V*I*pf; disp("SOLUTION (d)"); -disp(sprintf("The Power Factor is %.2f leading", pf)); +disp(sprintf("The Power Factor is %f leading", pf)); disp("SOLUTION (e)"); -disp(sprintf("The Power consumed in the circuit is %.0f W",pc)); +disp(sprintf("The Power consumed in the circuit is %f W",pc)); //XL=XC f0=1/(2*%pi*sqrt(L*C)); disp("SOLUTION (f)"); -disp(sprintf("Resonance will occur at %.1f Hz",f0));//The text book answer is 39.8 which is apprently wrong +disp(sprintf("Resonance will occur at %f Hz",f0)); disp(" "); // //END diff --git a/1445/CH2/EX2.36/Ex2_36.sce b/1445/CH2/EX2.36/Ex2_36.sce index 7ea401187..3ec7e82b8 100644 --- a/1445/CH2/EX2.36/Ex2_36.sce +++ b/1445/CH2/EX2.36/Ex2_36.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 36 // read it as example 35 in the book on page 2.90 +clc; disp("CHAPTER 2"); disp("EXAMPLE 36"); @@ -17,20 +18,20 @@ f=50; //Hz //conductance g, susceptance b Z12=(R1^2 +XL^2); //squared impedance Z^2 for branch 1 Z22=(R1^2 +C^2); //squared impedance Z^2 for branch 2 -g1=R1/Z12; //conductance +g1=R1/Z12; g2=R2/Z22; -b1=-XL/Z12; //susceptance +b1=-XL/Z12; b2=C/Z22; -g=g1+g2; //Total conductance -b=b1+b2; //Total susceptance -Y=sqrt(g^2+b^2); //Total admittance +g=g1+g2; +b=b1+b2; +Y=sqrt(g^2+b^2); I=V*Y; disp("SOLUTION (a)"); -disp(sprintf("The total current is %.1f Amp", I));//text book answer is 12.3 A +disp(sprintf("The total current is %f Amp", I)); pf=g/Y; disp("SOLUTION (b)"); -disp(sprintf("The power factor is %.3f", pf)); // text book answer is 0.985 +disp(sprintf("The power factor is %f", pf)); disp(" "); // //END diff --git a/1445/CH2/EX2.37/Ex2_37.sce b/1445/CH2/EX2.37/Ex2_37.sce index 692a599ba..e96f6f0fe 100644 --- a/1445/CH2/EX2.37/Ex2_37.sce +++ b/1445/CH2/EX2.37/Ex2_37.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 37 // read it as example 36 in the book on page 2.93 +clc; disp("CHAPTER 2"); disp("EXAMPLE 37"); @@ -20,8 +21,8 @@ Z2=sqrt(R2^2 +C^2); //squared impedance Z^2 for branch 2 i1=V/Z1; i2=V/Z2; disp("SOLUTION (a)"); -disp(sprintf("The current in Branch 1 is %d Amp", i1)); -disp(sprintf("The current in Branch 2 is %d Amp", i2)); +disp(sprintf("The current in Branch 1 is %f Amp", i1)); +disp(sprintf("The current in Branch 2 is %f Amp", i2)); phi1=atan(XL/R1); phi2=%pi/2; //atan(C/R2); //R2=0, output is infinity Icos=i1*cos(phi1)+i2*cos(phi2); // phi in radians @@ -29,11 +30,11 @@ Isin=-i1*sin(phi1)+i2*sin(phi2); // phi in radians I=sqrt(Icos^2+Isin^2); // disp("SOLUTION (b)"); -disp(sprintf("The total current is %.2f Amp", I)); +disp(sprintf("The total current is %f Amp", I)); // -pf=Icos/I; //power factor +pf=Icos/I; disp("SOLUTION (c)"); -disp(sprintf("The power factor is %.3f ", pf)); +disp(sprintf("The power factor is %f ", pf)); disp(" "); // //END diff --git a/1445/CH2/EX2.38/Ex2_38.sce b/1445/CH2/EX2.38/Ex2_38.sce index bce55490e..b429b6181 100644 --- a/1445/CH2/EX2.38/Ex2_38.sce +++ b/1445/CH2/EX2.38/Ex2_38.sce @@ -1,10 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 38 // read it as example 37 in the book on page 2.93 +clc; disp("CHAPTER 2"); disp("EXAMPLE 38"); -// -//Solve exercise 36 by j method + //VARIABLE INITIALIZATION z1=10+15*%i; z2=12-20*%i; @@ -15,10 +15,10 @@ magZ=sqrt(real(Z)^2+imag(Z)^2); I=V/magZ; pf=real(Z)/magZ; disp("SOLUTION (a)"); -disp(sprintf("The current is %.1f Amp", I)); +disp(sprintf("The current is %f Amp", I)); // disp("SOLUTION (b)"); -disp(sprintf("The Power factor is %.3f lagging", pf)); +disp(sprintf("The Power factor is %f", pf)); disp(" "); // //END diff --git a/1445/CH2/EX2.39/Ex2_39.sce b/1445/CH2/EX2.39/Ex2_39.sce index 6fe1c5555..2501085b9 100644 --- a/1445/CH2/EX2.39/Ex2_39.sce +++ b/1445/CH2/EX2.39/Ex2_39.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 39 // read it as example 38 in the book on page 2.94 +clc; disp("CHAPTER 2"); disp("EXAMPLE 39"); @@ -12,14 +13,8 @@ V=200; f=50; E=V+0*%i; // representing as a vector //invZ=1/z1+1/z2; -//Z23=1/Z2+1/Z3 which is equivalent impedance of parallel circuits -//Z13=Z1+Z23 which is symbolic expression of total impedance -// -//SOLUTION Z23=z2*z3/(z2+z3); Z=z1+Z23; -disp("SOLUTION (a)"); -disp(sprintf("The symbolic expression of impedance %.1f+j%.1f Amp",real(Z),imag(Z))); I=E/Z; magI=sqrt(real(I)^2+imag(I)^2); //total current phi=atan(-imag(I)/real(I)); //total phase @@ -43,21 +38,21 @@ i2=e23/z3; magi2=sqrt(real(i2)^2+imag(i2)^2); phii2=atan(imag(i2)/real(i2)); disp("SOLUTION (b)"); -disp(sprintf("The current in Upper branch is %.1f Amp",magi1)); -disp(sprintf("The current in Lower branch is %.1f Amp",magi2)); -disp(sprintf("The Total current is %.2f Amp",magI));//the text book answer is wrongly shown as 328 A +disp(sprintf("The current in Upper branch is %f Amp",magi1)); +disp(sprintf("The current in Lower branch is %f Amp",magi2)); +disp(sprintf("The Total current is %f Amp",magI)); // pf=cos(phi); // disp("SOLUTION (c)"); -disp(sprintf("The Power factor is %.3f", pf)); +disp(sprintf("The Power factor is %f", pf)); // disp("SOLUTION (d)"); -disp(sprintf("The voltage across series branch is %.1f V", mage12)); -disp(sprintf("The voltage across parallel branch is %.0f V", mage23)); +disp(sprintf("The voltage across series branch is %f V", mage12)); +disp(sprintf("The voltage across parallel branch is %f V", mage23)); // -tp=V*magI*pf; //total power +tp=V*magI*pf; disp("SOLUTION (e)"); -disp(sprintf("The total power absorbed in circuit is %d W", tp));// the text book answer is 6480 W +disp(sprintf("The total power absorbed in circuit is %f W", tp)); disp(" "); // //END diff --git a/1445/CH2/EX2.4/Ex2_4.sce b/1445/CH2/EX2.4/Ex2_4.sce index 7045a8f28..d39171e75 100644 --- a/1445/CH2/EX2.4/Ex2_4.sce +++ b/1445/CH2/EX2.4/Ex2_4.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 4 +clc; disp("CHAPTER 2"); disp("EXAMPLE 4"); @@ -9,13 +10,10 @@ v_m=10; //peak value of voltage in Volts angle=60*(%pi/180); //delay angle in radians //SOLUTION -//average value Vav by integrating v over 0 to pi and dividing by pi v_av=(integrate('v_m*sin(x)','x',angle,%pi))/(%pi); -//effective value v_rms=(integrate('(v_m*sin(x))^2','x',angle,%pi))/(%pi); v_rms=sqrt(v_rms); -disp(sprintf("Average value of full wave rectifier sine wave is %4.2f V",v_av));// truncade to two decimals -// //text book answer is 4.78 -disp(sprintf("Effective value of full wave rectifier sine wave is %4.2f V",v_rms));//text book answer is 6.33 +disp(sprintf("Average value of full wave rectifier sine wave is %f V",v_av)); +disp(sprintf("Effective value of full wave rectifier sine wave is %f V",v_rms)); //END diff --git a/1445/CH2/EX2.40/Ex2_40.sce b/1445/CH2/EX2.40/Ex2_40.sce index e70e3d40c..6b07c1b9a 100644 --- a/1445/CH2/EX2.40/Ex2_40.sce +++ b/1445/CH2/EX2.40/Ex2_40.sce @@ -1,12 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 40 // read it as example 39 in the book on page 2.98 +clc; disp("CHAPTER 2"); disp("EXAMPLE 40"); -// -//Given -//V=100.sin(314.t+5) V -//current is i=5.sin (314.t-40) + //VARIABLE INITIALIZATION V=100; // max amplitude of wave w=314; //angular speed @@ -16,12 +14,12 @@ phiI=-40; //phase angle in current in deg // //SOLUTION -phi=phiI-phiV; // phase difference +phi=phiI-phiV; pf=cos(phi*%pi/180); //convert to radians p=(V/sqrt(2))*(I/sqrt(2))*pf; // -disp(sprintf("The Power factor is %.3f lagging", pf)); -disp(sprintf("The Power delivered is %.2f W", p)); +disp(sprintf("The Power factor is %f lagging", pf)); +disp(sprintf("The Power delivered is %f W", p)); disp(" "); // //END diff --git a/1445/CH2/EX2.41/Ex2_41.sce b/1445/CH2/EX2.41/Ex2_41.sce index 48ca080c2..5d1c14a4e 100644 --- a/1445/CH2/EX2.41/Ex2_41.sce +++ b/1445/CH2/EX2.41/Ex2_41.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 41 // read it as example 40 in the book on page 2.99 +clc; disp("CHAPTER 2"); disp("EXAMPLE 41"); @@ -15,18 +16,18 @@ lampI=lampW/lampV; lampR=lampW/lampI^2; //W=I^2.R // disp("SOLUTION (a)"); -disp(sprintf("The resistance of the lamp is t is %.2f Ohms", lampR)); +disp(sprintf("The resistance of the lamp is t is %f Ohms", lampR)); // //in purely resistive / non inductive circuit,V=IR applies, and R=lampR+R R=V/lampI-lampR; -disp(sprintf("The value value of resistor to be placed in series with the lamp is %.0f Ohms", R)); +disp(sprintf("The value value of resistor to be placed in series with the lamp is %f Ohms", R)); // //in case of inductance //XL=2*%pi*f*L; //V=Z.I where Z^2=R^2+XL^2 //L=sqrt((V^2/I^2-R^2)/2*%pi*f) L=sqrt((V/lampI)^2-lampR^2)/(2*%pi*f); -disp(sprintf("The inductive resistance to be placed is %.4f H",L)); +disp(sprintf("The inductive resistance to be placed is %f H",L)); disp(" "); // //END diff --git a/1445/CH2/EX2.42/Ex2_42.sce b/1445/CH2/EX2.42/Ex2_42.sce index 4d3681898..9fba797b9 100644 --- a/1445/CH2/EX2.42/Ex2_42.sce +++ b/1445/CH2/EX2.42/Ex2_42.sce @@ -1,37 +1,34 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 42 // read it as example 41 in the book on page 2.100 +clc; disp("CHAPTER 2"); disp("EXAMPLE 42"); //VARIABLE INITIALIZATION I=10; // max amplitude of wave in Amp -rms1=5; //rms values of current +rms1=5; rms2=7.5; rms3=10; -phi1=30; //phase angles +phi1=30; phi2=-60; phi3=45; -f=50; //frequency in Hz +f=50; //Hz w=2*%pi*f; // //SOLUTION -//in case of sinosoidal wave, average value of alternating quantity = RMS values/1.11 -av1=rms1/1.11; //average values of 1,2,3 currents +av1=rms1/1.11; av2=rms2/1.11; av3=rms3/1.11; disp("SOLUTION (i)"); -disp(sprintf("The average value of 1st current is %.2f Amp", av1)); -disp(sprintf("The average value of 2nd current is %.2f Amp", av2)); -disp(sprintf("The average value of 3rd current is %.2f Amp", av3)); +disp(sprintf("The average value of 1st current is %f Amp", av1)); +disp(sprintf("The average value of 2nd current is %f Amp", av2)); +disp(sprintf("The average value of 3rd current is %f Amp", av3)); // -//instantaneous values of current -//i(t)=RMS.sqrt(2).sin (w.t+phi) -//w=2.pi.f which for 50 Hz coes to 314 disp("SOLUTION (ii)"); -disp(sprintf("The instantaneous value of 1st current is %.2f sin(%.0f*t+%.0f) Amp", rms1*sqrt(2), w,phi1)); -disp(sprintf("The instantaneous value of 2nd current is %.2f sin(%.0f*t%.0f) Amp", rms2*sqrt(2), w,phi2)); -disp(sprintf("The instantaneous value of 3rd current is %.2f sin(%.0f*t+%.0f) Amp", rms3*sqrt(2), w,phi3)); +disp(sprintf("The instantaneous value of 1st current is %f sin(%f*t+%f) Amp", rms1*sqrt(2), w,phi1)); +disp(sprintf("The instantaneous value of 2nd current is %f sin(%f*t%f) Amp", rms2*sqrt(2), w,phi2)); +disp(sprintf("The instantaneous value of 3rd current is %f sin(%f*t+%f) Amp", rms3*sqrt(2), w,phi3)); // //instantaneous values of current at t=100msec=0.1 sec t=0.1; @@ -39,9 +36,9 @@ i1=(rms1*sqrt(2))*(sin(w*t+phi1*%pi/180)); i2=(rms2*sqrt(2))*(sin(w*t+phi2*%pi/180)); i3=(rms3*sqrt(2))*(sin(w*t+phi3*%pi/180)); disp("SOLUTION (iv)"); -disp(sprintf("The instantaneous value of 1st current is %.3f Amp at %.3f Sec", i1, t)); -disp(sprintf("The instantaneous value of 2nd current is %.3f Amp at %.3f Sec", i2, t)); -disp(sprintf("The instantaneous value of 3rd current is %.3f Amp at %.3f Sec", i3, t)); +disp(sprintf("The instantaneous value of 1st current is %f Amp at %f Sec", i1, t)); +disp(sprintf("The instantaneous value of 2nd current is %f Amp at %f Sec", i2, t)); +disp(sprintf("The instantaneous value of 3rd current is %f Amp at %f Sec", i3, t)); disp(" "); // //END diff --git a/1445/CH2/EX2.43/Ex2_43.sce b/1445/CH2/EX2.43/Ex2_43.sce index b4e1f6b76..44090eb66 100644 --- a/1445/CH2/EX2.43/Ex2_43.sce +++ b/1445/CH2/EX2.43/Ex2_43.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 43 // read it as example 42 in the book on page 2.102 +clc; disp("CHAPTER 2"); disp("EXAMPLE 43"); @@ -14,8 +15,8 @@ f=50; //Hz Iav=(1/(2*%pi))*integrate('5+5*sin(th)', 'th',0,2*%pi); Ims=(1/(2*%pi))*integrate('(5+5*sin(th))^2', 'th',0,2*%pi); // -disp(sprintf("The average value of resultant current is %.2f Amp", Iav)); -disp(sprintf("The RMS value of resultant current is %.2f Amp", sqrt(Ims))); +disp(sprintf("The average value of resultant current is %f Amp", Iav)); +disp(sprintf("The RMS value of resultant current is %f Amp", sqrt(Ims))); disp(" "); // //END diff --git a/1445/CH2/EX2.44/Ex2_44.sce b/1445/CH2/EX2.44/Ex2_44.sce index b01b90a84..bd68d8081 100644 --- a/1445/CH2/EX2.44/Ex2_44.sce +++ b/1445/CH2/EX2.44/Ex2_44.sce @@ -1,22 +1,20 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 44 +clc; disp("CHAPTER 2"); disp("EXAMPLE 44"); -//given -//current in the resistor is given by i=4+5.sin wt - 3.cos 3.wt //VARIABLE INITIALIZATION -r=20; //resistance in Ohms +r=20; //in Ohms //SOLUTION -//Power consumed by the resistor is P=P0+P1+P2 p0=(4^2)*r; p1=((5/sqrt(2))^2)*r; p2=((3/sqrt(2))^2)*r; p=p0+p1+p2; I=sqrt(p/r); disp(sprintf("The power consumed by the resistor is %d W",p)); -disp(sprintf("The effective value of current is %.1f A",I)); +disp(sprintf("The effective value of current is %f A",I)); //END diff --git a/1445/CH2/EX2.45/Ex2_45.sce b/1445/CH2/EX2.45/Ex2_45.sce index 9122b5be2..06f1c14ca 100644 --- a/1445/CH2/EX2.45/Ex2_45.sce +++ b/1445/CH2/EX2.45/Ex2_45.sce @@ -1,36 +1,36 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 45 +clc; disp("CHAPTER 2"); disp("EXAMPLE 45"); //VARIABLE INITIALIZATION -L=1.405; //inductance in Henry -r=40; //resistance in Ohms -C=20/(10^6); //capacitance in Farad -v=100; //voltage in Volts +L=1.405; //in Henry +r=40; //in Ohms +c=20/(10^6); //in Farad +v=100; //in Volts //SOLUTION -//resonant frequency f=1/2.pi.sqrt (L.C) -f0=1/(2*%pi*sqrt(L*C)); +f0=1/(2*%pi*sqrt(L*c)); disp(sprintf("The frequency at which the circuit resonates is %d Hz",f0)); I0=v/r; -disp(sprintf("The current drawn from the supply is %.1f A",I0)); +disp(sprintf("The current drawn from the supply is %f A",I0)); xl0=2*%pi*f0*L; z0=sqrt((r^2)+(xl0^2)); vl0=I0*z0; -disp(sprintf("The voltage across the coil is %.1f V",vl0)); +disp(sprintf("The voltage across the coil is %f V",vl0)); -xc0=1/(2*%pi*f0*C); -disp(sprintf("The capcitative reactance is %.1f Ω",xc0)); +xc0=1/(2*%pi*f0*c); +disp(sprintf("The capcitative reactance is %f Ω",xc0)); Q0=(2*%pi*f0*L)/r; -disp(sprintf("The quality factor is %.3f", Q0)); +disp(sprintf("The quality factor is %f", Q0)); bw=r/L; -disp(sprintf("The bandwidth is %.3f Hz",bw)); +disp(sprintf("The bandwidth is %f Hz",bw)); //END diff --git a/1445/CH2/EX2.46/Ex2_46.sce b/1445/CH2/EX2.46/Ex2_46.sce index 8b73830ef..d8a4b6452 100644 --- a/1445/CH2/EX2.46/Ex2_46.sce +++ b/1445/CH2/EX2.46/Ex2_46.sce @@ -1,12 +1,13 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 46 +clc; disp("CHAPTER 2"); disp("EXAMPLE 46"); //VARIABLE INITIALIZATION -I=120-(%i*(50)); //given, current in Amperes -v=8+(%i*(2)); //given, voltage in Volts +I=120-(%i*(50)); //in Amperes +v=8+(%i*(2)); //in Volts //SOLUTION @@ -21,12 +22,12 @@ endfunction; //solution (i) z=v/I; angle_z=angle_v-angle_I; -disp(sprintf("(i) The impedance is %.4f Ω,<%.2f degrees",z,angle_z)); +disp(sprintf("(i) The impedance is %f Ω, %f degrees",z,angle_z)); //solution (ii) phi=angle_z; pf=cos(phi*(%pi/180)); -disp(sprintf("(ii) The power factor is %.3f (lagging)",pf)); +disp(sprintf("(ii) The power factor is %f (lagging)",pf)); //solution (iii) s=v*I; @@ -37,7 +38,7 @@ x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians y=mag*sin(angle*(%pi/180)); endfunction; [p,q]=pol2rect(s,angle_s); -disp(sprintf("(iii) The power consumed is %.2f W",p)); -disp(sprintf(" The reactive power is %.2f VAR",q)); +disp(sprintf("(iii) The power consumed is %f W",p)); +disp(sprintf(" The reactive power is %f VAR",q)); //END diff --git a/1445/CH2/EX2.47/Ex2_47.sce b/1445/CH2/EX2.47/Ex2_47.sce index 1e5f6185b..6bffacc05 100644 --- a/1445/CH2/EX2.47/Ex2_47.sce +++ b/1445/CH2/EX2.47/Ex2_47.sce @@ -1,11 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 47 +clc; disp("CHAPTER 2"); disp("EXAMPLE 47"); -//given -//current in the circuit is 5-j.10 A //VARIABLE INITIALIZATION r=10; //in Ohms xl=8.66; //in Ohms @@ -24,16 +23,14 @@ endfunction; //solution(i) v=I*z; angle_v=angle_I+angle_z; -disp(sprintf("(i) The applied voltage is %.1f V, %.2f degrees",v,angle_v)); +disp(sprintf("(i) The applied voltage is %f V, %f degrees",v,angle_v)); //solution (ii) phi=angle_I-angle_v; pf=cos(phi*(%pi/180)); -disp(sprintf("(ii) The power factor is %.3f (lagging)",pf)); +disp(sprintf("(ii) The power factor is %f (lagging)",pf)); //solution(iii) -//S=phasor voltageXconjugate of phasor current -//Converting v and I from polar to rectangular form s=v*I; angle_s=angle_v-angle_I; //function to convert from polar form to rectangular form @@ -42,7 +39,7 @@ x=mag*cos(angle*(%pi/180)); //to convert the angle from degrees to radians y=mag*sin(angle*(%pi/180)); endfunction; [p,q]=pol2rect(s,angle_s); -disp(sprintf("(iii) The active power is %.2f W",p)); -disp(sprintf(" The reactive power is %.2f VAR",q)); +disp(sprintf("(iii) The active power is %f W",p)); +disp(sprintf(" The reactive power is %f VAR",q)); //END diff --git a/1445/CH2/EX2.48/Ex2_48.sce b/1445/CH2/EX2.48/Ex2_48.sce index 9e93c267b..57c2b0e7b 100644 --- a/1445/CH2/EX2.48/Ex2_48.sce +++ b/1445/CH2/EX2.48/Ex2_48.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 48 +clc; disp("CHAPTER 2"); disp("EXAMPLE 48"); @@ -10,7 +11,6 @@ pf2=0.6; //power factor of 2nd circuit z=1; //this is an assumption //SOLUTION -//convert polar to rectangular form angle1=acos(pf1)*(180/%pi); //in degrees angle2=acos(pf2)*(180/%pi); //in degrees //function to convert from polar form to rectangular form @@ -32,6 +32,6 @@ endfunction; [z,angle]=rect2pol(z_x,z_y); angle_z=nr-angle; pf=cos(angle_z*(%pi/180)); -disp(sprintf("The power factor of the combination is %.3f",pf)); +disp(sprintf("The power factor of the combination is %f",pf)); //END diff --git a/1445/CH2/EX2.49/Ex2_49.sce b/1445/CH2/EX2.49/Ex2_49.sce index a1cd3ec1d..916d4afa2 100644 --- a/1445/CH2/EX2.49/Ex2_49.sce +++ b/1445/CH2/EX2.49/Ex2_49.sce @@ -1,13 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 49 +clc; disp("CHAPTER 2"); disp("EXAMPLE 49"); -//Given -//voltage V=200 <30 -//current 20 <60 and 40 <-30 - //VARIABLE INITIALIZATION v=200; //in Volts angle_v=30; //in degrees @@ -29,7 +26,7 @@ s1=v*I1; angle_s1=-angle_v+angle_I1; disp(sprintf("The apparent power in 1st branch is %d kVA",s1/1000)); [s1_x,s1_y]=pol2rect(s1,angle_s1); -disp(sprintf("The true power in 1st branch is %.3f kW",s1_x/1000)); +disp(sprintf("The true power in 1st branch is %f kW",s1_x/1000)); disp(" "); @@ -38,7 +35,7 @@ angle_s2=angle_v-angle_I2; disp(sprintf("The apparent power in 2nd branch is %d kVA",s2/1000)); [s2_x,s2_y]=pol2rect(s2,angle_s2); disp(sprintf("The true power in 2nd branch is %d kW",s2_x/1000)); -I=(I1_x+I2_x)+(%i*(I1_y+I2_y)); //disp(I); +I=(I1_x+I2_x)+(%i*(I1_y+I2_y)); disp(I); //function to convert from rectangular form to polar form function [I,angle]=rect2pol(x,y); @@ -46,12 +43,12 @@ I=sqrt((x^2)+(y^2)); angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; [I,angle]=rect2pol(real(I),imag(I)); -//disp(I); +disp(I); s=v*I; angle_s=angle_v-angle; -disp(sprintf("The apparent power in the main circuit is %.3f kVA",s/1000)); +disp(sprintf("The apparent power in the main circuit is %f kVA",s/1000)); [p,q]=pol2rect(s,angle_s); -disp(sprintf("The true power in the main circuit is %.3f kW",p/1000)); +disp(sprintf("The true power in the main circuit is %f kW",p/1000)); //END diff --git a/1445/CH2/EX2.5/Ex2_5.sce b/1445/CH2/EX2.5/Ex2_5.sce index ce799fefc..4fbe07d32 100644 --- a/1445/CH2/EX2.5/Ex2_5.sce +++ b/1445/CH2/EX2.5/Ex2_5.sce @@ -1,30 +1,28 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 5 +clc; disp("CHAPTER 2"); disp("EXAMPLE 5"); //VARIABLE INITIALIZATION -I1=0.75; //current in loop 1 in Amperes -v=240; //voltage supply in Volts -f=50; //frequency in Hertz -p=80; //power consumed by the lamp in Watts +I1=0.75; //in Amperes +v=240; //in Volts +f=50; //in Hertz +p=80; //in Watts //SOLUTION -//V.I1.cos(Φ1) = P -res=p/v; //I1cos(Φ1) -pf1=res/I1; //1st power factor = cos(Φ1) +res=p/v; +pf1=res/I1; //1st power factor = cos(Φ1) phi1=acos(pf1); -res1=tan(phi1); //result1 = tan(Φ1) -w=2*%pi*f; //w=2.pi.f +res1=tan(phi1); //result1 = tan(Φ1) +w=2*%pi*f; //solution (a) -//Given power factor = unity means cos(Φ2)=1 -//hence Φ2=0, tan (Φ2)=0 -res2=0; //result2 = tan(Φ2) as Φ2=0 +res2=0; //result2 = tan(Φ2) Ic1=res*(res1-res2); c1=Ic1/(v*w); -disp(sprintf("(a) When power factor is unity, the value of capacitance is %4.2f μF",c1*(10^6))); // in mF +disp(sprintf("(a) When power factor is unity, the value of capacitance is %f μF",c1*(10^6))); //solution (b) pf2=0.95; //given @@ -32,7 +30,7 @@ phi2=acos(pf2); res2=tan(phi2); Ic2=res*(res1-res2); c2=Ic2/(v*w); -disp(sprintf("(b) When power factor is 0.95(lagging), the value of capacitance is %5.3f μF",c2*(10^6))); //textbook answer is 7.458 mF +disp(sprintf("(b) When power factor is 0.95(lagging), the value of capacitance is %f μF",c2*(10^6))); //END diff --git a/1445/CH2/EX2.50/Ex2_50.sce b/1445/CH2/EX2.50/Ex2_50.sce index 1c1aa59a3..e46eac363 100644 --- a/1445/CH2/EX2.50/Ex2_50.sce +++ b/1445/CH2/EX2.50/Ex2_50.sce @@ -1,14 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 50 +clc; disp("CHAPTER 2"); disp("EXAMPLE 50"); -//Given -//three impedances -//6+j5 ohm, 8-j6 ohm and 8+j10 ohm -//Circuit in parallel -// //VARIABLE INITIALIZATION z1=6+(%i*5); //impedance in Ohms z2=8-(%i*6); //impedance in Ohms @@ -16,10 +12,10 @@ z3=8+(%i*10); //impedance in Ohms I=20; //in Amperes //SOLUTION -Y1=1/z1; // Admittance +Y1=1/z1; Y2=1/z2; Y3=1/z3; -Y=Y1+Y2+Y3; // Total admittance +Y=Y1+Y2+Y3; //function to convert from rectangular form to polar form function [Y,angle]=rect2pol(x,y); Y=sqrt((x^2)+(y^2)); @@ -38,11 +34,8 @@ angle_I2=angle_v-angle2; I3=v/z3; angle_I3=angle_v-angle3; disp("The current in each branch in polar form is-"); -disp(sprintf(" %.3f A, %.2f degrees",I1,angle_I1)); -disp(sprintf(" %.3f A, %.2f degrees",I2,angle_I2)); -disp(sprintf(" %.3f A, %.2f degrees",I3,angle_I3)); -//Total current -I=I1+I2+I3; -disp(sprintf("The total current is %.3f A",I)); //Answer not clear in the book -// +disp(sprintf(" %f A, %f degrees",I1,angle_I1)); +disp(sprintf(" %f A, %f degrees",I2,angle_I2)); +disp(sprintf(" %f A, %f degrees",I3,angle_I3)); + //END diff --git a/1445/CH2/EX2.51/Ex2_51.sce b/1445/CH2/EX2.51/Ex2_51.sce index 85f7d494b..90e9c5273 100644 --- a/1445/CH2/EX2.51/Ex2_51.sce +++ b/1445/CH2/EX2.51/Ex2_51.sce @@ -1,30 +1,25 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 51 +clc; disp("CHAPTER 2"); disp("EXAMPLE 51"); -// -//Given -// admittance of branches are: -//Y1=0.4+j0.6 -//Y2=0.1+j0.4 -//Y3=0.06+j0.23 -// + //VARIABLE INITIALIZATION Y1=0.4+(%i*0.6); //admittance of 1st branch in Siemens Y2=0.1+(%i*0.4); //admittance of 2nd branch in Siemens Y3=0.06+(%i*0.23); //admittance of 3rd branch in Siemens //SOLUTION -Y=Y1+Y2+Y3; // total admittance +Y=Y1+Y2+Y3; //function to convert from rectangular form to polar form function [Y,angle]=rect2pol(x,y); Y=sqrt((x^2)+(y^2)); angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees endfunction; -[Y,angle]=rect2pol(real(Y),imag(Y)); -disp(sprintf("The total admittance of the circuit is %.3f S, %.2f degrees",Y,angle)); -z=1/Y; -disp(sprintf("The impedance of the circuit is %.3f Ω, %.2f degrees",z,-angle)); -// +[Y1,angle]=rect2pol(real(Y),imag(Y)); +disp(sprintf("The total admittance of the circuit is %f S, %f degrees",Y1,angle)); +z=1/Y1; +disp(sprintf("The impedance of the circuit is %f Ω, %f degrees",z,-angle)); + //END diff --git a/1445/CH2/EX2.52/Ex2_52.sce b/1445/CH2/EX2.52/Ex2_52.sce index d0d64ad6f..f3b5d6d93 100644 --- a/1445/CH2/EX2.52/Ex2_52.sce +++ b/1445/CH2/EX2.52/Ex2_52.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 52 +clc; disp("CHAPTER 2"); disp("EXAMPLE 52"); @@ -49,29 +50,29 @@ r_tot=req+rp; x_tot=xeq+xp; [z_tot,angle_tot]=rect2pol(r_tot,x_tot); Z=r_tot+x_tot*%i; //complex representation -disp(sprintf("(a) The total impedance is %.3f Ω, %.2f degrees",z_tot,angle_tot)); +disp(sprintf("(a) The total impedance is %f Ω, %f degrees",z_tot,angle_tot)); //solution (b) I=v/Z; //complex division angle_I=-angle_tot; [I_x,I_y]=pol2rect(I,angle_I); -disp(sprintf("(b) The total currrent is (%.3f-j%.2f) A",real(I),imag(I))); +disp(sprintf("(b) The total currrent is (%f-j%f) A",real(I),imag(I))); //solution (c) //Voltage drop across Z3 Vab=I*Z3; -disp(sprintf(" The Voltage between AB is (%.3f-j%.2f) V",real(Vab),imag(Vab))); +disp(sprintf(" The Voltage between AB is (%f-j%f) A",real(Vab),imag(Vab))); //since we know that V=Vab+Vbc Vbc=v-Vab; -disp(sprintf(" The Voltage between BC is (%.3f-j%.2f) V",real(Vbc),imag(Vbc))); +disp(sprintf(" The Voltage between BC is (%f-j%f) A",real(Vbc),imag(Vbc))); I1=Vbc/Z1; //Branch 1 current I2=Vbc/Z2; //branch 2 current //I3=I, main branch current [mag1,angle1]=rect2pol(real(I1),imag(I1)); [mag2,angle2]=rect2pol(real(I2),imag(I2)); -disp(sprintf("(c) Current in branch 1 is %.3f,< %.2f degrees A",mag1,angle1)); -disp(sprintf(" The currrent in branch 1 is (%.3f-j%.2f) A",real(I1),imag(I1))); -disp(sprintf(" The current in branch 2 is %.3f A,<%.2f degrees A",mag2,angle2)); -disp(sprintf(" The currrent in branch 2 is (%.3f-j%.2f) A",real(I2),imag(I2))); +disp(sprintf("(c) Current in branch 1 is %f A, %f degrees",mag1,angle1)); +disp(sprintf(" The currrent in branch 1 is (%f-j%f) A",real(I1),imag(I1))); +disp(sprintf(" The current in branch 2 is %f A, %f degrees",mag2,angle2)); +disp(sprintf(" The currrent in branch 2 is (%f-j%f) A",real(I2),imag(I2))); //END diff --git a/1445/CH2/EX2.53/Ex2_53.sce b/1445/CH2/EX2.53/Ex2_53.sce index ccdef8fb0..f18db0590 100644 --- a/1445/CH2/EX2.53/Ex2_53.sce +++ b/1445/CH2/EX2.53/Ex2_53.sce @@ -1,13 +1,10 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 53 Read Example 52 of the Text Book +clc; disp("CHAPTER 2"); disp("EXAMPLE 53"); -//Given -//Voltage 230 <30 V -//Current in branches 20 <60 A & 40<-30 A -// //VARIABLE INITIALIZATION v=230; //in Volts angle_v=30; //in degrees @@ -37,11 +34,11 @@ endfunction; //solution (i) z=v/I; angle_z=angle_v-angle; -disp(sprintf("(i) The total impedance of the circuit is %.2f Ω, %.2f degrees",z,angle_z)); +disp(sprintf("(i) The total impedance of the circuit is %f Ω, %f degrees",z,angle_z)); //solution (ii) //disp(sprintf("The value of I is %f and angle is %f",I, angle_z)); -pf=cos(angle_z*(%pi/180)); //power factor -p=v*I*pf; // Power taken -disp(sprintf("(ii) The power taken is %.0f W",p)); +pf=cos(angle_z*(%pi/180)); +p=v*I*pf; +disp(sprintf("(ii) The power taken is %f W",p)); //END diff --git a/1445/CH2/EX2.54/Ex2_54.sce b/1445/CH2/EX2.54/Ex2_54.sce index 4b6e43d75..766e3ffeb 100644 --- a/1445/CH2/EX2.54/Ex2_54.sce +++ b/1445/CH2/EX2.54/Ex2_54.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 54 Read example 53 of the Book +clc; disp("CHAPTER 2"); disp("EXAMPLE 54"); @@ -10,13 +11,7 @@ R=15; //in Ohms L=260/1000; //in Henry //SOLUTION -//resonant Frequency is given by -//fr= 1/ 2.pi.(sqrt (1/LC - R^2/L^2)) -//Q-factor is given by: -//Qf=2.pi.fr.L/R -//dynamic impedance is given by -//Zr=L/C.R -// + //solution (i) f_r=(1/(2*%pi))*sqrt((1/(L*C)-(R^2/L^2))); f_r=round(f_r); //to round off the value @@ -24,10 +19,10 @@ disp(sprintf("(i) The resonant frequency is %d Hz",f_r)); //solution (ii) q_factor=(2*%pi*f_r*L)/R; -disp(sprintf("(ii) The Q-factor of the circuit is %.2f",q_factor)); +disp(sprintf("(ii) The Q-factor of the circuit is %f",q_factor)); //solution (iii) Z_r=L/(C*R); -disp(sprintf("(iii) The dynamic impedance of the circuit is %.0f Ω",Z_r)); +disp(sprintf("(iii) The dynamic impedance of the circuit is %f Ω",Z_r)); //END diff --git a/1445/CH2/EX2.6/Ex2_6.sce b/1445/CH2/EX2.6/Ex2_6.sce index 378b29151..61aedd2de 100644 --- a/1445/CH2/EX2.6/Ex2_6.sce +++ b/1445/CH2/EX2.6/Ex2_6.sce @@ -1,6 +1,7 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 6 +clc; disp("CHAPTER 2"); disp("EXAMPLE 6"); @@ -12,18 +13,17 @@ v=230; //in Volts pf2=0.9; //power factor(lagging) //SOLUTION -//V.I1.cos(Φ1) = P phi1=acos(pf1); res1=tan(phi1); //result1 = tan(Φ1) phi2=acos(pf2); res2=tan(phi2); //result2 = tan(Φ2) Ic=I1*pf1*(res1-res2); -w=2*%pi*f; //w=2.pi.f +w=2*%pi*f; c=Ic/(v*w); -disp(sprintf("The value of capacitance is %5.2f μF",c*(10^6)));//text book answer is 82.53 mF -Qc=v*Ic; // reactive power in kVAr -disp(sprintf("The reactive power is %6.4f kVAR",Qc/(10^3)));//text book answer is 1.3716 -I2=I1*(pf1/pf2); //I1.cos(Φ1) = I2.cos(Φ2) -disp(sprintf("The new supply current is %5.2f A",I2)); +disp(sprintf("The value of capacitance is %f μF",c*(10^6))); +Qc=v*Ic; +disp(sprintf("The reactive power is %f kVAR",Qc/(10^3))); +I2=I1*(pf1/pf2); +disp(sprintf("The new supply current is %f A",I2)); //END diff --git a/1445/CH2/EX2.7/Ex2_7.sce b/1445/CH2/EX2.7/Ex2_7.sce index 97183894a..a2b70e663 100644 --- a/1445/CH2/EX2.7/Ex2_7.sce +++ b/1445/CH2/EX2.7/Ex2_7.sce @@ -1,24 +1,25 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 7 +clc; disp("CHAPTER 2"); disp("EXAMPLE 7"); //VARIABLE INITIALIZATION -s1=300; //apparent power absorbed by the plant in kVA +s1=300; //apparent power in kVA pf1=0.65; //power factor(lagging) pf2=0.85; //power factor(lagging) //SOLUTION //solution (a) -p=s1*pf1; //active power P=S.cos(Φ) -q1=sqrt((s1^2)-(p^2)); //Q=sqrt(S^2-P^2) in kVAr -disp(sprintf("(a) To bring the power factor to unity, the capacitor bank should have a capacity of %3.0f kVAR",q1)); +p=s1*pf1; //active power +q1=sqrt((s1^2)-(p^2)); +disp(sprintf("(a) To bring the power factor to unity, the capacitor bank should have a capacity of %f kVAR",q1)); //solution (b) -s2=p/pf2; //since P=S.cos(Φ) -q2=sqrt((s2^2)-(p^2)); //Q=sqrt(S^2-P^2) in kVAr -disp(sprintf("(b) To bring the power factor to 85%% lagging, the capacitor bank should have a capacity of %3.0f kVAR",q2)); +s2=p/pf2; +q2=sqrt((s2^2)-(p^2)); +disp(sprintf("(b) To bring the power factor to 85%% lagging, the capacitor bank should have a capacity of %f kVAR",q2)); //END diff --git a/1445/CH2/EX2.8/Ex2_8.sce b/1445/CH2/EX2.8/Ex2_8.sce index adfd7b625..4c5492c4e 100644 --- a/1445/CH2/EX2.8/Ex2_8.sce +++ b/1445/CH2/EX2.8/Ex2_8.sce @@ -1,31 +1,22 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 8 +clc; disp("CHAPTER 2"); disp("EXAMPLE 8"); -//Given -//V=300.cos(314.t+20) volts -//i=15.cos(314.t-10) Amp -// //VARIABLE INITIALIZATION -//V=300.cos(314.t+20) volts -//V=300.sin(314.t+110) volts as cos(theta)=sin(theta+90) -//i=15.cos(314.t-10) Amp -//i=15.sin(314.t+80) Amp as cos(theta)=sin(theta+90) -//Now -V=300/sqrt(2); //in Volts -angle_V=110; //in degrees +v=300/sqrt(2); //in Volts +angle_v=110; //in degrees I=15/sqrt(2); //in Amperes angle_I=80; //in degrees //SOLUTION -Z=V/I; //circuit impedance -angle_Z=angle_V-angle_I; //angle between current and voltage +Z=v/I; +angle_Z=angle_v-angle_I; disp(sprintf("The circuit impedance is %d Ω",Z)); disp(sprintf("The phase angle is %d degrees",angle_Z)); -//Pav=Vm*Im.cos (phi) in RL circuit -Pav=V*I*cos(angle_Z*(%pi/180)); //to convert angle_z from degrees to radians -disp(sprintf("The average power drawn is %7.2f W",Pav));// textboo answer is 1949.85 w +p_av=v*I*cos(angle_Z*(%pi/180)); //to convert angle_z from degrees to radians +disp(sprintf("The average power drawn is %f W",p_av)); //END diff --git a/1445/CH2/EX2.9/Ex2_9.sce b/1445/CH2/EX2.9/Ex2_9.sce index 0fd9a5c6d..f2779616b 100644 --- a/1445/CH2/EX2.9/Ex2_9.sce +++ b/1445/CH2/EX2.9/Ex2_9.sce @@ -1,26 +1,20 @@ //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT //Example 9 +clc; disp("CHAPTER 2"); disp("EXAMPLE 9"); - //VARIABLE INITIALIZATION -V=120; //voltage of lamp in Volts -P=100; //in Watts -Vsupp=220; //supply voltage in Volts -f=50; //in Hertz -//Equations to be used -//Z=R+jXl -//Vsupply=V+jVl=sqrt(V^2+Vl^2) -//Hence Vl=sqrt(Vsupply^2-V^2) -//P=VI -//Xl=2.pi.f.L +v1=120; //voltage of lamp in Volts +p=100; //in Watts +v2=220; //supply voltage in Volts +f=50; //in Hertz //SOLUTION -Vl=sqrt((Vsupp^2)-(V^2)); -Xl=(V*Vl)/P; -L=Xl/(2*%pi*f); //inductance -disp(sprintf("The pure inductance should have a value of %6.4f H",L)); //text book answer is 0.7046 H +vl=sqrt((v2^2)-(v1^2)); +xl=(v1*vl)/p; +L=xl/(2*%pi*f); +disp(sprintf("The pure inductance should have a value of %f H",L)); //END |