# Improving Unknown Input canonization in UIO

Agostino Martinelli*

July 30, 2024

## Contents

<table><tr><td>1</td><td>Reminders</td><td>2</td></tr><tr><td>2</td><td>Canonization in the absence of known inputs</td><td>2</td></tr><tr><td>2.1</td><td>Observable functions expressed in V</td><td>3</td></tr><tr><td>2.2</td><td>New results</td><td>4</td></tr><tr><td>2.3</td><td>The case $\hat{G}^k \notin (\Omega_*)^\perp$</td><td>5</td></tr><tr><td>3</td><td>Example where the canonization proposed in [1] fails</td><td>6</td></tr><tr><td>3.1</td><td>New canonization</td><td>6</td></tr><tr><td>4</td><td>Canonization in the general case</td><td>8</td></tr><tr><td>4.1</td><td>Implementation of Algorithm 8*</td><td>8</td></tr><tr><td>4.1.1</td><td>$\hat{g}_{d\infty}$</td><td>8</td></tr><tr><td>4.1.2</td><td>$\psi_q^i$</td><td>9</td></tr><tr><td>5</td><td>Conclusion</td><td>9</td></tr></table>

## Abstract

This paper provides an improvement of the solution of the unknown input observability problem introduced in [1]. The improvement regards the case when the system is not canonic with respect to its unknown inputs. In this case, [1] introduced a systematic procedure (from now on, the *canonization*) able to either set the system in canonic form (for which we can compute the observability codistribution as explained in Section 4 of [1]) or, if the system is not canonic, to directly provide the observability codistribution. This procedure determines several functions and is based on their observability. On the other hand, their observability cannot be proven in general. In particular, their observability depends on the experiment (i.e., on the values taken by the unknown inputs). This paper, provides a new procedure to obtain the canonization, which is based on the computation of several functions that are observable independently of the values taken by the unknown inputs (in other words, these functions are observable in accordance with the definition of observability given in [2], which holds in the presence of unknown inputs).

<footnote>*A. Martinelli is with INRIA Rhone Alpes, Montbonnot, France e-mail: agostino.martinelli@inria.fr</footnote>
# 1 Reminders

We remind the reader of some fundamental concepts introduced in [1].

The system is characterized by:

$$ \begin{cases} \dot{x} = g^0(x,t) + \sum_{k=1}^{m_w} f^k(x,t)u_k(t) + \sum_{j=1}^{m_w} g^j(x,t)w_j(t) \\ y = [h_1(x,t), \dots, h_p(x,t)], \end{cases} \quad (1) $$

Given a codistribution $\Omega$, we denote by $\deg_w(\Omega)$ the unknown input degree of reconstructability of the system from the generators of $\Omega$ (see Definition 2 in Section 3 of [1]).

Let us denote by $\Omega$ the codistribution which is the span of all the observable functions that we know (at the beginning these are only the system outputs). If $\deg_w(\Omega) = m_w$ the system is in canonical form (see Definition 4 in Section 3 of [1]) and we obtain its observability codistribution as explained in Section 4 of [1].

Let us suppose that $\deg_w(\Omega) = m < m_w$. In order words, there exist $m$ observable functions, $\tilde{h}_1, \dots, \tilde{h}_m$, such that $\nabla\tilde{h}_1, \dots, \nabla\tilde{h}_m$ are in $\Omega$ (from now on, we say $\tilde{h}_1, \dots, \tilde{h}_m$ are in $\Omega$ to mean the same) and the unknown input degree of reconstructability from $\tilde{h}_1, \dots, \tilde{h}_m$ is $m$. In this paper, we call the functions $\tilde{h}_1, \dots, \tilde{h}_m$ unknown input identifiers, or, shortly, UUIDs.

We reorder the unknown inputs in such a way that, given the reconstructability matrix $\mathcal{RM}(\tilde{h}_1, \dots, \tilde{h}_m)$ (see Definition 1 in Section 3 of [1]), the submatrix that consists of its first $m$ columns is full rank.

As in [1], we compute the following tensor fields:

