summaryrefslogtreecommitdiff
path: root/1445/CH2/EX2.37/ch2_ex_37.sce
blob: d93ee733a6ac40e79f43ecf885032f06cb819c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT
//Example 37 // read it as example 36 in the book on page 2.93

disp("CHAPTER 2");
disp("EXAMPLE 37");

//VARIABLE INITIALIZATION 
R1=20;                              //
XL=15;                              // in ohms
R2=0;                               //assumed
C=50;                               //in ohms capacitative reactance
V=200;
f=60;                               //Hz 
//
//SOLUTION
//Solution (a)
//conductance g, susceptance b
Z1=sqrt(R1^2 +XL^2);                //squared impedance Z^2 for branch 1
Z2=sqrt(R2^2 +C^2);                 //squared impedance Z^2 for branch 2
i1=V/Z1;
i2=V/Z2;
disp("SOLUTION (a)");
disp(sprintf("The  current in Branch 1 is %f Amp",  i1));
disp(sprintf("The  current in Branch 2 is %f Amp",  i2));
phi1=atan(XL/R1);
phi2=%pi/2;                         //atan(C/R2);                    //R2=0, output is infinity
Icos=i1*cos(phi1)+i2*cos(phi2);     // phi in radians
Isin=-i1*sin(phi1)+i2*sin(phi2);     // phi in radians
I=sqrt(Icos^2+Isin^2);
//
disp("SOLUTION (b)");
disp(sprintf("The total current is %f Amp",  I));
//
pf=Icos/I; 
disp("SOLUTION (c)");
disp(sprintf("The power factor is %f ", pf)); 
disp(" "); 
// 
//END