## 6 Virtual Sensor Design
### Uncertainty Intervals  
The main objective of this point is to extend the virtual sensor algorithm proposed in the preceding section by an uncertainty interval quantifying the quality of the achieved estimates. This means that the resulting uncertainty interval will provide the knowledge about \(\mathbf{d}_{k}\) in the following form:  
\[\underline{\mathbf{d}}_{k}\leq\mathbf{d}_{k}\leq\hat{\mathbf{d}}_{k}. \tag{59}\]  
Thus, the objective of the subsequent part of this point is to provide a computational framework capable of calculating \(\mathbf{d}_{k}\) and \(\underline{\mathbf{d}}_{k}\). To tackle this problem, the following lemma [15] can be used:  
**Lemma 1**. : _If the system (45) is strictly quadratically bounded for all \(\bar{\mathbf{w}}_{k}\in\mathbb{E}_{w}\), then \(\alpha\in(0,1)\) exists such that_  
\[V_{k}\leq\zeta_{k}(\alpha),\qquad k=0,1,\ldots, \tag{60}\]  
_where the sequence \(\zeta_{k}(\alpha)\) is defined_  
\[\zeta_{k}(\alpha)=(1-\alpha)^{k}V_{0}+1-(1-\alpha)^{k},\qquad k=0,1,\ldots. \tag{61}\]  
Finally, bearing in mind that the estimation error \(\mathbf{e}_{d,k}\) lies within an ellipsoid (60), its bounds are shaped by:  
\[-\left(\zeta_{k}\left(\alpha\right)\mathbf{c}_{i}^{T}\mathbf{P}^{-1}\mathbf{c}_{i}\right) ^{\frac{1}{2}}\leq\mathbf{e}_{d,i,k}\leq\left(\zeta_{k}\left(\alpha\right)\mathbf{c}_{ i}^{T}\mathbf{P}^{-1}\mathbf{c}_{i}\right)^{\frac{1}{2}},\quad i=1,\ldots,n_{d}. \tag{62}\]  
This result leads to the final form of the uncertainty intervals:  
\[\underline{\mathbf{d}_{i,k}} =\hat{\mathbf{d}}_{i,k}-\left(\zeta_{k}\left(\alpha\right)\mathbf{c}_{i}^ {T}\mathbf{P}^{-1}\mathbf{c}_{i}\right)^{\frac{1}{2}}, \tag{63}\] \[\hat{\mathbf{d}_{i,k}} =\hat{\mathbf{d}}_{i,k}+\left(\zeta_{k}\left(\alpha\right)\mathbf{c}_{i}^ {T}\mathbf{P}^{-1}\mathbf{c}_{i}\right)^{\frac{1}{2}},\quad i=1,\ldots,n_{d}. \tag{64}\]  
From (61), it is evident that \(\zeta_{k}(\alpha)\) converges to one while its convergence rate depends solely on \(\alpha\), i.e., the closer it is to one, the better is the convergence rate, while, from (63) and (64), it can be deduced that the steady-state length of the uncertainty interval depends on \(\mathbf{P}\), i.e., on its diagonal elements. Thus, a natural measure to be optimized should be \(\text{trace}(\mathbf{P})\), which leads to the following strategy:  
\[(\alpha,\mathbf{P},\mathbf{L})=\arg\max_{\alpha\in(0,1),\,\mathbf{P}\succ\mathbf{0},\,\mathbf{L} }\text{trace}(\mathbf{P}), \tag{65}\]  
under constraints (58). Finally, to obtain \(\hat{\mathbf{d}}_{k}\) with possibly small uncertainty intervals, _Step 2_ of _Offline_ phase of the algorithm proposed in the preceding section should incorporate the above optimization task. This can be accomplished with widely available computational packages like, e.g., MATLAB (MathWorks, Natick, MA, USA). From the above discussion, it is evident that \(\alpha\in(0,1)\) should be selected in such a way as to achieve a good balance between convergence rate expressed by \(\zeta_{k}(\alpha)\) and the steady-state size of the confidence interval (63) and (64), which solely depends on the \(\text{trace}(\mathbf{P})\). The only way to achieve this goal is to solve (65) by iteratively changing \(\alpha\in(0,1)\). Finally, the achieved list of pairs \([\alpha,\text{trace}(\mathbf{P})]\) can be used to find a desired solution. The last component of the proposed strategy that deserves additional explanation is the selection of the matrix \(\mathbf{Q}_{w}\) in (47) shaping the size of the domain of \(\tilde{\mathbf{w}}_{k}= \begin{bmatrix}\mathbf{\varepsilon}_{k}\\ \mathbf{w}_{k}\end{bmatrix} \). This can be achieved by assuming that  
\[-\tilde{w}_{i,k}\leq\tilde{w}_{i,k}\leq\tilde{w}_{i,k},\quad i=1,2\ldots, \tag{66}\]  
where \(\tilde{w}_{i,k}\) (\(i=1,\ldots,4\)) shape the maximum force rate of change of \(F_{x,ij,k+1}-F_{x,ij,k}\) while \(\tilde{w}_{5,k}\) corresponds to the maximum torque rate of change.