Nonlinear Observability Algorithms with Known and Unknown Inputs: Analysis and Implementation

The observability of a dynamical system is affected by the presence of external inputs, either known (such as control actions) or unknown (disturbances). Inputs of unknown magnitude are especially detrimental for observability, and they also complicate its analysis. Hence, the availability of computational tools capable of analysing the observability of nonlinear systems with unknown inputs has been limited until lately. Two symbolic algorithms based on differential geometry, ORC-DF and FISPO, have been recently proposed for this task, but their critical analysis and comparison is still lacking. Here we perform an analytical comparison of both algorithms and evaluate their performance on a set of problems, while discussing their strengths and limitations. Additionally, we use these analyses to provide insights about certain aspects of the relationship between inputs and observability. We found that, while ORC-DF and FISPO follow a similar approach, they differ in key aspects that can have a substantial influence on their applicability and computational cost. The FISPO algorithm is more generally applicable, since it can analyse any nonlinear ODE model. The ORC-DF algorithm analyses models that are affine in the inputs, and if those models have known inputs it is sometimes more efficient. Thus, the optimal choice of a method depends on the characteristics of the problem under consideration. To facilitate the use of both algorithms, we implemented the ORC-DF condition in a new version of STRIKE-GOLDD, a MATLAB toolbox for structural identifiability and observability analysis. Since this software tool already had an implementation of the FISPO algorithm, the new release allows modellers and model users the convenience of choosing between different algorithms in a single tool, without changing the coding of their model.


