# Superior Control of Spacecraft Re-Entry Trajectory
## 2 Optimization Mathematical Model for Re-Entry Trajectory and Superior Control Algorithms
### Optimization Algorithm for Superior Control of Re-Entry Flight Trajectory  
The design of the optimized control algorithm for the entire re-entry flight trajectory is as follows:  
Step 1:  
Set a time step \(\Delta t\), calculate only one performance index at each step, such as the first performance index in the first step and the second performance index in the second step, taking turns calculating each performance index. After calculating the last performance index, recalculate the first performance index.  
If \(\Delta t=1\),  
\[\mathbf{J}_{c}=[J_{1},J_{2},J_{3},\ldots,J_{n}]\times[1,\underbrace{0,0, \ldots,0}_{(n-1)\text{ \emph{copies of }}0}]^{T};\]  
If \(\Delta t=2\),  
\[\mathbf{J}_{c}=[J_{1},J_{2},J_{3},\ldots,J_{n}]\times[0,1,\underbrace{0, \ldots,0}_{(n-2)\text{ \emph{copies of }}0}]^{T};\ldots;\]  
If \(\Delta t=i\),  
\[\mathbf{J}_{c}=[J_{1},J_{2},J_{3},\ldots,J_{n}]\times[\underbrace{0,\ldots,0 }_{(i-1)\text{ \emph{copies of }}0},\underbrace{0,\ldots,0}_{(n-i)\text{ \emph{copies of }}0}]^{T}.\]  
Among them, \(\mathbf{J}_{c}\) is the performance metric that needs to be optimized, n is the number of performance metrics, and \([\underbrace{0,\ldots,0}_{(i-1)\text{ \emph{copies of }}0},\underbrace{1,\underbrace{0,\ldots,0}_{(n-i)\text{ \emph{copies of }}0}}]^{T}\) is the superior optimization matrix, \(i=1,2,\ldots,n\).  
If \(\Delta t>n\), \(\mathbf{J}_{c}\) starts the loop from \(\Delta t=1\) to \(\Delta t=n\) again, which continues until the calculation is completed.  
Step 2:  
**Definition**: The maximum allowable limit refers to a value designed for performance indicators; this value is closer to the maximum value of this performance indicator and is used to determine whether the current value of a performance indicator needs to be optimized. When the value of a performance metric exceeds its maximum allowable limit, optimization of that performance metric begins. When the value of a performance indicator does not exceed its maximum allowable limit, the performance indicator is allowed to change freely without optimization.  
When a certain performance index \(J_{k_{1}}\) exceeds the maximum allowable limit, optimization is carried out for it, and the current rotation performance index and the performance index that need to be optimized are calculated. The maximum allowable limit designed in this article is 0.8 \(J_{k_{1}Max}\), where \(J_{k_{1}Max}\) is the maximum value constrained by performance metric 0.8\(J_{k_{1}}\). Let the current number of performance indexes exceeding the maximum permitted limit be \(m\) and the set of performance indexes exceeding the maximum permitted limit be \(\vec{k}=[k_{1},k_{2},...,k_{m}]\).  
At this point \(t<n\Delta t\), when \(t=k_{1}\) and when the \(k_{1}\)-th performance metric has exceeded the maximum allowable limit \(J_{k_{1}}\geq\) 0.8 \(J_{k_{1}Max}\), in addition to the performance metric being calculated alternately, \(J_{k_{1}}\) is optimized and calculated simultaneously until \(J_{k_{1}}<\) 0.8 \(J_{k_{1}Max}\). The mathematical expression is  
\[\mathbf{J}_{c}=[J_{1},J_{2},J_{3},\ldots,J_{n}]\times[\underbrace{0,\ldots, 0}_{(k-1)\text{ \emph{copies of }}0}\underbrace{1}_{k-th}\underbrace{0,\ldots,0}_{(i-1-k)\text{ \emph{copies of }}0}\underbrace{1}_{i-th}\underbrace{0,\ldots 0}_{(n-i) \text{ \emph{copies of }}0}]^{T}.\]  
Step 3:  
Calculate all performance metrics that exceed the maximum permitted limit and optimize them until they are optimized to within the permitted limit. If a certain index always exceeds the maximum allowable limit during the optimization process, the optimization will be maintained until the calculation of trajectory optimization is completed.