# Inducing Optimality in Prescribed Performance Control for Uncertain Euler-Lagrange Systems
## 4 Methodology
### Solving the Hamilton-Jacobi-Bellman Equation
```
1:Initialize based on the PPC technique the control policy: \(\tau(q,\rho,\epsilon)=-kT^{\prime}(\tilde{x})\rho^{-1}\epsilon+G(\tilde{q}_{d})\) with \(\xi=\frac{\tilde{q}+\lambda(q-\tilde{q}_{d})}{\rho}\). 2:Select\((q^{i},\rho^{i},\epsilon^{i})\), \(i=1,\ldots,P\) points over which the HJB will be fitted. 3:Repeat
4:Calculate the terms \(X\) and \(Y\) from (15) and (16) over the data \((q^{i},\rho^{i},\epsilon^{i})\), \(i=1,\ldots,P\). 5:Calculate the terms \(\tilde{A}\) and \(\tilde{B}\) from (21) over the data \((q^{i},\rho^{i},\epsilon^{j+})\), \(j=1,\ldots,M\) and \((q^{j},\rho^{j},\epsilon^{j-})\), \(j=1,\ldots,M\). 6:Find\(w_{L}\) by solving the constrained least-squares problem (23). 7:Update the control policy according to (8) employing the parameter vector \(w_{L}\) in the approximation of \(\
abla_{\epsilon}J\). 8:until\(w_{L}\) converges. ```  
**Algorithm 1** Cost function approximation algorithm  
**Theorem 1**. : _Consider the Euler-Lagrange system (1) under Assumptions 1-3, as well as a compact set \(\Omega_{q,q,\tau}\) for which a sufficiently accurate neural network approximation \(NN(q,q,\tau)\) of the system dynamics has been acquired. Then, for a compact set \(\Omega_{2}\subset\Re^{3n}\) where \(z\triangleq[q^{\tau},\rho^{T},\epsilon^{T}]^{T}\) and a linearly independent polynomial basis \(\{\sigma_{j}\}_{1}^{L}\), Algorithm 1 converges to a near-optimal estimate \(J_{L}(q,\rho,\epsilon)=w_{L}^{T}\sigma(q,\rho,\epsilon)\) of the minimum cost function, i.e., for any arbitrarily small constant \(\xi\), there exists \(L_{0}\) such that for any \(L\geq L_{0}\):_  
\[\sup_{z\in\Omega_{z}}|J(z)-w_{L}^{T}\sigma(z)|<\xi \tag{24}\]  
Proof. : For a sufficiently accurate neural network approximation and by utilizing the admissible policy \(u^{(0)}\) in the initialization of Algorithm 1, an initial, unique, least-squares solution \(J_{L}^{(0)}\) for (8) can be acquired through the optimization problem (23). This solution is employed in the calculation of the control policy \(u^{(1)}\), and by iterating the process, we obtain the successive approximation algorithm, which, along with the inequality constraints imposed, guarantees, following [30], that each new policy that is provided by the cost function of the previous one is stable and better than the previous one with respect to the metric (6), while also satisfying the prescribed performance specifications, since \(\epsilon\in\mathcal{L}_{\infty}\) and consequently remains bounded. Moreover, every trajectory \(z(t)\) lies strictly within the set where the approximation capabilities of the polynomial approximation structure hold. Therefore, starting from an admissible policy, we always improve it until \(u^{(i)}\) and \(J_{L}^{(i)}\) converge to their optimal values. Finally, to show (24), notice that from [PERSON]'s approximation theorem, since \(J(z)\) is \(C^{1}\), it can be uniformly approximated as accurately as desired by a polynomial function within a compact set. As a consequence, no matter how small \(\xi\) is chosen, there exists a polynomial basis \(\{\sigma_{j}\}_{1}^{L}\) with \(L\geq L_{0}(\xi)\) such that (24) holds.