Introduction
Mathematical models of ordinary differential equations (ODEs) are used in all areas of science and technology for describing nonlinear systems. The ODEs define the derivatives of the state variables of the system with respect to time,ẋ(t); the measurable quantities y(t) are defined by the output function. The model equations (ODEs and output function) may contain unknown parameters, θ, and external inputs that may be known (u(t)) or unknown (w(t)). The structure of the model equations determines whether it is possible to estimate the model unknowns from the outputs. The theoretical possibility of inferring the states (respectively parameters) from the outputs is called observability (respectively structural identifiability) (Chatzis et al., 2015;Villaverde, 2019). Since a parameter can be considered as a state variable with time derivative equal to zero, structural identifiability can be considered as a particular case of observability. The possibility of recovering the unknown inputs is called invertibility, reconstructibility, or input observability. For simplicity, in this manuscript we use the word observability for all model unknowns, that is, to refer to the possibility of determining states, parameters, and/or inputs from the output.
The concept of observability arose in systems and control theory. It was initially defined for linear models and extended to the nonlinear case afterwards (Hermann and Krener, 1977). The concept of structural identifiability, on the other hand, was motivated by the analysis of biological models (Bellman and Åström, 1970), due to the specific challenges that parameter identification poses in mathematical biology and other biosciences. Hence, many observability analysis methods developed in that context aimed at analysing structural identifiability and were named accordingly, even though they could be applied or adapted to the more general task of analysing observability. Examples of software tools include DAISY (Bellu et al., 2007), COMBOS (Meshkat et al., 2009), EAR (Karlsson et al., 2012), STRIKE-GOLDD (Villaverde et al., 2016), GenSSI (Ligon et al., 2018), and SIAN (Hong et al., 2019).
The existence of external inputs affects the observability of a model and determines which methods can be applied for its analysis. A key distinction is between known and unknown inputs, where "known" is interpreted as "quantified"; thus, we are aware of the existence of an unknown input but not of its magnitude. A known input that can be manipulated is also called a control input, or simply a control. An unknown input can be considered as an unmeasured disturbance or as a time-varying parameter. Some techniques are applicable specifically to uncontrolled systems (Evans et al., 2002), while others allow for the existence of known inputs. Few methods are capable of handling both known and unknown inputs. Some exceptions (Martinelli, 2015(Martinelli, , 2019 are not applicable to systems in which the outputs are a direct function of the inputs, and do not analyse the observability of the unknown input itself. Two differential geometry algorithms called ORC-DF -Observability Rank Condition with Direct Feedthrough (Maes et al., 2019) -andFISPO -Full Input, State, andParameter Observability (Villaverde et al., 2019b) -have been recently presented. Both methods are capable of determining the observability of states, parameters, and inputs of nonlinear ODE models. ORC-DF is applicable to affine-in-the-inputs systems, while FISPO does not have this requirement. The FISPO algorithm is implemented in the STRIKE-GOLDD toolbox (Villaverde et al., 2016).
In the present paper we perform a critical examination of the ORC-DF and FISPO algorithms. First we provide the necessary background on observability analysis and differential geometry in Section 2. Then we perform a theoretical analysis of the two methods in Section 3, showing that they are equivalent for a certain class of problems and describing how they differ for other classes. Realizing the convenience of having both algorithms available in the same software environment, we provide their implementations in a new version of the MATLAB toolbox STRIKE-GOLDD, which is described in Section 4. The new release includes an implementation of ORC-DF, as well as a seamless integration with the already existing FISPO. Furthermore, it enables the automatic analysis of multiexperiment observability. Since ORC-DF and FISPO are symbolic algorithms that can be computationally expensive, in Section 5 we evaluate their performance by applying them to a number of modelling problems of different domains, from mechanical engineering to biology, and report their applicability and computational cost. The analysis of the selected case studies is also helpful for obtaining detailed insights about the inner working of the algorithms. Finally, we conclude with a discussion of the results in in Section 6.

Notation and model classes
We are interested in the observability of nonlinear systems of the following form: defined for all t ∈ I, I ⊂ [0, +∞) an arbitrary time interval, where f and h are nonlinear and analytical (infinitely differentiable) functions of the states x(t) ∈ R n x , known and unknown inputs, u(t) ∈ R n u and w(t) ∈ R n w respectively, and unmeasured parameters θ ∈ R n p . The output y(t) ∈ R m consists of measurement functions of model variables.
As a special case of (1-2) we also study systems affine in the inputs, which are of the following form: where f 0 , f u i , f w j , h 0 , h u i , h w j , for 1 ≤ i ≤ n u , 1 ≤ j ≤ n w , are analytical functions -possibly nonlinear -and: where, following Maes et al. (2019): In what follows, a vector v ∈ R n is assumed to be a one column matrix and v T its transpose. The Jacobian matrix of a function φ = (φ 1 , . . . , φ s ) with respect to a vector field v = (v 1 , . . . , v n ) , will be denoted as: 2.2. Background 2.2.1. Structural identifiability, observability, and differential geometry A nonlinear system Σ is structurally observable if it is possible to distinguish between its state trajectories from the data provided by its output, and structurally reconstructible (or invertible) if its disturbances can be tracked from the aforementioned measurements. Similarly, Σ is structurally identifiable if it is possible to infer the values of its unknown parameters from the output. In practice it is often not necessary distinguish between every pair of unmeasured states in the phase mapping of Σ -a property called structural global observability -and it is sufficient to distinguish neighbouring states -a property called local "weak" observability in some texts (Hermann and Krener, 1977). In this work we will not make this distinction, and local "weak" structural observability will be simply called observability. Likewise, we will refer to structural local identifiability and structural local invertibility simply as identifiability and invertibility.
Structural identifiability can be studied as particular case of observability. Since any unknown parameter θ i of Σ can be considered as a constant state, that is,θ i = 0 holds for 1 ≤ i ≤ n p , it is possible to augment the state vector as: which consists of nx = n x + n θ components and follows the augmented dynamics: Thus, the identifiability and observability of Σ can be studied as the observability of the augmented system with states (7), dynamics (8), and the same output as Σ.
The algorithms analysed in this work adopt a differential geometry approach, which uses the concept of Lie derivative to bring out algebraic conditions that establish observability. Let us consider first the case in which Σ is not dependent on unknown inputs, that is: Definition 1 (Lie derivative (Vidyasagar, 1993)). Consider the system Σ with augmented state vector (7) and augmented dynamics (8), and assume that the inputs u(t) are constant. The Lie derivative of the output function h along the tangent vector fieldf =f (·, u) is: and, setting L 0f h = h, the i−order Lie derivative can be recursively computed as: The above definition can be extended to the case of analytical inputs as follows: 3 Definition 2 (Extended Lie derivative (Karlsson et al., 2012)). Consider the system Σ with augmented state vector (7), augmented dynamics (8), and assume that the inputs u(t) are analytical functions. The extended Lie derivative of the output function h by the tangent vector fieldf =f (·, u) is: and, setting L e,0 f h = h, the i−order extended Lie derivative can be recursively computed as: Remark. Note that, in the case of constant inputs, the Lie derivative introduced in Definition (1) verifies . . .
by using repeatedly the chain rule. Likewise, the extended Lie derivative of Definition (2) verifies: Given a nonlinear system Σ with augmented state (7) and analytical inputs, it is possible to use the extended Lie derivatives of the output to build the following mnx × nx matrix: which is the observability-identifiability matrix of Σ . By calculating the rank of the above matrix, it is possible to establish the observability and identifiability of Σ using the following condition.
Theorem 1 (Observability-identifiability condition, OIC (Karlsson et al., 2012)). If the identifiability-observability matrix of a model Σ satisfies rank (O I (x 0 , u)) = nx, withx 0 being a (possibly generic) point in the augmented state space (8) of Σ , then the system is structurally locally observable and structurally locally identifiable.
Remark. The rank of O I is constant except for a zero-measurement subset in the augmented state space (8) of Σ where the rank is smaller, as a consequence of the system being analytical (Isidori, 1995). Thus, to verify the condition of the Theorem 1 it is sufficient to calculate the rank of O I at any non-singular point of the phase space.

FISPO
The effect of unknown inputs w can be taken into account by further augmenting Σ, including w as unmeasured states. Thus, for a non-negative integer l we have the l−augmented states vector: which follows the l−augmented dynamics: leading to the l−augmented system: An analogous extension for affine systems Σ A exists. Using the notation given in (5)-(6)-(7), the l−augmented system described above takes the form (Maes et al., 2019): where the l−augmented dynamics is decomposed as follows: We note that, in order to build l−augmented systems Σ l and Σ l A , it must be possible to calculate the l + 1−time derivative of disturbances w(t) and, therefore, they will be considered as analytical functions from now on. We also note that the l−augmented form of Σ and Σ A is equivalent to the original system, which consists of n l = n x + n θ + (l + 1) n w states, n u controls, n w disturbances (the l + 1−order time derivatives of w) and m outputs, that have not changed due to state augmentation (Martinelli, 2015).
As an additional hypothesis we assume that a non-negative integer s exists (possibly s = +∞) such that w s) (t) 0 and w i) (t) = 0 for all i > s. In principle, this assumption introduces a restriction on the type of allowed inputs, and it is equivalent to assuming that the disturbances are polynomial functions of time. Nevertheless, in practice, the method may still provide relevant information about the general case, as is discussed in (Villaverde et al., 2019b).
In what follows, if a vector function φ depends on variables x l we denote: and, if φ = φ (·, u) (where controls u(t) are considered to be analytical) then: Definition 3 (Full Input-State-Parameter Observability, FISPO (Villaverde et al., 2019b)). Consider the system Σ and the augmented states vector z(t) = (x(t), θ, w(t)) . We say that Σ has the FISPO property if, for every t 0 ∈ I and 1 ≤ i ≤ n 0 , z i (t 0 ) can be determined from the output y(t) and the known inputs u(t) = u 1 (t), . . . , u n u (t) in a finite time interval t 0 , t f ⊂ I. Thus, a system Σ is FISPO if, for every z(t 0 ) and for almost any vector z * (t 0 ), there is a neighbourhood N (z * (t 0 )) such that, for allẑ(t 0 ) ∈ N (z * (t 0 )) , the following condition holds: Remark. The original definition of the term FISPO reproduced above refers to a model property. Here we also use it to refer to the algorithm presented for its evaluation by Villaverde et al. (2019b).
Using the system augmentation (11) and taking the unique l = s such that w s) (t) 0 and w i) (t) = 0 for all i > s, it is possible to build the following matrix, which is the generalized observability matrix of Σ. Note that (14) coincides with the observability matrix (9) of Σ s without disturbances. Thus, the rank of O g I provides a condition for assessing the observability of Σ as follows: Theorem 2 (FISPO Condition (Villaverde et al., 2019b)). A nonlinear system Σ given by (1-2) with analytic inputs is FISPO if, for x s 0 being a (possibly generic) point in the state space of the s−augmented system Σ s , the generalized observability matrix (14) verifies rank O g I (x s 0 , u) = n s . Remark. For 1 ≤ i ≤ n s , the observability of the i−th state of x s can also be studied using the matrix (14). Thus, if O g,i I (x s 0 , u) denotes the matrix obtained from O g I (x s 0 , u) after removing its i−th column, state x i is observable if rank O g,i I (x s 0 , u) < rank O g I (x s 0 , u) for almost any x s 0 in the phase space of Σ s .

