## 2 Methods
### Two-Stage Risk-Benefit Hedging Calculation Considering Forecast Uncertainty
#### 2.5.2 Calculation of Downstream Flood Risk Rate Considering Forecast Information
From the perspective of economics, it means the marginal contribution value of the pre-storage water \(W_{1}\) in the first stage and the flood control safety value \(\sigma\) in the second stage to the two-stage loss, whose value is as follows:  
\[ \begin{array}{l}G_{1}^{\prime}(W_{1})=\frac{\partial G_{1}(W_{1})}{ \partial W_{1}}=-f_{1}(W_{1})\\ G_{2}^{\prime}(\delta)=\frac{\partial G_{2}(\delta)}{\partial\delta}=-f_{2}( \delta)\end{array}  \tag{14}\]  
where \(f_{1}(W_{1})\) is the marginal benefit of reservoir water storage and represents the added value of water storage benefit brought by increasing unit water storage \(W_{1}\). \(f_{1}(W_{1})\) and \(f_{2}(\delta\ )\) are the decreasing functions of \(W_{1}\) and \(\delta\), respectively. When the water storage volume \(W_{1}\) increases, the increased water storage benefit will decrease owing to the increase in the total pre-storage volume (the reduced flood control risk rate when the unit flood control safety value \(\delta\) is increased). Therefore, both \(f_{1}(W_{1})\) and \(f_{2}(\delta\ )\) experience the law of diminishing marginal benefits. According to the sufficient and necessary conditions of KKT condition, when the marginal benefit of water storage \(f_{1}(W_{1}^{*})\) is equal to the marginal benefit of flood control \(f_{2}(\delta^{*})\), the loss of the two stages is the least, that is, as follows:  
\[f_{1}(W_{1}^{*})=f_{2}(\delta^{*}) \tag{15}\]  
where the optimal value of pre-storage water in the decision stage (stage 1) is \(W_{1}^{*}\), the optimal value of flood control safety in the residual stage (stage 2) is \(\delta^{*}\), and \(RF=W_{1}^{*}+\delta^{*}\). The optimal solution when the marginal benefits are equal is shown in Figure 7.  
Figure 7: The best solution for reservoir impoundment and benefit when when \(f_{1}=f_{2}\). The solid red line in the figure represents the marginal benefit curve \(f_{1}(W_{1})\) of water storage at range \([0,W_{\text{max}}]\) of pre-storage water \(W_{1}\), and the coordinate origin is point B. The black dashed line represents the flood control marginal benefit curve \(f_{2}(\delta\ )\) of the flood control safety value \(\delta\) within the feasible range \(\delta\geq\delta_{\text{min}}\), and the coordinate origin is point C. The remaining flood control capacity RF is the distance between the two vertical axes, then point A is the optimal solution of two-stage loss-benefit. (3) Calculation of marginal benefit value of hydropower and photovoltaic power generation. As the next day's electricity demand issued by the grid is determined, single hydropower, photovoltaic power stations, cascade hydropower, multi-level photovoltaic power stations, and other entities hope to generate more electricity to generate greater economic benefits, and there must be a competition between their grid-connected electricity. Therefore, the electricity demand \(W_{z}\) meets the following condition:  
\[W_{z}=W_{s}+W_{g} \tag{16}\]  
where \(W_{s}\) represents the on-grid electricity of the hydropower station and \(W_{g}\) represents the on-grid power of photovoltaic power stations. In the actual joint dispatch process, \(W_{s}\) and \(W_{g}\) are both predicted values, so it is necessary to consider the compensation penalty brought by prediction errors, that is, the power generation benefits of hydropower and photovoltaic are expressed respectively as follows:  
\[ \begin{split} F(W_{s})&=f(W_{s})-\lambda f(W_{q})\\ F(W_{g})&=f(W_{g})-\gamma f(W_{q})\end{split}  \tag{17}\]  
where \(F(W_{s})\) and \(F(W_{g})\) are the final power generation benefit values of the hydropower station and photovoltaic power station, respectively; \(F(W_{s})\) and \(F(W_{g})\) are the actual on-grid electricity benefit values of the hydropower station and photovoltaic power station, respectively; \(F(W_{q})\) is the power loss benefit of the combined system; and \(\lambda\) and \(\gamma\) are the power loss compensation coefficients of the transmission station and photovoltaic power station, respectively.