ltbams 1.0.7__py3-none-any.whl → 1.0.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ams/_version.py CHANGED
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-04-14T02:15:15-0400",
11
+ "date": "2025-04-20T09:18:49-0400",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "ba5d62c3b3d080ab5ffe03e04883a3492dc121eb",
15
- "version": "1.0.7"
14
+ "full-revisionid": "4bda2874669399db2c37d0a4bf6ae10e324d96a7",
15
+ "version": "1.0.8"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -0,0 +1,375 @@
1
+ % Case saved by PowerWorld Simulator, version 23, build date August 27, 2023
2
+ function mpc = Hawaii40_20231026
3
+ mpc.version = '2';
4
+ mpc.baseMVA = 100.00;
5
+
6
+ %% bus data
7
+ mpc.bus = [
8
+ 1 1 0.00 0.00 0.00 0.00 1 0.9935453 -1.119907 138.00 1 1.100 0.900 5.22 0.00 0 0
9
+ 2 2 60.70 0.00 0.00 0.00 1 0.9912250 -3.927372 69.00 1 1.100 0.900 5.25 0.00 0 0
10
+ 3 1 59.39 0.00 0.00 0.00 1 0.9845477 -4.731145 69.00 1 1.100 0.900 5.71 -0.03 0 0
11
+ 4 1 22.47 0.00 0.00 0.00 1 0.9787999 -5.745870 69.00 1 1.100 0.900 5.42 -0.01 0 0
12
+ 5 1 0.00 0.00 0.00 0.00 1 0.9889847 -2.069792 138.00 1 1.100 0.900 5.28 0.00 0 0
13
+ 6 1 27.46 0.00 0.00 0.00 1 0.9812064 -5.528160 69.00 1 1.100 0.900 5.49 -0.00 0 0
14
+ 7 1 37.01 0.00 0.00 0.00 1 0.9805826 -5.671337 69.00 1 1.100 0.900 5.48 -0.00 0 0
15
+ 8 1 65.10 0.00 0.00 0.00 1 0.9786187 -5.702381 69.00 1 1.100 0.900 5.75 -0.03 0 0
16
+ 9 1 0.00 0.00 0.00 0.00 1 0.9867678 -2.548359 138.00 1 1.100 0.900 5.31 -0.00 0 0
17
+ 10 1 37.76 0.00 0.00 0.00 1 0.9809410 -5.651960 69.00 1 1.100 0.900 5.47 0.00 0 0
18
+ 11 1 65.55 0.00 0.00 0.00 1 0.9749115 -6.522955 69.00 1 1.100 0.900 5.50 0.00 0 0
19
+ 12 1 54.01 0.00 0.00 0.00 1 0.9773269 -6.198354 69.00 1 1.100 0.900 5.51 -0.00 0 0
20
+ 13 1 59.24 0.00 0.00 0.00 1 0.9789530 -6.094816 69.00 1 1.100 0.900 5.49 -0.00 0 0
21
+ 14 1 0.00 0.00 0.00 0.00 1 0.9837641 -3.136205 138.00 1 1.100 0.900 5.35 -0.00 0 0
22
+ 15 1 60.90 0.00 0.00 0.00 1 0.9786311 -6.029763 69.00 1 1.100 0.900 5.51 0.01 0 0
23
+ 16 1 23.83 0.00 0.00 32.00 1 0.9821866 -6.456032 69.00 1 1.100 0.900 5.56 -0.01 0 0
24
+ 17 1 12.04 0.00 0.00 0.00 1 0.9754957 -6.981904 69.00 1 1.100 0.900 5.53 -0.01 0 0
25
+ 18 1 36.32 0.00 0.00 0.00 1 0.9759604 -7.121150 69.00 1 1.100 0.900 5.55 -0.01 0 0
26
+ 19 1 48.60 0.00 0.00 0.00 1 0.9913040 -3.514221 69.00 1 1.100 0.900 5.89 -0.04 0 0
27
+ 20 1 64.95 0.00 0.00 0.00 1 0.9896603 -1.963951 69.00 1 1.100 0.900 7.07 -0.18 0 0
28
+ 21 1 48.34 0.00 0.00 0.00 1 0.9799422 -5.268157 69.00 1 1.100 0.900 5.54 -0.01 0 0
29
+ 22 1 0.00 0.00 0.00 0.00 1 0.9963974 -0.844548 138.00 1 1.100 0.900 5.19 0.00 0 0
30
+ 23 3 86.75 0.00 0.00 0.00 1 1.0000000 -2.106015 69.00 1 1.100 0.900 5.10 0.00 0 0
31
+ 24 1 46.58 0.00 0.00 0.00 1 0.9934020 -3.706851 69.00 1 1.100 0.900 4.59 -0.05 0 0
32
+ 25 1 0.00 0.00 0.00 0.00 1 0.9966141 -0.528763 138.00 1 1.100 0.900 5.20 0.00 0 0
33
+ 26 2 75.28 0.00 0.00 0.00 1 0.9951046 -3.596866 69.00 1 1.100 0.900 4.93 -0.02 0 0
34
+ 27 2 3.95 0.00 0.00 0.00 1 1.0034164 1.362694 69.00 1 1.100 0.900 7.78 -0.10 0 0
35
+ 28 2 8.82 0.00 0.00 0.00 1 1.0000000 0.234055 69.00 1 1.100 0.900 0.00 0.00 0 0
36
+ 29 1 7.70 0.00 0.00 0.00 1 0.9953834 -0.097274 69.00 1 1.100 0.900 7.84 -0.12 0 0
37
+ 30 1 49.03 0.00 0.00 0.00 1 0.9957983 -0.422344 69.00 1 1.100 0.900 8.14 -0.10 0 0
38
+ 31 1 9.62 0.00 0.00 0.00 1 0.9952150 -2.101776 69.00 1 1.100 0.900 2.58 0.08 0 0
39
+ 32 1 6.67 0.00 0.00 0.00 1 0.9912167 -1.321157 69.00 1 1.100 0.900 7.37 -0.16 0 0
40
+ 33 2 58.22 0.00 0.00 0.00 1 0.9956520 -3.050368 69.00 1 1.100 0.900 4.14 -0.01 0 0
41
+ 34 2 0.00 0.00 0.00 0.00 1 1.0000000 -2.084231 69.00 1 1.100 0.900 4.62 0.00 0 0
42
+ 35 2 0.00 0.00 0.00 0.00 1 1.0000000 0.376390 138.00 1 1.100 0.900 5.20 0.00 0 0
43
+ 36 2 0.00 0.00 0.00 0.00 1 0.9965724 -3.565242 69.00 1 1.100 0.900 4.59 -0.05 0 0
44
+ 37 2 0.00 0.00 0.00 0.00 1 1.0000000 0.251430 138.00 1 1.100 0.900 5.20 0.00 0 0
45
+ ];
46
+
47
+ %% generator data
48
+ mpc.gen = [
49
+ 2 2.50 0.80 0.80 -0.50 1.0000 2.80 1 2.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
50
+ 2 2.50 0.80 0.80 -0.50 1.0000 2.80 1 2.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
51
+ 2 2.50 0.80 0.80 -0.50 1.0000 2.80 1 2.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
52
+ 2 2.50 0.80 0.80 -0.50 1.0000 2.80 1 2.50 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
53
+ 23 69.27 0.04 23.30 -14.00 1.0000 85.60 1 77.80 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
54
+ 23 39.13 0.04 13.80 -8.30 1.0000 50.50 1 45.90 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
55
+ 23 69.27 0.04 23.30 -14.00 1.0000 85.60 1 77.80 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
56
+ 23 47.64 0.04 15.60 -9.40 1.0000 57.10 1 51.90 23.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
57
+ 23 47.11 0.04 15.50 -9.30 1.0000 57.00 1 51.80 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
58
+ 23 44.53 0.04 15.40 -9.20 1.0000 56.30 1 51.20 6.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
59
+ 23 44.53 0.04 15.40 -9.20 1.0000 56.30 1 51.20 6.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
60
+ 23 43.61 0.04 14.30 -8.60 1.0000 52.50 1 47.70 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
61
+ 23 43.19 0.04 14.20 -8.50 1.0000 51.90 1 47.20 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
62
+ 23 12.53 0.04 4.40 -2.60 1.0000 16.20 1 14.70 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
63
+ 26 20.00 6.00 6.00 -3.60 1.0000 22.00 1 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
64
+ 26 10.20 3.10 3.10 -1.90 1.0000 11.20 1 10.20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
65
+ 27 30.00 -5.40 9.00 -5.40 1.0000 33.00 1 30.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
66
+ 27 27.60 -5.00 8.30 -5.00 1.0000 30.40 1 27.60 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
67
+ 28 46.30 -5.49 14.70 -8.80 1.0000 53.90 1 49.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
68
+ 28 69.00 -5.49 20.70 -12.40 1.0000 75.90 1 69.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
69
+ 33 27.60 8.30 8.30 -5.00 1.0000 30.40 1 27.60 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
70
+ 34 7.22 -0.98 2.50 -1.50 1.0000 9.20 1 8.40 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
71
+ 34 6.04 -0.98 2.50 -1.50 1.0000 9.20 1 8.40 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
72
+ 34 6.04 -0.98 2.50 -1.50 1.0000 9.20 1 8.40 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
73
+ 34 6.04 -0.98 2.50 -1.50 1.0000 9.20 1 8.40 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
74
+ 34 6.01 -0.98 2.50 -1.50 1.0000 9.20 1 8.40 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
75
+ 34 7.22 -0.98 2.50 -1.50 1.0000 9.20 1 8.40 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
76
+ 35 58.00 0.05 17.40 -10.40 1.0000 63.80 1 58.00 5.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
77
+ 35 28.00 0.05 8.40 -5.00 1.0000 30.80 1 28.00 5.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
78
+ 35 0.00 0.00 54.00 -32.40 1.0000 198.00 0 180.00 63.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
79
+ 35 20.00 0.05 6.00 -3.60 1.0000 22.00 1 20.00 5.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
80
+ 35 67.00 0.05 25.50 -15.30 1.0000 93.50 1 85.00 40.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
81
+ 35 0.00 0.00 25.50 -15.30 1.0000 93.50 0 85.00 40.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
82
+ 35 50.00 0.05 15.00 -9.00 1.0000 55.00 1 50.00 10.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
83
+ 35 56.20 0.05 33.90 -20.30 1.0000 124.30 1 113.00 42.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
84
+ 36 2.00 1.00 1.00 -0.60 1.0000 3.50 1 3.20 2.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
85
+ 36 2.10 1.00 1.00 -0.60 1.0000 3.50 1 3.20 2.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
86
+ 36 2.00 1.00 1.00 -0.60 1.0000 3.50 1 3.20 2.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
87
+ 36 2.48 1.00 1.00 -0.60 1.0000 3.50 1 3.20 2.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
88
+ 37 0.00 0.00 38.60 -23.20 1.0000 141.60 0 128.70 45.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
89
+ 37 0.00 0.00 38.40 -23.00 1.0000 140.90 0 128.10 55.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
90
+ 37 58.32 5.63 26.20 -15.70 1.0000 95.90 1 87.20 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
91
+ 37 0.00 0.00 24.60 -14.80 1.0000 90.30 0 82.10 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
92
+ 37 68.48 5.63 23.40 -14.00 1.0000 85.90 1 78.10 30.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
93
+ 37 0.00 0.00 23.40 -14.00 1.0000 85.70 0 77.90 20.00 0.00 0.00 0.00 0.00 0.00 0.00 0 0 0 0 0.0000 0 0 0 0
94
+ ];
95
+
96
+ %% generator cost data
97
+ mpc.gencost = [
98
+ 2 0 0 4 0.0000 0.003 4.570 0.00
99
+ 2 0 0 4 0.0000 0.002 4.570 0.00
100
+ 2 0 0 4 0.0000 0.002 4.570 0.00
101
+ 2 0 0 4 0.0000 0.002 4.570 0.00
102
+ 2 0 0 4 0.0000 0.004 4.680 0.00
103
+ 2 0 0 4 0.0000 0.000 0.000 0.00
104
+ 2 0 0 4 0.0000 0.005 4.680 0.00
105
+ 2 0 0 4 0.0000 0.004 4.640 0.00
106
+ 2 0 0 4 0.0000 0.004 4.640 0.00
107
+ 2 0 0 4 0.0000 0.003 4.640 0.00
108
+ 2 0 0 4 0.0000 0.003 4.640 0.00
109
+ 2 0 0 4 0.0000 0.003 4.640 0.00
110
+ 2 0 0 4 0.0000 0.005 4.630 0.00
111
+ 2 0 0 4 0.0000 0.000 0.000 0.00
112
+ 2 0 0 4 0.0000 0.000 0.000 0.00
113
+ 2 0 0 4 0.0000 0.000 0.000 0.00
114
+ 2 0 0 4 0.0000 0.000 0.000 0.00
115
+ 2 0 0 4 0.0000 0.000 0.000 0.00
116
+ 2 0 0 4 0.0000 0.000 0.000 0.00
117
+ 2 0 0 4 0.0000 0.000 0.000 0.00
118
+ 2 0 0 4 0.0000 0.000 0.000 0.00
119
+ 2 0 0 4 0.0000 0.003 4.580 0.00
120
+ 2 0 0 4 0.0000 0.003 4.580 0.00
121
+ 2 0 0 4 0.0000 0.004 4.580 0.00
122
+ 2 0 0 4 0.0000 0.003 4.580 0.00
123
+ 2 0 0 4 0.0000 0.004 4.580 0.00
124
+ 2 0 0 4 0.0000 0.003 4.580 0.00
125
+ 2 0 0 4 0.0000 0.004 4.650 0.00
126
+ 2 0 0 4 0.0000 0.004 4.610 0.00
127
+ 2 0 0 4 0.0000 0.007 4.810 0.00
128
+ 2 0 0 4 0.0000 0.003 4.600 0.00
129
+ 2 0 0 4 0.0000 0.004 4.690 0.00
130
+ 2 0 0 4 0.0000 0.005 4.690 0.00
131
+ 2 0 0 4 0.0000 0.004 4.640 0.00
132
+ 2 0 0 4 0.0000 0.004 4.720 0.00
133
+ 2 0 0 4 0.0000 0.003 4.580 0.00
134
+ 2 0 0 4 0.0000 0.002 4.580 0.00
135
+ 2 0 0 4 0.0000 0.003 4.580 0.00
136
+ 2 0 0 4 0.0000 0.002 4.580 0.00
137
+ 2 0 0 4 0.0000 0.006 4.740 0.00
138
+ 2 0 0 4 0.0000 0.006 4.740 0.00
139
+ 2 0 0 4 0.0000 0.005 4.690 0.00
140
+ 2 0 0 4 0.0000 0.005 4.680 0.00
141
+ 2 0 0 4 0.0000 0.004 4.680 0.00
142
+ 2 0 0 4 0.0000 0.005 4.680 0.00
143
+ ];
144
+
145
+ %% branch data
146
+ mpc.branch = [
147
+ 1 2 0.004840 0.123766 0.00000 123.20 123.20 123.20 1.00000 0.000 1 0.00 0.00 39.02 1.29 -38.95 0.62 0 0 0 0
148
+ 1 2 0.004840 0.123766 0.00000 123.20 123.20 123.20 1.00000 0.000 1 0.00 0.00 39.02 1.29 -38.95 0.62 0 0 0 0
149
+ 1 2 0.004840 0.123766 0.00000 123.20 123.20 123.20 1.00000 0.000 1 0.00 0.00 39.02 1.29 -38.95 0.62 0 0 0 0
150
+ 1 5 0.003400 0.020913 0.00846 232.80 232.80 232.80 0.00000 0.000 1 0.00 0.00 79.42 8.98 -79.20 -8.46 0 0 0 0
151
+ 1 5 0.003400 0.020913 0.00846 232.80 232.80 232.80 0.00000 0.000 1 0.00 0.00 79.42 8.98 -79.20 -8.46 0 0 0 0
152
+ 1 22 0.003740 0.024173 0.00605 177.80 177.80 177.80 0.00000 0.000 1 0.00 0.00 -20.99 -8.73 21.01 8.25 0 0 0 0
153
+ 1 25 0.002890 0.015798 0.00771 217.00 217.00 217.00 0.00000 0.000 1 0.00 0.00 -65.93 -7.29 66.06 7.23 0 0 0 0
154
+ 1 25 0.002890 0.015798 0.00771 217.00 217.00 217.00 0.00000 0.000 1 0.00 0.00 -65.93 -7.29 66.06 7.23 0 0 0 0
155
+ 1 35 0.010800 0.041922 0.01284 281.60 281.60 281.60 0.00000 0.000 1 0.00 0.00 -61.53 0.73 61.95 -0.40 0 0 0 0
156
+ 1 35 0.010800 0.041922 0.01284 281.60 281.60 281.60 0.00000 0.000 1 0.00 0.00 -61.53 0.73 61.95 -0.40 0 0 0 0
157
+ 2 4 0.042960 0.079357 0.00257 66.80 66.80 66.80 0.00000 0.000 1 0.00 0.00 36.76 -3.89 -36.16 4.74 0 0 0 0
158
+ 2 6 0.026890 0.058600 0.00312 82.00 82.00 82.00 0.00000 0.000 1 0.00 0.00 44.97 -3.19 -44.41 4.10 0 0 0 0
159
+ 2 6 0.026890 0.058600 0.00312 82.00 82.00 82.00 0.00000 0.000 1 0.00 0.00 44.97 -3.19 -44.41 4.10 0 0 0 0
160
+ 2 7 0.027540 0.075691 0.00377 77.80 77.80 77.80 0.00000 0.000 1 0.00 0.00 39.18 0.09 -38.75 0.73 0 0 0 0
161
+ 2 21 0.036460 0.077337 0.00173 94.80 94.80 94.80 0.00000 0.000 1 0.00 0.00 29.76 0.69 -29.43 -0.16 0 0 0 0
162
+ 2 23 0.032620 0.081030 0.00180 101.30 101.30 101.30 0.00000 0.000 1 0.00 0.00 -36.96 4.68 37.42 -3.71 0 0 0 0
163
+ 2 23 0.032620 0.081030 0.00180 101.30 101.30 101.30 0.00000 0.000 1 0.00 0.00 -36.96 4.68 37.42 -3.71 0 0 0 0
164
+ 2 23 0.032620 0.081030 0.00180 101.30 101.30 101.30 0.00000 0.000 1 0.00 0.00 -36.96 4.68 37.42 -3.71 0 0 0 0
165
+ 2 26 0.030490 0.066116 0.00186 61.70 61.70 61.70 0.00000 0.000 1 0.00 0.00 -9.30 -1.59 9.33 1.47 0 0 0 0
166
+ 2 26 0.030490 0.066116 0.00186 61.70 61.70 61.70 0.00000 0.000 1 0.00 0.00 -9.30 -1.59 9.33 1.47 0 0 0 0
167
+ 3 6 0.014780 0.036690 0.00104 85.00 85.00 85.00 0.00000 0.000 1 0.00 0.00 34.71 -4.81 -34.52 5.18 0 0 0 0
168
+ 3 6 0.014780 0.036690 0.00104 85.00 85.00 85.00 0.00000 0.000 1 0.00 0.00 34.71 -4.81 -34.52 5.18 0 0 0 0
169
+ 3 16 0.023830 0.063585 0.00504 82.80 82.80 82.80 0.00000 0.000 1 0.00 0.00 41.57 -11.48 -41.11 12.21 0 0 0 0
170
+ 3 19 0.013820 0.031229 0.00541 91.60 91.60 91.60 0.00000 0.000 1 0.00 0.00 -63.13 7.08 63.70 -6.30 0 0 0 0
171
+ 3 19 0.013820 0.031229 0.00541 91.60 91.60 91.60 0.00000 0.000 1 0.00 0.00 -63.13 7.08 63.70 -6.30 0 0 0 0
172
+ 3 19 0.013820 0.031229 0.00541 91.60 91.60 91.60 0.00000 0.000 1 0.00 0.00 -63.13 7.08 63.70 -6.30 0 0 0 0
173
+ 3 21 0.024230 0.047508 0.00152 49.00 49.00 49.00 0.00000 0.000 1 0.00 0.00 19.00 -0.13 -18.91 0.16 0 0 0 0
174
+ 4 13 0.012140 0.038486 0.00170 53.20 53.20 53.20 0.00000 0.000 1 0.00 0.00 13.69 -4.74 -13.67 4.66 0 0 0 0
175
+ 5 6 0.004790 0.139559 0.00000 198.00 198.00 198.00 1.00000 0.000 1 0.00 0.00 42.13 5.33 -42.04 -2.76 0 0 0 0
176
+ 5 9 0.002290 0.012058 0.00409 170.70 170.70 170.70 0.00000 0.000 1 0.00 0.00 68.63 5.23 -68.52 -5.05 0 0 0 0
177
+ 5 14 0.005740 0.038815 0.00687 162.50 162.50 162.50 0.00000 0.000 1 0.00 0.00 47.64 6.35 -47.50 -6.10 0 0 0 0
178
+ 7 6 0.004000 0.010000 0.00096 40.20 40.20 40.20 0.00000 0.000 1 0.00 0.00 -22.83 3.00 22.85 -3.03 0 0 0 0
179
+ 7 6 0.004000 0.010000 0.00096 40.20 40.20 40.20 0.00000 0.000 1 0.00 0.00 -22.83 3.00 22.85 -3.03 0 0 0 0
180
+ 7 6 0.004000 0.010000 0.00096 40.20 40.20 40.20 0.00000 0.000 1 0.00 0.00 -22.83 3.00 22.85 -3.03 0 0 0 0
181
+ 6 11 0.019800 0.042395 0.00097 89.00 89.00 89.00 0.00000 0.000 1 0.00 0.00 37.88 -2.83 -37.58 3.37 0 0 0 0
182
+ 6 12 0.013640 0.033191 0.00066 58.80 58.80 58.80 0.00000 0.000 1 0.00 0.00 33.01 -1.93 -32.86 2.25 0 0 0 0
183
+ 6 12 0.013640 0.033191 0.00066 58.80 58.80 58.80 0.00000 0.000 1 0.00 0.00 33.01 -1.93 -32.86 2.25 0 0 0 0
184
+ 7 10 0.004000 0.010000 0.00096 50.00 50.00 50.00 0.00000 0.000 1 0.00 0.00 -4.02 -1.95 4.02 1.86 0 0 0 0
185
+ 7 13 0.009410 0.027706 0.00096 40.20 40.20 40.20 0.00000 0.000 1 0.00 0.00 24.74 -2.59 -24.68 2.67 0 0 0 0
186
+ 7 13 0.009410 0.027706 0.00096 40.20 40.20 40.20 0.00000 0.000 1 0.00 0.00 24.74 -2.59 -24.68 2.67 0 0 0 0
187
+ 7 13 0.009410 0.027706 0.00096 40.20 40.20 40.20 0.00000 0.000 1 0.00 0.00 24.74 -2.59 -24.68 2.67 0 0 0 0
188
+ 8 15 0.031390 0.075848 0.00197 84.90 84.90 84.90 0.00000 0.000 1 0.00 0.00 6.16 -2.64 -6.15 2.49 0 0 0 0
189
+ 8 19 0.036990 0.102463 0.00246 90.00 90.00 90.00 0.00000 0.000 1 0.00 0.00 -35.63 1.32 36.12 -0.20 0 0 0 0
190
+ 8 19 0.036990 0.102463 0.00246 90.00 90.00 90.00 0.00000 0.000 1 0.00 0.00 -35.63 1.32 36.12 -0.20 0 0 0 0
191
+ 9 10 0.004680 0.125654 0.00000 56.20 56.20 56.20 1.00000 0.000 1 0.00 0.00 41.86 4.15 -41.78 -1.86 0 0 0 0
192
+ 9 14 0.009330 0.037848 0.01017 169.30 169.30 169.30 0.00000 0.000 1 0.00 0.00 26.66 0.90 -26.59 -1.61 0 0 0 0
193
+ 11 13 0.018440 0.047771 0.00224 45.30 45.30 45.30 0.00000 0.000 1 0.00 0.00 -15.74 -2.22 15.79 2.13 0 0 0 0
194
+ 11 15 0.023280 0.069221 0.00152 48.60 48.60 48.60 0.00000 0.000 1 0.00 0.00 -12.23 -1.15 12.26 1.11 0 0 0 0
195
+ 12 15 0.015110 0.041464 0.00414 77.00 77.00 77.00 0.00000 0.000 1 0.00 0.00 -6.98 -0.72 6.99 0.34 0 0 0 0
196
+ 12 17 0.022780 0.065341 0.00282 49.90 49.90 49.90 0.00000 0.000 1 0.00 0.00 18.68 -3.77 -18.60 3.75 0 0 0 0
197
+ 13 16 0.013090 0.032547 0.00110 52.00 52.00 52.00 0.00000 0.000 1 0.00 0.00 12.68 -14.82 -12.63 14.84 0 0 0 0
198
+ 14 15 0.003250 0.131522 0.00000 85.90 85.90 85.90 1.00000 0.000 1 0.00 0.00 37.05 3.86 -37.00 -1.97 0 0 0 0
199
+ 14 15 0.003250 0.131522 0.00000 85.90 85.90 85.90 1.00000 0.000 1 0.00 0.00 37.05 3.86 -37.00 -1.97 0 0 0 0
200
+ 16 18 0.015530 0.039228 0.00191 51.70 51.70 51.70 0.00000 0.000 1 0.00 0.00 29.91 3.82 -29.77 -3.63 0 0 0 0
201
+ 17 18 0.009840 0.029754 0.00145 47.90 47.90 47.90 0.00000 0.000 1 0.00 0.00 6.56 -3.75 -6.55 3.63 0 0 0 0
202
+ 19 23 0.012580 0.030449 0.00133 100.30 100.30 100.30 0.00000 0.000 1 0.00 0.00 -77.99 4.83 78.77 -3.07 0 0 0 0
203
+ 19 23 0.012580 0.030449 0.00133 100.30 100.30 100.30 0.00000 0.000 1 0.00 0.00 -77.99 4.83 78.77 -3.07 0 0 0 0
204
+ 19 23 0.012580 0.030449 0.00133 100.30 100.30 100.30 0.00000 0.000 1 0.00 0.00 -77.99 4.83 78.77 -3.07 0 0 0 0
205
+ 19 23 0.012580 0.030449 0.00133 100.30 100.30 100.30 0.00000 0.000 1 0.00 0.00 -77.99 4.83 78.77 -3.07 0 0 0 0
206
+ 20 23 0.042660 0.074844 0.00179 85.80 85.80 85.80 0.00000 0.000 1 0.00 0.00 -3.41 -11.81 3.47 11.75 0 0 0 0
207
+ 20 30 0.027800 0.068487 0.00300 64.40 64.40 64.40 0.00000 0.000 1 0.00 0.00 -36.15 6.18 36.53 -5.53 0 0 0 0
208
+ 20 32 0.014940 0.039916 0.00335 52.00 52.00 52.00 0.00000 0.000 1 0.00 0.00 -25.40 5.64 25.50 -5.69 0 0 0 0
209
+ 22 23 0.004450 0.116580 0.00000 149.60 149.60 149.60 1.00000 0.000 1 0.00 0.00 18.68 -3.58 -18.66 4.01 0 0 0 0
210
+ 22 23 0.004450 0.116580 0.00000 149.60 149.60 149.60 1.00000 0.000 1 0.00 0.00 18.68 -3.58 -18.66 4.01 0 0 0 0
211
+ 22 23 0.004450 0.116580 0.00000 149.60 149.60 149.60 1.00000 0.000 1 0.00 0.00 18.68 -3.58 -18.66 4.01 0 0 0 0
212
+ 22 25 0.002980 0.017679 0.00775 277.00 277.00 277.00 0.00000 0.000 1 0.00 0.00 -30.29 3.58 30.32 -4.19 0 0 0 0
213
+ 22 37 0.006820 0.040841 0.01104 292.90 292.90 292.90 0.00000 0.000 1 0.00 0.00 -46.75 -1.08 46.90 0.88 0 0 0 0
214
+ 23 34 0.030140 0.091720 0.00193 74.40 74.40 74.40 0.00000 0.000 1 0.00 0.00 -0.37 0.03 0.37 -0.22 0 0 0 0
215
+ 23 34 0.030140 0.091720 0.00193 74.40 74.40 74.40 0.00000 0.000 1 0.00 0.00 -0.37 0.03 0.37 -0.22 0 0 0 0
216
+ 24 26 0.016450 0.053480 0.00135 65.60 65.60 65.60 0.00000 0.000 1 0.00 0.00 -4.13 -1.96 4.13 1.83 0 0 0 0
217
+ 24 26 0.016450 0.053480 0.00135 65.60 65.60 65.60 0.00000 0.000 1 0.00 0.00 -4.13 -1.96 4.13 1.83 0 0 0 0
218
+ 24 33 0.016900 0.033191 0.01102 69.50 69.50 69.50 0.00000 0.000 1 0.00 0.00 -29.76 8.07 29.92 -8.84 0 0 0 0
219
+ 24 36 0.018930 0.037551 0.00194 48.70 48.70 48.70 0.00000 0.000 1 0.00 0.00 -8.56 -4.16 8.58 4.00 0 0 0 0
220
+ 25 26 0.005320 0.147265 0.00000 131.70 131.70 131.70 1.00000 0.000 1 0.00 0.00 36.07 0.68 -36.00 1.25 0 0 0 0
221
+ 25 26 0.005320 0.147265 0.00000 131.70 131.70 131.70 1.00000 0.000 1 0.00 0.00 36.07 0.68 -36.00 1.25 0 0 0 0
222
+ 25 35 0.004130 0.024420 0.00685 201.40 201.40 201.40 0.00000 0.000 1 0.00 0.00 -64.87 -2.68 65.04 3.03 0 0 0 0
223
+ 25 35 0.004130 0.024420 0.00685 201.40 201.40 201.40 0.00000 0.000 1 0.00 0.00 -64.87 -2.68 65.04 3.03 0 0 0 0
224
+ 25 37 0.004890 0.026145 0.00780 224.00 224.00 224.00 0.00000 0.000 1 0.00 0.00 -52.42 -3.14 52.55 3.08 0 0 0 0
225
+ 25 37 0.004890 0.026145 0.00780 224.00 224.00 224.00 0.00000 0.000 1 0.00 0.00 -52.42 -3.14 52.55 3.08 0 0 0 0
226
+ 27 29 0.023880 0.042832 0.00128 67.50 67.50 67.50 0.00000 0.000 1 0.00 0.00 53.65 -10.40 -52.94 11.54 0 0 0 0
227
+ 28 30 0.011200 0.031396 0.00433 70.00 70.00 70.00 0.00000 0.000 1 0.00 0.00 36.53 0.34 -36.39 -0.35 0 0 0 0
228
+ 28 30 0.011200 0.031396 0.00433 70.00 70.00 70.00 0.00000 0.000 1 0.00 0.00 36.53 0.34 -36.39 -0.35 0 0 0 0
229
+ 28 31 0.051070 0.104683 0.01435 58.30 58.30 58.30 0.00000 0.000 1 0.00 0.00 33.41 -11.66 -32.78 11.52 0 0 0 0
230
+ 29 30 0.014790 0.036656 0.00188 49.30 49.30 49.30 0.00000 0.000 1 0.00 0.00 12.82 -6.35 -12.79 6.24 0 0 0 0
231
+ 29 32 0.023150 0.061347 0.00173 60.00 60.00 60.00 0.00000 0.000 1 0.00 0.00 32.42 -5.19 -32.17 5.69 0 0 0 0
232
+ 31 33 0.026960 0.057612 0.00333 38.00 38.00 38.00 0.00000 0.000 1 0.00 0.00 23.16 -11.52 -22.98 11.58 0 0 0 0
233
+ 33 34 0.035280 0.083927 0.00256 84.30 84.30 84.30 0.00000 0.000 1 0.00 0.00 -18.78 2.78 18.91 -2.73 0 0 0 0
234
+ 33 34 0.035280 0.083927 0.00256 84.30 84.30 84.30 0.00000 0.000 1 0.00 0.00 -18.78 2.78 18.91 -2.73 0 0 0 0
235
+ 35 37 0.001520 0.008374 0.00809 297.60 297.60 297.60 0.00000 0.000 1 0.00 0.00 25.22 -4.95 -25.21 4.20 0 0 0 0
236
+ ];
237
+
238
+ %% bus names
239
+ mpc.bus_name = {
240
+ 'ALOHA138';
241
+ 'ALOHA69';
242
+ 'FLOWER69';
243
+ 'WAVE69';
244
+ 'HONOLULU138';
245
+ 'HONOLULU69';
246
+ 'SURF69';
247
+ 'KANEOHE69';
248
+ 'TURTLE138';
249
+ 'TURTLE69';
250
+ 'MAHALO69';
251
+ 'LYCHEE69';
252
+ 'COCONUT69';
253
+ 'KAILUA138';
254
+ 'KAILUA69';
255
+ 'PALM69';
256
+ 'WAIMANALO69';
257
+ 'VOLCANO69';
258
+ 'PEARL CITY69';
259
+ 'MILILANI69';
260
+ 'AIEA69';
261
+ 'WAIPAHU138';
262
+ 'WAIPAHU69';
263
+ 'KAPOLEI69';
264
+ 'EWA BEACH138';
265
+ 'EWA BEACH69';
266
+ 'KAHUKU69';
267
+ 'HALEIWA69';
268
+ 'LAIE69';
269
+ 'WAHIAWA69';
270
+ 'WAIALUA69';
271
+ 'HAUULA69';
272
+ 'WAIANAE69';
273
+ 'SCHOFIELD69';
274
+ 'KALAELOA138';
275
+ 'COGEN69';
276
+ 'KAHE138';
277
+ };
278
+
279
+ %% Generator Unit Types
280
+ mpc.gentype = {
281
+ 'UN';
282
+ 'UN';
283
+ 'UN';
284
+ 'UN';
285
+ 'UN';
286
+ 'UN';
287
+ 'UN';
288
+ 'UN';
289
+ 'UN';
290
+ 'UN';
291
+ 'UN';
292
+ 'UN';
293
+ 'UN';
294
+ 'UN';
295
+ 'UN';
296
+ 'UN';
297
+ 'UN';
298
+ 'UN';
299
+ 'UN';
300
+ 'UN';
301
+ 'UN';
302
+ 'UN';
303
+ 'UN';
304
+ 'UN';
305
+ 'UN';
306
+ 'UN';
307
+ 'UN';
308
+ 'UN';
309
+ 'UN';
310
+ 'UN';
311
+ 'UN';
312
+ 'UN';
313
+ 'UN';
314
+ 'UN';
315
+ 'UN';
316
+ 'UN';
317
+ 'UN';
318
+ 'UN';
319
+ 'UN';
320
+ 'UN';
321
+ 'UN';
322
+ 'UN';
323
+ 'UN';
324
+ 'UN';
325
+ 'UN';
326
+ };
327
+
328
+ %% Generator Fuel Types
329
+ mpc.genfuel = {
330
+ 'wood';
331
+ 'wood';
332
+ 'wood';
333
+ 'wood';
334
+ 'dfo';
335
+ 'solar';
336
+ 'dfo';
337
+ 'dfo';
338
+ 'dfo';
339
+ 'dfo';
340
+ 'dfo';
341
+ 'dfo';
342
+ 'dfo';
343
+ 'solar';
344
+ 'solar';
345
+ 'solar';
346
+ 'wind';
347
+ 'wind';
348
+ 'solar';
349
+ 'wind';
350
+ 'solar';
351
+ 'wood';
352
+ 'wood';
353
+ 'wood';
354
+ 'wood';
355
+ 'wood';
356
+ 'wood';
357
+ 'wood';
358
+ 'wood';
359
+ 'coal';
360
+ 'dfo';
361
+ 'dfo';
362
+ 'dfo';
363
+ 'dfo';
364
+ 'dfo';
365
+ 'dfo';
366
+ 'dfo';
367
+ 'dfo';
368
+ 'dfo';
369
+ 'dfo';
370
+ 'dfo';
371
+ 'dfo';
372
+ 'dfo';
373
+ 'dfo';
374
+ 'dfo';
375
+ };
@@ -8,6 +8,7 @@ function mpc = case5
8
8
 
