diff options
Diffstat (limited to '1445/CH2/EX2.18/Ex2_18.sce')
-rw-r--r-- | 1445/CH2/EX2.18/Ex2_18.sce | 21 |
1 files changed, 10 insertions, 11 deletions
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 |