## 4 Simulation Examples and Results
### Comparison with Previous Approaches  
As indicated in Section 1.2, the proposed method constitutes a substantial novelty relative to previous approaches in the literature, fundamentally due to (i) the 3D nature of the approach, which considers the real topography of the terrain avoiding simplification errors that are present in 2D-based traditional methods (such as those in [22; 32], and (ii) its continuous formulation, which improves the search space and avoids the strong conditioning between the resolution of the terrain mesh and the efficiency of the method that arises from discrete methods (such as [23]. Regarding approaches based on 2D simplification, it is clear that their practical implementation is limited to those cases in which the curvature of the river is negligible. In those cases where this is not met, not only might the performance of the plant differ, but the difference in length of the optimal layout projected (2D) and the real one (3D) can cause incompatibility problems during the installation. These issues have been numerically demonstrated by the authors in [32], where the authors propose a 3D approach, in which the plant layout is defined as a connection of straight pipe lengths, connected to each other using elbows. For the sake of a fair comparison, the approach proposed in this work cited has been used to solve the reference example in Section 4.1. The method considered is defined on a discrete basis, the raw topographic data points considered as candidate positions for these elbows to be deployed on the terrain. It is relevant to note that, in addition to the different framework of the discrete approach, the cost function is slightly different, as it includes an additional term to account for the cost of the elbows and their installation. For this approach, Equation (13) is transformed into:  
\[C_{p}=L_{p}\sum_{i=0}^{m}a_{i}D_{p}^{i}+n_{c}\sum_{i=0}^{n}b_{i}D_{p}^{i} \tag{22}\]  
where \(n_{c}\) represents the total number of penstock pipe elbows, and the constants \(b_{i}\) are adjusted to match the real costs from local manufacturers. For this problem, the values from [32] have been used; these are:  
\[b_{0}=50,\quad b_{3}=1200,\quad b_{i}=0\ \forall i\
eq\{0,3\}\]  
The optimal solution obtained with this method is represented in Figure 15, and numerically summarized in Table 5. When these results are observed, it can be seen that the continuous approach proposed in this work provides a better solution. Nevertheless, some interesting additional comments can be made. First, it is relevant to note that the cost reduction is not very high (about 3% reduction), as both layouts are qualitatively similar. It is also interesting to note that the penstock obtained with the discrete approach is 11 m shorter with the same diameter, but it is the cost of the elbows that increases the cost. Finally, the fact that the continuous approach provided a power generation closer to the minimum constraint (7 kW) demonstrates how the discrete is strongly conditioned by the refinement of the topographic survey, that is, the number of terrain points. The fewer the data points, the lower the probability of finding a solution that satisfies the constraints more tightly.  
To conclude the comparison between these two approaches, it is mandatory to note that these actually refer to two different alternatives for the physical installation of the penstock, and thus the superiority of the continuous approach is not to be taken for granted, as some particular cases (such very steep, irregular terrains) might be better suited to layouts with a penstock composed of straight segments connected through elbows, avoiding the curvature limitations of the continuous approach. For these reasons, both methods are recommended to be considered for the optimization of these plants.