9
9
  % Created by Rui Bo in 2006, modified in 2010, 2014.
10
10
  % Distributed with permission.
11
+ % Make up two sections gentype, genfuel, and bus_name for testing purposes.
11
12
 
12
13
  % MATPOWER
13
14
 
@@ -60,3 +61,27 @@ mpc.gencost = [
60
61
  2 0 0 2 40 0;
61
62
  2 0 0 2 10 0;
62
63
  ];
64
+
65
+ mpc.gentype = {
66
+ 'ST';
67
+ 'ST';
68
+ 'ST';
69
+ 'ST';
70
+ 'ST';
71
+ };
72
+
73
+ mpc.genfuel = {
74
+ 'coal';
75
+ 'coal';
76
+ 'coal';
77
+ 'coal';
78
+ 'coal';
79
+ };
80
+
81
+ mpc.bus_name = {
82
+ 'A';
83
+ 'B';
84
+ 'C';
85
+ 'D';
86
+ 'E';
87
+ };
ams/io/__init__.py CHANGED
@@ -25,6 +25,7 @@ input_formats = {
25
25
  'matpower': ('m', ),
26
26
  'psse': ('raw', 'dyr'),
27
27
  'pypower': ('py',),
28
+ 'powerworld': ('aux',),
28
29
  }
