## 2 Models and Methods
### Problem Optimization Frame  
Obviously, the goal of three-dimensional flight strategy optimization for the HALE SPA based on gravity energy reserving and mission altitude is a multi-phase optimization problem, and can be disguised as a nonlinear programming problem. Figure 4 shows the connection of this multi-phase optimization problem. Therefore, the optimization objective, boundary conditions and dynamic equations for each segment need to be analyzed. The boundary conditions and the optimization objective of HALE SPA for each phase are summarized as bellows:  
Phase 1: Maximum power ascending(\(t_{0}\)-\(t_{1}\))  
As described in Section 2.1, the main task of the aircraft at this phase is to climb to the mission altitude with the maximum available power, so the performance indicators of the aircraft can be set as follows:  
\[Min\;J_{1}=t_{1}-t_{0} \tag{14}\]  
Figure 4: Schematic diagram of connection for multi-phase optimization problems. The three-dimensional dynamic equation of SPA can be expressed as same as Equation (9), and the applied boundary conditions can be as follows:  
\[\left\{ \begin{array}{ccc}v_{\{1\}}(t_{0})=v_{0}&&\gamma_{\{1\}}(t_{f})=0\\ \varphi_{\{1\}}(t_{0})=\varphi_{0}&&h_{\{1\}}(t_{f})=h_{2}\\ \gamma_{\{1\}}(t_{0})=0&&Q_{\{1\}}(t_{f})=Q_{\min}\\ x_{\{1\}}(t_{0})=x_{0}&&\\ y_{\{1\}}(t_{0})=y_{0}&&\\ h_{\{1\}}(t_{0})=h_{1}&&\\ Q_{\{1\}}(t_{0})=Q_{\min}&&\\ \end{array} \right. \tag{15}\]  
Phase 2: Level flight for mission and charging battery(\(t_{1}\)-\(t_{2}\))  
The aim of phase 2 is the task execution in predetermined mission altitude as well as charge battery, so the power consumption of the level flight is concerned at this phase. Hence, the target optimization function can be expressed as per the following formula:  
\[Min\;J_{2}=\int_{t_{2}}^{t_{1}}P_{level}dt=\int_{t_{2}}^{t_{1}}T_{h_{2}}vdt \tag{16}\]  
The applied boundary conditions satisfy:  
\[\left\{ \begin{array}{ccc}v_{\{2\}}(t_{0})=v_{\{1\}}(t_{f})&&\gamma_{\{2\}}( t_{f})=0\\ \varphi_{\{2\}}(t_{0})=\varphi_{\{1\}}(t_{f})&&h_{\{2\}}(t_{f})=h_{2}\\ \gamma_{\{2\}}(t_{0})=\gamma_{\{1\}}(t_{f})=0&&Q_{\{2\}}(t_{f})=Q_{\max}\\ x_{\{2\}}(t_{0})=x_{\{1\}}(t_{f})&&\\ y_{\{2\}}(t_{0})=y_{\{1\}}(t_{f})&&\\ h_{\{2\}}(t_{0})=h_{\{1\}}(t_{f})=h_{2}&&\\ Q_{\{2\}}(t_{0})=Q_{\min}&&\\ \end{array} \right. \tag{17}\]  
Phase 3: Maximum power ascending for gravity energy storage(\(t_{2}\)-\(t_{3}\))  
In the phase 3, the final altitude is the key to the optimization. The higher altitude the SPA gains, the greater advantage for the phase 4. Therefore, the performance indicators can be set as follows:  
\[Max\;J_{3}=h_{\{3\}}(t_{f}) \tag{18}\]  
The applied boundary conditions in this phase can be expressed as follows:  
\[\left\{ \begin{array}{ccc}v_{\{3\}}(t_{0})=v_{\{2\}}(t_{f})&&\\ \varphi_{\{3\}}(t_{0})=\varphi_{\{2\}}(t_{f})&&h_{\{3\}}(t_{f})\geq h_{2}\\ \gamma_{\{3\}}(t_{0})=\gamma_{\{2\}}(t_{f})=0&&Q_{\{3\}}(t_{f})=Q_{\max}\\ x_{\{3\}}(t_{0})=x_{\{2\}}(t_{f})&&\\ y_{\{3\}}(t_{0})=y_{\{2\}}(t_{f})&&\\ h_{\{3\}}(t_{0})=h_{\{2\}}(t_{f})=h_{2}&&\\ Q_{\{3\}}(t_{0})=Q_{\max}&&\\ \end{array} \right. \tag{19}\]  
Phase 4: Longest gliding endurance path(\(t_{3}\)-\(t_{4}\))The aim of the aircraft at this phase is to achieve gliding for longer time, which is helpful for delaying the moment of battery discharge and the night flight for SPA. Hence, the target optimization function can be expressed as follow:  
\[Max\;J_{4}=t_{4}-t_{3} \tag{20}\]  
The applied boundary conditions in phase 4 satisfy:  
\[\left\{ \begin{array}{rcl}v_{[4]}(t_{0})=v_{[3]}(t_{f})&\gamma_{[4]}(t_{f})=0\\ \varphi_{[4]}(t_{0})=\varphi_{[3]}(t_{f})&h_{[4]}(t_{f})=h_{1}\\ \gamma_{[4]}(t_{0})=\gamma_{[3]}(t_{f})&Q_{[4]}(t_{f})=Q_{\text{max}}\\ x_{[4]}(t_{0})=x_{[3]}(t_{f})\\ y_{[4]}(t_{0})=y_{[3]}(t_{f})\\ h_{[4]}(t_{0})=h_{[4]}(t_{f})\\ Q_{[4]}(t_{0})=Q_{\text{max}}\end{array} \right.