$$ \mu_j^i = \mathcal{L}_{g^i} \tilde{h}_j, \quad i, j = 1, \dots, m $$

$$ \mu_0^0 = 1, \mu_0^i = 0, \mu_i^0 = \frac{\partial \tilde{h}_i}{\partial t} + \mathcal{L}_{g^0} \tilde{h}_i, \quad i = 1, \dots, m. $$

and its inverse, denoted by $\nu$. Note that in [1] we denoted the above tensors by $^m\mu$ and $^m\nu$. We have:

$$ \nu_0^0 = 1, \nu_i^0 = 0, \nu_i^0 = -\mu_k^0 \nu_i^k, \nu_k^i \mu_j^k = \mu_k^i \nu_j^k = \delta_j^i. $$

At this moment, the system is not in canonical form. We do not know if the system is canonical (Definition 3 in Section 3 of [1]), non canonical but canonizable (Definition 7 in Section 5 of [1]), or even not canonizable. The starting step of the procedure proposed in [1] is the determination of new observable functions. This is obtained in the nested loop of Algorithm 9 in [1], and consists in the execution of the recursive step of Algorithm 8 in [1]. Unfortunately, this iterative step can include functions that could be non observable, depending on the values taken by the unknown inputs. In particular, this regards the last term at the recursive step. In addition, even $\tilde{O}^\infty$ (at the initialization) is not guaranteed to be observable. In the following, we will see which terms must be included and the correct procedure to be followed. Specifically, we first deal with the easier case where the dynamics are only driven by unknown inputs (absence of known inputs). For this case, dealt with in Section 2, we introduce a complete different approach with respect to [1]. In Section 3 we provide a simple example where the canonization proposed in [1] fails. Finally, in Section 4, we deal with the general case (simultaneous presence of known and unknown inputs) and we provide Algorithm 8* that replaces Algorithm 8 in [1].

As in [1], when an index takes positive values (1, 2, ...) we adopt a Latin index. When an index can also take the zero value (0, 1, 2, ...) we adopt a Greek index. In addition, when is not ambiguous, we adopt Einstein's notation for indices that take the values 0, 1, ..., m or 1, ..., m, with m the unknown input degree of reconstructability. In other words, we use the convention that repeated indices imply the summation is to be done ($\sum_0^m$ or, if Latin, $\sum_1^m$).

# 2 Canonization in the absence of known inputs

In this section, we analyze the systems characterized by the following dynamics:

$$ \dot{x} = g^0 + g^j w_j + \sum_{k=m+1}^{m_w} G^k W_k \quad (2) $$
where we use the capital W for the last $d = m_w - m$ unknown inputs.

For simplicity, we also refer to the autonomous case (the case non autonomous is a trivial extension).

The first step consists in using the UIDs $\tilde{h}_1, \dots, \tilde{h}_m$ to eliminate $w_1, \dots, w_m$ from the dynamics. Specifically, we compute the functions (observable):

$$v_i := \dot{\tilde{h}}_i = \mathcal{L}_{g^0} \tilde{h}_i + w_j \mathcal{L}_{g^j} \tilde{h}_i + \sum_{k=m+1}^{m_w} W_k \mathcal{L}_{G^k} \tilde{h}_i = \mu_i^0 + w_j \mu_i^j + \sum_{k=m+1}^{m_w} W_k \mathcal{L}_{G^k} \tilde{h}_i$$

By setting $v_0 = w_0 = 1$ and $\tilde{h}_0 = t$, we have:

$$v_{\alpha} = \dot{\tilde{h}}_{\alpha} = w_{\beta}\mu_{\alpha}^{\beta} + \sum_{k=m+1}^{m_w} W_k \mathcal{L}_{G^k} \tilde{h}_{\alpha} \quad (3)$$

From them we obtain $w_1, \dots, w_m$. Namely:

$$w_{\alpha} = \nu_{\alpha}^{\beta} v_{\beta} - \sum_{k=m+1}^{m_w} \nu_{\alpha}^{j} W_k \mathcal{L}_{G^k} \tilde{h}_j \quad (4)$$