29
30
 
30
31
  # Output formats is a dictionary of supported output formats and their extensions
ams/io/matpower.py CHANGED
@@ -2,9 +2,10 @@
2
2
  MATPOWER parser.
3
3
  """
4
4
  import logging
5
+ import re
5
6
  import numpy as np
6
7
 
7
- from andes.io.matpower import m2mpc
8
+ from andes.io import read_file_like
8
9
  from andes.shared import deg2rad, rad2deg
9
10
 
10
11
  logger = logging.getLogger(__name__)
@@ -29,6 +30,151 @@ def read(system, file):
29
30
  return mpc2system(mpc, system)
30
31
 
31
32
 
33
+ def m2mpc(infile: str) -> dict:
34
+ """
35
+ Parse a MATPOWER file and return a dictionary containing the parsed data.
36
+
37
+ This function processes MATPOWER case files and extracts relevant fields
38
+ into a structured dictionary. It is revised from ``andes.io.matpower.m2mpc``.
39
+
40
+ Supported fields include:
41
+ - `baseMVA`: The system base power in MVA.
42
+ - `bus`: Bus data, including voltage, load, and generation information.
43
+ - `bus_name`: Names of the buses (if available).
44
+ - `gen`: Generator data, including power limits and voltage setpoints.
45
+ - `branch`: Branch data, including line impedances and ratings.
46
+ - `gencost`: Generator cost data (parsed but not used in this implementation).
47
+ - `areas`: Area data (parsed but not used in this implementation).
48
+ - `gentype`: Generator type information (if available).
49
+ - `genfuel`: Generator fuel type information (if available).
50
+
51
+ Parameters
52
+ ----------
53
+ infile : str
54
+ Path to the MATPOWER file to be parsed.
55
+
56
+ Returns
57
+ -------
58
+ dict
59
+ A dictionary containing the parsed MATPOWER data, where keys correspond
60
+ to MATPOWER struct names and values are numpy arrays or lists.
61
+ """
62
+
63
+ func = re.compile(r'function\s')
64
+ mva = re.compile(r'\s*mpc.baseMVA\s*=\s*')
65
+ bus = re.compile(r'\s*mpc.bus\s*=\s*\[?')
66
+ gen = re.compile(r'\s*mpc.gen\s*=\s*\[')
67
+ branch = re.compile(r'\s*mpc.branch\s*=\s*\[')
68
+ area = re.compile(r'\s*mpc.areas\s*=\s*\[')
69
+ gencost = re.compile(r'\s*mpc.gencost\s*=\s*\[')
70
+ bus_name = re.compile(r'\s*mpc.bus_name\s*=\s*{')
71
+ gentype = re.compile(r'\s*mpc.gentype\s*=\s*{')
72
+ genfuel = re.compile(r'\s*mpc.genfuel\s*=\s*{')
73
+ end = re.compile(r'\s*[\];}]')
74
+ has_digit = re.compile(r'.*\d+\s*]?;?')
75
+
76
+ field = None
77
+ info = True
78
+
79
+ mpc = {
80
+ 'version': 2, # not in use
81
+ 'baseMVA': 100,
82
+ 'bus': [],
83
+ 'gen': [],
84
+ 'branch': [],
85
+ 'area': [],
86
+ 'gencost': [],
87
+ 'bus_name': [],
88
+ 'gentype': [],
89
+ 'genfuel': [],
90
+ }
91
+
92
+ input_list = read_file_like(infile)
93
+
94
+ for line in input_list:
95
+ line = line.strip().rstrip(';')
96
+ if not line:
97
+ continue
98
+ elif func.search(line): # skip function declaration
99
+ continue
100
+ elif len(line.split('%')[0]) == 0:
101
+ if info is True:
102
+ logger.info(line[1:])
103
+ info = False
104
+ else:
105
+ continue
106
+ elif mva.search(line):
107
+ mpc["baseMVA"] = float(line.split('=')[1])
108
+
109
+ if not field:
110
+ if bus.search(line):
111
+ field = 'bus'
112
+ elif gen.search(line):
113
+ field = 'gen'
114
+ elif branch.search(line):
115
+ field = 'branch'
116
+ elif area.search(line):
117
+ field = 'area'
118
+ elif gencost.search(line):
119
+ field = 'gencost'
120
+ elif bus_name.search(line):
121
+ field = 'bus_name'
122
+ elif gentype.search(line):
123
+ field = 'gentype'
124
+ elif genfuel.search(line):
125
+ field = 'genfuel'
126
+ else:
127
+ continue
128
+ elif end.search(line):
129
+ field = None
130
+ continue
131
+
132
+ # parse mpc sections
133
+ if field:
134
+ if line.find('=') >= 0:
135
+ line = line.split('=')[1]
136
+ if line.find('[') >= 0:
137
+ line = re.sub(r'\[', '', line)
138
+ elif line.find('{') >= 0:
139
+ line = re.sub(r'{', '', line)
140
+
141
+ if field in ['bus_name', 'gentype', 'genfuel']:
142
+ # Handle string-based fields
143
+ line = line.split(';')
144
+ data = [i.strip('\'').strip() for i in line if i.strip()]
145
+ mpc[field].extend(data)
146
+ else:
147
+ if not has_digit.search(line):
148
+ continue
149
+ line = line.split('%')[0].strip()
150
+ line = line.split(';')
151
+ for item in line:
152
+ if not has_digit.search(item):
153
+ continue
154
+ try:
155
+ data = np.array([float(val) for val in item.split()])
156
+ except Exception as e:
157
+ logger.error('Error parsing "%s"', infile)
158
+ raise e
159
+ mpc[field].append(data)
160
+
161
+ # convert mpc to np array
162
+ mpc_array = dict()
163
+ for key, val in mpc.items():
164
+ if isinstance(val, (float, int)):
165
+ mpc_array[key] = val
166
+ elif isinstance(val, list):
167
+ if len(val) == 0:
168
+ continue
169
+ if key in ['bus_name', 'gentype', 'genfuel']:
170
+ mpc_array[key] = np.array(val, dtype=object)
171
+ else:
172
+ mpc_array[key] = np.array(val)
173
+ else:
174
+ raise NotImplementedError("Unknown type for mpc, ", type(val))
175
+ return mpc_array
176
+
177
+
32
178
  def mpc2system(mpc: dict, system) -> bool:
33
179
  """
