ControlSystemIdentification
System identification for ControlSystems.jl.
System identification is the process of estimating a dynamical model from data. This packages estimates primarily linear time-invariant (LTI) models, in the form of statespace systems
\[\begin{aligned} x^+ &= Ax + Bu + Ke\\ y &= Cx + Du + e \end{aligned}\]
or in the form of transfer functions
\[Y(z) = \dfrac{B(z)}{A(z)}U(z)\]
We also have capabilities for estimation of nonlinear Hammerstein-Wiener models and linear/nonlinear gray-box identification of models in continuous or discrete time, i.e., models on the form
\[\begin{aligned} x^+ &= f_d(x, u, p, t) + w \quad \text{Discrete time}\\ \dot x &= f_c(x, u, p, t) + w \quad \text{Continuous time}\\ y &= h(x, u, p, t) + e \end{aligned}\]
where $p$ are the parameters of the nonlinear system.
This package is implemented in the free and open-source programming language Julia.
If you are new to this package, start your journey through the documentation by learning about Identification data. Examples are provided in the Examples section and in the form of jupyter notebooks here. An introductory video series using this package is available below
See also the YouTube playlist with the entire video series.
Installation
Install Julia from the download page. Then, in the Julia REPL, type
using Pkg
Pkg.add("ControlSystemIdentification")
Optional: To work with linear systems and plot Bode plots etc., also install the control toolbox ControlSystems.jl package which this package builds upon, as well as the plotting package
Pkg.add(["ControlSystemIdentification", "ControlSystemsBase", "Plots"])
Algorithm overview
The following table indicates which estimation algorithms are applicable in different scenarios. A green circle (🟢) indicates that a particular method is well suited for the situation, an orange diamond (🔶) indicates that a match is possible, but somehow not ideal, while a red square (🟥) indicates that a method in its standard form is ill suited for the situation. The table is not exhaustive, and is intended to give a rough overview of the applicability of different algorithms.
Estimation method | SIMO | MISO | Disturbance models | Nonlinearities | Custom loss | Time domain | Frequency domain | Multiple dataset |
---|---|---|---|---|---|---|---|---|
|
🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟥 | 🟥 |
|
🟢 | 🟢 | 🟢 | 🟥 | 🟢 | 🟢 | 🟢 | 🟥 |
|
🟢 | 🟢 | 🔶 | 🟥 | 🟢 | 🟢 | 🟥 | 🟥 |
|
🟢 | 🟢 | 🔶 | 🟢 | 🟥 | 🟢 | 🟥 | 🟥 |
|
🟥 | 🟢 | 🟥 | 🔶 | 🟢 | 🟢 | 🟥 | 🟢 |
|
🟥 | 🟢 | 🟢 | 🟥 | 🟢 | 🟢 | 🟥 | 🟥 |
|
🟥 | 🟢 | 🟢 | 🟥 | 🟢 | 🟢 | 🟥 | 🔶 |
|
🟢 | 🟢 | 🟥 | 🟥 | 🟥 | 🟢 | 🟥 | 🟢 |
|
🟥 | 🟢 | 🟥 | 🟥 | 🟢 | 🟢 | 🟥 | 🟥 |
|
🟥 | 🟥 | 🟢 | 🟥 | 🟢 | 🟢 | 🟢 | 🟥 |
Comments
- All methods can estimate SISO systems, i.e., systems with a single input and a single output.
- Missing from the comparison is whether an algorithm estimates a transfer function or a statespace system, this is because one can without loss convert one to the other by simply calling
tf/ss
. One notable exception is for non-causal transfer functions which cannot be represented as statespace systems, but those do not appear very often. - Several methods are listed as 🟥 on nonlinearities, but it is oftentimes possible to handle known input nonlinearities by adding nonlinearly transformed versions of the input to the dataset. Known output nonlinearities that are invertible can be handled by similarly applying the inverse nonlinearity to the data before estimation. Only
newpem
has explicit methods for estimating parameters of nonlinearities.arx
is listed as 🔶, since with the correctestimator
option that promotes sparsity, it is possible to find the most appropriate nonlinearity among a set of candidates. However, no explicit support for this is provided. - Custom loss functions are sometimes supported explicitly, such as for
newpem
, but often supported by providing a customestimator
for methods that solve a problem on the form $\operatorname{argmin}_w \sum_i \operatorname{loss}(e_i) \quad \forall e_i \in \{e = y - Aw\}$. The default estimator in these cases is always\
, i.e., to solve a least-squares problem. Useful alternatives are, e.g.,TotalLeastSquares.tls
andTotalLeastSquares.irls
. This can be useful to increase robustness w.r.t. noise etc. - In specific situations it is possible to use any method with multiple datasets by simply concatenating two datasets like
[d1 d2]
. This is only recommended if the state of the system in the end of the first dataset is very close to the state of the system in the beginning of the second dataset, for example, if all experiments start and end at rest in the origin. - Some methods estimate explicit disturbance models, such as
plr
andarxar
, whereas other methods estimate observers with an implicit disturbance model, such asnewpem
andsubspaceid
. All methods that estimate disturbance models are able to account for input disturbance (also referred to as dynamic disturbance or load disturbance).structured_pem
andControlSystemIdentification.nonlinear_pem
are listed as 🔶 since they allow for the estimation of a disturbance model, but the user has to encode the model in the dynamics manually.
Other resources
- YouTube playlist with tutorials using this package.
- For estimation of linear time-varying models (LTV), see LTVModels.jl.
- For more advanced spectral estimation, cross coherence, etc., see LPVSpectral.jl
- This package interacts well with MonteCarloMeasurements.jl. See example file.
- State estimation is facilitated by LowLevelParticleFilters.jl.