# Building fault detection and isolation related objects

Fault detection and isolation synthesis model.`FDIModel`

Fault detection filter object.`FDFilter`

Fault detection and isolation filter object.`FDIFilter`

Fault detection filter internal form object.`FDFilterIF`

Fault detection and isolation filter internal form object.`FDIFilterIF`

Setup of synthesis models for solving fault detection and isolation problems.`fdimodset`

Evaluation of the internal forms of fault detection and isolation filters.`fdIFeval`

`FaultDetectionTools.FDIModel`

— Type`FDIModel <: AbstractFDDObject`

Type for synthesis models employed to solve fault detection and isolation problems.

If `sysf::FDIModel`

is the synthesis model object, the underlying descriptor system model can be obtained via `sysf.sys`

and the dimensions of the control, disturbance, fault, noise and auxiliary vectors are contained in the integers `sysf.mu`

, `sysf.md`

, `sysf.mf`

, `sysf.mw`

and `sysf.ma`

, respectively. The ranges of indices of control, disturbance, fault, noise and auxiliary inputs can be accessed as `sysf.controls`

, `sysf.disturbances`

, `sysf.faults`

, `sysf.noise`

and `sysf.aux`

, respectively.

`FaultDetectionTools.fdimodset`

— Function`fdimodset(sys; controls, c, disturbances, d, faults, f, fa, faults_sen, fs, noise, n, aux) -> sysf::FDIModel`

Build for a given linear time-invariant system model `sys = (A-λE,B,C,D)`

, a synthesis model object `sysf::FDIModel`

to be used in conjunction with the analysis and synthesis functions of FDI filters. If `sys`

is a vector of system models, then `sysf`

results as a vector of synthesis model objects.

The information on the partition of the input components in control, disturbance, fault, noise and auxiliary inputs can be specified using the following keyword arguments:

`controls = inpu`

or `c = inpu`

specifies the indices `inpu`

of the control inputs (default: void)

`disturbances = inpd`

or `d = inpd`

specifies the indices `inpd`

of the disturbance inputs (default: void)

`faults = inpf`

or `f = inpf`

specifies the indices `inpf`

of the fault inputs (default: void)

`fa = inpfa`

specifies the indices `inpfa`

of control inputs subject to actuator fault (default: void)

`faults_sen = inpfs`

or `fs = inpfs`

specifies the indices `inpfs`

of the system outputs subject to sensor fault inputs (default: void)

`noise = inpn`

or `noise = inpn`

specifies the indices `inpn`

of the noise inputs (default: void)

`aux = inpa`

specifies the indices `inpa`

of the auxiliary inputs (default: void)

The indices of inputs or outputs can be specified as integer vectors, integer scalars or integer `UnitRange`

s.

The resulting `sysf`

contains the partitioned system `sysf.sys = (A-λE,[Bu Bd Bf Bw Bv],C,[Du Dd Df Dw Dv])`

, where `Bu`

, `Bd`

, `Bf`

, `Bw`

and `Bv`

are the input matrices from the control inputs `u`

, disturbance inputs `d`

, fault inputs `f`

, noise inputs `w`

and auxiliary inputs `v`

, respectively, and `Du`

, `Dd`

, `Df`

, `Dw`

and `Dv`

are the feedthrough matrices from those inputs. The dimensions of control, disturbance, fault, noise and auxiliary input vectors are contained in `sysm.mu`

, `sysm.md`

, `sysm.mf`

, `sysm.mw`

and `sysm.ma`

, respectively.

*Method:* If `G(λ)`

is the `p x m`

transfer function matrix of `sys`

, then the resulting system `sysf`

has an equivalent input output form `[Gu(λ) Gd(λ) Gf(λ) Gw(λ) Gv(λ)]`

, where the following relations define the component matrices: `Gu(λ) = G(λ)*Su`

, `Gd(λ) = G(λ)*Sd`

, `Gf(λ) = [G(λ)*Sf Ss]`

, `Gw(λ) = G(λ)*Sw`

, `Gv(λ) = G(λ)*Sv`

, with the selection matrices `Su`

, `Sd`

, `Sf`

, `Sw`

and `Sv`

formed from the columns of the `m`

-th order identity matrix and `Ss`

is formed from the columns of the `p`

-th order identity matrix.