We substitute in (2), and we obtain:

$$\dot{x} = \hat{g}^{\alpha} v_{\alpha} + \sum_{k=m+1}^{m_w} \hat{G}^{k} W_k \quad (5)$$

with:

$$\hat{g}^{\alpha} = \nu_{\beta}^{\alpha} g^{\beta}, \quad \hat{G}^{k} := G^{k} - \hat{g}^{j} \mathcal{L}_{G^{k}} \tilde{h}_{j}$$

From (3), by recursively differentiating with respect to the time, we obtain the following structure for the $q$ time derivative of $v_i$:

$$v_i^{(q)} = \mathrm{func}(x, w^{(\le q-1)}, W^{(\le q-1)}) + \mu_i^j w_j^{(q)} + \mathcal{L}_{G^k} \tilde{h}_i W_k^{(q)} \quad (6)$$

(trivially, all the time derivatives of $v_0$ and $w_0$ vanish).

A manner to obtain all the observable functions is by computing all the time derivatives of the functions in $\Omega$. However, we do not know when to stop the procedure (highest order time derivative to be considered). These functions can be computed by using (2) or (5). In the first case, they will be expressed in terms of $x, w_1, \dots, w_m$ and their derivatives and $W_{m+1}, \dots, W_{m_w}$ and their derivatives. We compactly denote the space of $w_1, \dots, w_m$ and their derivatives and $W_{m+1}, \dots, W_{m_w}$ and their derivatives by $\mathcal{W}$. In the second case, they will be expressed in terms of $x, v_1, \dots, v_m$ and their derivatives and $W_{m+1}, \dots, W_{m_w}$ and their derivatives. We compactly denote the space of $v_1, \dots, v_m$ and their derivatives and $W_{m+1}, \dots, W_{m_w}$ and their derivatives by $\mathcal{V}$.

We can pass from $\mathcal{W}$ and $\mathcal{V}$ by using Equations (3) and (6), which is one-to-one because of the non singularity of $\mu$.

## 2.1 Observable functions expressed in $\mathcal{V}$

We denote the codistribution associated to these functions by $\mathcal{O}_v$. Let us better specify the structure of these functions. We have:

$$\theta = \theta(x, \dots, v_j, v_j^{(1)}, \dots, v_j^{(\bar{j})}, \dots, W_k, W_k^{(1)}, \dots, W_k^{(\bar{k})})$$

for $j = 1, \dots, m$ and $k = m + 1, \dots, m_w$ and, for each $j$ and for each $k, \bar{j}$ and $\bar{k}$ are the highest order time derivatives that appear in $\theta$.

Note that $v_1, \dots, v_m$ and their time derivatives are known. In particular,

$$v_j^{(q)} = \tilde{h}_j^{(q+1)}$$
There is a particular case that, as we will see, deserves a separate study. It is case when all the above functions are independent of $W_k$ ($k = m+1, \dots, m_w$). For brevity, we use the notation $\partial_W O_v = 0$ to compactly characterize this case.

We have the following first simple result.

**Lemma 1.** If $\partial_W O_v = 0$, then all the functions in $O_v$ are also independent of the derivatives of $W_k$.

*Proof.* The functions in $O_v$ are obtained by recursively computing the time derivatives by using the dynamics in (5), starting from the functions in $\Omega$. We proceed by induction. At the beginning, no function in $\Omega$ depends on $W_k$ and its derivatives. Let us suppose that this is true at a given step. At the next step, the time derivative can at most depend on $W_k$. But this is not possible by assumption. ◀

In the next subsection we provide new results that allow us to conclude that, by recursively computing the time derivatives of $\Omega$, we achieve one of the following two results, in a finite number of steps : (i) we determine $O_v$ (that is our goal) or (ii) we find a new unknown input identifier, i.e., a new observable function able to increase the unknown input degree of reconstructability. In the second case, we need to characterize our system by a finite unknown input extension of the original system. This extension is automatically determined.

