# Inducing Optimality in Prescribed Performance Control for Uncertain Euler-Lagrange Systems
## 3 Problem Formulation and Preliminaries
### Optimal Control with Prescribed Performance  
To induce optimality along with prescribed performance, we formulate the cost function of the optimal control problem as follows:  
\[J=\int_{0}^{\infty}\Big{(}\alpha\|\epsilon(t)\|^{2}+\beta\|\tau(t)-G(\bar{q}_{ d})\|^{2}\Big{)}dt \tag{6}\]  
where \(\epsilon=\big{[}\epsilon_{1},\ldots,\epsilon_{n}\big{]}^{T}\) denotes the vector of the transformed errors defined via (4) as \(\epsilon_{i}(t)=T\Big{(}\frac{q_{i}+\lambda(q_{i}-q_{i_{j}})}{\rho_{i}(t)} \Big{)},\;\;i=1,\ldots,n\). The constants \(\alpha\) and \(\beta\) are positive and regulate the trade-off between the state convergence and the energy of the input signal. Additionally, for an admissible control policy (i.e., a control policy that exhibits a finite cost value from any initial condition in the workspace) the transformed errors remain bounded since \(\epsilon_{i}(t)\in\mathcal{L}_{2}\) and thus the predefined performance specifications are met according to Proposition 1. Finally, notice that the term \(G(\bar{q}_{d})\) is necessary in the input-related term in (6), so that \(\bar{q}_{d}\) becomes an equilibrium and the integral cost is valid (otherwise the integral of the second term in the cost function (6) would grow unbounded as the input signal to keep the system at the desired position \(\bar{q}_{d}\) would not vanish).  
To find an admissible policy that minimizes (6) and guarantees predefined transient and steady state performance specifications, first, notice that (6) can be transformed in its differential form as \(\dot{J}=-\alpha\|\epsilon\|^{2}-\beta\|\tau-G(\bar{q}_{d})\|^{2}\). Thus, the equivalent HJB equation can be written as:  
\[HJB(z)=\
abla_{q}\dot{J}^{T}\dot{q}+\
abla_{\rho}\dot{J}^{T}\dot{\rho}+\
abla_ {\epsilon}\dot{J}^{T}\dot{\epsilon}+\alpha\|\epsilon\|^{2}+\beta\|\tau-G(\bar {q}_{d})\|^{2}=0 \tag{7}\]  
for a stacked state-space vector \(z=\big{[}q^{T},\rho^{T},\epsilon^{T}\big{]}^{T}\), where \(\rho=[\rho_{1},\ldots,\rho_{n}]^{T}\) denotes the vector of the performance functions, and \(\
abla_{\bullet}\) denotes the gradient with respect to each argument \(\bullet\). Applying the stationary condition in (7) after substituting the system dynamics (1) in \(\dot{\epsilon}_{i}\), the optimal control policy is calculated as:  
\[\tau^{\star}(q,\rho,\epsilon)=-\frac{1}{2\beta}M^{-T}(q)\mathbf{T}^{\prime} \text{diag}(\rho)^{-1}\
abla_{\epsilon}J+G(\bar{q}_{d}), \tag{8}\]  
where \(\mathbf{T}^{\prime}\) denotes the diagonal matrix with the derivatives of the transformation function \(\frac{dT(\star)}{d\star}\) for each error, respectively, which are yielded by \(\dot{\epsilon}\).  
Now, we have to deal with two major obstacles. The first concerns the lack of knowledge of the system dynamics, which is heavily involved in both the HJB Equation (7) via \(\dot{\epsilon}\) as well as in the optimal control policy (8). Furthermore, notice that in order to implement (8) we need the gradient of the cost function. However, the HJB Equation (7) is a nontrivial partial differential equation to solve numerically (i.e., we cannot easily calculate \(\
abla_{\epsilon}J\) and apply it in the optimal control policy (8)). In the next section, both issues are rigorously addressed.