forked from sustainable-computing/dist_grid_identification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadTopologyIEEE13woSwitch_new.m
156 lines (130 loc) · 3.29 KB
/
loadTopologyIEEE13woSwitch_new.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
function [nNodes, Y, mappingTerminal2Node, PhA, PhB, PhC, homesPerNode]=loadTopologyIEEE13woSwitch_new(DSSObj)
% FUNCTION loadTopology: parse the topology config file and use values
% to initialize variables
% INPUT:
% DSSObj: OpenDSS COM Object used to obtain Ymatrix for the specified model
% OUTPUT:
% nNodes: the number of nodes
% Y: the three-phase nodal admittance matrix
% mappingTerminal2Node: mapping from bus names to node indices
% PhX: a logical vector showing whether a node is connected to phase X
% homesPerNode: the number of homes connected downstream of each node
%Reference the circuit for the interface
DSSCircuit = DSSObj.ActiveCircuit;
% Topology
NodeList = DSSCircuit.YNodeOrder;
nNodes = length(NodeList);
keySet = {'sourcebus.1', 'sourcebus.2', 'sourcebus.3',... %1-3
'650.1', '650.2', '650.3',... %4-6
'rg60.1', 'rg60.2', 'rg60.3',... %7-9
'633.1', '633.2', '633.3',... %10-12
'634.1', '634.2', '634.3',... %13-15 *
'680.1', '680.2', '680.3',... %16-18 *
'675.1', '675.2', '675.3',... %19-21 *
'645.2', '645.3',... %22-23 *
'646.2', '646.3',... %24-25 *
'684.1', '684.3',... %26-27 *
'652.1',..., %28 *
'611.3',... %29 *
'632.1', '632.2', '632.3',... %30-32
'671.1', '671.2', '671.3'};%,... %33-35
%'692.1', '692.2', '692.3'}; %36-38
valueArray = 1:nNodes;
mappingTerminal2Node = containers.Map(keySet,valueArray);
PhA = logical([0, 0, 0,...
1, 0, 0,...
1, 0, 0,...
1, 0, 0,...
1, 0, 0,...
1, 0, 0,...
1, 0, 0,...
0, 0,...
0, 0,...
1, 0,...
1,...
0,...
1, 0, 0,...
1, 0, 0,...
1, 0, 0]);
PhB = logical([0, 0, 0,...
0, 1, 0,...
0, 1, 0,...
0, 1, 0,...
0, 1, 0,...
0, 1, 0,...
0, 1, 0,...
1, 0,...
1, 0,...
0, 0,...
0,...
0,...
0, 1, 0,...
0, 1, 0,...
0, 1, 0]);
PhC = logical([0, 0, 0,...
0, 0, 1,...
0, 0, 1,...
0, 0, 1,...
0, 0, 1,...
0, 0, 1,...
0, 0, 1,...
0, 1,...
0, 1,...
0, 1,...
0,...
1,...
0, 0, 1,...
0, 0, 1,...
0, 0, 1]);
% polyphase nodal admittace matrix
Y = constructYMatrix(DSSObj);
% Loads
LSRC = 0;
L650a = 0;
L650b = 0;
L650c = 0;
LREG = 0;
L632a = 120;
L632b = 90;
L632c = 100;
L671a = 10;
L671b = 14;
L671c = 12;
L680a = 90;
L680b = 110;
L680c = 120;
L633a = 25;
L633b = 32;
L633c = 20;
L634a = 30;
L634b = 32;
L634c = 25;
L692a = 0;
L692b = 0;
L692c = 0;
L675a = 40;
L675b = 35;
L675c = 25;
L645b = 20;
L645c = 30;
L646b = 65;
L646c = 80;
L684a = 20;
L684c = 15;
L652a = 50;
L611c = 50;
homesPerNode = [LSRC, LSRC, LSRC,...
L650a, L650b, L650c,...
LREG, LREG, LREG,...
L633a, L633b, L633c,...
L634a, L634b, L634c,...
L680a, L680b, L680c,...
L675a, L675b, L675c,...
L645b, L645c,...
L646b, L646c,...
L684a, L684c,...
L652a,...
L611c,...
L632a, L632b, L632c,...
L671a, L671b, L671c];
% L692a, L692b, L692c];