summaryrefslogtreecommitdiff
path: root/3640/CH3/EX3.12/Ex3_12.sce
blob: 32b51b5e39577e8142cf2e163dfc5dca40c59b2e (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
clc
//the code uses a userdefined function 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
kVAL=100 //kva required for supply
kVAM=20 //kVA rating of motor of the air conditioning compressor
V=220 //supply voltage in volts
IL3=(kVAM*1000)/(sqrt(3)*V)
mprintf("IL3=%fA=|I2| of small transformer\n",IL3)
//abc sequence
ph1=36.9 //phase angle of motor current
IL3=IL3*exp(%i*(-1)*ph1*%pi/180)//-1 comes due to the lagging power factor,conversion of degree to radian for calculation
mprintf("Il3=%fA with a phase angle of %f degrees\n",abs(IL3),(-1)*ph1)//-1 comes due to the lagging power factor
disp('IL3='+complexstring(IL3)+'A')
ph2=30-25.8 //phase angle of Il1
IL1=((kVAL*1000)/V)*exp(%i*(ph2)*%pi/180)
disp('IL1='+complexstring(IL1)+'A')
mprintf("IL1=%f with a phase angle of %f degrees\n",abs(IL1),ph2)
I2=IL3+IL1
disp('I2='+complexstring(I2)+'A')
mprintf("I2=%fA with a phase angle of %f degrees\n",abs(I2),(acos(real(I2)/abs(I2)))*180/%pi)
//acb sequence
ph3=30+25.8 //phase angle of Il1 in degrees
IL1=abs(IL1)*exp(%i*(-1)*(ph3)*%pi/180) //-1 comes due to lagging power factor
disp('IL1='+complexstring(IL1)+'A')
mprintf("IL1=%f with a phase angle of %f degrees\n",abs(IL1),(-1)*ph3)//-1 comes due to the lagging power factor
I2=IL3+IL1
disp('I2='+complexstring(I2)+'A')
mprintf("I2=%fA with a phase angle of %f degrees\n",abs(I2),(acos(real(I2)/abs(I2)))*180/%pi)