34
180
  Load an mpc dict into an empty AMS system.
@@ -97,7 +243,20 @@ def mpc2system(mpc: dict, system) -> bool:
97
243
  mpc_gen[:, 19] = system.PV.Rq.default * base_mva / 60
98
244
  else:
99
245
  mpc_gen = mpc['gen']
100
- for data in mpc_gen:
246
+
247
+ # Ensure 'gentype' and 'genfuel' keys exist in mpc, with default values if missing
248
+ gentype = mpc.get('gentype', [''] * mpc_gen.shape[0])
249
+ genfuel = mpc.get('genfuel', [''] * mpc_gen.shape[0])
250
+
251
+ # Validate lengths of 'gentype' and 'genfuel' against the number of generators
252
+ if len(gentype) != mpc_gen.shape[0]:
253
+ raise ValueError(
254
+ f"'gentype' length ({len(gentype)}) does not match the number of generators ({mpc_gen.shape[0]})")
255
+ if len(genfuel) != mpc_gen.shape[0]:
256
+ raise ValueError(
257
+ f"'genfuel' length ({len(genfuel)}) does not match the number of generators ({mpc_gen.shape[0]})")
258
+
259
+ for data, gt, gf in zip(mpc_gen, gentype, genfuel):
101
260
  # bus pg qg qmax qmin vg mbase status pmax pmin