## 2.2 New results

Let us denote by $\Omega_*$ the smallest codistribution that includes $\Omega$ and it is invariant with respect to $\mathcal{L}_{\hat{g}^0}, \mathcal{L}_{\hat{g}^1}, \dots, \mathcal{L}_{\hat{g}^m}$. It is usually denoted by: $\langle \hat{g}^0, \hat{g}^1, \dots, \hat{g}^m | \Omega \rangle$.

We have the following result:

**Proposition 1.** $\partial_W O_v = 0$ if and only if $\hat{G}^k \in \mathcal{O}_v^{\perp}$ ($\forall k = m+1, \dots, m_w$).

*Proof.* (⇒) By contradiction. If $\exists k$ ($m+1 \le k \le m_w$) such that $\hat{G}^k \notin \mathcal{O}_v^{\perp}$ then $\dot{\theta}$, which is in $O_v$, would depend on $W_k$. Indeed:

$$ \dot{\theta} = \mathcal{L}_{\hat{g}^\alpha} \theta v_\alpha + \frac{\partial \theta}{\partial v_\alpha^{(i_\alpha)}} v_\alpha^{(i_\alpha+1)} + \sum_{k=m+1}^{m_w} \mathcal{L}_{\hat{G}^k} \theta W_k. $$

($\Leftarrow$) By induction. At the beginning the functions in $\Omega$ are independent of $W_k$. If $\theta$ is independent of $W_k$, also its time derivative is independent. Indeed:

$$ \dot{\theta} = \mathcal{L}_{\hat{g}^\alpha} \theta v_\alpha + \frac{\partial \theta}{\partial v_\alpha^{(i_\alpha)}} v_\alpha^{(i_\alpha+1)}. \quad \triangle $$

We remind the reader that the functions of $O_v$ are computed by recursively computing the time derivatives by using the dynamics in (5), starting from the functions in $\Omega$. Let us suppose that, up to a given order, these functions are independent of any $W_k$ ($m+1 \le k \le m_w$). We have the following result:

**Lemma 2.** If the time derivatives up to the $L^{th}$ order are independent of any $W_k$ ($m+1 \le k \le m_w$), then they depend on $x$ through the functions in $\Omega_*$.

*Proof.* By induction. At the beginning it is true, as we start from $\Omega$ and $\Omega \subseteq \Omega_*$. If it is true at a given order ($< L$), then it also holds at the next order. Indeed, the dynamics in (5) act by computing the Lie derivatives along $\hat{g}^0, \dots, \hat{g}^m$. Clearly, the result is not ensured when the order is larger than $L$. ◀

A simple corollary of this result is:

**Lemma 3.** If $\partial_W O_v = 0$, then all the functions in $O_v$ depend on $x$ through the functions in $\Omega_*$.

Let us denote by $L_v$ the span of all the functions $v_\alpha^{(i_\alpha)}$. We have the following results:

**Proposition 2.** $\partial_W O_v = 0$ if and only if $O_v = \Omega_* + L_v$.
Proof. (⇒) It is a consequence of Lemma 3 (above), the fact that all the functions in $L_v$ are observable, and Lemma 8.8 in [2].

(←) Trivial, by construction all the functions in $\Omega_*$ and $L_v$ are independent of W. ◀

**Proposition 3.** $\partial_W \mathcal{O}_v = 0$ if and only if, for any $k = m + 1, \dots, m_w$, $\hat{G}^k \in (\Omega_*)^{\perp}$.

Proof. (⇒) From Proposition 1 we know that $\hat{G}^k \in \mathcal{O}_v^{\perp}$. In addition, from Proposition 2 we also know that $\mathcal{O}_v = \Omega_* + L_v$.

(←) By induction. At the beginning, the functions in $\Omega$ are independent of any $W_k$ ($m+1 \le k \le m_w$). Let us suppose that $\theta$ is independent of any $W_k$ ($m+1 \le k \le m_w$). $\theta$ depends on $x$ only by functions in $\Omega_*$ (Lemma 2). As a result, $\mathcal{L}_{\hat{G}^k} \theta = 0$ and $\dot{\theta}$ is independent of any $W_k$ ($m+1 \le k \le m_w$). ◀

