-
Notifications
You must be signed in to change notification settings - Fork 7
/
typeOfLoads.m
50 lines (47 loc) · 1.89 KB
/
typeOfLoads.m
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
50
yload = caseObject.yload;
threePhaseNum = 0;
twoPhaseNum = 0;
singlePhaseNum = 0;
zeroPhaseNum = 0;
for n=1:size(yload,1)
if(yload(n,2) > 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4) > 0.0000001)
threePhaseNum = threePhaseNum+1;
end
if((yload(n,2) > 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4)<= 0.0000001) ||...
(yload(n,2) > 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4) > 0.0000001) ||...
(yload(n,2)<= 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4) > 0.0000001))
twoPhaseNum = twoPhaseNum+1;
end
if((yload(n,2) > 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4)<= 0.0000001) ||...
(yload(n,2)<= 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4)<= 0.0000001) ||...
(yload(n,2)<= 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4) > 0.0000001))
singlePhaseNum = singlePhaseNum+1;
end
if(yload(n,2)<= 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4)<= 0.0000001)
zeroPhaseNum = zeroPhaseNum+1;
end
end
index3PH = zeros(threePhaseNum,1);
index2PH = zeros(twoPhaseNum,1);
index1PH = zeros(singlePhaseNum,1);
n1PH = 0;
n2PH = 0;
n3PH = 0;
for n=1:size(yload,1)
if(yload(n,2) > 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4) > 0.0000001)
n3PH = n3PH+1;
index3PH(n3PH) = n;
end
if((yload(n,2) > 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4)<= 0.0000001) ||...
(yload(n,2) > 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4) > 0.0000001) ||...
(yload(n,2)<= 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4) > 0.0000001))
n2PH = n2PH+1;
index2PH(n2PH) = n;
end
if((yload(n,2) > 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4)<= 0.0000001) ||...
(yload(n,2)<= 0.0000001 && yload(n,3) > 0.0000001 && yload(n,4)<= 0.0000001) ||...
(yload(n,2)<= 0.0000001 && yload(n,3)<= 0.0000001 && yload(n,4) > 0.0000001))
n1PH = n1PH+1;
index1PH(n1PH) = n;
end
end