# On Application of the Ray-Shooting Method for LQR via Static-Output-Feedback
## 2 The Practical Algorithm for the Problem of LQR via SOF  
Assume that \(K^{(0)}\in int\left(\mathcal{S}_{\alpha}\right)\) was found by the RS algorithm (see [16]) or by any other method (see [19; 20; 21]). Let \(h>0\) and let \(U^{(0)}\) be a unit vector w.r.t. the Frobenius norm, i.e., \(\left\|U^{(0)}\right\|_{F}=1\). Let \(L^{(0)}=K^{(0)}+h\cdot U^{(0)}\) and let \(\mathcal{L}\) be the hyperplane defined by \(L^{(0)}+V\), where \(\left\langle V,U^{(0)}\right\rangle_{F}=0\). Let \(\tau_{\infty}>0\) and let \(\mathcal{R}_{\infty}\) denote the set of all \(F\in\mathcal{L}\), such that \(\left\|F-L^{(0)}\right\|_{F}\leq\tau_{\infty}\). Let \(\mathcal{R}_{\infty}\left(\epsilon\right)=\mathcal{R}_{\infty}+\overline{ \mathbb{B}\left(0,\epsilon\right)}\), where \(\overline{\mathbb{B}\left(0,\epsilon\right)}\) denotes the closed ball centered at \(0\) with radius \(\epsilon\) (\(0<\epsilon\leq\frac{1}{2}\)), with respect to the Frobenius norm on \(\mathbb{R}^{q\times r}\). Let \(\mathcal{D}^{(0)}=CH\left(K^{(0)},\mathcal{R}_{\infty}\left(\epsilon\right)\right)\) denote the convex-hull of the vertex \(K^{(0)}\) with the basis \(\mathcal{R}_{\infty}\left(\epsilon\right)\). Let \(\mathcal{S}_{\alpha}^{(0)}=\mathcal{S}_{\alpha}\cap\mathcal{D}^{(0)}\) and note that \(\mathcal{S}_{\alpha}^{(0)}\) is compact (but generally not convex). We wish to minimize the continuous function \(\sigma_{max}\left(K\right)\) (or the continuous function \(J\left(x_{0},K\right)\), when \(x_{0}\) is known) over the compact set \(\mathcal{S}_{\alpha}\cap\overline{\mathbb{B}\left(K^{(0)},h\right)}\). Let \(K_{*}\) denote a point in \(\mathcal{S}_{\alpha}\cap\overline{\mathbb{B}\left(K^{(0)},h\right)}\) where the minimum of \(\sigma_{max}\left(K\right)\) is accepted. Obviously, \(K_{*}\in\mathcal{D}^{(0)}\), for some direction \(U^{(0)}\), as above. The suggested algorithm in Algorithm 1 works as follows:  
We start with a point \(K^{(0)}\in int\left(\mathcal{S}_{\alpha}\right)\), found by the RS algorithm. Assuming that \(K_{*}\in\mathcal{D}^{(0)}\), the inner-loop (\(j=1,\ldots,n\)) uses the Ray-Shooting Method in order to find an approximation of the global minimum of the function \(\sigma_{max}\left(K\right)\) over \(\mathcal{S}_{\alpha}^{(0)}\)--the portion of \(\mathcal{S}_{\alpha}\) bounded in the cone \(\mathcal{D}^{(0)}\). The proof of convergence in probability of the inner-loop and its complexity (under the above mentioned assumption) can be found in [16] (see also [22]). In the inner-loop, we choose a search direction by choosing a point \(F\) in \(\mathcal{R}_{\infty}\left(\epsilon\right)\)--the base of the cone \(\mathcal{D}^{(0)}\). Next, in the most inner-loop (\(k=1,\ldots,s\)) we scan the ray \(K\left(t\right):=\left(1-t\right)K^{(0)}+tF\) and record the best controller on it. Repeating this a sufficient number of times (as is given in (7) and in the discussion right after), we reach \(K_{*}\) (or an \(\epsilon\)- neighborhood of it) with high probability, under the assumption that \(K_{*}\in\mathcal{D}^{(0)}\). The outer-loop (\(i=1,\ldots,m\)) is used as a substitution for restarting the RS algorithm again and again, by taking \(K^{(\text{best})}\) as the new vertex of the search cone instead of \(K^{(0)}\) and by choosing a different direction \(U^{(0)}\). The choice of a different direction is made as a backup to the case where the above mentioned assumption didn't hold in the previous iterations (see Remark 1 below). The replacement of \(K^{(0)}\) by \(K^{(\text{best})}\) can be considered as a heuristic step, which is made instead of running the RS algorithm many times in order to generate \"the best starting point\", which is relevant only if we actually evaluate \(\sigma_{max}\left(K\right)\) on each such point and take the point with the best value as the best starting point. Since we,in any case, evaluate \(\sigma_{max}\left(K\right)\) in the main algorithm, we could avoid the repeated execution of the RS algorithm. The outer-loop is similar to what is done in the Hide-And-Seek algorithm (see [23; 24]).