ORC-DF
The observability of affine systems Σ A with bounded controls u(t) can also be analysed by building a different observability matrix, as explained below. For a full description of the procedure, see (Maes et al., 2019).
Definition 4 (Observability Rank Criterion for systems with Direct Feedthrough, ORC-DF). A system Σ A is classified as k−row observable if almost any initial state x k (t 0 ), t 0 ∈ I, in the state space of the k−augmented system Σ k A can be separated locally from its neighbours based on the output at k + 1 consecutive times t 0 , t 1 , . . . , t k . If there exists k ≥ 1 such that Σ A is k−row observable, it is said that Σ A satisfies the ORC-DF.
Lemma 1. Consider the system Σ A and the vector field Ω k , which is recursively defined by Corollary 1. Let d k Ω i k denote the matrix that is obtained after removing the i−th column from d k Ω k . The i−th state of x k is k−row observable if and only if rank d k Ω i k x k 0 < rank d k Ω k x k 0 for almost any x k 0 in the phase space of Σ k .

Theory: analysis of the FISPO and ORC-DF algorithms
In this section we discuss the similarities and differences between FISPO and ORC-DF, whose pseudo-code is provided in Algorithms 1-2.

Preliminary remarks
We begin by recalling three facts that are relevant for the analysis: (i) the FISPO algorithm does not always require building the full matrix, (ii) both ORC-DF and FISPO can be inconclusive for certain models, (iii) ORC-DF and FISPO can handle different types of inputs.
Remark (The FISPO algorithm does not always require building the full matrix). In each iteration the FISPO algorithm builds the matrix O k I (x k , u), composed by extended Lie derivatives of output up to order k, and then calculates its rank and partial ranks, instead of directly building the full matrix (14). The algorithm is programmed in this way because the matrix O k I (x k , u) can reach full rank for some k ≤ n s − 1, and if the number of states increases indefinitely, (14) can never be built in practice. In addition, the above procedure may classify some states as observable before obtaining the full matrix (14), since any observable state in the k− augmented system Σ k remains observable in Σ l , for l ≥ k (Martinelli, 2015). Moreover, if the system does not have unknown inputs it is possible to classify it as unobservable or unidentifiable using fewer than nx − 1 Lie derivatives (Anguelova, 2004).
Result: Observable and unobservable states, parameters and disturbances.
Remark (Both ORC-DF and FISPO can be inconclusive for certain models). If the model under study has unknown inputs and their time derivatives w j) (t) do not vanish for any non-negative integer j < +∞, both FISPO and ORC-DF algorithms can be inconclusive. This happens when the rank of the observability matrices grows at each iteration without reaching a value equal to the number of states (which also increases with each iteration). Therefore, a computational implementation of both algorithms should include shutdown conditions based on computation time or number of iterations.
Remark (ORC-DF and FISPO can handle different types of inputs). Both ORC-DF and FISPO construct an observation space generated by Lie derivatives of the output; its dimension determines observability. FISPO builds an observation space spanned by extended Lie derivatives (2) considering analytical inputs, while ORC-DF assumes piecewise constant inputs and exploits certain properties specific to affine systems in order to build a different observation space. If an affine system is classified as observable by ORC-DF or FISPO, it is observable when a generic measurable input is considered (Anguelova, 2004;Maes et al., 2019).
In the next subsections we present the main novel insights of our theoretical analysis of the algorithms.

