## 4 Numerical Example  
By searching China's portal websites that are related to coal and power, major regional trading centers, and major port information platforms, this study has sorted out the transaction information of some of the coal mining and power generation companies and listed the supply-demand information and matching preference rankings of nine coal mining companies and six power generation companies. Based on the degree of matching between the coal mining and power generation companies, we derived their order of preferences for each other. As shown in Table 1, we used (\(m\), \(n\)) to indicate these companies' orders of preferences for the trading partners on the other side of the market, where \(m\) denotes the rank of power generation company \(d_{j}\) for coal mining company \(S_{i}\), and \(n\) denotes the rank of coal mining company \(S_{i}\) for power generation company \(d_{j}\). Power generation company \(d_{j}\)'s demand for coal \(q_{dj}\) = (25, 50, 50, 50, 100, 50) (unit: kilotons); coal mining company \(S_{i}\)'s coal supply capacity \(q_{si}\) = (30, 5, 40, 5, 20, 60, 50, 100, 20) (unit: kilotons). Based on the orders of preferences of the coal mining and power generation companies for matching, we employed the deferred acceptance algorithm that takes into account the trading quantity in order to perform matching and arrive at the stable matching results. Through numerical examples, we can more intuitively understand the features of this matching mechanism. * Results of pairwise stable matching  
We used MATLAB to perform the calculations in order to arrive at a pairwise stable matching scheme. As shown in Table 2, we used \(S_{i}\), \(d_{j}\) (the value of the matching result at the \(i\)th row and \(j\)th column) to denote the quantity of coal supplied by coal mining company \(S_{i}\) to power generation company \(d_{j}\) (unit: kilotons), where a quantity of zero means there is no trading matching. The stable matching results indicate that the demand for coal of each power generation company had been met, which led to the termination of the algorithm. The matching produced 13 trading pairs and achieved a total coal trading amount of 325 kilotons. Under this matching, only coal mining company \(S_{8}\) still held a residual supply capacity of 5 kilotons, which, to certain extent, indicates that this company's production plan was somewhat high. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Coal Mining**} & \multicolumn{6}{c}{**Power Generation Company \(d_{j}\)**} & \multicolumn{2}{c}{**Supply–Demand**} \\
**Company \(S_{i}\)** & \(d_{1}\) & \(d_{2}\) & \(d_{3}\) & \(d_{4}\) & \(d_{5}\) & \(d_{6}\) & **Quantity \(q_{si}\)** \\ \hline \(S_{1}\) & (4, 3) & (1, 1) & (5, 5) & (3, 2) & (2, 4) & (7, 6) & 30 \\ \(S_{2  
* Stability of matching results  
The analysis indicates that the matching results have pairwise stability. We viewed the matching results as individual matrices, each comprising four elements in Table 2. Any two zero elements that are not in the same row and not in the same column form a rectangular loop with the other two nonzero elements. Pairwise stability means that there are no random rectangular loops in the matrix. By increasing the value of the zero elements or decreasing the value of the nonzero elements in the rectangular loop, the matching preferences of both the coal mining and power generation companies to which the original nonzero elements correspond are all increased (the rankings in the order of preferences become higher). To more intuitively describe the above problem, we can select the double pairs \(S_{3}\), \(d_{3}\) and \(S_{4}\), \(d_{2}\), which do not achieve coal trading, as an example for the analysis. We placed the matrix loop that involves \(S_{3}\), \(d_{3}\) and \(S_{4}\), \(d_{2}\) into Table 3 in order to perform a separate analysis. Under the stable matching result, only the two pairs \(S_{3}\), \(d_{2}\) and \(S_{4}\), \(d_{3}\) achieved coal trading, at amounts of 20 and 5 kilotons, respectively.