|
175 | 175 | "\"\"\"\n",
|
176 | 176 | "\n",
|
177 | 177 | "\n",
|
178 |
| - "# Spannungsebenen des Transformators\n", |
| 178 | + "# Voltage levels of the transformer\n", |
179 | 179 | "u_rated = {\"HV\": 200e3, \"MV\": 150e3, \"LV\": 30.2e3, \"AUX\": 200e3, \"Station1\": 150e3, \"Source\": 200e3}\n",
|
180 | 180 | "\n",
|
181 |
| - "# Eingespeiste Leistung (200 kV) auf der 380 kV Seite\n", |
| 181 | + "# Injected power (200 kV) on the 380 kV side\n", |
182 | 182 | "source_voltage = u_rated[\"Source\"] # 200 kV\n",
|
183 | 183 | "source_power = 1e40 # hohe Kurzschlussleistung -> v_pu = 1.0\n",
|
184 | 184 | "\n",
|
185 |
| - "# Lasten\n", |
| 185 | + "# Loads\n", |
186 | 186 | "load_MV = {\"P\": 30e6, \"Q\": 5e6}\n",
|
187 | 187 | "load_LV = {\"P\": 1.5e6, \"Q\": 0.15e6} # Eigenbedarf\n",
|
188 | 188 | "\n",
|
189 |
| - "# Zuweisung der Knotennummern\n", |
| 189 | + "# Assignment of node numbers\n", |
190 | 190 | "nodes = {\"HV\": 1, \"MV\": 2, \"LV\": 3, \"AUX\": 4, \"Station1\": 11, \"Source\": 14}\n",
|
191 | 191 | "non = len(nodes) # number of nodes\n",
|
192 | 192 | "# tap-changer\n",
|
193 | 193 | "v_tap = 6.0e3\n",
|
194 | 194 | "\n",
|
195 |
| - "# Generiere Knoten\n", |
| 195 | + "# generated nodes\n", |
196 | 196 | "node_data = initialize_array(DatasetType.input, ComponentType.node, non)\n",
|
197 | 197 | "node_data[\"id\"] = list(nodes.values())\n",
|
198 | 198 | "node_data[\"u_rated\"] = list(u_rated.values())\n",
|
|
202 | 202 | "\n",
|
203 | 203 | "# node_data[\"u_rated\"] = [u_rated['HV'], u_rated['MV'], u_rated['LV'], u_rated['AUX'],u_rated['Station1'] ]\n",
|
204 | 204 | "\n",
|
205 |
| - "# Quelle auf der 380kV-Seite (Slack)\n", |
| 205 | + "# Slack\n", |
206 | 206 | "source_data = initialize_array(DatasetType.input, ComponentType.source, 1)\n",
|
207 | 207 | "source_data[\"id\"] = [5]\n",
|
208 | 208 | "source_data[\"node\"] = [nodes[\"Source\"]]\n",
|
209 | 209 | "source_data[\"status\"] = [1]\n",
|
210 | 210 | "source_data[\"u_ref\"] = [1.0]\n",
|
211 | 211 | "source_data[\"sk\"] = [source_power]\n",
|
212 | 212 | "\n",
|
213 |
| - "# Last auf der 110kV-Seite\n", |
| 213 | + "# Loads 110kV\n", |
214 | 214 | "load_data = initialize_array(DatasetType.input, ComponentType.sym_load, 2)\n",
|
215 | 215 | "load_data[\"id\"] = [6, 7]\n",
|
216 | 216 | "load_data[\"type\"] = [LoadGenType.const_power, LoadGenType.const_power]\n",
|
|
222 | 222 | "node_name = [\"HV\", \"MV\", \"LV\", \"AUX\", \"Station1\", \"Source\"]\n",
|
223 | 223 | "branch_name = [\"BHV\", \"BMV\", \"BLV\", \"BLine2\", \"BLine1\"]\n",
|
224 | 224 | "\n",
|
225 |
| - "# Generic Branch für jeden der zwei Wickler\n", |
| 225 | + "\n", |
226 | 226 | "branch_data = initialize_array(DatasetType.input, ComponentType.generic_branch, 5)\n",
|
227 | 227 | "\n",
|
228 |
| - "# Verbindungen der zwei Wickler\n", |
| 228 | + "\n", |
229 | 229 | "branch_data[\"id\"] = [8, 9, 10, 12, 13]\n",
|
230 | 230 | "branch_data[\"from_node\"] = [nodes[\"HV\"], nodes[\"AUX\"], nodes[\"AUX\"], nodes[\"MV\"], nodes[\"Source\"]]\n",
|
231 | 231 | "branch_data[\"to_node\"] = [nodes[\"AUX\"], nodes[\"MV\"], nodes[\"LV\"], nodes[\"Station1\"], nodes[\"HV\"]]\n",
|
|
241 | 241 | "branch_data[\"theta\"] = [0.0, 0.0, 0.0, 0.0, 0.0]\n",
|
242 | 242 | "branch_data[\"sn\"] = [450e6, 450e6, 100e6, 100e6, 450e6]\n",
|
243 | 243 | "\n",
|
244 |
| - "# Input-Daten sammeln\n", |
245 | 244 | "input_data = {\n",
|
246 | 245 | " ComponentType.node: node_data,\n",
|
247 | 246 | " ComponentType.source: source_data,\n",
|
248 | 247 | " ComponentType.sym_load: load_data,\n",
|
249 | 248 | " ComponentType.generic_branch: branch_data,\n",
|
250 | 249 | "}\n",
|
251 | 250 | "\n",
|
252 |
| - "# Überprüfung der Eingabedaten\n", |
| 251 | + "\n", |
253 | 252 | "assert_valid_input_data(input_data=input_data, calculation_type=CalculationType.power_flow)\n",
|
254 | 253 | "\n",
|
255 |
| - "# Power-Flow Modell erstellen und Berechnungen durchführen\n", |
| 254 | + "\n", |
256 | 255 | "model = PowerGridModel(input_data)\n",
|
257 | 256 | "output_data = model.calculate_power_flow(\n",
|
258 | 257 | " symmetric=True, error_tolerance=1e-8, max_iterations=20, calculation_method=CalculationMethod.newton_raphson\n",
|
|
370 | 369 | " genb_out = output_data[ComponentType.generic_branch]\n",
|
371 | 370 | " df = pd.DataFrame(genb_out)\n",
|
372 | 371 | "\n",
|
373 |
| - " # Summiere die aktive und reaktive Leistung über alle Branches hinweg\n", |
| 372 | + " # Sum up the active and reactive performance across all branches\n", |
374 | 373 | " P_total = e6(df[\"p_from\"].sum()) + e6(df[\"p_to\"].sum())\n",
|
375 | 374 | " Q_total = e6(df[\"q_from\"].sum()) + e6(df[\"q_to\"].sum())\n",
|
376 | 375 | "\n",
|
377 |
| - " # Ausgabe der Gesamtsummen\n", |
378 | 376 | " print(\"\\nTotal Power for all Branches\")\n",
|
379 | 377 | " print(\"----------------------------\")\n",
|
380 | 378 | " print(f\"Total Active Power (P_total): {P_total:.2f} MW\")\n",
|
|
394 | 392 | "print_load_input(input_data)\n",
|
395 | 393 | "print_source_input(input_data)\n",
|
396 | 394 | "\n",
|
397 |
| - "\n", |
398 |
| - "# Ausgabe der Spannungen und Ströme\n", |
399 | 395 | "print(\"========================================\")\n",
|
400 | 396 | "print(\" Output Data\")\n",
|
401 | 397 | "print(\"========================================\")\n",
|
|
754 | 750 | " genb_out = output_data[ComponentType.generic_branch]\n",
|
755 | 751 | " df = pd.DataFrame(genb_out)\n",
|
756 | 752 | "\n",
|
757 |
| - " # Summiere die aktive und reaktive Leistung über alle Branches hinweg\n", |
| 753 | + " # Sum up the active and reactive performance across all branches\n", |
758 | 754 | " P_total = e6(df[\"p_from\"].sum()) + e6(df[\"p_to\"].sum())\n",
|
759 | 755 | " Q_total = e6(df[\"q_from\"].sum()) + e6(df[\"q_to\"].sum())\n",
|
760 | 756 | "\n",
|
761 |
| - " # Ausgabe der Gesamtsummen\n", |
762 | 757 | " print(\"\\nTotal Power for all Branches\")\n",
|
763 | 758 | " print(\"----------------------------\")\n",
|
764 | 759 | " print(f\"Total Active Power (P_total): {P_total:.2f} MW\")\n",
|
|
0 commit comments