102
261
  # 0 1 2 3 4 5 6 7 8 9
103
262
  # pc1 pc2 qc1min qc1max qc2min qc2max ramp_agc ramp_10
@@ -142,7 +301,7 @@ def mpc2system(mpc: dict, system) -> bool:
142
301
  Qc2min=qc2min, Qc2max=qc2max,
143
302
  Ragc=ramp_agc, R10=ramp_10,
144
303
  R30=ramp_30, Rq=ramp_q,
145
- apf=apf)
304
+ apf=apf, gentype=gt, genfuel=gf)
146
305
  else:
147
306
  system.add('PV', idx=gen_idx, bus=bus_idx, busr=bus_idx,
148
307
  name=None,
@@ -155,7 +314,7 @@ def mpc2system(mpc: dict, system) -> bool:
155
314
  Qc2min=qc2min, Qc2max=qc2max,
156
315
  Ragc=ramp_agc, R10=ramp_10,
157
316
  R30=ramp_30, Rq=ramp_q,
158
- apf=apf)
317
+ apf=apf, gentype=gt, genfuel=gf)
159
318
 
160
319
  for data in mpc['branch']:
161
320
  # fbus tbus r x b rateA rateB rateC ratio angle
@@ -204,9 +363,8 @@ def mpc2system(mpc: dict, system) -> bool:
204
363
  gen_idx = np.arange(mpc['gen'].shape[0]) + 1
205
364
  mpc_cost = mpc['gencost']
206
365
  if mpc_cost[0, 0] == 1:
207
- logger.warning("Type 1 gencost detected. "
208
- "This is not supported in AMS. "
209
- "Default type 2 cost parameters will be used as a fallback."
366
+ logger.warning("Type 1 gencost detected, which is not supported in AMS.\n"
367
+ "Default type 2 cost parameters will be used as a fallback.\n"
210
368
  "It is recommended to manually convert the gencost data to type 2.")
211
369
  mpc_cost = np.repeat(np.array([[2, 0, 0, 3, 0, 0, 0]]),
212
370
  mpc_cost.shape[0], axis=0)
ams/io/psse.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """
2
- Excel reader and writer for AMS.
2
+ PSS/E .raw reader for AMS.
3
3
  This module is the existing module in ``andes.io.psse``.
4
4
  """
5
5
 
ams/models/group.py CHANGED
@@ -175,20 +175,91 @@ class Reserve(GroupBase):
175
175
 
176
176
  class StaticGen(GroupBase):
177
177
  """
178
- Generator group.
178
+ Static Generator Group.
179
+
180
+ The generator types and fuel types are referenced from MATPOWER.
181
+
182
+ Generator Types
183
+ ---------------
184
+ The following codes represent the types of generators:
185
+ - BA : Energy Storage, Battery
186
+ - CE : Energy Storage, Compressed Air
187
+ - CP : Energy Storage, Concentrated Solar Power
188
+ - FW : Energy Storage, Flywheel
189
+ - PS : Hydraulic Turbine, Reversible (pumped storage)
190
+ - ES : Energy Storage, Other
191
+ - ST : Steam Turbine (includes nuclear, geothermal, and solar steam)
192
+ - GT : Combustion (Gas) Turbine
193
+ - IC : Internal Combustion Engine (diesel, piston, reciprocating)
194
+ - CA : Combined Cycle Steam Part
195
+ - CT : Combined Cycle Combustion Turbine Part
196
+ - CS : Combined Cycle Single Shaft
197
+ - CC : Combined Cycle Total Unit
198
+ - HA : Hydrokinetic, Axial Flow Turbine
199
+ - HB : Hydrokinetic, Wave Buoy
200
+ - HK : Hydrokinetic, Other
201
+ - HY : Hydroelectric Turbine
202
+ - BT : Turbines Used in a Binary Cycle
203
+ - PV : Photovoltaic
204
+ - WT : Wind Turbine, Onshore
205
+ - WS : Wind Turbine, Offshore
206
+ - FC : Fuel Cell
207
+ - OT : Other
208
+ - UN : Unknown
209
+ - JE : Jet Engine
210
+ - NB : ST - Boiling Water Nuclear Reactor
211
+ - NG : ST - Graphite Nuclear Reactor
212
+ - NH : ST - High Temperature Gas Nuclear Reactor
213
+ - NP : ST - Pressurized Water Nuclear Reactor
214
+ - IT : Internal Combustion Turbo Charged
215
+ - SC : Synchronous Condenser
216
+ - DC : DC ties
217
+ - MP : Motor/Pump
218
+ - W1 : Wind Turbine, Type 1
219
+ - W2 : Wind Turbine, Type 2
220
+ - W3 : Wind Turbine, Type 3
221
+ - W4 : Wind Turbine, Type 4
222
+ - SV : Static Var Compensator
223
+ - DL : Dispatchable Load
224
+
225
+ Fuel Types
226
+ ----------
227
+ The following codes represent the fuel types:
228
+ - biomass : Biomass
229
+ - coal : Coal
230
+ - dfo : Distillate Fuel Oil
231
+ - geothermal : Geothermal
232
+ - hydro : Hydro
233
+ - hydrops : Hydro Pumped Storage
234
+ - jetfuel : Jet Fuel
235
+ - lng : Liquefied Natural Gas
236
+ - ng : Natural Gas
237
+ - nuclear : Nuclear
238
+ - oil : Unspecified Oil
239
+ - refuse : Refuse, Municipal Solid Waste
240
+ - rfo : Residual Fuel Oil
241
+ - solar : Solar
242
+ - syncgen : Synchronous Condenser
243
+ - wasteheat : Waste Heat
244
+ - wind : Wind
245
+ - wood : Wood or Wood Waste
246
+ - other : Other
247
+ - unknown : Unknown
248
+ - dl : Dispatchable Load
249
+ - ess : Energy Storage System
179
250
 
180
251
  Notes
181
252
  -----
182
- For co-simulation with ANDES, check
183
- `ANDES StaticGen <https://docs.andes.app/en/latest/groupdoc/StaticGen.html#staticgen>`_
184
- for replacing static generators with dynamic generators.
253
+ For co-simulation with ANDES, refer to the `ANDES StaticGen Documentation
254
+ <https://docs.andes.app/en/latest/groupdoc/StaticGen.html#staticgen>`_ for
255
+ replacing static generators with dynamic generators.
185
256
  """
186
257
 
187
258
  def __init__(self):
188
259
  super().__init__()
189
260
  self.common_params.extend(('bus', 'Sn', 'Vn', 'p0', 'q0', 'ra', 'xs', 'subidx',
190
261
  'pmax', 'pmin', 'pg0', 'ctrl', 'R10', 'td1', 'td2',
191
- 'area', 'zone'))
262
+ 'area', 'zone', 'gentype', 'genfuel'))
192
263
  self.common_vars.extend(('p', 'q'))
193
264
 
194
265
 
ams/models/line.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from andes.models.line.line import LineData
2
2
  from andes.models.line.jumper import JumperData
3
3
  from andes.core.param import NumParam
4
- from andes.shared import deg2rad, np, spmatrix
4
+ from andes.shared import deg2rad
5
5
 
6
6
  from ams.core.model import Model
7
7
 
@@ -49,167 +49,6 @@ class Line(LineData, Model):
49
49
  self.a1a = None
50
50
  self.a2a = None
51
51
 