For systems without known inputs, ORC-DF and FISPO reduce to the same algorithm
Here we prove by induction that, if no inputs u are involved in Σ A , the FISPO algorithm reduces to ORC-DF. Before presenting the result, we remark that, in the case n u = 0, the extended Lie derivative reduces to: L e f (·) = L f (·) and, denoting the composition of functions with •, the k + 1−order Lie derivative verifies: since L j f k h depends only on time derivatives w i) (t) for 1 ≤ i ≤ j ≤ k + 1. Result 1. If the system Σ A is independent of any known input, then d k Ω k = O k I for all k ≥ 0. Proof. Setting n u = 0 in (5), the dynamics and output of Σ A are given by: Let k = 0. By the recursion given in Lemma (1), it is verified that: so the induction hypothesis holds for k = 0 : Consider now any non-negative integer k ≥ 0 and suppose that the induction hypothesis holds for 0 ≤ j ≤ k, then: and the result is proven if for every k ≥ 0 it holds that: The above equality is fulfilled for k ≥ 0. Indeed, for k = 0, using (16) we have: if k ≥ 0 and the condition (17) holds for 0 ≤ j ≤ k − 1, then: f k h where in the last equality we have applied (15). Thus, condition (17) holds for k ≥ 0.

For systems with known inputs, ORC-DF and FISPO lead to different observability matrices
Excluding the case n u = 0, an important difference between the observability matrices built by algorithms ORC-DF and FISPO is the number of Lie derivatives (rows) they include in each iteration. Indeed, for k ≥ 0, so the observability matrix constructed by FISPO grows in m rows in each iteration, while the matrix constructed by ORC-DF includes m (1 + n u ) k+1 new rows in the k−th stage. This fact can be an advantage for ORC-DF, as it makes it possible to reach full rank more rapidly, i.e. with lower order Lie derivatives. However, it may also be a disadvantage if this growth makes the problem dimension increase rapidly while adding little new information. Hence the faster growth may be beneficial or not depending on the form of the mathematical expressions of the dynamics and output functions in which the known inputs are present. For example, suppose that there exists an integer 1 ≤ i ≤ n u and n u − 1 real numbers λ j not simultaneously zero, such that: which, using (12), implies: Since, by definition, it holds that: the matrix built by ORC-DF algorithm in the k + 1−th iteration includes m (1 + n u ) k+1 dependent rows; the rows forming d k+1 L f k u i (∆Ω k ) can be written as a linear combination of the remaining rows. Indeed, by a property of Lie derivative (Isidori, 1995) it holds that: so, using linearity of the derivative, the following linear combination has been obtained: Likewise, if there exists 1 ≤ i ≤ n u such that h u i is linearly dependent on vector fields h u j for 1 ≤ j ≤ n u , j i, the observability matrix built by ORC-DF includes m (1 + n u ) k+1 dependent rows in the k + 1−th iteration, for k ≥ 0.
Note that the real values λ j can be replaced by functions of unknown parameters, λ j = λ j (θ) , as they are constant variables, so the equality (18) holds for this case as well.

