# Structural Methodologies for Distributed Fault Detection and Isolation
## 4 Equation-Based Distributed Fault Detection and Isolation
### Maximum Detectability  
**Example 7**. : _Consider subsystem \(S_{1}\) in the four-tank example whose equations are listed in (1). The DM decomposition of this subsystem is shown in Figure 2. \(f_{2}\) is in the just determined part of the subsystem; therefore, the fault is not locally detectable. However, \(p_{2}\) is a shared variable with Subsystem 2. Therefore, an equation from subsystem \({}_{2}\) can be selected, \(e_{10}\), to make \(f_{2}\) locally detectable in the augmented subsystem, \(S_{1e10}\) (see Figure 3). Adding measurement equation \(e_{10}\) makes \(p_{2}\) known and, therefore, makes the subsystem over-determined._  
Note that a variable that only appears in one subsystem (for example \(\dot{p}_{1}\) in \(S_{1}\)) cannot become known by adding equations from other subsystems. Therefore, our ability to increase fault diagnosability is limited to the shared variables in the subsystem. More formally, we can prove the following theorem. **Theorem 1**. : _Consider local subsystem model \(S_{i}=\{V_{i}\), \(M_{i}\), \(E_{i}\), \(F_{i}\}\) and \(V_{ishared}\subset V_{i}\) the set of shared variables in the subsystem. If a fault \(f\in F_{i}\) is not locally detectable in a new subsystem \(S_{j}=\{V_{i}-V_{ishared}\), \(M_{i}\cup V_{ishared}\), \(E_{i}\), \(F_{i}\}\) where all the shared variables are known, \(f\) is not globally detectable._  
Proof. : If \(e_{f}\) remains in the just determined part or under determined part of the subsystem when all the shared variables have became known, there is no additional equation in the system that can make any of the variables in \(e_{f}\) known. Therefore, the equation cannot be moved to the over-determined part of the structural decomposition. Therefore, the maximum detectability that can be achieved in each subsystem cannot be more than the detectability when all the shared variables are known. Using Theorem 1, we develop Algorithm 1 and Algorithm 2 to find an upper bound for the number of detectable faults and isolable fault pairs in each subsystem, respectively. Note that our algorithms do not require any information from the neighboring subsystems. ```
1:input:\(V_{ishared}\)
2:input:\(S_{i}=\{V_{i}\), \(M_{i}\), \(E_{i}\), \(F_{i}\}\)
3: Let \(DF\) be \(\{\}\)
4: Let \(S_{DF}\) be \(\{V_{i}-V_{ishared}\), \(M_{i}\cup V_{ishared}\), \(E_{i}\), \(F_{i}\}\)
5:for each\(f\in F_{i}\)do
6:if\(f\in(S_{DF})^{+}\)then
7:\(DF\) = \(DF\cup\{f\}\)
8:return\(DF\)
```  
**Algorithm 1** Detectable faults. Adopting the following strategy, a minimal set of shared variables can be found that guarantees maximum detectability. * We assume all the shared variables are known. If a fault is not locally detectable when all the shared variables are known, that fault is removed from the list of detectable faults (see Algorithm 1). * Each shared variable is removed from the list of known variables to the unknown variables one at the time, to evaluate the list of detectable faults. If removing the shared variable from the known variables decreases the number of faults in the list of detectable faults, the shared variable is added back to the list of minimal required shared variables. Otherwise, the shared variable is not needed. Algorithm 3 presents our method to find a minimal set of required shared variables. The algorithm is initialized with the subsystem model and the set of shared variables (for subsystem \(S_{1}\), \(p_{2}\) and \(q_{1}\) areunknown shared variables), and this provides a minimal subset of shared variables that makes all the faults detectable in the subsystem. For Subsystem 1, \(V_{1m}=\{p_{2}\}\) is a possible answer.