52
- # NOTE: following code are minly copied from `andes.models.line.Line`
53
- # and they are not fully verified
54
- # potential issues:
55
- # `build_Bp` contains 'fdxb', which is not included in the input parameters,
56
- # and the results are the negative of `Bbus` from `makeBdc` in PYPOWER
57
- # `build_Bpp` ignores the line resistance for all three methods
58
- # `build_Bdc` results are the negative of `Bbus` from `makeBdc` in PYPOWER
59
- # `build_y` results have inignorable differences at diagonal elements with `makeYbus` in PYPOWER
60
-
61
- def build_y(self):
62
- """
63
- Build bus admittance matrix. Copied from ``andes.models.line.line.Line``.
64
-
65
- Returns
66
- -------
67
- Y : spmatrix
68
- Bus admittance matrix.
69
- """
70
-
71
- nb = self.system.Bus.n
72
-
73
- y1 = self.u.v * (self.g1.v + self.b1.v * 1j)
74
- y2 = self.u.v * (self.g2.v + self.b2.v * 1j)
75
- y12 = self.u.v / (self.r.v + self.x.v * 1j)
76
- m = self.tap.v * np.exp(1j * self.phi.v)
77
- m2 = self.tap.v**2
78
- mconj = np.conj(m)
79
-
80
- # build self and mutual admittances into Y
81
- Y = spmatrix((y12 + y1 / m2), self.a1a, self.a1a, (nb, nb), 'z')
82
- Y -= spmatrix(y12 / mconj, self.a1a, self.a2a, (nb, nb), 'z')
83
- Y -= spmatrix(y12 / m, self.a2a, self.a1a, (nb, nb), 'z')
84
- Y += spmatrix(y12 + y2, self.a2a, self.a2a, (nb, nb), 'z')
85
-
86
- return Y
87
-
88
- def build_Bp(self, method='fdpf'):
89
- """
90
- Function for building B' matrix.
91
-
92
- Parameters
93
- ----------
94
- method : str
95
- Method for building B' matrix. Choose from 'fdpf', 'fdbx', 'dcpf'.
96
-
97
- Returns
98
- -------
99
- Bp : spmatrix
100
- B' matrix.
101
- """
102
- nb = self.system.Bus.n
103
-
104
- if method not in ("fdpf", "fdbx", "dcpf"):
105
- raise ValueError(f"Invalid method {method}; choose from 'fdpf', 'fdbx', 'dcpf'")
106
-
107
- # Build B prime matrix -- FDPF
108
- # `y1`` neglects line charging shunt, and g1 is usually 0 in HV lines
109
- # `y2`` neglects line charging shunt, and g2 is usually 0 in HV lines
110
- y1 = self.u.v * self.g1.v
111
- y2 = self.u.v * self.g2.v
112
-
113
- # `m` neglected tap ratio
114
- m = np.exp(self.phi.v * 1j)
115
- mconj = np.conj(m)
116
- m2 = np.ones(self.n)
117
-
118
- if method in ('fdxb', 'dcpf'):
119
- # neglect line resistance in Bp in XB method
120
- y12 = self.u.v / (self.x.v * 1j)
121
- else:
122
- y12 = self.u.v / (self.r.v + self.x.v * 1j)
123
-
124
- Bdc = spmatrix((y12 + y1) / m2, self.a1a, self.a1a, (nb, nb), 'z')
125
- Bdc -= spmatrix(y12 / mconj, self.a1a, self.a2a, (nb, nb), 'z')
126
- Bdc -= spmatrix(y12 / m, self.a2a, self.a1a, (nb, nb), 'z')
127
- Bdc += spmatrix(y12 + y2, self.a2a, self.a2a, (nb, nb), 'z')
128
- Bdc = Bdc.imag()
129
-
130
- for item in range(nb):
131
- if abs(Bdc[item, item]) == 0:
132
- Bdc[item, item] = 1e-6 + 0j
133
-
134
- return Bdc
135
-
136
- def build_Bpp(self, method='fdpf'):
137
- """
138
- Function for building B'' matrix.
139
-
140
- Parameters
141
- ----------
142
- method : str
143
- Method for building B'' matrix. Choose from 'fdpf', 'fdbx', 'dcpf'.
144
-
145
- Returns
146
- -------
147
- Bpp : spmatrix
148
- B'' matrix.
149
- """
150
-
151
- nb = self.system.Bus.n
152
-
153
- if method not in ("fdpf", "fdbx", "dcpf"):
154
- raise ValueError(f"Invalid method {method}; choose from 'fdpf', 'fdbx', 'dcpf'")
155
-
156
- # Build B double prime matrix
157
- # y1 neglected line charging shunt, and g1 is usually 0 in HV lines
158
- # y2 neglected line charging shunt, and g2 is usually 0 in HV lines
159
- # m neglected phase shifter
160
- y1 = self.u.v * (self.g1.v + self.b1.v * 1j)
161
- y2 = self.u.v * (self.g2.v + self.b2.v * 1j)
162
-
163
- m = self.tap.v
164
- m2 = abs(m)**2
165
-
166
- if method in ('fdbx', 'fdpf', 'dcpf'):
167
- # neglect line resistance in Bpp in BX method
168
- y12 = self.u.v / (self.x.v * 1j)
169
- else:
170
- y12 = self.u.v / (self.r.v + self.x.v * 1j)
171
-
172
- Bpp = spmatrix((y12 + y1) / m2, self.a1a, self.a1a, (nb, nb), 'z')
173
- Bpp -= spmatrix(y12 / np.conj(m), self.a1a, self.a2a, (nb, nb), 'z')
174
- Bpp -= spmatrix(y12 / m, self.a2a, self.a1a, (nb, nb), 'z')
175
- Bpp += spmatrix(y12 + y2, self.a2a, self.a2a, (nb, nb), 'z')
176
- Bpp = Bpp.imag()
177
-
178
- for item in range(nb):
179
- if abs(Bpp[item, item]) == 0:
180
- Bpp[item, item] = 1e-6 + 0j
181
-
182
- return Bpp
183
-
184
- def build_Bdc(self):
185
- """
186
- The MATPOWER-flavor Bdc matrix for DC power flow.
187
-
188
- The method neglects line charging and line resistance. It retains tap ratio.
189
-
190
- Returns
191
- -------
192
- Bdc : spmatrix
193
- Bdc matrix.
194
- """
195
-
196
- nb = self.system.Bus.n
197
-
198
- y12 = self.u.v / (self.x.v * 1j)
199
- y12 = y12 / self.tap.v
200
-
201
- Bdc = spmatrix(y12, self.a1a, self.a1a, (nb, nb), 'z')
202
- Bdc -= spmatrix(y12, self.a1a, self.a2a, (nb, nb), 'z')
203
- Bdc -= spmatrix(y12, self.a2a, self.a1a, (nb, nb), 'z')
204
- Bdc += spmatrix(y12, self.a2a, self.a2a, (nb, nb), 'z')
205
- Bdc = Bdc.imag()
206
-
207
- for item in range(nb):
208
- if abs(Bdc[item, item]) == 0:
209
- Bdc[item, item] = 1e-6
210
-
211
- return Bdc
212
-
213
52
 
214
53
  class Jumper(JumperData, Model):
