diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1445/CH2/EX2.49 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1445/CH2/EX2.49')
-rw-r--r-- | 1445/CH2/EX2.49/Ex2_49.sce | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/1445/CH2/EX2.49/Ex2_49.sce b/1445/CH2/EX2.49/Ex2_49.sce new file mode 100644 index 000000000..a1cd3ec1d --- /dev/null +++ b/1445/CH2/EX2.49/Ex2_49.sce @@ -0,0 +1,61 @@ +//CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT +//Example 49 + +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 +I1=20; //in Amperes +angle_I1=60; //in degrees +I2=40; //in Amperes +angle_I2=-30; //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; +[v_x,v_y]=pol2rect(v,angle_v); +[I1_x,I1_y]=pol2rect(I1,angle_I1); +[I2_x,I2_y]=pol2rect(I2,angle_I2); +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(" "); + +s2=v*I2; +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); + +//function to convert from rectangular form to polar form +function [I,angle]=rect2pol(x,y); +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); +s=v*I; +angle_s=angle_v-angle; +disp(sprintf("The apparent power in the main circuit is %.3f kVA",s/1000)); +[p,q]=pol2rect(s,angle_s); +disp(sprintf("The true power in the main circuit is %.3f kW",p/1000)); + +//END + + + + + |