Hence, the key condition is:

$$ \hat{G}^k \in (\Omega_*)^{\perp}, \quad \forall k = m+1, \dots, m_w, \quad \text{with:} \quad \Omega_* = \langle \hat{g}^0, \hat{g}^1, \dots, \hat{g}^m | \Omega \rangle \quad (7) $$

If, for any $k$ ($m+1 \le k \le m_w$), $\hat{G}^k \in (\Omega_*)^{\perp}$, from Propositions 2 and 3, we have obtained the entire observability codistribution $(\Omega_*)$.

The case when, for a given $m+1 \le k \le m_w$, $\hat{G}^k \notin (\Omega_*)^{\perp}$, will be considered separately.

## 2.3 The case $\hat{G}^k \notin (\Omega_*)^{\perp}$

Let us analyze the case when $\hat{G}^k \notin (\Omega_*)^{\perp}$ (for at least a given $k = m+1, \dots, m_w$). From Propositions 3, and 1, we know that there exists $\theta$ such that:

$$ \mathcal{L}_{\hat{G}^k} \theta \neq 0 $$

for a given $m+1 \le k \le m_w$. We choose the lowest order time derivative obtained by computing the time derivatives as explained in Section 2.1. This is independent of any $W_k$ ($m+1 \le k \le m_w$). We reorder the W in such a way that $\mathcal{L}_{\hat{G}^{m+1}} \theta \neq 0$. Let us specify the dependence of $\theta$ on $v_j$ and their time derivatives ($j = 1, \dots, m$). For each $j = 1, \dots, m$, $\theta$ depends on $v_j$, $v_j^{(1)}, \dots, v_j^{(\bar{j})}$, where $\bar{j}$ is the highest order time derivative that appears in $\theta$.

We have:

$$ \theta = \theta(x, v_j, v_j^{(1)}, \dots, v_j^{(\bar{j})}) $$

We reset the unknown input identifiers:

$$ \tilde{h}_j \rightarrow \tilde{h}_j := v_j^{(\bar{j})} = \tilde{h}_j^{(\bar{j}+1)}, \quad j = 1, \dots, m $$

and we add the new unknown input identifier:

$$ \tilde{h}_{m+1} = \theta. $$

We have the following result:

**Proposition 4.** If there exists $\theta \in \mathcal{O}_v$ such that, for a given $k = m+1, \dots, m_w$, we have $\mathcal{L}_{\hat{G}^k} \theta \neq 0$, then:

$$ \mathrm{rank} \left\{ \mathcal{RM} \left( \tilde{h}_1, \dots, \tilde{h}_m, \theta \right) \right\} = m+1 $$
*Proof.* We compute the rank of the matrix in $V$. In other words, we include all the $v_j, v_j^{(1)}, v_j^{(\bar{j})}$ in the state. The dynamics become:

$$ \hat{g}_E^0 = \begin{bmatrix} \hat{g}^0 + \sum_{j=1}^m \hat{g}^j v_j \\ v_1^{(1)} \\ \vdots \\ v_1^{(\bar{1})} \\ 0 \\ \vdots \\ v_j^{(1)} \\ \vdots \\ v_j^{(\bar{j})} \\ 0 \\ \vdots \\ v_m^{(1)} \\ \vdots \\ v_m^{(\bar{m})} \\ 0 \end{bmatrix}, \quad \hat{g}_E^j = \begin{bmatrix} 0_n \\ 0 \\ \vdots \\ 0 \\ 0 \\ \vdots \\ 0 \\ \vdots \\ 0 \\ 1 \\ \vdots \\ 0 \\ \vdots \\ 0 \\ 0 \end{bmatrix}, \quad \hat{G}_E^k = \begin{bmatrix} \hat{G}^k \\ 0 \\ \vdots \\ 0 \\ 0 \\ \vdots \\ 0 \\ 0 \\ \vdots \\ 0 \\ 0 \\ \vdots \\ 0 \\ 0 \end{bmatrix} $$

