## 6 Solution Method of Distributed Cooperative Dispatch for DN-DHN-BESS
### Solution Process  
The specific solution process includes the following five steps:  
Step 1: Initialize the Lagrange multipliers, penalty parameters, and boundary power, and set the iteration flag \(r=0\).  
Step 2: Let \(r=r+1\) and calculate the average value of the boundary power according to (53).  
Step 3: The optimal dispatch models for DN, DHN, and BESS are solved separately to obtain the dispatch results and update the boundary power.  
Step 4: Calculate the original residuals (\(M_{i,t}^{\mathrm{D-H},(r)}\), \(M_{i,t}^{\mathrm{D-E},(r)}\)) and pairwise residuals (\(D_{i,t}^{\mathrm{D-H},(r)}\), \(D_{i,t}^{\mathrm{D-E},(r)}\)) according to (54) and (55), and check whether the residuals satisfy the convergence condition in (56). If satisfied, output the calculation results; otherwise, continue with step 5.  
\[\left\{\begin{array}{l}M_{i,t}^{\mathrm{D-L},(r)}=\left\|P_{i,t}^{\mathrm{D-H },(r)}-\overline{P}_{i,t}^{\mathrm{D-H},(r)}\right\|_{2}\\ M_{i,t}^{\mathrm{D-E},(r)}=\left\|P_{i,t}^{\mathrm{D-E},(r)}-\overline{P}_{i,t }^{\mathrm{D-E},(r)}\right\|_{2}\end{array}\right. \tag{54}\]  
\[\left\{\begin{array}{l}D_{i,t}^{\mathrm{D-H},(r)}=\left\|\overline{P}_{i,t} ^{\mathrm{D-H},(r)}-\overline{P}_{i,t}^{\mathrm{D-H},(r-1)}\right\|_{2}\\ D_{i,t}^{\mathrm{D-E},(r)}=\left\|\overline{P}_{i,t}^{\mathrm{D-E},(r)}- \overline{P}_{i,t}^{\mathrm{D-E},(r-1)}\right\|_{2}\end{array}\right. \tag{55}\]  
\[\left\{\begin{array}{l}M_{\max}^{(r)}=\max\left\{M_{i,t}^{\mathrm{D-H},(r)}, M_{i,t}^{\mathrm{D-E},(r)}\right\}\leq\varepsilon_{\mathrm{M}}\\ D_{\max}^{\mathrm{D-H},(r)}=\max\left\{D_{i,t}^{\mathrm{D-H},(r)},D_{i,t}^{ \mathrm{D-E},(r)}\right\}\leq\varepsilon_{\mathrm{D}}\end{array}\right. \tag{56}\]  
where the superscript \((r)\) is the value of the variable corresponding to the \(r\)-th iteration; \(\varepsilon_{\mathrm{M}}\) and \(\varepsilon_{\mathrm{D}}\) are the convergence margins of the original and pairwise residuals, respectively.  
Step 5: Update the Lagrange multipliers and penalty parameters according to (57)-(60) and go to step 2.  
\[\rho_{i,t}^{\mathrm{D-H},(r+1)}=\begin{cases}\xi_{1}p_{i,t}^{\mathrm{D-H},(r )}&\max\left\{M_{i,t}^{\mathrm{D-H},(r)}\right\}>\
u\max\left\{D_{i,t}^{ \mathrm{D-H},(r)}\right\}\\ \frac{\rho_{i,t}^{\mathrm{D-H},(r)}}{\xi_{2}}&\max\left\{D_{i,t}^{\mathrm{D-H},(r)}\right\}>\
u\max\left\{M_{i,t}^{\mathrm{D-H},(r)}\right\}\\ \rho_{i,t}^{\mathrm{D-H},(r)}&\mathrm{other}\end{cases} \tag{57}\]  
\[\lambda_{i,t}^{\mathrm{D-H},(r+1)}=\lambda_{i,t}^{\mathrm{D-H},(r)}+\rho_{i,t} ^{\mathrm{D-H},(r+1)}\left(P_{i,t}^{\mathrm{D-H},(r)}-\overline{P}_{i,t}^{ \mathrm{D-H},(r)}\right) \tag{58}\]  
\[\rho_{i,t}^{\mathrm{D-E},(r+1)}=\begin{cases}\xi_{1}p_{i,t}^{\mathrm{D-E},(r)} &\max\left\{M_{i,t}^{\mathrm{D-E},(r)}\right\}>\
u\max\left\{D_{i,t}^{\mathrm{ D-E},(r)}\right\}\\ \frac{\rho_{i,t}^{\mathrm{D-E},(r)}}{\xi_{2}}&\max\left\{D_{i,t}^{\mathrm{D-E},( r)}\right\}>\
u\max\left\{M_{i,t}^{\mathrm{D-E},(r)}\right\}\\ \rho_{i,t}^{\mathrm{D-E},(r)}&\mathrm{other}\end{cases} \tag{59}\]  
\[\lambda_{i,t}^{\mathrm{D-E},(r+1)}=\lambda_{i,t}^{\mathrm{D-E},(r)}+\rho_{i,t} ^{\mathrm{D-E},(r+1)}\left(P_{i,t}^{\mathrm{D-E},(r)}-\overline{P}_{i,t}^{ \mathrm{D-E},(r)}\right) \tag{60}\]  
where \(\xi_{1}\) and \(\xi_{2}\) are the update coefficients of penalty parameters; \(v\) is the update judgment coefficient.