`FaultDetectionTools.FDFilter`

— Type`FDFilter <: AbstractFDDObject`

Type for fault detection filters resulted as solutions of fault detection problems.

If `filter::FDFilter`

is the fault detection filter object, the underlying descriptor system model can be obtained via `filter.sys`

and the dimensions of the partitioned filter input vectors as `measured outputs`

and `control inputs`

, can be accessed as the integers contained in `filter.ny`

and `filter.mu`

, respectively. The ranges of the indices of output and control inputs can be accessed as `filter.outputs`

and `filter.controls`

, respectively.

`FaultDetectionTools.FDFilter`

— Method`FDFilter(sys, ny, mu) -> Q::FDFilter`

Build for a given linear time-invariant descriptor system model `sys = (A-λE,B,C,D)`

, a fault detection filter object `Q`

, as determined with the synthesis functions of FDI filters. `ny`

and `mu`

are the number of measured outputs and the number of control inputs, respectively. It is assumed that `B = [By Bu Bv]`

and `D = [Dy Du Dv]`

are partitioned matrices such that `By`

and `Dy`

have `ny`

columns, and `Bu`

and `Du`

have `mu`

columns, where `By`

and `Bu`

are the input matrices from the measured outputs `y`

and control inputs `u`

, `Dy`

and `Du`

are the feedthrough matrices from the measured outputs `y`

and control inputs `u`

.

The resulting `Q`

contains the partitioned system `Q.sys = (A-λE,[By Bd],C,[Dy Du])`

and the dimensions of the partitioned filter input vectors as `measured outputs`

and `control inputs`

, can be accessed as the integers contained in `Q.ny`

and `Q.mu`

, respectively.

`FaultDetectionTools.FDFilterIF`

— Type`FDFilterIF <: AbstractFDDObject`

Type for the internal form of fault detection filters resulted as solutions of fault detection problems.

If `filter::FDFilterIF`

is the fault detection filter internal form object, the underlying descriptor system model can be obtained via `filter.sys`

and the dimensions of the control, disturbance, fault, noise and auxiliary vectors are contained in the integers `filter.mu`

, `filter.md`

, `filter.mf`

, `filter.mw`

and `filter.ma`

, respectively. The ranges of indices of control, disturbance, fault, noise and auxiliary inputs can be accessed as `filter.controls`

, `filter.disturbances`

, `filter.faults`

, `filter.noise`

and `filter.aux`

, respectively.

`FaultDetectionTools.FDFilterIF`

— Method`FDFilterIF(sys; mu = 0, md = 0, mf = 0, mw = 0, ma = 0, moff = 0) -> R::FDFilterIF`

Build for a given linear time-invariant descriptor system model `sys = (A-λE,B,C,D)`

, a fault detection filter internal form object `R`

, as determined with the synthesis functions of FDI filters. `mu`

, `md`

, `mf`

, `mw`

and `maux`

are the dimensions of control, disturbance, fault, noise and auxiliary input vectors, respectively. It is assumed that `B = [Boff Bu Bd Bf Bw Bv]`

and `D = [Doff Du Dd Df Dw Dv]`

are partitioned matrices such that `Boff`

and `Doff`

have `moff`

columns, `Bu`

and `Du`

have `mu`

columns, `Bd`

and `Dd`

have `md`

columns, `Bf`

and `Df`

have `mf`

columns, `Bw`

and `Dw`

have `mw`

columns, and `Bv`

and `Dv`

have `maux`

columns.

The resulting `R`

contains the partitioned system `R.sys = (A-λE,[Bu Bd Bf Bw Bv],C,[Du Dd Df Dw Dv])`

and the dimensions of control, disturbance, fault, noise and auxiliary input vectors are contained in `R.mu`

, `R.md`

, `R.mf`

, `R.mw`

and `R.ma`

, respectively.

`FaultDetectionTools.FDIFilter`

— Type`FDIFilter <: AbstractFDDObject`

Type for fault detection and isolation filters resulted as solutions of fault detection and isolation problems.

If `filter::FDIFilter`

is the fault detection and isolation filter object, the underlying `i`

-th descriptor system model can be obtained via `filter.sys[i]`

and the dimensions of the partitioned filter input vectors as `measured outputs`

and `control inputs`

, can be accessed as the integers contained in `filter.ny`

