## 2 Methods and Models
### The Fuzzy Logic Controller
#### 2.3.2.1 Performance-Based Supervision  
The Systeminfo variable contains information about the overall performance of the plant. This variable is one of the inputs to the fuzzy inference system and concurs to choose the best OM, following a performance-based supervision approach [31]. The Systeminfo variable is built according to the logic depicted in Figure 5. The input to the system is \(u(t)=E_{p}(t)-E_{l}(t)\), namely the difference between the produced thermal energy and that required by the user (load). This difference is fed to a high-pass filter, which accounts for high-frequency components, added to a term composed by a constant value, which accounts for low-frequency noise, and added again to a scaled version of the input itself. The resulting signal is low-pass-filtered to obtain a smoother signal and saturated over a custom range, here selected between \(-4\) and \(+4\). The variable is finally fuzzified according to the membership functions (Figure 4f). Negative values imply that the consumption is greater than the production, with a trend that can be decreasing (bad) or increasing (poor). Positive values imply, instead, that the production is greater than the consumption, with a trend that can be decreasing (ok) or increasing (good).  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Rule Number** & **P\({}_{\text{LFR,out}}\)** & **T\({}_{\text{TES,av}}\)** & **T\({}_{\text{LFR,out}}\)** & **Systeminfo** & **T\({}_{\text{diff}}\)** & **OM** \\ \hline
1 & zero & high OM3 & high & ok & 3 \\
2 & low & normal & & bad & 0 \\
3 & ok & & & *–good & 1 \\
4 & ok & *–high & & good & 4 \\
5 & zero & normal & *–high & bad & 2 \\
6 & zero & high OM3 & high & ok & 3 \\
7 & low & high OM3 & high & ok & 3 \\
8 & high & *–high & & good & 4 \\
9 & high & high & & & 1 \\
10 & zero & ok & & bad & 5 \\
11 & zero & high & & & 5 \\
12 & low & ok & & & 6 \\
13 & low & high & & & 6 \\
14 & zero & low & *–high & bad & 2 \\
15 & ok & high & & good & 1 \\
16 & high & & & *–good & 1 \\ \hline \hline \end{tabular}  
*– is the logic negation symbol.  
\end{table}
Table 4: Set of 16 linguistic rules at the base of the fuzzy load-following control strategy (residential load model). Membership functions are defined in Figure 4.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Rule Number** & **P\({}_{\text{LFR,out}}\)** & **T\({}_{\text{TES,av}}\)** & **T\({}_{\text{LFR,out}}\)** & **Systeminfo** & **T\({}_{\text{diff}}\)** & **Time** & **OM** \\ \hline
3 & ok & & \multicolumn{2}{c}{–good} & ok & 1 \\
10 & zero & ok & & bad & ok & 5 \\
11 & zero & high & & & ok & 5 \\
12 & low & ok & good & & ok & 6 \\
17 & ok & & *–good & bad & *–ok & 4 \\
18 & zero & high & & & *–ok & 2 \\
19 & zero & ok & & & *–ok & 2 \\
20 & low & ok & & & *–ok & 3 \\
21 & low & high & & & *–ok & 6 \\ \hline \hline \end{tabular}  
*– is the logic negation symbol.  
\end{table}
Table 5: Set of 21 linguistic rules at the base of the fuzzy load-following control strategy (school load model); when the rule number is not reported, the rule is identical to the one detailed in Table 4. Membership functions are defined in Figure 4.