# On Application of the Ray-Shooting Method for LQR via Static-Output-Feedback
## 2 The Practical Algorithm for the Problem of LQR via SOF
\begin{array}{c}\left(I_{p}\otimes A\left( t\right)^{\mathrm{T}}+A\left(t\right)^{\mathrm{T}}\otimes I_{p}\right)^{-1} \cdot\\ vec\left(Q+C^{\mathrm{T}}K\left(t\right)^{\mathrm{T}}RK\left(t\right)C\right) \end{array} \right)\)
8.3. \(S\left(t\right)\leftarrow-mat\left(\left(I_{p}\otimes A\left(t\right)+A\left( t\right)\otimes I_{p}\right)^{-1}\cdot vec\left(I_{p}\right)\right)\)
8.3. \(\sigma_{max}\left(K\left(t\right)\right)\leftarrow\max\left(\sigma\left(P \left(t\right)\right)\right)\)
8.3. \(\mathrm{if}\ \sigma_{max}\left(K\left(t\right)\right)<\sigma_{max}\left(K_{0}\right)\) then
8.3.5. \(K_{1}\gets K\left(t\right)\)
8.3.5. \(A_{1}\gets A-BK_{1}C\)
8.3.5. \(P_{1}\gets P\left(t\right)\)
8.3.5. \(S_{1}\gets S\left(t\right)\)
8.3.5. \(\sigma_{max}\left(K_{1}\right)\leftarrow\sigma_{max}\left(K\left(t\right)\right)\)
8.3.5. \(flag\gets 1\)
9. if \(flag==1\) then
9. \(\mathrm{while}\left(\left|\sigma_{max}\left(K_{j+1}\right)-\sigma_{max}\left(K_{j }\right)\right|\geq\epsilon\right)\) and \(\left(j<m\right)\) do
9.1. \(\Delta K_{j}\gets R^{-1}B^{\mathrm{T}}P_{j}S_{j}C^{\mathrm{T}}\left(CS_{j} C\right)^{-1}-K_{j}\)
9.1.2. for \(k=1\) to \(s\) do
9.1.1. \(t\leftarrow\frac{k}{s}\)
9.1.2. \(K\left(t\right)\leftarrow\left(1-t\right)K_{j}+t\Delta K_{j}\)
9.1.2.3. if \(K\left(t\right)\in\mathcal{S}_{\alpha}\) then
9.1.2.3.1. \(A\left(t\right)\gets A-BK\left(t\right)C\)
9.1.2.3.2. \(P\left(t\right)\leftarrow-mat\left( \begin{array}{c}\left(I_{p}\otimes A \left(t\right)^{\mathrm{T}}+A\left(t\right)^{\mathrm{T}}\otimes I_{p}\right)^{ -1}\cdot\\ vec\left(Q+C^{\mathrm{T}}K\left(t\right)^{\mathrm{T}}RK\left(t\right)C\right) \end{array} \right)\)
9.1.2.3.3. \(S\left(t\right)\leftarrow-mat\left(\left(I_{p}\otimes A\left(t\right)+A\left( t\right)\otimes I_{p}\right)^{-1}\cdot vec\left(I_{p}\right)\right)\)
9.1.2.3.4. \(\sigma_{max}\left(K\left(t\right)\right)\leftarrow\max\left(\sigma\left(P \left(t\right)\right)\right)\)
9.1.2.3.5. if \(\sigma_{max}\left(K\left(t\right)\right)<\sigma_{max}\left(K_{j}\right)\) then
9.1.2.3.5.1. \(K_{j+1}\gets K\left(t\right)\)
9.1.2.3.5.2. \(A_{j+1}\gets A-BK_{j+1}C\)
9.1.2.3.5.3. \(P_{j+1}\gets P\left(t\right)\)
9.1.2.3.5.4. \(S_{j+1}\gets S\left(t\right)\)
9.1.2.3.5. \(\sigma_{max}\left(K_{j+1}\right)\leftarrow\sigma_{max}\left(K\left(t\right)\right)\)
9.1.2.3.5. \(j\gets j+1\)
10. return \(K^{\mathrm{best}}\gets K_{j},A_{j},P_{j},S_{j},\sigma_{max}^{\mathrm{best}} \leftarrow\sigma_{max}\left(K^{\mathrm{best}}\right)\)
```

**Algorithm 2**The MC Algorithm. ## 3 Experiments

In the following experiments we applied the Algorithm 1 and Algorithm 2, on systems taken from the liberaries [27; 28; 29]. We took only the systems with controllable \(\left(A,B\right),\left(A^{T},C^{T}\right)\) pairs, for which the RS algorithm succeeded in finding SOFs (see [16], Table 8, p. 231). In order to initialize the MC Algorithm, we also used the RS algorithm to find a starting \(\alpha\)-stabilizing static-output-feedback, for known optimal value for \(\alpha\). In all the experiments for the suggested algorithm we used \(m=100\), \(n=100\), \(s=100\), \(h=100\), \(r_{\infty}=100\), \(\epsilon=10^{-16}\), and for the MC Algorithm we used \(m=10{,}000\), \(s=100\) (in order to get the same number of \(10^{6}\) overall iterations and the same number \(s=100\) of iterations for the local search). In every case, we took \(Q=I_{p},R=I_{q}\). The Stability Margin column of Table 1 relates to \(\alpha>0\) for which the real part of any eigenvalue of the closed-loop is less than or equal to \(-\alpha\). The values of \(\alpha\) in Table 1 relates to the largest \(\alpha\) for which the RS algorithm succeeded in finding \(K^{(0)}\). The reason is that if \(\lambda\) is an eigenvalue of \(A_{c\ell}\left(K\right)\) with corresponding eigenvector \(v\) then, (4) implies

\[\Re\left(\lambda\right)=-\frac{v^{*}\left(Q+C^{T}K^{T}RKC\right)v}{2v^{*}P \left(K\right)v}\leq-\frac{v^{*}Qv}{2v^{*}P\left(K\right)v}.\]

It follows that minimizing \(\sigma_{max}\left(K\right)\) results in a larger abscissa.