and `filter.mu`

, respectively. The ranges of the indices of output and control inputs can be accessed as `filter.outputs`

and `filter.controls`

, respectively.

`FaultDetectionTools.FDIFilter`

— Method`FDIFilter(sys, ny, mu) -> Q::FDIFilter`

Build for a vector of linear time-invariant descriptor system models `sys[i] = (Ai-λEi,Bi,Ci,Di)`

with the same number of inputs, a fault detection and isolation filter object `Q`

, as determined with the synthesis functions of FDI filters. `ny`

and `mu`

are the number of measured outputs and the number of control inputs, respectively. It is assumed that each `Bi = [Byi Bui Bvi]`

and `Di = [Dyi Dui Dvi]`

are partitioned matrices such that `Byi`

and `Dyi`

have `ny`

columns, and `Bui`

and `Dui`

have `mu`

columns, where `Byi`

and `Bui`

are the input matrices from the measured outputs `y`

and control inputs `u`

, `Dyi`

and `Dui`

are the feedthrough matrices from the measured outputs `y`

and control inputs `u`

.

The resulting `Q`

contains the vector of partitioned systems `Q.sys[i] = (Ai-λEi,[Byi Bdi],Ci,[Dyi Dui])`

and the dimensions of the partitioned filter input vectors as `measured outputs`

and `control inputs`

, can be accessed as the integers contained in `Q.ny`

and `Q.mu`

, respectively.

`FaultDetectionTools.FDIFilterIF`

— Type`FDIFilterIF <: AbstractFDDObject`

Type for the internal form of fault detection and isolation filters resulted as solutions of fault detection and isolation problems.

If `filter::FDIFilterIF`

is the fault detection and isolation filter internal form object, the underlying `i`

-th descriptor system model can be obtained via `filter.sys[i]`

and the dimensions of the control, disturbance, fault, noise and auxiliary vectors are contained in the integers `filter.mu`

, `filter.md`

, `filter.mf`

, `filter.mw`

and `filter.ma`

, respectively. The ranges of indices of control, disturbance, fault, noise and auxiliary inputs can be accessed as `filter.controls`

, `filter.disturbances`

, `filter.faults`

, `filter.noise`

and `filter.aux`

, respectively. .

`FaultDetectionTools.FDIFilterIF`

— Method`FDIFilterIF(sys; mu = 0, md = 0, mf = 0, mw = 0, ma = 0, moff = 0 ) -> R::FDIFilterIF`

Build for a vector of linear time-invariant descriptor system models `sys[i] = (Ai-λEi,Bi,Ci,Di)`

, a fault detection and isolation filter internal form object `R`

, as determined with the synthesis functions of FDI filters. `mu`

, `md`

, `mf`

, `mw`

and `ma`

are the dimensions of control, disturbance, fault, noise and auxiliary input vectors, respectively. It is assumed that each `Bi = [Boffi Bui Bdi Bfi Bwi Bvi]`

and `Di = [Doffi Dui Ddi Dfi Dwi Dvi]`

are partitioned matrices such that `Boffi`

and `Doffi`

have `moff`

columns, `Bui`

and `Dui`

have `mu`

columns, `Bdi`

and `Ddi`

have `md`

columns, `Bfi`

and `Dfi`

have `mf`

columns, `Bwi`

and `Dwi`

have `mw`

columns, and `Bvi`

and `Dvi`

have `ma`

columns.

The resulting `R`

contains the vector of partitioned systems `R.sys[i] = (A-λE,[Bui Bdi Bfi Bwi Bvi],C,[Dui Ddi Dfi Dwi Dvi])`

and the dimensions of control, disturbance, fault, noise and auxiliary input vectors are contained in `R.mu`

, `R.md`

, `R.mf`

, `R.mw`

and `R.ma`

, respectively.

`FaultDetectionTools.fdIFeval`

— Function`fdIFeval(sysQ::FDFilter, sysf::FDIModel; minimal = false, atol, atol1 = atol, atol2 = atol, rtol, fast = true) -> sysR::FDFilterIF`

Compute the internal form `sysR`

of the fault detection filter `sysQ`

applied to the synthesis model `sysf`

. If `sysf`

has the partitioned transfer function matrix `G(λ) = [ Gu(λ) Gd(λ) Gf(λ) Gw(λ) Gv(λ) ]`

