summaryrefslogtreecommitdiff
path: root/1445/CH2/EX2.47/Ex2_47.sce
diff options
context:
space:
mode:
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