The STRIKE-GOLDD software toolbox
STRIKE-GOLDD (STRuctural Identifiability taKen as Extended-Generalized Observability using Lie Derivatives and Decomposition) is an open source MATLAB toolbox that analyses the identifiability, observability, and invertibility of nonlinear systems of the form (1-2). It is available at https://sites.google.com/site/strikegolddtoolbox/ and https://github.com/afvillaverde/strike-goldd/. STRIKE-GOLDD versions up to v2.1.6 implemented the FISPO algorithm, including a number of additional features that go beyond the core instructions described in Algorithm 1, with the purpose of facilitating the analysis of large models. Furthermore, they also allowed to indicate a given number of non-zero time derivatives of inputs, both known and unknown.

Implementation of the ORC-DF algorithm
We have released a new version of STRIKE-GOLDD (v2.2) that includes an implementation of ORC-DF (Algorithm 2) along with the already existing implementation of FISPO (Algorithm 1). The algorithm is chosen with the newly introduced option opts.affine in the options.m file (set it to 1 for ORC-DF, and to 0 for FISPO). The ORC_DF.m function checks whether a model is indeed affine in the inputs and, if that is the case, converts it to the appropriate form Σ A (3-4), storing it in a mat-file to avoid repeating this calculation in the future. Thus, the user only needs to enter the model once, using the same format for ORC-DF and FISPO. New specific options for the ORC-DF algorithm include the possibility of setting a maximum number of iterations through the variable opts.kmax, limiting the computation time of each stage with opts.tStage, and using the MATLAB Parallel Toolbox.

Multiple experiments and piecewise constant inputs
FISPO analyses the observability of a model for a single experiment with an infinitely differentiable ("smooth") input. However, it is possible to use it to consider multiple experiments with possibly different inputs by applying it to a modified model: if we create as many replicates of the model states, inputs, and outputs as the number of experiments that we want to consider, we obtain a new model whose analysis for a single input has the same observability properties as the original model with multiple inputs (Villaverde et al., 2019a). Until now, this feature was only available in the GenSSI 2.0 toolbox (Ligon et al., 2018). We have included the possibility of carrying out this multi-experiment analysis automatically in the new version of STRIKE-GOLDD, by setting the option opts.multiexp=1. The number of experiments can be chosen with opts.numexp.

Computational results and discussion
We have applied the ORC-DF and FISPO algorithms to a set of illustrative case studies from different areas of science and technology, ranging from civil engineering to different biological disciplines. They are listed in Table 1, along with the computation times of the algorithms.

Model
Section Reference #θ #u #w  Table 2  Table 2 Table 1: Computation times of the two algorithms for the models analysed in this study. The computation times of case studies with unknown inputs depend on the highest order of the derivatives of the unknown inputs that are assumed to be non-zero, k. Three different cases are shown for those models: k = {0, 1, 5}. For models without unknown inputs this setting does not apply. Cases in which an algorithm cannot be applied are labeled as N/A. Results were obtained on a personal computer with 16 GB RAM and processor Intel(R) Core(TM) i7-8550U 1.80 GHz.

