*3.2. Simulation*

Two different types of simulations have been performed: using real numbers and using marks, with a simulation step of Δ*t* = 5 and 1000 steps of simulations (5000 s in all). The results using real numbers, for the three state variables are represented in Figure 2. The intermittent input flow gives the sawtooth shape for the values of *h*1.

**Figure 2.** Three-tank system. Simulation results for the three state variables using real numbers.

For the simulations using marks, all magnitudes are considered as marks whose centers are the former real numbers and granularities have been fixed to *g* = 0.00001, for all the marks. The levels of liquid into the tanks are influenced by perturbations and the dynamics of the inputs and outputs of liquid. Calling *pr* this variation, the tolerance can be calculated by *t* = *pr*/*h*. Taking *pr* = 0.10, the common tolerance for all the simulations is *t* = 0.05. Unlike the granularities, the tolerances have to be equal for all the marks.

Results are shown in Figure 3 that contains the intervals associated to the marks, drawn in form of little vertical segments. Together, they are represented by the dark band of the figure. The run time for the *t* = 5000 s of the simulation is 200 s.

**Figure 3.** Three-tank system. Simulation results for the three state variables using real numbers. The dark bands are only apparent. They are the accumulation of the 1000 little vertical segments which represent the intervals associated to the resulting marks in the 1000 simulation points

In accordance with the semantic of marks (16) these results mean that, for one instant, for example *i* = 500 (time *t* = 2500 s), the model outputs the result in these marks and related associated intervals:

```
h1(2500) = 1.588474, 0.000011
                                  , Iv(h1(2500)) = [1.509068, 1.667881]
h2(2500) = 1.003461, 0.000011
                                  , Iv(h2(2500)) = [0.953299, 1.053623]
h3(2500) = 0.525883, 0.000011
                                  , Iv(h3(2500)) = [0.499595, 0.552171].
```
An experimental state value like

> *<sup>h</sup>*1*exp*(2500) = 1.6 ± 0.01 m, *<sup>h</sup>*2*exp*(2500) = 1 ± 0.01 m, *<sup>h</sup>*3*exp*(2500) = 0.52 ± 0.01 m.

is contained in them and, thus, consistent with the model (17). However, for *t* = 5000 s the results are the following:

$$\begin{aligned} \mathfrak{h}\_1(5000) &= \langle 0.018793, 0.000011 \rangle \quad , \, I v'(\mathfrak{h}\_1(5000)) = [0.017854, 0.019733] \\ \mathfrak{h}\_2(5000) &= \langle 0.017685, 0.000011 \rangle \quad , \, I v'(\mathfrak{h}\_2(5000)) = [0.016801, 0.018569] \\ \mathfrak{h}\_3(5000) &= \langle 0.012397, 0.000011 \rangle \quad , \, I v'(\mathfrak{h}\_3(5000)) = [0.011778, 0.013017] \end{aligned}$$

with the associated intervals too narrow to obtain reasonable results with the related semantic (16).

The heights values contained in the associated intervals (14) are consistent with the model, but these intervals depend on the value of the center of the mark because their widths tend to zero, as shown in the final parts of the graphics in Figure 3. To avoid this effect, in this benchmark, it is possible to change to a physical system (Figure 4), where the common height of the tanks is *h* + *hexc*. The behaviour of the liquid levels along the simulations is the same for the two physical systems.

**Figure 4.** Schematic representation of the extended three-tank system.

To do this in the simulation algorithm, it is sufficient to add *hexc* to the initial values of the state variables *h*1, *h*2 and *h*3 and to scale the tolerance to *t*/(*h* + *hexc*). This scaled tolerance depends on *hexc*, which when increased for small granularities, the width of all the associated intervals moves near to 2 · *pr*.

For the case *hexc* = 2, the tolerance is *t*/(*h* + *hexc*) = 0.025. The simulation results after subtracting *hexc* to the final values of *h*1, *h*2 and *h*3 can be found in Figure 5.

**Figure 5.** Extended three-tank system. Simulation results for the three state variables using real numbers.The dark bands are only apparent. They are the accumulation of the 1000 little vertical segments which represent the intervals associated to the resulting marks in the 1000 simulation points.

Now the outputs for the step number 500 (*t* = 2500 s) are the following:

$$\begin{aligned} \mathfrak{h}\_{1}(2500) &= \langle 1.588474, 0.000167 \rangle \quad , \operatorname{Iv}'(\mathfrak{h}\_{1}(2500)) = [1.498802, 1.678147] \\ \mathfrak{h}\_{2}(2500) &= \langle 1.003461, 0.000167 \rangle \quad , \operatorname{Iv}'(\mathfrak{h}\_{2}(2500)) = [0.928407, 1.078515] \\ \mathfrak{h}\_{3}(2500) &= \langle 0.525883, 0.000167 \rangle \quad , \operatorname{Iv}'(\mathfrak{h}\_{3}(2500)) = [0.462763, 0.589003] \end{aligned}$$

and for the step number 1000 (*t* = 5000*s*) are the following:


where the effect of the small center values over the associated intervals widths has disappeared. Associated intervals are truncated to avoid negative values for the heights values.

The model results and the initial granularities are strongly dependent on one another because of the inevitable increase of the granularities throughout the simulation. So, if the initial granularity is changed to *g* = <sup>10</sup>−4, then in the simulation step *i* = 903 (time *t* = 4515 s) the resulting marks are invalid (1) (the granularity is larger than tolerance) and all the subsequent results are invalid. For *g* = 10−<sup>3</sup> in the simulation step, *i* = 86 and *g* = 10−<sup>2</sup> are only valid for the eight first simulation steps.

As a rule of thumb, starting from a granularity *g* = 1*e* − *n*, if to arrive until *g* = 1*e* − (*n* + 1) lasts *p* simulation steps, then to ge<sup>t</sup> a granularity 10 times larger, *g* = 1*e* − (*n* + <sup>2</sup>), lasts near to *p*/10 steps more. This quasi-exponential dependence causes invalidity of non-small granularities to be reached quickly, independently from the fixed value for the tolerance.

### *3.3. Fault Detection*

The goal is to detect the presence of a fault in a system and indicate the location of the detected fault (fault isolation). It is assumed that only the measurements of the liquid levels, which are influenced by leakage in one tank or clogging in a valve are available.

In accordance with the semantic of marks (16), a fault is detected when a measurement (within an interval of uncertainty) is outside the estimated band of associated intervals obtained by simulation using marks, indicating that it is not consistent with the model. Therefore, if the model is correct, the measurement is not. These measurements are generated simulating the behavior of the system in the following situations:


The simulations were performed until *t* = 1000 s to underline the comparisons.

**Figure 6.** Faulty three-tank system: Leakage of approximately 0.25 % of the water inflow in tank 1 from *t* = 500 s. Blue bands represent the computation using marks while red lines correspond to the measured values of the three state variables.

**Figure 7.** Faulty three-tank system: clogging between tanks 2 and 3 from *t* = 500 s. Blue bands represent the computation using marks while red lines correspond to the measured values of the three state variables.
