summaryrefslogtreecommitdiff
path: root/1445/CH2/EX2.47/Ex2_47.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /1445/CH2/EX2.47/Ex2_47.sce
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '1445/CH2/EX2.47/Ex2_47.sce')
-rw-r--r--1445/CH2/EX2.47/Ex2_47.sce13
1 files changed, 5 insertions, 8 deletions
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