# ORC Optimal Design through Clusterization for Waste Heat Recovery in Anaerobic Digestion Plants
## 3 Methodology
### Preliminary Design
#### 3.1.1 Definition of Design Boundary Conditions
to measure the partitioning goodness. The silhouette is a standard indicator to understand if the right number of clusters is used and is defined as in Equation (1) [37]:  
\[S_{i}=\ \frac{(b_{i}-a_{i})}{\max\ (a_{i},b_{i})} \tag{1}\]  
where \(a_{i}\) is the average distance between the \(i\)-th point and the other points in the same cluster as \(i\), while \(b_{i}\) is the minimum average distance between the \(i\)-th point and the points of a different cluster, minimized between the different clusters. Silhouette values range between \(-1\) and \(1\), and for values close to \(1\), it indicates the correct assignment of the point to the corresponding cluster. A null silhouette value indicates that the point does not belong in a defined manner to one cluster compared to another, while a negative value indicates that the point is assigned to the wrong cluster. Clustering results are reported in Figure 4a, which show how the four-cluster case performed the best according to average silhouette values. The silhouette value distribution across the four-clusters case is shown in Figure 4b. Since several data points within the same clusters scored high silhouette values, it can be concluded that the partitioning was successful. Due to the inherent noise in the large amount of data available, clustering was performed on hourly averaged data, rather than on the entire dataset. This timescale reduction allowed for the achievement of more stable results. This design choice is considered as adequate if the slow dynamic of the anaerobic digester is taken into account. Table 2 shows the cluster centroid values obtained from clustering. The values chosen to size the system are those corresponding to the most populated cluster (Cluster 3). These values also correspond to those capable of maximizing the ORC cycle electrical power output. In Table 2, the four clusters are compared with the annual average plant operating conditions, and with the summer and winter average conditions. However, it may be noted that the clustering algorithm allowed for the selection of representative operating conditions, which cannot be selected with traditional methods. Figure 4: (**a**) Silhouette average value as a function of cluster number. (**b**) Data silhouette values for each cluster of the best cluster partitioning (four clusters). For both (**a**,**b**), the higher the values, the better the results. Data clustering may disclose a pattern in data that would be difficult to highlight otherwise. For example, in Table 2, the system operating conditions that corresponded to the four cluster centroids were compared with the annual and summer average conditions. As a result, the annual and summer average did not resemble any of the clusters, which means that the former failed in representing the actual frequency of the operating conditions. In other words, the annual or summer average was not like the operating conditions that frequently showed up in the record, while the cluster centroids were precisely built to resemble those that most frequently showed up. Therefore, each cluster represents a part of the operating condition dataset and the number of elements represented by each centroid (i.e., similar to it) is the cluster population. As a result, Cluster 3 represents most of the operating conditions over the year. This means that this cluster is similar to the operating conditions encountered most frequently during system operation. Clusters are built through a numeric procedure, so they are mathematical objects. However, they may maintain physical significance. In this case, the following patterns can be observed:  
* Clusters 1 and 2 represent the operating conditions with comparatively high \(Q_{dig}\) (i.e., over the average value), comparatively low \(T_{f}\) (i.e., under the average values), and high \(m_{f}\) (Cluster 1) or low \(m_{f}\) (Cluster 2). * Clusters 3 and 4 are somewhat the opposite.