5.
1. An identifiable and observable model with known input: "C2M" Our first case study is a deceivingly simple compartmental model (Villaverde et al., 2019a), where each state x i (i = 1, 2) corresponds to a compartment, and θ = (k 1e , k 12 , k 21 , b) is the unknown parameter vector. The augmented state vector isx = (x 1 , x 2 , k 1e , k 12 , k 21 , b) , with extended dynamics given by: with the following vector fields for the affine-in-inputs formulation (5): In addition, the output is given by the function: Due to its reduced size, this model is well suited for illustrating the differences between the procedures followed by the ORC-DF and FISPO algorithms. For this purpose we derive the equations of the extended Lie derivatives calculated by each algorithm in Appendix A, where we also discuss the implications for the analyses.
This model is classified as observable and identifiable by ORC-DF after three iterations. The result yielded by FISPO depends on the number of input derivatives assumed to be zero: the unmeasured variables are classified as unobservable with a constant input, while they become observable in the fifth iteration if the input is any nonconstant analytical function. The variables classified as observable by both algorithms at each iteration are illustrated in Fig. 1.A-B. Fig. 1.C shows the ranks of the matrices built by both algorithms in each iteration. As can be seen, the observability matrix constructed by ORC-DF reaches full rank after considering Lie derivatives up to order three. The matrix built by FISPO stagnates from the fourth iteration onward with a constant input, while it reaches full rank after five iterations with a non-constant input.

A non-identifiable, non-observable model with known inputs: "Bolie"
Our second example is a model with similarities to the previous one, given by (Bolie, 1961): where x = (q 1 , q 2 ) is the states vector, θ = p 1 , p 2 , p 3 , p 4 , V p are the unknown parameters, and u(t) is a measured input. The output is a function of the state q 1 and the unknown parameter V p : so, in this case, there are no directly measured states or parameters. The augmented state vector isx = q 1 , q 2 , p 1 , p 2 , p 3 , p 4 , V p , and the extended dynamics: can be separated into the vector fields: The model is classified as non-identifiable and non-observable by FISPO and ORC-DC, as shown in Fig. 2. A detailed analysis of the calculations performed by both algorithms is provided in Appendix B. Order of Lie derivatives

A model with known and unknown inputs: "2DOF"
We consider now an affine-in-the-inputs model with a known and an unknown input, proposed by Maes et al. (2019). It describes the behaviour of a mechanical system consisting of two masses connected by a spring. In the form (1-2), its dynamics and output functions are given by: The state vector is x = (x 1 , x 2 , dx 1 , dx 2 ) and the unknown parameters are θ = (k 1 , δk 1 , m 2 ) . Two external forces act on the system as inputs, one of known magnitude, u(t) = F 1 (t), and another of unknown value, w(t) = F 2 (t). The remaining parameters k 2 , m 1 , c 1 and c 2 are known.
Since there is an unknown input acting on the model, it is necessary to include its time derivatives in the extended states vector. The 0−augmented state is x 0 = (x 1 , x 2 , dx 1 , dx 2 , k 1 , δ, k 1 , m 2 , w), which follows the dynamics: where the contribution of the known input is: First we consider the case in which the unknown disturbance w(t) is assumed constant,ẇ(t) = 0. The results are shown in Fig. 3. After calculating three Lie derivatives both algorithms conclude that the system is identifiable, observable and invertible. It should be noted that for this model FISPO always leads to the result shown in Fig. 3.A, regardless of the number of known input derivatives assumed to be non-zero. Next, we consider a time-varying unknown input, assuming that w k) = 0 for some k > 1. For this case, the model is again classified as fully observable by both algorithms. However, the paths that they follow to reach that conclusion are different. The number of Lie derivatives required by FISPO to classify the model as observable increases as k grows, due to the number of states in each stage also increasing without reaching full rank. In contrast, ORC-DF ends at most in four iterations, regardless of the value of k ≥ 1. This situation is illustrated in Fig. 4, which shows the number of derivatives required by each algorithm to achieve a result has been represented for 0 ≤ k ≤ 10. A difference between the procedures carried out by both algorithms for this model is that -similarly to the case of parameter b in the C2M example, mentioned in Appendix A -the expressions obtained by ORC-DF determine that the unknown parameter m 2 can be calculated directly from the measurements since the first iteration as: In the case of FISPO, in contrast, the parameter m 2 is the last to be classified as identifiable, which happens at the same time in which the entry w(t) is classified as invertible for a sufficiently large k (k ≥ 5).

