## 3 Preliminary Work
### Algorithm to Calculate Mileage Matrix
### Study of a real case

A real power grid in Chongqing, China, was used to verify our algorithm. It is a system with 17 nodes and has a total nominal load \(1.08\;\mathrm{MW}+j0.324\;\mathrm{MVar}\). Figure 4 shows the topology of the case with the node number, and Table 4 shows the information about the cables (cable1 means the cable between two nodes, cable2 means the cable between a node and a transformer and cable3 means the cable between the transformer and the load or generator). To fully consider the change of solar energy and hydro energy in one year, 12 time points were chosen to represent the 12 months of a year. Two large hydro stations are located in node 11 and node 17, with a total nominal power of \(1.2\;\mathrm{MW}+j0.59\;\mathrm{MVar}\). This is enough power for them to supply all of the load in this area of the country during the high-water season, which is mainly in summer. However, to help the development of this area of the country, PPAP installed 8 PV power stations in the last year, which can generate a total power of \(0.502\;\mathrm{MW}\). These new installations led to a large amount of surplus energy in the summer. In addition, a large amount of energy is needed in the winter due to the lack of RE and the heavy load. The data over the past year show that the surplus of energy reached nearly 50 MWh in May, with a deficit of 85 MWh in February. Figure 5 shows the power flow through node 0. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Type** & **Length (km)** & **Resistance (\(\Omega\)/km)** & **Inductance (I/km)** \\ \hline Cable 1 & 1.70 & 0.435 & 0.107/314 \\ Cable 2 & 1.00 & 0.622 & 0.113/314 \\ Cable 3 & 0.05 & 1.359 & 0.082/314 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Cable parameters. Figure 4: Simplified topology of the power grid in Chongqing, China, with the node numbers. To verify the efficient of the power mileage, first the voltage for the ending node (node 17) for 12 months of the real case is calculated by the power mileage and matpower, which uses the Newton-Raphson method. In the deduction of power mileage, approximation is used in the dominator (replace the node voltage with rated voltage), and in the voltage drop equation (use the simplified equation, where only the vertical component is considered). Though in the discussion we illustrate that the influence is small, a test is done on it. The result is shown in Figure 6 and can be seen that two lines are nearly overlapped, which proves the utility of power mileage for its linearity. We calculated that the total active power mileage \(PM_{p}\) is 64845 kW\(\cdot\)km and the total reactive power mileage \(PM_{Q}\) is 27864 kVar\(\cdot\)km. To perform the network optimization algorithm, we chose \(\tau\) as 0.8, which denotes the relative magnitude of resistance and reactance. The result of the first iteration is presented in Table 5. In the table, the branch number indicates where the separation is performed. For convenience, we assumed that grid \(G_{2}\) was connected to the national grid from the cutting point. Figure 5: Power flow through node 0 in different months. Figure 6: Power flow through node 0 in different months. From the table, we know that cutting the grid at the branch near the smaller hydro station (node 11) is not a good idea because the difference between the supply and demand of power in the sub-graph is not very large, leading to little voltage quality improvement. Only when we cut the grid at branches 12, 13, 14, and 15 could the requirement of Equation (7) be satisfied, and all of them satisfy Equation (6). Separating the grid at branch 13 and adding transmission lines at node 13 were the best choices because we obtained the largest improvement of voltage quality in both sub-graphs. Due to the punishment in Equation (6) and the small scale of the grid, the algorithm stopped at the second iteration, and the final result is shown in Figure 7.

To verify the improvement in the voltage quality, we ran the case study in MATPOWER@for all 12 time points.