## 3 Two-Stage Stochastic Optimization Problem
### Energy Storage Constraint  
Therefore, for the lithium battery, the following constraints apply:  
\[SOC_{0}=SOC_{360} \tag{21}\]  
\[0\leq SOC_{in}\leq Y_{SOC,t}\times P_{in,\max} \tag{22}\]  
\[0\leq SOC_{out}\leq(1-Y_{SOC,t})\times P_{out,\max} \tag{23}\]\[0.2 Cap_{soc}\leq SOC_{t}\leq 0.8 Cap_{soc} \tag{24}\]  
In the equation, \(Y_{SOC,t}\) represents the Boolean variable used to determine whether the lithium battery is charging or discharging, with a value of 0 or 1; \(P_{in,\max}\) represents the maximum charging power of the lithium battery; \(P_{out,\max}\) represents the maximum discharging power of the lithium battery; \(Cap_{soc}\) represents the capacity of the lithium battery. For the hydrogen storage tank, which serves as the hydrogen energy storage device, the following assumptions and constraints apply:  
1. Before the hydrogen hybrid UAV takes off, the hydrogen storage tank has already stored a certain amount of hydrogen energy. 2. Due to the continuity of multiple flight missions by the hydrogen hybrid UAV, when the hydrogen fuel is at no less than 20% of its maximum capacity, refueling is not required. Therefore, the amount of hydrogen in the storage tank at the end of the previous flight is assumed to be the same as the starting amount for the next flight. 3. The storage and withdrawal of hydrogen from the tank do not occur simultaneously. Since the refueling process does not affect the capacity configuration of the hydrogen hybrid UAV, the focus is more on the withdrawal rate, which should not exceed the maximum withdrawal power of the hydrogen storage tank. Therefore, for the hydrogen storage tank, the following constraints apply:  
\[TP_{0}=\left\{ \begin{array}{l}TP_{\max},if\ TP_{360}<0.2 TP_{\max}\\ TP_{360},else\end{array} \right. \tag{25}\]  
\[0\leq TP_{out}\leq(1-Y_{TP,t})\times H_{out,\max} \tag{26}\]  
In the equation, \(Y_{TP,t}\) represents the Boolean variable used to determine whether the hydrogen storage tank is releasing hydrogen, with a value of 0 or 1; \(H_{out,\max}\) represents the maximum hydrogen release power of the hydrogen storage tank. A stochastic programming model is constructed for the capacity configuration of the hydrogen hybrid UAV. The variables in the stochastic model for the capacity configuration of the hydrogen hybrid UAV include design variables, which refer to the capacity of the equipment, and operational variables, which refer to the variables during the operation of the hydrogen hybrid UAV. Based on these variables, an MILP problem is constructed:  
\[ \begin{array}{l}\min_{d,x_{t},y_{t}}f(d,x_{t},y_{t})\\ \text{s.t.}\ \psi^{dc}(d)\leq 0\\ \varphi^{oc}(d,x_{t},y_{t})=0\\ \psi^{oc}(d,x_{t},y_{t})\leq 0\\ d\in\Re^{1},x_{t}\in\Re^{n},y_{t}\in\left\{0,1\right\}^{n}\end{array}  \tag{27}\]  
where \(d\) represents the continuous decision variables determined during the design process; \(x_{t}\) and \(y_{t}\) represent the continuous variables and 0-1 binary variables involved in the operation process, respectively, existing within each time interval during the project lifecycle;\(f\) is the objective function, i.e., the total cost of the system over its entire lifecycle; \(\psi^{dc}\) represents inequality constraints in the design process, which are related only to the design variables \(d\); \(\varphi^{oc}\) and \(\psi^{oc}\) represent equality and inequality constraints during the operational process, which are related to the operational variables \(x_{t}\), \(y_{t}\), and \(d\). \(\Re^{1}\) and \(\Re^{n}\) represent the feasible regions of the respective continuous variables determined, and the feasible region of the continuous variables involved in the operation process; \(n\) represents the dimensionality, i.e., the number of 0-1-type variables. When considering the impact of uncertain parameters on the optimization problem, the problem above becomes a typical two-stage resource problem. For a deterministic MILP problem, the design variables and operational variables can be determined simultaneously and optimally.