A model with a known or unknown input: "HIV"
Next we consider a model of HIV dynamics in the human body given by (Miao et al., 2011): where the states are x = (T U , T I , V) , the unknown parameters vector is θ = (λ, ρ, δ, N, c) , and η(t) is a time-varying input, the infection rate.
As was established in Section 3.2, if η(t) is unknown, ORC-DF and FISPO become the same algorithm (leaving aside implementation details). If η(t) is known and time-varying, they differ.
This model was analysed with FISPO by Villaverde et al. (2019b) considering two possibilities, i.e. η(t) known and unknown. In both cases the model is classified as observable and identifiable by FISPO. In the latter case, the number of Lie derivatives necessary to achieve this conclusion grows with the number of derivatives of η(t) assumed to be non-zero, as happened with the 2DOF model analysed in Section 5.3.
It is possible to analyse the HIV model with the ORC-DF algorithm, since it is affine in inputs. With the infection rate considered known, i.e. u(t) = η(t), the functions of the affine formulation (12-13) are written as: we have: If the infection rate is considered known, both algorithms classify the model as observable and identifiable, regardless of the number of input derivatives assumed non-zero by FISPO. Fig. 5 illustrates this fact.
The observability matrix calculated by ORC-DF has full rank after including Lie derivatives up to second order, so the number of its rows is 2 i=0 m (1 + n u ) i+1 = 2 i=0 2 i+2 = 26 (actually, 14 rows after excluding dependent rows arising from the equality h u = 0) while the matrix constructed by FISPO needs to include Lie derivatives up to order three to achieve full rank, so it has m(k + 1) = 8 rows. This is an example of a model for both algorithms perform similarly; although FISPO needs to calculate one more Lie derivative to classify the system as observable, ORC-DF calculates ranks of matrices of greater dimension, resulting in similar computational cost of the calculations involved in each algorithm. As can be seen in Fig.5.C, the ranks of both observability matrices coincide up to the first iteration, as a consequence of:

A genetic toggle switch with two inputs: "TS"
Let us now consider the following model of a genetic toggle switch (Lugagne et al., 2017): x 2 ) is the state vector and the inputs are aT c(t) and IPTG(t). The remaining variables are unknown parameters.
This model is an example that cannot be analysed by ORC-DF algorithm, since it is not affine in inputs. It was analysed with FISPO in (Villaverde et al., 2019b), considering both measured and unmeasured inputs. If both inputs are known, FISPO classifies the model as structurally identifiable, as long as neither input is constant. If the inputs are unknown FISPO concludes that some parameters become unidentifiable. For more details we refer the reader to (Villaverde et al., 2019b).

A signaling pathway with five known inputs: "JAK-STAT"
To show the computational limitations of the two algorithms, we analyse here a model that pushes them to their limits. It is a classic model of the JAK-STAT signaling pathway presented by Bachmann et al. (2011), which has 25 states, 26 unknown parameters and 5 inputs. The output consists on 15 measured functions of the model variables that depend only on one of the external signals u i , which is not involved in system dynamics, that is, The model equations are provided in Appendix C. This model was analysed with FISPO in (Villaverde and Banga, 2019), concluding that all its parameters are structurally identifiable but two of its 25 states are non-observable. The calculations are computationally expensive, requiring the use of procedures supported in STRIKE-GOLDD -such as model decomposition or successive executions after removing parameters previously classified as identifiable -in order to reach the conclusion. Thus, the model was first analysed after setting the maximum computation time of each Lie derivative to 100 seconds, which allowed FISPO to calculate 5 Lie derivatives and to classify 17 parameters and 4 states as observable. Next, the 17 parameters were specified as previously classified in the FISPO options, thus removing them from further consideration and decreasing the size of the problem, and the model was decomposed. The post-decomposition analysis classified 5 additional parameters as identifiable. After removing them, it was possible to analyse the remainder of the model and reach the aforementioned conclusion.
With ORC-DF we did not manage to analyse the model due to computational limitations (specifically, insufficient memory). The different computational requirements of ORC-DF and FISPO are shown in Table (2).   Table (2) shows that the number of rows of the matrix built by ORC-DF grows rapidly at each iteration (even though the implementation removes null rows arising from dependencies in (19)(20), which is why the number of rows of the ORC-DF matrix does not match the number given in Section 3.3). Although this matrix leads to higher ranks than the one built by FISPO, especially at the beginning of the execution (i.e. with few Lie derivatives), the difference decreases soon and the rank of the two matrices is similar despite the big difference in the number of rows. With 5 Lie derivatives ORC-DF labels 27 model variables as observable (9 states and 18 parameters), including those classified as observable by FISPO (21: 4 states and 17 parameters). However, the computation time of ORC-DF at that point is roughly ten times higher than FISPO, and memory requirements impede further progress with this algorithm.