In this extended state, we have: $\nabla \tilde{h}_j = \nabla v_j^{(\bar{j})} = [0, \dots, 0, 1, 0, \dots, 0]$. As a result, $\mathcal{L}_{\hat{g}_E^i} \tilde{h}_j = \delta_j^i$ and $\mathcal{L}_{\hat{G}_E^{m+1}} \tilde{h}_j = 0$. On the other hand, $\mathcal{L}_{\hat{G}_E^k} \theta = \mathcal{L}_{\hat{G}_E^k} \theta \neq 0$. $\blacksquare$

The above result allows us to obtain the unknown input extension where the unknown input degree of reconstructability is $m+1$. Indeed, by using (3) and (6) we back to the dynamics of the type in (2), where the unknown inputs are the highest derivatives, and the other ones are in the state. For this extended system we have the unknown input identifiers. They are the $m+1$ functions $\tilde{h}_j^{(\bar{j})}$ ($j=1, \dots, m$) and $\tilde{h}_{m+1} = \theta$ expressed in terms of $w_j$ and $W_k$ (we eliminated all the terms $v_j^{(i_j)}$).

The procedure cannot be repeated more than $m_w - m$ times. If at the end, $m = m_w$, we obtain a system that is in canonical form and we can proceed as explained in Section 4 of [1]. Otherwise, it means that at a given execution of the procedure, we have obtained the entire $O_v$.

### 3 Example where the canonization proposed in [1] fails

We consider the following system:

$$ \begin{bmatrix} \dot{x}_1 = & w_1 \\ \dot{x}_2 = & x_3 + x_4 w_1 \\ \dot{x}_3 = & w_2 \\ \dot{x}_4 = & 0 \end{bmatrix} $$

$$ g^0 = \begin{bmatrix} 0 \\ x_3 \\ 0 \\ 0 \end{bmatrix}, \quad g^1 = \begin{bmatrix} 1 \\ x_4 \\ 0 \\ 0 \end{bmatrix}, \quad g^2 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}, \quad h_1 = x_1, \ h_2 = x_2. $$

This system has, at the beginning, $m=1$, with $\tilde{h}_1 = x_1$.

Then: $v_1^1 = v_0^1 = 1$ and $v_0^1 = v_1^0 = 0$. As a result: $\hat{g}^0 = g^0$ and $\hat{g}^1 = g^1$. In addition, $\mathcal{L}_{g^2} h_2 = 0$. Therefore, according to the canonization given in [1], $\mathcal{L}_{\hat{g}^0} h_2 = x_3$ and $\mathcal{L}_{\hat{g}^1} h_2 = x_4$ would be observable, while they are not.

#### 3.1 New canonization

We have
$$g^0 = \begin{bmatrix} 0 \\ x_3 \\ 0 \\ 0 \end{bmatrix}, \quad g^1 = \begin{bmatrix} 1 \\ x_4 \\ 0 \\ 0 \end{bmatrix}, \quad G^2 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}, \quad h_1 = x_1, h_2 = x_2.$$

$$\Omega = \operatorname{span}\{\nabla x_1, \nabla x_2\}$$

and $\deg_w(\Omega) = 1 < 2 = m_w$.

$$\tilde{h}_1 = x_1$$

$$\mu_0^0 = 1, \mu_0^1 = 0, \mu_1^0 = 0, \mu_1^1 = 1$$

$$\nu_0^0 = 1, \nu_0^1 = 0, \nu_1^0 = 0, \nu_1^1 = 1$$

We obtain:

$$\hat{g}^0 = \begin{bmatrix} 0 \\ x_3 \\ 0 \\ 0 \end{bmatrix}, \quad \hat{g}^1 = \begin{bmatrix} 1 \\ x_4 \\ 0 \\ 0 \end{bmatrix}, \quad \hat{G}^2 = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}.$$

because

$$\hat{G}^2 = G^2 - \hat{g}^1 \mathcal{L}_{G^2} \tilde{h}_1 = G^2.$$

