summaryrefslogtreecommitdiff
path: root/3640/CH2/EX2.5/Ex2_5.sce
blob: d73ae2672f92ea88608519e75abe4241c79d0dc7 (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
42
43
44
45
46
47
48
49
clc
//the following code contains userdefined fucntion complexstring 
function s=complexstring(a)
    
    if imag(a)>=0 then
        s=sprintf('%g+%gi',real(a),imag(a))
    else
        s=sprintf('%g%gi',real(a),imag(a))
        
    end
    funcprot(0)
endfunction
Load=5000 //load of the plant in kW
pf1=0.8 //power factor of load(lagging)
pf2=0.9 //power factor of induction motor
pf3=0.8 //power factor of synchronous motor
Hp=500 //rating of induction motor to be replaced in hp
Pout=0.746*Hp //output power of induction motor in kW
Eta=0.96 //efficiency of the induction motor equal to η in textbook
Sp=Load+(Load*tan(acos(pf1)))*%i //original complex power of load in kVA
disp('Sp=' + complexstring(Sp)+'kVA')
Pin=Pout/Eta //input power in kW
mprintf("Pin=%fkW\n",Pin)//complex power of induction motor //the ans may vary due to round off error
Sm=Pin+(Pin*tan(acos(pf2)))*%i
disp('Sm='+complexstring(Sm)+'kVA')//the ans may vary due to round off error //complex power of induction motor
mprintf("\n")
Ss=Pin-(Pin*tan(acos(pf3)))*%i
disp('Ss='+complexstring(Ss)+'kVA')//complex power of synchronous machine //the ans may vary due to round off error
mprintf("\n")
Qm=(Pin*tan(acos(pf2)))*%i//reactive power of induction motor in kVAR
Qs=(-1*(Pin*tan(acos(pf3)))*%i)//reactive power of synchronous motor in kVAR
Sp1=Sp-Qm+Qs
disp('Sp1='+complexstring(Sp1)+'kVA')//new plant requirement,equal to Sp` in textbook
mprintf("\n")
pha=acos(real(Sp1)/abs(Sp1)) //phase angle of Sp1 in radians
mprintf("New power factor=%f\n",cos(pha))//new power factor //the ans may vary due to round off error
invl=abs(Sp)//initial value of complex power in kVA
fnvl=abs(Sp1) //final value of complex power in kVA 
mprintf("Percent reduction=%f%c\n",(((invl-fnvl)/invl)*100),'%')//the ans may vary due to round off error