diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1445/CH2/EX2.17/ch2_ex_17.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '1445/CH2/EX2.17/ch2_ex_17.sce')
-rw-r--r-- | 1445/CH2/EX2.17/ch2_ex_17.sce | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/1445/CH2/EX2.17/ch2_ex_17.sce b/1445/CH2/EX2.17/ch2_ex_17.sce new file mode 100644 index 000000000..ba82080a2 --- /dev/null +++ b/1445/CH2/EX2.17/ch2_ex_17.sce @@ -0,0 +1,51 @@ +//CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT +//Example 17 + +disp("CHAPTER 2"); +disp("EXAMPLE 17"); + +//VARIABLE INITIALIZATION +e=141.4; //in Volts +E=141.4/sqrt(2); //in Volts +angle_E=0; //in degrees +//i(t)=(14.14<0)+(7.07<120) +i1=14.14; //in Amperes +angle_i1=0; //in degrees +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); +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); +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); +mag=sqrt((x^2)+(y^2)); +angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees +endfunction; +[I,angle_I]=rect2pol((i1_x+i2_x),(i1_y+i2_y)); +I=I/sqrt(2); + +//solution (i) +z=E/I; +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 %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 %f ",pf)); + +//solution (iii) +p=E*I*pf; +disp(sprintf("(iii) The power absorbed by the source is %f W",p)); + +//END |