# Discrete-Time Asymptotic Tracking Control System for a Satellite with a Solar Panel
## 5 Numerical Simulations
The state feedback gain matrix \(F\in\mathbb{R}^{1\times 4}\) was chosen to minimize the quadratic functional  
\[J(\tau^{d})=w_{0}\sum_{i=0}^{\infty}(x^{d}(i))^{T}x^{d}(i)+u_{0}\sum_{i=0}^{ \infty}(\tau^{d}(i))^{2}\,, \tag{142}\]  
with weights \(w_{0}=1\) and \(u_{0}=1\), for the system \(x^{d}(i+1)=A^{d}(\mu)x^{d}(i)+B^{d}(\mu)\tau^{d}(i)\) with \(\tau^{d}(i)=-Fx^{d}(i)\). To solve this optimization problem, we used the _dlqr_ procedure from the MATLAB R2024b Control System Toolbox [25]. As a result,  
\[F(20)=\Big{[} \begin{array}{cc}-64.9105&66.0854&1.7803&-0.1379\end{array}  \Big{]}, \tag{143}\]  
with  
\[\sigma(A^{d}(20)-B^{d}(20)F(20))=\left[ \begin{array}{cc}-0.8875+j0.4182\\ -0.8875-j0.4182\\ 0.8938\\ 0.8019\end{array} \right], \tag{144}\]  
and  
\[F(40)=\Big{[} \begin{array}{cc}-62.0930&63.3290&1.8883&-0.3066\end{array}  \Big{]}, \tag{145}\]  
with  
\[\sigma(A^{d}(40)-B^{d}(40)F(40))=\left[ \begin{array}{cc}-0.6488+j0.7277\\ -0.6488-j0.7277\\ 0.9490\\ 0.8459\end{array} \right]. \tag{146}\]  
The output error gain matrix \(\left[ \begin{array}{c}L_{1}\\ L_{2}\end{array} \right]\in\mathbb{R}^{6\times 1}\) was chosen such that \(\left[ \begin{array}{c}L_{1}\\ L_{2}\end{array} \right]^{T}\in\mathbb{R}^{1\times 6}\) minimizes the quadratic cost functional  
\[J(\vartheta^{d})=w_{1}\sum_{i=0}^{\infty}(\xi^{d}(i))^{T}\xi^{d}(i)+u_{1}\sum _{i=0}^{\infty}(\vartheta^{d}(i))^{2}\,, \tag{147}\]  
with weights \(w_{1}=1\) and \(u_{1}=1\), for the system \(\xi^{d}(i+1)=\left[ \begin{array}{cc}A^{d}(\mu)&0\\ 0&S^{d}(\mu)\end{array} \right]^{T}\xi^{d}(i)+\left[ \begin{array}{cc}C^{d}( \mu)&-T^{d}(\mu)\end{array} \right]^{T})\theta^{d}(i)\) and \(\vartheta^{d}(i)=-\Bigg{[} \begin{array}{c}L_{1}\\ L_{2}\end{array} \Bigg{]}^{T}\xi^{d}(i)\). Hence,  
\[\left[ \begin{array}{c}L_{1}(20)\\ L_{2}(20)\end{array} \right]=\Big{[} \begin{array}{cc}40.6359&40.4759&-4.0984&82.7 493&39.2876&-0.3458\end{array} \Big{]}^{T}, \tag{148}\]  
with  
\[\sigma(\left[ \begin{array}{cc}A^{d}(20)&0\\ 0&S^{d}(20)\end{array} \right]-\left[ \begin{array}{c}L_{1}(20)\\ L_{2}(20)\end{array} \right]\Big{[} \begin{array}{cc}C^{d}(20)&-T^{d}(20)\end{array}  \Big{]})=\left[ \begin{array}{c}-0.9016+j0.4265\\ -0.9016-j0.4265\\ 0.6575\\ 0.9021\\ 0.9994+j0.0013\\ 0.9994-j0.0013\end{array} \right], \tag{149}\]and  
\[\left[ \begin{array}{c}L_{1}(40)\\ L_{2}(40)\end{array} \right]=\left[ \begin{array}{cc}44.1508&43.7351&-3.9466&81.31 72&42.7705&-0.3751\end{array} \right]^{T}, \tag{150}\]  
with  
\[\sigma(\left[ \begin{array}{cc}A^{d}(40)&0\\ 0&S^{d}(40)\end{array} \right]-\left[ \begin{array}{c}L_{1}(40)\\ L_{2}(40)\end{array} \right]\left[ \begin{array}{cc}C^{d}(40)&-T^{d}(40)\end{array}  \right])=\left[ \begin{array}{c}-0.6620+j0.7447\\ -0.6620-j0.7447\\ 0.7390\\ 0.9506\\ 0.9997+j0.0007\\ 0.9997-j0.0007\end{array} \right]. \tag{151}\]  
The two obtained versions of the state space matrix for the controller (131), corresponding to \(h=0.1\) s and \(h=0.05\) s, are given as follows:  
\[\left[ \begin{array}{c|cc}A_{K}(20)&B_{K}(20)\\ \hline C_{K}(20)&0\end{array} \right] \tag{152}\] \[=\left[ \begin{array}{rrrrr}-14.3785&2.5844&-0.4287&-0.0353&12.79 40&0.5640&40.6359\\ -13.4414&1.6982&-0.4307&-0.0304&12.7432&0.5611&40.4759\\ 10.9187&-9.8364&0.6318&0.1343&-1.0824&0.2339&-4.0984\\ 14.5488&-40.7775&0.4666&-0.8604&26.2287&1.3938&82.7493\\ -15.3188&2.9592&-0.4909&-0.0404&13.3595&0.6313&39.2876\\ 0.1349&-0.0261&0.0043&0.0004&-0.1088&0.9953&-0.3458\\ \hline 64.9105&-66.0854&-1.7803&0.1379&1.1748&1.6424&0\end{array} \right]\]  
and  
\[\left[ \begin{array}{c|cc}A_{K}(40)&B_{K}(40)\\ \hline C_{K}(40)&0\end{array} \right] \tag{153}\] \[=\left[ \begin{array}{rrrrr}-9.2751&0.4179&-0.1644&-0.0129&9.8572 &0.2273&44.1508\\ -8.5477&-0.2160&-0.1698&-0.0045&9.7637&0.2243&43.7351\\ 5.0198&-4.2940&0.6891&0.1324&-0.7257&0.1785&-3.9466\\ 50.1649&-68.4405&0.9973&-0.5703&18.2756&0.5730&81.3172\\ -10.0530&0.5077&-0.1997&-0.0157&10.5452&0.2654&42.7705\\ 0.0882&-0.0045&0.0018&0.0001&-0.0837&0.9981&-0.3751\\ \hline 62.0930&-63.3290&-1.8883&0.3066&1.2358&1.5817&0\end{array}