215
54
  """
ams/models/static/gen.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from collections import OrderedDict
2
2
 
3
- from andes.core.param import NumParam, ExtParam
3
+ from andes.core.param import NumParam, ExtParam, DataParam
4
4
  from andes.models.static.pv import PVData
5
5
  from andes.models.static.slack import SlackData
6
6
 
@@ -81,6 +81,14 @@ class GenParam:
81
81
  tex_name=r't_{d2}',
82
82
  unit='h',
83
83
  )
84
+ self.gentype = DataParam(default=None,
85
+ info='generator type',
86
+ tex_name=r'g_{type}',
87
+ )
88
+ self.genfuel = DataParam(default=None,
89
+ info='generator fuel type',
90
+ tex_name=r'g_{fuel}',
91
+ )
84
92
 
85
93
 
86
94
  class PVModel(Model):
ams/routines/dcpf0.py CHANGED
@@ -168,7 +168,7 @@ class DCPF0(RoutineBase):
168
168
  if self.exit_code == 0:
169
169
  msg = f"<{self.class_name}> solved in {s}, converged in "
170
170
  msg += n_iter_str + f"with {sstats['solver_name']}."
171
- logger.info(msg)
171
+ logger.warning(msg)
172
172
  try:
173
173
  self.unpack(res)
174
174
  except Exception as e:
@@ -7,7 +7,7 @@ License
7
7
 
8
8
  GNU Public License v3
9
9
  *********************
10
- | Copyright :raw-html:`&copy;` 2023-2024 Jinning Wang.
10
+ | Copyright :raw-html:`&copy;` 2023-2025 Jinning Wang.
11
11
 
12
12
  AMS is free software; you can redistribute it and/or modify it under the terms
13
13
  of the `GNU General Public License <http://www.gnu.org/licenses/gpl-3.0.html>`_
@@ -9,6 +9,16 @@ The APIs before v3.0.0 are in beta and may change without prior notice.
9
9
  v1.0
10
10
  ==========
11
11
 
12
+ v1.0.8 (2024-04-20)
13
+ --------------------
14
+
15
+ - Run workflow "Publish" only on push tag event
16
+ - Include Hawaii synthetic case from
17
+ `Hawaii Synthetic Grid <https://electricgrids.engr.tamu.edu/hawaii40/>`_
18
+ - Remove matrices calculation functions in model ``Line``
19
+ - Include ``gentype`` and ``genfuel`` when parsing MATPOWER cases
20
+ - Fix logging level in ``ACOPF.run``
21
+
12
22
  v1.0.7 (2024-04-14)
13
23
  --------------------
14
24
 
@@ -19,6 +29,8 @@ v1.0.7 (2024-04-14)
19
29
  - Include module ``MatProcessor`` in the API documentation
20
30
  - Improve Line parameters correction in ``System.setup()``
21
31
  - Make func ``interface._to_andes_pflow`` public
32
+ - Discard ``sync_adsys`` step in func ``to_andes_pflow`` to fix mistake in
33
+ parameters conversion
22
34
  - Update case files
23
35
 
24
36
  v1.0.6 (2024-04-10)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ltbams
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: Python software for scheduling modeling and co-simulation with dynamics.
5
5
  Home-page: https://github.com/CURENT/ams
6
6
  Author: Jinning Wang
@@ -1,6 +1,6 @@
1
1
  ams/__init__.py,sha256=dKIwng8xES4NQHn6ZHy8RCKeXphN9z2wyfmbvniIEg0,351
2
2
  ams/__main__.py,sha256=EB4GfGiKgvnQ_psNr0QwPoziYvjmGvQ2yVsBwQtfrLw,170
3
- ams/_version.py,sha256=OAPUdjEgjrXQonMYZMpBIDd9aovta238shZS3_AbAQ8,497
3
+ ams/_version.py,sha256=l75Msd6bSTQ0CAX_Sc-wAbTvXkpOZ2xKEDedkXIFFlY,497
4
4
  ams/cli.py,sha256=EyNFXn565gFCppTxpyTZviBdPgUuKtgAPZ4WE6xewRk,6164
5
5
  ams/interface.py,sha256=_aF2VrO_hmVrW56H_q4CYWJps63nWUswCd3AWUbPbE8,44880
6
6
  ams/main.py,sha256=wzKLe_BeQAUyFh-U1cxQIOwr-rAJM8ppB3EEi6_v2tw,23607
@@ -10,6 +10,7 @@ ams/system.py,sha256=AW2_rMH0wjTuxhha87hQuyUCAllzWTfEsVBaTIiSAOg,25956
10
10
  ams/cases/5bus/pjm5bus_demo.xlsx,sha256=OWIUprkg8_aQ_bTCaEFMl7Bhfa1R20zxAHXRQtXBix0,32607
11
11
  ams/cases/5bus/pjm5bus_ev.xlsx,sha256=vR8dJv5jIxib1pgcMonhzvraoqZVJWhBSJdVXDL0qsI,19498
12
12
  ams/cases/5bus/pjm5bus_jumper.xlsx,sha256=47QAol1RGz_aGvhV2emq9XCy_Db9Zca15_OMVAdFVR0,19332
13
+ ams/cases/hawaii40/Hawaii40.m,sha256=t6YZwncQrMhZg3yDXh38oqDMY3akrdvCPf97nNm1otw,20683
13
14
  ams/cases/ieee123/ieee123.xlsx,sha256=yWsEFN1BvcoBYX9hWdrenPC_qKQfXtZ4xhpwoIc2OSE,39223
14
15
  ams/cases/ieee123/ieee123_regcv1.xlsx,sha256=dIygkiNGzo_RE0moMPFu-9Bt0uPDuAL9zYWAs6e8VSk,41678
15
16
  ams/cases/ieee14/ieee14.json,sha256=bBy3i2jKqFNmnc_rmNOYvGm-SAW2T6wwvEQ-Hkj5Hkw,21400
@@ -26,7 +27,7 @@ ams/cases/matpower/case118.m,sha256=vC5vIrS553ZXKIXuS1Dk9Ksu4MVXfpEm6G2QbxTEtfc,
26
27
  ams/cases/matpower/case14.m,sha256=L_xOG3NK5sXpLb5otONgEO1pWku8xNBlx0xPvDn888E,4597
27
28
  ams/cases/matpower/case300.m,sha256=L3mWBAncy5pHy53nycEXPmmRh1Rl-ZtlsELXwQGX4S8,65678
28
29
  ams/cases/matpower/case39.m,sha256=RAgz-ZjR2HaMYgR32stq_U4D8l85S7DSAFJFE60_3Dw,9628
29
- ams/cases/matpower/case5.m,sha256=7ZByCJ0IDeveKqAp7YqVSRwxGwj_T0Wte_Bogthv4nk,1921
30
+ ams/cases/matpower/case5.m,sha256=5KbGGXoS5Abx2mHZqX-vmmNEQ5AhhG4qo6Q6YZz9Qxs,2169
30
31
  ams/cases/matpower/case_ACTIVSg2000.m,sha256=jQBhjej9EL81pZn1nS3uv-zQ2G4o_P9zIZrXxOurhgs,659546
31
32
  ams/cases/npcc/npcc.m,sha256=QrYcufKlHrXr5nFC2Z92X05_Q1Rn3Nf11HCCYenAaC0,26342
32
33
  ams/cases/npcc/npcc_uced.xlsx,sha256=zuaZEOBwdOHwK5hFgQSXownyH-MfKDZQ-iVFeaFVSyg,86557
@@ -43,19 +44,19 @@ ams/core/symprocessor.py,sha256=HegjU_UnvWEny9kitI1su9J0WeFDjQnM4gNoeUGJ7qU,8428
43
44
  ams/core/var.py,sha256=f48pzir4miBsB5sh6PwUsFe0LdNNEM-d3VufcjbUU0w,1591
44
45
  ams/extension/__init__.py,sha256=5IFTNirDL0uDaUsg05_oociVT9VCy2rhPx1ad4LGveM,65
45
46
  ams/extension/eva.py,sha256=wUF8RNxzwas2Q6_xD0k3EVWjmX4kxHmTSkv2inJzaUY,16342
46
- ams/io/__init__.py,sha256=HLE3aozzXEx-6IBy8WTQVdSCpAZrrR9nX6UqaZ7okTw,3774
47
+ ams/io/__init__.py,sha256=GIfF7X44olHaySL8EzOBU1eXUnunr1owzzdPfPvvHZU,3802
47
48
  ams/io/json.py,sha256=IurwcZDuKczSbRTpcbQZiIi0ARCrMK6kJ0E3wS8ENy8,2585
48
- ams/io/matpower.py,sha256=Oj3FW-eqcl3H5mnB0U5XG1mtCK0SaxVOkgRXaC6MIKA,14523
49
- ams/io/psse.py,sha256=w5VKNE6enX0lfKwPI857PRtdpwN39R6IFRIcdbPSpOg,151
49
+ ams/io/matpower.py,sha256=SNYvCO0Be9rdM4PPPFuK6H2JuOLflFpWQloFtG59uIM,20174
50
+ ams/io/psse.py,sha256=TOLsGuoFWpgLRK_zZqjCLIjd9fHAlfgjbDm84okw3p0,145
50
51
  ams/io/pypower.py,sha256=E6_kSNfv1Yyv9oYfFebeNeKaQPlHyRZQpE8F6Y67g8Q,2583
51
52
  ams/io/xlsx.py,sha256=7ATW1seyxsGn7d5p5IuSRFHcoCHVVjMu3E7mP1Mc74U,2460
52
53
  ams/models/__init__.py,sha256=EGkViLkVX_We9FAGuEkgfleMNmPw_vGp2Nq1OQimL7U,691
53
54
  ams/models/area.py,sha256=AKYU6aJQKsVWRZdvMO7yic-8wZ1GumSTQXgDg5L0THw,899
54
55
  ams/models/bus.py,sha256=U0vSegkm-9fqPQS9KMJQU6gpIMX_1GK5O_dvRc8-0P0,1585
55
56
  ams/models/cost.py,sha256=rmGNj9ztMbqA-OIJj8fNNBh8bdYJSY9hk10vffgxc6k,5916
56
- ams/models/group.py,sha256=EEB66FwLq6liC6lGHax3oXIFxlwdYb4JMeDLnbLg6j4,5618
57
+ ams/models/group.py,sha256=AS3kAK7vsRAKpqd-_tS953PFDttnV45ujg6i4QKk_xQ,8399
57
58
  ams/models/info.py,sha256=Oh0Xo5J4ZHBsNIkMOzIwv_DegsX1inyuv3Q5CpCfyQw,788
58
- ams/models/line.py,sha256=dltKgVZdXj_kchA9QhHeyorYQKm_7PQW9B2qC_PTsKs,8084
59
+ ams/models/line.py,sha256=ju5h1BcW4kgVWm_lgl8zWhSYqlsUjbdoUwzz2t0Vx1s,2770
59
60
  ams/models/reserve.py,sha256=3BjWCyKrPL4CwTvmzRxk25H8Nkxh-Rz0Ne17I9Y2TUA,2816
60
61
  ams/models/shunt.py,sha256=h5QV33EcCd86XRR0sMIzcO0PTeTirkWaxi8imPKzOi0,337
61
62
  ams/models/timeslot.py,sha256=XfXJukbQXTUawbsYI6BMLbytXNIe5VE2SQ5_t1Lc8_8,2001
@@ -67,7 +68,7 @@ ams/models/distributed/pvd1.py,sha256=KAOlXpZgT_w58xaGWjm5ht6ksac6eRhaqBFHK4EPRH
67
68
  ams/models/renewable/__init__.py,sha256=7dZyRXbvBAHbLJeJssJ1hsOHj9Bgeg77kB5gcX_mBtg,118
68
69
  ams/models/renewable/regc.py,sha256=3J9alIGUn_GkibQ3-dKTylAOpNPzd5zpancPc79q9T4,3448
69
70
  ams/models/static/__init__.py,sha256=lh5yR5Xb2unS4ndng-cLU1TAeoidu2s6VAVFLc3HUDU,96
70
- ams/models/static/gen.py,sha256=SAaQD5_oOGFWa8NY8hbhsNqMQGHlToHdngEt_Xy5S3E,6685
71
+ ams/models/static/gen.py,sha256=QXklOYlnU7QHWy-WFJwhxuNItUPqFsLJIjAO4sGMUbg,7087
71
72
  ams/models/static/pq.py,sha256=a-z7-1Vegr3mPguRAdLqfJlwk5OG_Zpp8usfOzRAR30,2583
72
73
  ams/opt/__init__.py,sha256=INsl8yxtOzTKqV9pzVxlL6RSGDRaUDwxpZMY1QROrF4,459
73
74
  ams/opt/constraint.py,sha256=ERT9zwjQyGkvDo465Yd0wBexlIhjVmw0MyWq4BWnWoI,5534
@@ -105,7 +106,7 @@ ams/routines/cpf.py,sha256=xsrUVjtGQ1b7UCXpwwYihqzTeEGJJKnO9LlX1Tz9Tks,1552
105
106
  ams/routines/dcopf.py,sha256=6ETgopvX9tSFF3kssHsBchAttcyo2DTG-eIqjvlk0WY,11087
106
107
  ams/routines/dcopf2.py,sha256=sDCP8zqYHDh7s7p9SX6G8QhMfIxCg3VPYJn6r3pRKyo,3620
107
108
  ams/routines/dcpf.py,sha256=SswIb7t37ulxe1rjroA7oSa6z01kYjO-x8P1WWOUutM,8237
108
- ams/routines/dcpf0.py,sha256=gPPfSUzzJbHz_gAEFVyZ3iriEHvLJ-OGpTzhza8FOkA,6811
109
+ ams/routines/dcpf0.py,sha256=V9zfBoV0cRMFLJdLrpvieyvwTybLTZADPoaKMJLKSkY,6814
109
110
  ams/routines/dopf.py,sha256=8D36-FkPORYGaMnwGTqwz8HxAXk5ywo3mk8NlGq327g,6289
110
111
  ams/routines/ed.py,sha256=i0Y3COlz4oAf8u8JxqfuQWn6WxjJzb59weLedow0Y_g,11777
111
112
  ams/routines/pflow.py,sha256=CZAiwnZYhEmSU7Exn9CK6rFxWvjpvv1Py-pLegWJ71s,9419
@@ -124,13 +125,13 @@ docs/source/conf.py,sha256=UyoWogZTUNSJU7pQS_JaR28nKddW94zr01LYoIciZZw,6688
124
125
  docs/source/genmodelref.py,sha256=IhmF7bDw8BXPvLD8V3WjQNrfc-H07r5iS-_4DHbbp-8,1420
125
126
  docs/source/genroutineref.py,sha256=0JyMc2kV5bWrWbSoO6d7o4QgDgG8mVy3JGGQWacJypw,1064
126
127
  docs/source/index.rst,sha256=N5phQS5RIyYs-NZo_5yYB8LjvHzOKLeXzRA-M8i-g3Q,2688
127
- docs/source/release-notes.rst,sha256=KHsxEcYBAKMF19k9sl6FyO5Et4ecRutohZvkC6vr1PA,13787
128
+ docs/source/release-notes.rst,sha256=8655hUeA11Fxd-fTIUUtTrsfhwi9nnEbwCduTTiIzmc,14250
128
129
  docs/source/_templates/autosummary/base.rst,sha256=zl3U4baR4a6YjsHyT-x9zCOrHwKZOVUdWn1NPX2u3bc,106
129
130
  docs/source/_templates/autosummary/class.rst,sha256=Hv_igCsLsUpM62_zN0nqj6FSfKnS5xLyu8ZldMbfOAk,668
130
131
  docs/source/_templates/autosummary/module.rst,sha256=YdbpCudOrEU-JbuSlzGvcOI2hn_KrCM6FW5HcGqkaEE,1113
131
132
  docs/source/_templates/autosummary/module_toctree.rst,sha256=sg30OdqFDLyo8Y3hl9V-s2BXb1bzcjjqqWaWi-C3qFM,1126
132
133
  docs/source/examples/index.rst,sha256=6VT3wVeKk8BWf6pJQtZrmcumW_3jI8esdlzja8scUCA,742
133
- docs/source/getting_started/copyright.rst,sha256=XBfWvLm7T8p-zh1jkDy1kODvTDcH73AEV_vkiN32A2o,715
134
+ docs/source/getting_started/copyright.rst,sha256=d3S7FjrbysVqQd3pEBadrrkcQOZ7sYYeDTCOS4goPC8,715
134
135
  docs/source/getting_started/index.rst,sha256=mcp1NdUwbPoNzpn7Owf5Qzfd6J_--ToU52PjmrbwjBY,1512
135
136
  docs/source/getting_started/install.rst,sha256=gE4L0ApiC_mwbjbYtkGW4ilyIAu_Jn-VIeoYlgRiOIw,7268
136
137
  docs/source/getting_started/overview.rst,sha256=Zy890bDCUVW37NvjhQFUJUae1Zkghr72Az4Qd0PhP_I,1068
@@ -156,13 +157,12 @@ docs/source/modeling/system.rst,sha256=NMOPNMOKG1_dRyNPPx-MiCKbbpadxWJxGyU6geRUs
156
157
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
158
  tests/test_1st_system.py,sha256=BLlJsHnEBeLfiMJvIjyPguMikfDjqGSzfn8cZ-tqCVc,1900
158
159
  tests/test_addressing.py,sha256=MIT713KCqMg0h2o4rBDZsGUrpGadmMlXnrrdq-wB77E,1364
159
- tests/test_andes_mats.py,sha256=O4nCthteh7Y91KsWnq_EcplvsIN8DY-lgEGkH5a7iOc,1669
160
160
  tests/test_case.py,sha256=8Jn1hwrB72l6-rqbCWTGJOcxicu4GHVDzGsLLxjDFos,8833
161
161
  tests/test_cli.py,sha256=TtCGBy2e7Ll_2gJTFo9juZtzhaakho_MqkcqhG2w2dk,870
162
162
  tests/test_export_csv.py,sha256=rZCafNrVbwDo7ZNC4MrL1gIcrU0c6YVw2q-QGL3O4K4,2921
163
163
  tests/test_group.py,sha256=Tq0s9gtenqrv4ws5YNzWxbiF4WgyhtMEAXZfJtew6M4,2699
164
164
  tests/test_interface.py,sha256=lXKR8OAsGIg5dV2Uj0UwGAl69hKnc_7EtCYvpP_0rrU,8157
165
- tests/test_io.py,sha256=LaNkRXZaItAFHqqXs6CC5iaxTMXiDEFGbwYODcOHPWc,1416
165
+ tests/test_io.py,sha256=epa2f7gnZPAd-bX8MRmYn53ohk0H_SzGABuKOO5zn6g,2137
166
166
  tests/test_jumper.py,sha256=bdOknplEGnO_tiJc7p3xQvgTe2b6Dz53bOgbFaXKMAI,537
167
167
  tests/test_known_good.py,sha256=NBrlAxnVMxIHXR2cWps-Kwjh36fiU4Y-eupspZkM0ks,9670
168
168
  tests/test_matp.py,sha256=LkjhqxSFr6oY_ENpduDQ77rhLLBl6RzIHZ2d0m_8i-8,17262
@@ -180,8 +180,8 @@ tests/test_rtn_pflow.py,sha256=aDL5Ewm6lWqpdHqIIu-DTllhXzt4bMjsLJaKbJa8sXQ,6990
180
180
  tests/test_rtn_rted.py,sha256=1Vd4JCX3sfLnuXXzuUGFsEPTtqmdaDzDXpBcAQwnDf0,9785
181
181
  tests/test_rtn_uc.py,sha256=8KrqxOxW6tiN4Fxl417NyHJCgdZwXh2ioX0mQbHuEgU,8302
182
182
  tests/test_service.py,sha256=6IP6CAH2xHxGHZM4-R8LjZxVJ2L10LcGaPDyRIqKLmc,2438
183
- ltbams-1.0.7.dist-info/METADATA,sha256=Wd2Mlqkkwsqm2zA1DNsDL-RS55TJe8Ptod_oAWB55O8,14023
184
- ltbams-1.0.7.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
185
- ltbams-1.0.7.dist-info/entry_points.txt,sha256=FA56FlhO_yVNeEf810SrorVQb7_Xsmo3_EW-W-ijUfA,37
186
- ltbams-1.0.7.dist-info/top_level.txt,sha256=pyKDqG2kj13F9-BYd_wkruRdBSqLXw8Nwc-cmljqrxg,15
187
- ltbams-1.0.7.dist-info/RECORD,,
183
+ ltbams-1.0.8.dist-info/METADATA,sha256=Ui__dkyfMC9bk9tO-Bur2iMVqnieYJVZygg08Z26Q7w,14023
184
+ ltbams-1.0.8.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
185
+ ltbams-1.0.8.dist-info/entry_points.txt,sha256=FA56FlhO_yVNeEf810SrorVQb7_Xsmo3_EW-W-ijUfA,37
186
+ ltbams-1.0.8.dist-info/top_level.txt,sha256=pyKDqG2kj13F9-BYd_wkruRdBSqLXw8Nwc-cmljqrxg,15
187
+ ltbams-1.0.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (78.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tests/test_io.py CHANGED
@@ -15,10 +15,19 @@ class TestMATPOWER(unittest.TestCase):
15
15
  self.mpc14 = ams.io.matpower.m2mpc(ams.get_case('matpower/case14.m'))
16
16
 
17
17
  def test_m2mpc(self):
18
+ """Test conversion from M file to mpc dict."""
19
+ # NOTE: when the keys are there, read them
18
20
  self.assertTupleEqual(self.mpc5['gencost'].shape, (5, 6))
21
+ self.assertTupleEqual(self.mpc5['gentype'].shape, (5,))
22
+ self.assertTupleEqual(self.mpc5['genfuel'].shape, (5,))
23
+
24
+ # NOTE: when the keys are not there, the read mpc will not complete them
19
25
  self.assertTupleEqual(self.mpc14['gencost'].shape, (5, 7))
26
+ self.assertNotIn('gentype', self.mpc14)
27
+ self.assertNotIn('genfuel', self.mpc14)
20
28
 
21
29
  def test_mpc2system(self):
30
+ """Test conversion from MPC to AMS System."""
22
31
  system5 = ams.system.System()
23
32
  ams.io.matpower.mpc2system(self.mpc5, system5)
24
33
  # In case5.m, the gencost has type 2 cost model, with 2 parameters.
@@ -26,6 +35,12 @@ class TestMATPOWER(unittest.TestCase):
26
35
  np.zeros(system5.StaticGen.n))
27
36
 
28
37
  system14 = ams.system.System()
38
+ # Test gentype length check
39
+ mpc14 = self.mpc14.copy()
40
+ mpc14['gentype'] = np.array(['WT'] * 6)
41
+ with self.assertRaises(ValueError, msg='gentype length check failed!'):
42
+ ams.io.matpower.mpc2system(mpc14, system14)
43
+
29
44
  ams.io.matpower.mpc2system(self.mpc14, system14)
30
45
  # In case14.m, the gencost has type 2 cost model, with 3 parameters.
31
46
  np.testing.assert_array_less(np.zeros(system14.StaticGen.n),
tests/test_andes_mats.py DELETED
@@ -1,61 +0,0 @@
1
- """
2
- Test ANDES matrices.
3
- """
4
-
5
- import unittest
6
- import numpy as np
7
- import importlib.metadata
8
- from packaging.version import parse as parse_version
9
-
10
- import ams
11
-
12
-
13
- class TestMatrices(unittest.TestCase):
14
- """
15
- Tests for system matrices consistency.
16
- """
17
-
18
- andes_version = importlib.metadata.version("andes")
19
- if parse_version(andes_version) < parse_version('1.9.2'):
20
- raise unittest.SkipTest("Requires ANDES version >= 1.9.2")
21
-
22
- sp = ams.load(ams.get_case('matpower/case14.m'),
23
- setup=True, no_output=True, default_config=True,)
24
- sa = sp.to_andes(setup=True, no_output=True, default_config=True,)
25
-
26
- def setUp(self) -> None:
27
- """
28
- Test setup.
29
- """
30
-
31
- def test_build_y(self):
32
- """
33
- Test build_y consistency.
34
- """
35
- ysp = self.sp.Line.build_y()
36
- ysa = self.sa.Line.build_y()
37
- np.testing.assert_equal(np.array(ysp.V), np.array(ysa.V))
38
-
39
- def test_build_Bp(self):
40
- """
41
- Test build_Bp consistency.
42
- """
43
- Bp_sp = self.sp.Line.build_Bp()
44
- Bp_sa = self.sa.Line.build_Bp()
45
- np.testing.assert_equal(np.array(Bp_sp.V), np.array(Bp_sa.V))
46
-
47
- def test_build_Bpp(self):
48
- """
49
- Test build_Bpp consistency.
50
- """
51
- Bpp_sp = self.sp.Line.build_Bpp()
52
- Bpp_sa = self.sa.Line.build_Bpp()
53
- np.testing.assert_equal(np.array(Bpp_sp.V), np.array(Bpp_sa.V))
54
-
55
- def test_build_Bdc(self):
56
- """
57
- Test build_Bdc consistency.
58
- """
59
- Bdc_sp = self.sp.Line.build_Bdc()
60
- Bdc_sa = self.sa.Line.build_Bdc()
61
- np.testing.assert_equal(np.array(Bdc_sp.V), np.array(Bdc_sa.V))