We compute $\Omega^*$. We obtain: $\Omega_* = \operatorname{span}\{\nabla x_1, \nabla x_2, \nabla x_3, \nabla x_4\}$

Hence $\Omega_*^\perp$ is empty and the condition in (7) is not satisfied.

We compute the first order time derivatives of $\Omega$ by using (5). We obtain:

$$\dot{x}_2 = x_3 + v_1 x_4$$

We have:

$$\mathcal{L}_{\hat{G}^2}(x_3 + v_1 x_4) = 1 \neq 0$$

and we can stop the computation of the time derivatives.

We have:

$$\theta = x_3 + v_1 x_4$$

We eliminate $v_1$ by using (3). In this specific case, (3) becomes:

$$v_1 = w_1.$$

Hence, the unknown input extension is obtained by including $w_1$ in the state. The system is characterized by two unknown inputs, which are $\dot{w}_1$ and $w_2$. The unknown input degree of reconstructability is $1+1=2=m_w$. The system is in canonical form. The two unknown input identifiers are:

$$\tilde{\tilde{h}}_1 = \dot{\tilde{h}}_1 = w_1, \quad \tilde{\tilde{h}}_2 = \theta = x_3 + w_1 x_4$$

By proceeding as explained in Section 4 of [1], we obtain the observability codistribution. It is:

$$\operatorname{span}\{\nabla x_1, \nabla x_2, \nabla \theta, \nabla w_1\}$$
## 4 Canonization in the general case

We now consider the general case, as in [1]. As we aforementioned, the shortcoming is in Algorithm 8. The correct algorithm is Algorithm 8*, given below. On the other hand, Algorithm 8 and its outputs still play a fundamental role (as the role played by the computation of $\Omega_* = \langle \hat{g}^0, \hat{g}^1, \dots, \hat{g}^m | \Omega \rangle$ in the case without known inputs). Hence, during the canonization, we still run Algorithm 8. We can have the following two results:

1. It provides a function that depends on $w_{d\infty}$.

2. It converges and provides a given codistribution (denoted by $\Omega_*$, as in the case dealt with in Section 2).

In the first case, although is not ensured that this function is observable, it is ensured that, in a finite number of steps, Algorithm 8* provides a function that depends on $w_{d\infty}$ (and which is observable). Only in this case, Algorithm 8* must be executed. The unknown input extension is determined as follows. We first determine the observable function that depends on $w_{d\infty}$. Then, we eliminate in this function all the $v_j$ and their time derivatives by using (3) and (6). Hence, this function is expressed in terms of some of the original unknown inputs and some of their time derivatives. By including these unknown inputs and time derivatives in the state we obtain the appropriate unknown input extension.

In the second case, the codistribution determined by Algorithm 8 is the observability codistribution. Indeed, in this case, the limit codistribution computed by Algorithm 8* is $\Omega_* + L_v$. Therefore, in this second case, we do not need to run Algorithm 8*.

### 4.1 Implementation of Algorithm 8*

<caption>**Algorithm 8***: The algorithm used during canonization.</caption>

$$ 
\begin{aligned}
\mathcal{O}_0^\infty &= \operatorname{span}\{\nabla h_1, \dots, \nabla h_p\} \\
\mathcal{O}_{k+1}^\infty &= \mathcal{O}_k^\infty + \sum_{i=1}^{m_u} \mathcal{L}_{f_{d\infty}^i} \mathcal{O}_k^\infty + \mathcal{L}_{\hat{g}_{d\infty}}^v \mathcal{O}_k^\infty + \sum_{q=1}^m \sum_{i=1}^{m_u} \operatorname{span}\{\nabla \mathcal{L}_{\psi_k^i} \hat{h}_q\}
\end{aligned}
$$

The state of the system in Algorithm 8* is the same as for Algorithm 8, and it is $x_{d\infty}$. The initialization of Algorithm 8* only includes the output functions.

The recursive step differs in two respects:

