## 5 Conclusions  
This research proposes a capacity configuration optimization model for hydrogen UAVs based on two-stage stochastic optimization, aiming to account for the impact of uncertain factors such as wind speed and wind direction. The model integrates both short-term and long-term costs of the UAV, providing an optimal capacity configuration for hydrogen hybrid UAVs. By introducing a combination of PSO algorithm and Monte Carlo simulation, the model overcomes the limitations of existing deterministic models that cannot effectively address uncertainty. The model incorporates multiple key factors, including energy balance constraints, equipment capacity constraints, and energy storage constraints, ensuring the feasibility and efficiency of the optimization results in actual flight scenarios. The main contributions and conclusions are as follows:  
1. The two-stage stochastic optimization method proposed in this paper effectively addresses the impact of uncertain factors such as wind speed and wind direction. In the first stage, PSO is used to optimize the capacity configuration of the equipment, while the second stage evaluates the expected optimal cost under different scenarios by solving the MILP problem, ultimately achieving the system's full lifecycle optimization. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Indicators** & **PSO** & **GA** \\ \hline The optimal lifecycle cost (CNY ten thousand) & 30.15 & 31.20 \\ Number of iterations & 143 & 256 \\ Computation time (s) & 63 & 102 \\ Post-iteration error (\%) & 0.5 & 1.2 \\ Number of feasible solutions (\%) & 98 & 92 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison table of PSO and GA algorithms. Figure 7: Sensitivity analysis of the number of particles. 2. This paper constructs a comprehensive evaluation metric that includes both short-term and long-term costs. The short-term costs focus on hydrogen consumption and regular maintenance expenses, while the long-term costs consider equipment investment and amortization of service life. By using a weighted sum, the short-term and long-term objectives are balanced, ensuring that the system meets the immediate operational needs while maintaining long-term sustainability. 3. To address the uncertainty of wind speed and wind direction, the Monte Carlo method is used to generate random scenarios for these variables. By combining this with the PSO algorithm, the system configuration is continuously optimized. Through iterative optimization, the PSO algorithm effectively finds the optimal solution, thereby improving the overall system performance. 4. A sensitivity analysis of the number of particles in the PSO algorithm was conducted, and the results showed that the optimization effect was best when the number of particles was set to 50. This provides valuable guidance for future optimization algorithm configurations, ensuring both computational efficiency and convergence. Although the optimization method proposed in this paper has shown good results under various uncertain scenarios, there is still room for further improvement. First, the current model primarily considers the uncertainties of wind speed and wind direction. Future research could introduce additional environmental factors, such as temperature changes, weather fluctuations, and power demand, to further enhance the model's applicability and accuracy. Moreover, with the continuous advancement of technology, the application scenarios of hydrogen hybrid UAVs will become more complex. Future studies could explore dynamic optimization methods based on real-time data, which involve monitoring various flight parameters in real time and adjusting flight strategies accordingly to improve operational efficiency. Additionally, the optimization goal in this paper focuses on cost minimization. However, in practical applications, multiple objectives may need to be balanced, such as environmental impact, operational safety, and others.