in accordance with the partitioned system inputs as `controls`

, `disturbances`

, `faults`

, `noise`

and `auxiliary`

inputs, respectively, and `Q(λ) = [ Qy(λ) Qu(λ) ]`

is the partitioned transfer function matrix of the fault detection filter `sysQ`

in accordance with the partitioned filter inputs as `measurable outputs`

and `control inputs`

, then the transfer function matrix `R(λ)`

of the resulting internal form `sysR`

is given by

```
R(λ) = | Qy(λ) Qu(λ) | * | Gu(λ) Gd(λ) Gf(λ) Gw(λ) Gv(λ) |
| I 0 0 0 0 |
```

A minimal descriptor realization is computed if `minimal = true`

and a possibly non-minimal realization is determined if `minimal = false`

(default).

The minimal realization computation relies on pencil manipulation algorithms which employ rank determinations based on either the use of rank revealing QR-decomposition with column pivoting, if `fast = true`

, or the SVD-decomposition. The rank decision based on the SVD-decomposition is generally more reliable, but the involved computational effort is higher.

If `(Ar-λEr,Br,Cr,Dr)`

is the full order descriptor realization of `sysR.sys`

, then the keyword arguments `atol1`

, `atol2`

, and `rtol`

, specify, respectively, the absolute tolerance for the nonzero elements of matrices `Ar`

, `Br`

, `Cr`

, `Dr`

, the absolute tolerance for the nonzero elements of `Er`

, and the relative tolerance for the nonzero elements of `Ar`

, `Br`

, `Cr`

, `Dr`

and `Er`

. The default relative tolerance is `nϵ`

, where `ϵ`

is the working *machine epsilon* and `n`

is the order of the system `sysR`

. The keyword argument `atol`

can be used to simultaneously set `atol1 = atol`

and `atol2 = atol`

.

`fdIFeval(sysQ::FDIFilter, sysf::FDIModel; minimal = false, atol, atol1 = atol, atol2 = atol, rtol, fast = true) -> sysR::FDIFilterIF`

Compute the internal form `sysR`

of the fault detection and isolation filter `sysQ`

applied to the synthesis model `sysf`

. If `sysf`

has the partitioned transfer function matrix `G(λ) = [ Gu(λ) Gd(λ) Gf(λ) Gw(λ) Gv(λ) ]`

in accordance with the partitioned system inputs as `controls`

, `disturbances`

, `faults`

, `noise`

and `auxiliary`

inputs, respectively, and `Qi(λ) = [ Qyi(λ) Qui(λ) ]`

is the partitioned transfer function matrix of the `i`

-th filter `sysQ.sys[i]`

in accordance with the partitioned filter inputs as `measurable outputs`

and `control inputs`

, then the transfer function matrix `Ri(λ)`

of the `i`

-th filter in the resulting internal form `sysR.sys[i]`

is given by

```
Ri(λ) = | Qyi(λ) Qui(λ) | * | Gu(λ) Gd(λ) Gf(λ) Gw(λ) Gv(λ) |
| I 0 0 0 0 |
```

Minimal descriptor realizations are computed if `minimal = true`

and a possibly non-minimal realization is determined if `minimal = false`

(default).

The minimal realization computation relies on pencil manipulation algorithms which employ rank determinations based on either the use of rank revealing QR-decomposition with column pivoting, if `fast = true`

, or the SVD-decomposition. The rank decision based on the SVD-decomposition is generally more reliable, but the involved computational effort is higher.

If `(Ari-λEri,Bri,Cri,Dri)`

is the full order descriptor realization of `sysR.sys[i]`

, then the keyword arguments `atol1`

, `atol2`

, and `rtol`

, specify, respectively, the absolute tolerance for the nonzero elements of matrices `Ari`

, `Bri`

, `Cri`

, `Dri`

, the absolute tolerance for the nonzero elements of `Eri`

, and the relative tolerance for the nonzero elements of `Ari`

, `Bri`

, `Cri`

, `Dri`

and `Eir`

. The default relative tolerance is `ni*ϵ`

, where `ϵ`

is the working *machine epsilon* and `ni`

is the order of the system `sysR.sys[i]`

. The keyword argument `atol`

can be used to simultaneously set `atol1 = atol`

and `atol2 = atol`

.