Conclusion
In this paper we have analysed two recent algorithms for observability analysis of nonlinear systems with known and/or unknown inputs, which we refer to as ORC-DF and FISPO. Our analyses have revealed the key similarities and differences between them. The main conclusions can be summarized as follows.
First, we have proven theoretically that for models without known inputs both algorithms are basically equivalent, since they calculate the rank of the same observability matrix. In contrast, for models with known inputs -e.g. for controlled systems -the two algorithms differ, since they build different observability matrices. Specifically, the number of rows of the matrix built by ORC-DF increases more at each iteration than the one built by FISPO. We have shown that this increased growth is often an advantage of ORC-DF, since it makes it possible to reach full rank -and, thus, to conclude that a model is observable -with less Lie derivatives, and hence less computational cost; an example was shown in Section 5.1. However, said increased growth is not always advantageous: as we have noted in Section 3.3, it can also be detrimental to the efficiency of ORC-DF. The latter situation may happen when the structure of the model equations is such that the increase in problem dimension outweighs the increase in information resulting from the inclusion of a new Lie derivative; we provided an example in Section 5.6.
When applying FISPO to a model with unknown input(s), it is generally necessary to assume that the derivatives of the unknown input, w k) , are zero for orders higher than a finite k. This is not a theoretical requirement -and in fact, a counter-example that did not require this assumption was shown in Villaverde et al. (2019b) -but it is often necessary in practice in order to reach a conclusion in finite time. This was indeed the case for the models with unknown inputs that we analysed in this paper.
Another difference between both algorithms lies in the types of models and known inputs that they can analyse. In regard to model types, FISPO is applicable to a general class of nonlinear ODE models, while ORC-DF is applicable to a subclass of those models: the ones that are affine in the inputs. There is an additional, albeit subtle, difference between both algorithms in regard to the (known) inputs: FISPO considers infinitely differentiable ("smooth") functions, while ORC-DF considers piecewise constant inputs. It should be noted however that an affine system that is observable for piecewise constant inputs is also observable for smooth inputs; therefore, ORC-DF can also establish the observability of (affine) models with continuous inputs. Finally, FISPO can analyse observability from multiple experiments by applying a model transformation as described in Section 4. We have implemented the possibility of carrying out this transformation automatically in a new version of the STRIKE-GOLDD toolbox (v2.2), thus enabling the FISPO algorithm to consider multiple experiments without requiring any manual transformation from the user. In STRIKE-GOLDD 2.2 we have also included an implementation of the ORC-DF algorithm, thus allowing the user to apply different algorithms with the same tool and model definition. It should be noted that the implementations of the FISPO and ORC-DF algorithms included in the STRIKE-GOLDD toolbox have a number of additional features that increase the efficiency of the core algorithms analysed here, as noted in Section 4.
We used the new implementations in STRIKE-GOLDD 2.2 to benchmark the algorithms with several models taken from the literature. Our selection of case studies included both simple models, included to illustrate the inner workings of the algorithms in detail, and more complex models whose analysis is computationally challenging, which we used for pushing the algorithms to their limits. We also provided an example of a model that cannot be analysed with ORC-DF due to being not affine in the inputs.
In conclusion, the theoretical and computational analyses presented here have informed about the differences between the ORC-DF and FISPO algorithms, showing that they represent complementary techniques for solving an often challenging problem, and clarifying when one may be preferred over the other. The release of a new version of the MATLAB toolbox STRIKE-GOLDD that includes implementations of both algorithms provides the convenience of performing different analyses with minimal intervention from the user.

Data and materials availability
The methods and models used in this paper are available in the GitHub repository as part of release v2.2 of the STRIKE-GOLDD toolbox: https://github.com/afvillaverde/strike-goldd. Let us first consider the FISPO algorithm and the model with non-constant input. As shown in Fig. 1.C, in this case there are six independent extended Lie derivatives of the output:
In the case of constant input, equations (B.1-B.6) become redundant, so there are only five independent Lie derivatives, as it is shown in Fig. 2. The combinations p 1 + p 3 , p 1 p 3 + p 2 p 4 are the only observable functions of the variables that can be extracted from (B.1-B.5). Since the rational combinations of these functions are insufficient to determine any of the parameters or states, all variables are non-observable, as shown in Fig. 2
The model has seven known constants (k 1 -k 7 ), 5 of which correspond to experimental conditions that can be considered as constant inputs (k 1 -k 5 ), including the external signal (k 5 ≡ Epo).