## 3 Aircraft System Identification
### Prediction Error Method (PEM)  
In this study, PEM was applied to perform parameter estimation. According to [PERSON] [24], PEMs are a broad family of parameter estimation methods that can be applied to quite arbitrary model parameterizations and these methods have a close kinship with the maximum likelihood method. The state-space form of energy distribution is then readily available to be identified by using the PEM function in MATLAB System Identification Toolbox. The objective of system identification is to identify the discrete time state-space model in the following form:  
\[\mathbf{x}\left(k+1\right)=\mathbf{A}\mathbf{x}\left(k\right)+\mathbf{B} \mathbf{u}\left(k\right)+\mathbf{K}\mathbf{w}\left(k\right) \tag{20}\]  
\[\mathbf{y}\left(k\right)=\mathbf{C}\mathbf{x}\left(k\right)+\mathbf{v}\left(k\right) \tag{21}\]  
where \(k\) is the number of time-step. Note that \(\mathbf{x}\), \(\mathbf{y}\), \(\mathbf{u}\), \(\mathbf{w}\), and \(\mathbf{v}\) are the state vector, output vector, input vector, process noise vector, and measurement noise vector, respectively. The remaining \(\mathbf{A}\), \(\mathbf{B}\), \(\mathbf{C}\), and  
Figure 4: Thrust pulse with time step of 3 s as input. Figure 3: Elevator doublet with time step of 1 s as input. Figure 2: Doublet input with different time steps. \(\mathbf{K}\) are the so-called system matrices, which determine the dynamics of the aircraft motion, and they are known to be constant with respect to a particular trimmed flight condition. Equation (21) is the output equation, and \(\mathbf{C}\) is output matrix which represents the rationale of a linear relation between the state variables and the output. The used state vector, output vector, and input vector are presented as follows:  
\[\mathbf{x}=\left[\Delta V\;\Delta\alpha\;\Delta q\;\Delta\theta\;\Delta a_{ \mathrm{x}}\;\Delta a_{\mathrm{z}}\right]^{T} \tag{22}\]  
\[\mathbf{y}=\left[\Delta q\;\Delta\dot{L}\right]^{T} \tag{23}\]  
\[\mathbf{u}=\left[\Delta\delta_{\mathrm{e}}\right] \tag{24}\]  
The rationale of a linear relation between the state variables and the \(\Delta\dot{L}\) is based on that the \(\Delta\dot{L}\) is the function of the longitudinal acceleration and the flight path angle, and the flight path angle is the function of the pitch angle and angle of attack. In Equation (23), \(\Delta q\) was selected to be the output state instead of \(\Delta\theta\) since \(\Delta q\) is equal to \(\Delta\dot{\theta}\) and can be directly measured from the inertial sensor. The predictor used to compute the one-step-ahead prediction for an underlying system description is the Kalman filter provided that \(\mathbf{w}\) and \(\mathbf{v}\) are Gaussian process. The predictor form of state-space representation can be given by:  
\[\mathbf{\hat{x}}\left(k+1,\mathbf{\hat{\xi}}\right)=\mathbf{A}\left(\mathbf{ \hat{\xi}}\right)\mathbf{\hat{x}}\left(k,\mathbf{\hat{\xi}}\right)+\mathbf{B }\left(\mathbf{\hat{\xi}}\right)\mathbf{u}\left(k,\mathbf{\hat{\xi}}\right)+ \mathbf{K}\left(\mathbf{\hat{\xi}}\right)\left[\mathbf{y}\left(k\right)- \mathbf{C}\left(\mathbf{\hat{\xi}}\right)\mathbf{\hat{x}}\left(k,\mathbf{\hat{ \xi}}\right)\right] \tag{25}\]  
where \(\mathbf{\hat{x}}\) and \(\mathbf{\hat{y}}\) are the predicted states and predicted outputs, respectively, and \(\mathbf{\hat{\xi}}\) is a vector of parameters that typically correspond to unknown values of physical coefficients.