1. Instead of the $m+1$ terms $\mathcal{L}_{\hat{g}_{d\infty}^\alpha} \mathcal{O}_k^\infty$ ($\alpha = 0, \dots, m$), we have the single term $\mathcal{L}_{\hat{g}_{d\infty}}^v \mathcal{O}_k^\infty$, where the vector $\hat{g}_{d\infty}$ and the operator $\mathcal{L}^v$ are defined Section 4.1.1.

2. The last term at the recursive step of Algorithm 8* was absent in Algorithm 8, as it was included at the initialization in $\tilde{\mathcal{O}}^\infty$. The vectors $\psi_k^i$ are defined in Section 4.1.2.

#### 4.1.1 $\hat{g}_{d\infty}$

This vector is defined as follows:

$$ \hat{g}_{d\infty} := \sum_{\alpha=0}^{m} v_{\alpha} \hat{g}_{d\infty}^{\alpha}, \quad v_0 = 1, \quad v_j = \dot{\hat{h}}_j, $$

and the operator $\mathcal{L}_\chi^v$ is:

$$ \mathcal{L}_\chi^v := \left( \mathcal{L}_\chi + \sum_{j=1}^{m} \sum_{i_j=1}^{\bar{j}} v_j^{(i_j+1)} \frac{\partial}{\partial v_j^{(i_j)}} \right) $$

or, for time varying systems:

$$ \mathcal{L}_\chi^v \rightarrow \mathcal{L}_\chi^v + \frac{\partial}{\partial t} $$
### 4.1.2 $\psi_q^i$

The expression of $\psi_q^i$ is complex but can be obtained automatically and recursively.

We start from

$$ \psi_0^i = f_{d\infty}^i $$

Then we use the following recursive formula:

$$ \psi_{q+1}^i = \frac{\partial \psi_q^i}{\partial x_{d\infty}} w_\gamma g^\gamma + \sum_{z=0}^q \frac{\partial \psi_q^i}{\partial w_\alpha^{(z)}} w_\alpha^{(z+1)} - \frac{\partial g^\gamma}{\partial x_{d\infty}} w_\gamma \psi_q^i $$

or, for time-varying systems:

$$ \psi_{q+1}^i \rightarrow \psi_{q+1}^i + \frac{\partial \psi_q^i}{\partial t} $$

Once determined, we must eliminate $w_\alpha$, $w_\alpha^{(1)}, \dots, w_\alpha^{(z+1)}$ by expressing them in terms of $v_\alpha$, $v_\alpha^{(1)}, \dots, v_\alpha^{(z+1)}$. This is obtained by using (4) and the inverse of (6).

## 5 Conclusion

This paper provided an improvement of the solution of the unknown input observability problem introduced in [1]. The improvement regards the case when the system is not canonic with respect to its unknown inputs. In this case, [1] introduced a systematic procedure able to either set the system in canonic form (for which we can compute the observability codistribution as explained in Section 4 of [1]) or, if the system is not canonic, to directly provide the observability codistribution. This procedure is the nested loop of Algorithm 9 in [1]. This procedure determines several functions and is based on their observability. On the other hand, their observability cannot be proven in general. In particular, their observability depends on the experiment (i.e., on the values taken by the unknown inputs). This paper, provided a new procedure to obtain the canonization, which is based on the computation of several functions that are observable independently of the values taken by the unknown inputs (in other words, these functions are observable in accordance with the definition of observability given in [2], which holds in the presence of unknown inputs). In addition, the paper proposed a new approach for systems whose dynamics are only driven by unknown inputs. It is possible to prove that this approach provides the same results provided by Algorithm 8*, in the absence of known inputs.

## References

[1] A. Martinelli, Nonlinear unknown input observability and unknown input reconstruction: The general analytical solution, Information Fusion, 2022, ISSN 1566-2535, https://doi.org/10.1016/j.inffus.2022.03.004.

[2] A. Martinelli, Observability: A New Theory Based on the Group of Invariance, published by SIAM in Advances in Design and Control, 2020, ISBN: 978-1-61197-624-3.