## 3 Generation of Equations
### Realizability Analysis
#### 3.2.2 Algorithm
\right), \tag{27}\]where matrices are related to \(\mathbf{J}\) in (5) as follows. \[\mathbf{D}=\left(\frac{\mathbf{I_{d}}}{T}-\frac{\mathbf{I_{x}}\cdot \mathbf{Q}}{2}\right),^{-1} \mathbf{A_{w}}=\frac{1}{2}\mathbf{K}^{\intercal}\cdot\mathbf{Q} \cdot(2\mathbf{I_{d}}+\mathbf{A_{x}}),\] \[\mathbf{A_{x}}=\mathbf{D}\cdot\mathbf{J_{x}}\cdot\mathbf{Q}, \mathbf{B_{w}}=\mathbf{J_{w}}+\frac{1}{2}\mathbf{K}^{\intercal}\cdot \mathbf{Q}\cdot\mathbf{B_{x}},\] \[\mathbf{B_{x}}=-\mathbf{D}\cdot\mathbf{K}, \mathbf{C_{w}}=-\mathbf{G_{w}}+\frac{1}{2}\mathbf{K}^{\intercal} \cdot\mathbf{Q}\cdot\mathbf{C_{x}},\] \[\mathbf{C_{x}}=-\mathbf{D}\cdot\mathbf{G_{x}}, \mathbf{A_{y}}=\frac{1}{2}\mathbf{G_{x}}^{\intercal}\cdot\mathbf{Q} \cdot(2\mathbf{I_{d}}+\mathbf{A_{x}}),\] \[\mathbf{B_{y}}=\mathbf{G_{w}}^{\intercal}+\frac{1}{2}\mathbf{G_{ x}}^{\intercal}\cdot\mathbf{Q}\cdot\mathbf{B_{x}},\] \[\mathbf{C_{y}}=\mathbf{J_{y}}+\frac{1}{2}\mathbf{G_{x}}^{ \intercal}\cdot\mathbf{Q}\cdot\mathbf{C_{x}}.\]

Given \(\mathbf{u}(k)\), the solution of (27) is obtained from the solution of the static nonlinear implicit function \(\mathbf{f}(\mathbf{w}(k))=\mathbf{p}\big{(}\mathbf{x}(k),\mathbf{u}(k)\big{)}\), with

\[ \begin{array}{rcl}\mathbf{f}\big{(}\mathbf{w}(k)\big{)}&=&\mathbf{w}(k)- \mathbf{B_{w}}\cdot\mathbf{z}\big{(}\mathbf{w}(k)\big{)},\\ \mathbf{p}\big{(}\mathbf{x}(k),\mathbf{u}(k)\big{)}&=&\mathbf{A_{w}}\cdot \mathbf{x}(k)+\mathbf{C_{w}}\cdot\mathbf{u}(k).\end{array}  \tag{28}\]

**Remark 5** (Explicit mapping). : _From the global inverse function theorem (see [34]), there exists an explicit mapping \(\mathbf{w}(k)=\mathbf{f}^{-1}\big{(}\mathbf{p}\big{(}\mathbf{x}(k),\mathbf{u}( k)\big{)}\big{)}\) provided the Jacobian matrix \(\mathcal{J}_{\mathbf{f}}(\mathbf{w}(k))=\mathbf{I_{d}}-\big{(}\mathbf{J_{w}}- \frac{1}{2}\mathbf{K}^{\intercal}\cdot\mathbf{Q}\cdot\mathbf{D}\cdot\mathbf{ K}\big{)}\cdot\mathcal{J}_{\mathbf{z}}(\mathbf{w}(k))\) is invertible for all \(\mathbf{w}(k)\), connecting the proposed method to the \(K\) method [18; 19]. This is true since \(\mathbf{Q}\), \(\mathbf{D}\) and the Jacobian of \(\mathbf{z}\) (for the components of the dictionary in Table 1) prove positive definite, and \(\mathbf{J_{w}}\) is skew-symmetric._

In this paper, we use the Newton-Raphson algorithm, which iteratively approximates the nearest root of function \(\mathbf{r}\colon\mathbf{w}(k)\in\mathbb{R}^{n_{D}}\to\mathbf{r}\big{(} \mathbf{w}(k)\big{)}\in\mathbb{R}^{n_{D}}\) with the following update rule: \(\mathbf{w}_{n+1}(k)=\mathbf{w}_{n}(k)-\mathcal{J}_{\mathbf{r}}(\mathbf{w}_{n} (k))^{-1}\). \(\mathbf{r}(\mathbf{w}_{n}(k))\), where \(\mathcal{J}_{\mathbf{r}}(\mathbf{w})\) is the Jacobian matrix of \(\mathbf{r}\big{(}\mathbf{w}(k)\big{)}=\mathbf{f}\big{(}\mathbf{w}(k)\big{)}- \mathbf{p}(k)\). Once a solution \(\mathbf{w}(k)\) to the implicit equation is available, the output and state updates are given by:

\[\mathbf{y}(k) = \mathbf{A_{y}}\cdot\mathbf{x}(k)+\mathbf{B_{y}}\cdot\mathbf{z} \big{(}\mathbf{w}(k)\big{)}+\mathbf{C_{y}}\cdot\mathbf{u}(k),\] \[\delta\mathbf{x}(k) = \mathbf{A_{x}}\cdot\mathbf{x}(k)+\mathbf{B_{x}}\cdot\mathbf{z} \big{(}\mathbf{w}(k)\big{)}+\mathbf{C_{x}}\cdot\mathbf{u}(k),\] \[\mathbf{x}(k+1) = \mathbf{x}(k)+\delta\mathbf{x}(k).\]

Finally, denoting by \(n_{t}\) the number of time-steps and \(n_{NR}\) the number of Newton-Raphson iterations per time-step, the simulation is performed according to Algorithm 2. ```
\(\mathbf{x}_{1}\gets 0\) \(\mathbf{w}_{0}\gets 0\) for\(k=1\) to \(n_{t}\)do \(\mathbf{w}_{k,0}\leftarrow\mathbf{w}_{k-1}\) \(\mathbf{p}_{k}\leftarrow\mathbf{A_{w}}\cdot\mathbf{x}_{k}+\mathbf{C_{w}}.