## ABSTRACT

A Piano Key Weir (PKW) is a nonlinear (labyrinth-type) weir with a small spillway footprint and a large discharge carrying capacity. It (PKW) enables water bodies to continue functioning at elevated supply levels while causing no damage to dam structures, resulting in increased storage. PKW's geometrical structure is extremely complex, and geometrical aspects have a significant impact on its efficiency and on energy dissipation. Among them relative width ratio (*W*_{i}*/**W _{o}*) (i.e., inlet to outlet key width ratio) is a critical parameter that affects the PKW's discharge efficiency, and energy dissipation across the weir significantly. This study predicts the PKW's inlet to the outlet key ratio and understands the resulting hydraulic behaviours based on a Fuzzy Neural Network (FNN). The dataset used in this study was collected experimentally, which adds to the study's authenticity because it is not a conventional dataset. The model's performance is evaluated by the Root Mean Square Error (RMSE) and Mean Absolute Error (MAE); both values are 0.0305 and 0.0222, respectively. According to the dataset, these scores tell the model's reliability as it is in the ideal range. The FNN approach can be applied in a variety of fields to predict or solve different problems erent problems.

## HIGHLIGHTS

This study aims to predict the optimum inlet-to-outlet key width ratio of PKWs based on a Fuzzy Neural Network (FNN) computation.

Studying the effects of width ratio on energy dissipation of piano key weirs.

Studying and comparing the energy dissipation of the different width ratios of piano key weirs.

## LIST OF SYMBOLS AND ABBREVIATIONS

*P*PKW's height

*L*Overall development length

*W*Weir's width

*H*_{t}Cumulative head over the weir

*W*_{i}Width of inlet key

*W*_{o}Width of outlet key

*N*Cycle number

*S*_{i}Slope of inlet key

*S*_{o}Slope of outlet key

*B*_{i}Length of inlet key

*B*_{o}Length of outlet key

*C*_{DL}Coefficient of discharge along developed crest length

*Q*Discharge flow of PKW

*E*_{L}Relative energy dissipation

*E*_{1}or*E*_{2}Energy dissipation in sections 1 and 2

- MLPNN
Multi-level perceptron neural network

- CWR
Crop water requirement

- CIR
Crop irrigation requirement

- EC
Electrical conductivity

- GCM
General circulation model

- NSE
Nash-Sutcliffe efficiency model

- CFD
Computational fluid dynamics

- ANFIS
Adaptive Neuro-fuzzy Inference System

- PSO
Particle swarm optimization

- GA
Genetic algorithm

- MFO
Moth flame optimization

- FA
Factor analysis

- SVR
Support vector machine

- ANN
Artificial Neural Network

*x*Input for the FNN model

Weights associated with i

^{th}layer in FNN model*e*Epsilon

Outputs associated with i

^{th}layer in FNN modelPartial differentiation

## INTRODUCTION

Piano key weir (PKW) is a spillway that is used in water management at dams. In dam engineering, there are height and space restrictions; at that given condition, PKW is a very effective management solution and is nonlinear in design. As the name suggests, it resembles piano keys, a structure where keys are grouped in a stepped manner to serve the purpose. When PKW is compared with traditional linear spillways, it has much better discharge capacity, energy dissipation, and lower material utilization. This is a very cutting-edge structure used to manage and regulate water flows in dams. PKW is an upgraded form of labyrinth weirs, which were first researched by and gained notoriety as a more effective and economical weir (Lempérière & Ouamane 2003). A recent project in France that uses PKW to boost the water release capacity of the country's current suction dams (Laugier *et al.* 2017) and as a promising solution for dam weir on derailed structures in Vietnam (Khanh 2017) is rapidly increasing. Since 2011, significant knowledge exchange during geographical conferences has guided the compilation of reference material summarizing the current state of PKW technology (Erpicum *et al.* 2011, 2013, 2017). All around the world, more than 35 PKWs have been successfully built, including in the UK, Algeria, South Africa, France, Switzerland, Vietnam, India, Australia, and Sri Lanka (Crookston *et al.* 2019).

The first PKWs were built in 2006 at the Goulours Dam in France and more recently at the Hazelmere Dam in South Africa. They significantly increased the possibility of reservoir and spillway release. An upcoming PKW implementation at Tzaneen Dam is in progress (van Deventer *et al.* 2015). Notably, recent interest in PKW implementations extends to interior weir applications, complementing the primary focus on utilizing PKWs as lateral weirs for runoff release (Karimi *et al.* 2018). Over the past two decades, detailed summaries of PKW geometry and hydraulic behaviour have been presented by Abhash & Pandey (2020) and Singh & Kumar (2021). Weir altitude (*P*), relative advancement *L/W* ratio (crest length), (*H*_{t}/*P*) ratio, alveolar width (*W*_{i}/*W*_{o}), and cycle number (*N*) for a constant channel width are geometric parameters that have a significant impact on head-discharge efficiency and energy dissipation (where *L* is the overall development length, *W* is weir's width, *H*_{t} is cumulative head over the weir, and *P* is weir altitude). PKW behaviour is further influenced by the type of crest, lengths of overhangs, upstream apex walls, and raising the crest via a parapet wall (Anderson & Tullis 2013). Numerous investigations have explored scientific hypotheses, case studies, and original research on PKW energy loss and labyrinths (Bieri *et al.* 2011; Ribeiro *et al.* 2011; Khanh 2013). Silvestri *et al.* (2013) observed that in PKWs with stepped chutes, residual energy was low at the spillway toe and increased with release and spillway length. Al-Shukur & Al-Khafaji (2018) investigated how the PKW slope affected energy loss and showed that the proportion of energy dissipation decreased as the slope decreased. Computational techniques employing AI models such as MLPNN, ANFIS, PSO, GA, MFO, and FA have been used to define PKW hydraulic behaviour based on geometrical parameters (Zounemat-Kermani & Mahdavi-Meymand 2019). Karbasi & Azamathulla (2016) used GEP for hydraulic jump aspects over a rough bed, comparing its performance with conventional AI approaches SVR and ANN. Many studies have tried to estimate how deep scour can occur along dikes, weirs, and piers that are partially submerged in water (Karbasi & Azamathulla 2016; Pandey *et al.* 2020; Birbal *et al.* 2021; Emadi *et al.* 2022; Singh *et al.* 2022). Therefore, more new ideas and rivals are needed to improve PKW technology. Comprehensive reviews on PKWs for discharge measurement (Bhukya *et al.* 2022) and energy dissipation (Silvestri *et al.* 2013; R. Eslinger & Crookston, 2020; Singh & Kumar, 2022a, 2022b, 2022c, 2023a, 2023b) have been presented, emphasizing the need for robust experimental and computational analyses to better understand PKW hydraulic properties.

*et al.*(2019) have provided valuable information on energy loss in free streams below rectangular sharp-crested weirs, emphasizing the importance of careful hydraulic system design to enhance efficiency and reduce negative effects on the environment and structure. This study aims to examine how the difference between the width of the air sacs at the entrance and the exit (

*W*

_{i}/

*W*

_{o}) influences the flow and energy loss of PKWs (PKWs). Previous studies have only tried to explore how the

*W*

_{i}/

*W*

_{o}ratio affects the discharge capacity, coefficient, and energy dissipation in PKWs. However, there is still a big lack of knowledge about this topic. Consequently, this experimental investigation was conducted to provide comprehensive insights into how the

*W*

_{i}/

*W*

_{o}ratio impacts hydraulic efficiency and downstream energy dissipation, mainly focusing on type-A PKWs. Pralong

*et al.*(2011) indicated various geometrical parameters associated with PKWs (shown in Figure 1), which are frequently used in design analysis and provide sufficient information about the PKWs. The study utilizes a fuzzy neural network (FNN) to enhance our understanding of this critical PKW design and performance parameter. Poonia

*et al.*(2021a, 2021b, 2021c) focus on the problem of resource distribution and ineffective response to disasters, which makes natural disasters worse. The aim is to resolve issues such as poor coordination, late responses, and corruption among responsible agencies. The author proposes a step-by-step approach to tackle disaster management using blockchain technology; the first step is data management: a blockchain framework that ensures the timely sharing of trustable and traceable records related to various aspects of disasters. The second step is automated aid distribution, built on smart contracts to automate the fast transfer of emergency relief, prevent corruption in its use, and allocate it wisely.

Kumar *et al.* (2021) reviewed and understood the change in extreme circumstances to develop effective, durable strategies. The document identifies regions in India prone to droughts and floods to prepare in advance and reduce risk. The author offers a solid approach for assessing risks and boosting the resilience of essential infrastructure. The proposed approach first assesses the potential impact of extreme weather on critical infrastructure and then develops strategies that can withstand climate-related challenges. Tiwari *et al.* (2024) explore the relationship between climate change and water quality by focusing on the electrical conductivity in the Narmada basin. AI techniques can be used to predict water quality. The author develops 10 AI models to predict the EC levels at the Sandia station in the Narmada basin. This information can be used to manage the region's drinking water, irrigation, and other uses. Model 8 performs exceptionally well among all models, with an *R*^{2} value of 0.889. Poonia *et al.* (2021a, 2021b, 2021c) addressed the lack of comprehensive analysis of the joint dependence of drought duration and its effect across Indian river basins. There is a research gap that hinders the development of effective drought strategies. The author suggests modelling the joint dependence structure of drought features using a bivariate copula-based technique. The author aims to identify patterns and hotspots of severe and prolonged drought events across India. Poonia *et al.* (2021a, 2021b, 2021c) aim to address the research gap related to the unpredictability of climate model projections and scenarios in assessing CWR and CIR in the Eastern region of Himalayan, specifically in Sikkim. Das *et al.* (2020) provide a thorough analysis of how climate change affects a Sikkim crop field, particularly rice, wheat, and maize. They use calibrated AquaCrop simulations based on historical data to project future crop yields under different emission scenarios and GCMs.

Additionally, they add possibility theory to examine uncertainty with GCMs. Jamal *et al.* (2024) aim to address the challenge and land loss in states like West Bengal and India. Existing systems for protecting riverbanks include different materials and methods to determine stone size and effectiveness under different temporal variations. The author identifies a lack of research finding the most effective stone for safeguarding against bank failure. The author suggests a way to test how a riverbank reacts to different sizes of stones using a physical model. Poonia & Tiwari (2020) aim to satisfy the demand for rainfall-runoff modelling in Madhya Pradesh's Hoshangabad Narmada River watershed. This area often experiences floods, so it is important to have accurate runoff estimation for good flood management. The author suggests using ANN-based models to simulate water flow in the Hoshangabad area. Different ways of measuring how well the models work is used, such as how close they are to the real data, how much error they have, and how much they improve the results. Kantharia *et al.* (2024) want to find out how well they can predict the amount of water that flows out of the Damanganga River daily by using information about the rain and the soil. The study's objective is to fill the gap by creating a model using ANFIS that is customized for the Damanganga basin, taking into account soil moisture at various depths as input variables. We measure how well the model fits the data by using two numbers: the *R*^{2} and the NSE.

Although there is growing awareness of the urban heat island (UHI) phenomenon and its consequences, Sharma *et al.* (2023) discovered a scarcity of in-depth investigations on this topic, especially in regions with hot semi-arid climates, such as India. The author's model intends to fill the current knowledge gaps on UHI effects, and it employs remote sensing and geospatial analysis methods to examine how surface temperatures and UHI effects vary throughout the year, especially considering the influence of land use and water body cooling. Baudhanwala *et al.* (2024) discuss the necessity for accurate rainfall prediction models in regions like South Gujarat, India. Severe rainstorms are happening more often in the area, and this causes problems for water, farming, buildings, and people's lives. The writer utilizes four distinct machine learning (ML) techniques: support vector regression (SVR), multiple linear regression (MLR), decision tree (DT), and random forest (RF). The research suggests that a width ratio between 1.25 and 1.30 provides the best results in terms of hydraulic efficiency, as indicated by the highest discharge coefficient. Beyond this range, energy dissipation increases, yielding diminishing returns. This research offers valuable insights for PKW design and highlights the applicability of FNNs in hydraulic engineering, ultimately enhancing civil engineering and water resource management practices.

A real-world dataset and the suggested strategy were used to demonstrate the contribution. An overview of the contribution would be as follows:

The dataset utilized in this research is experimentally obtained and used to evaluate proposed methodologies; it is not pre-defined. The dataset utilized in this work was obtained through experimentation. Unlike traditional methods, which rely on pre-defined datasets, this study offers a unique dataset, enhancing the data's validity.

A new model named FNN is proposed; this method has never been used before. The research void in hydraulic behaviour pattern prediction for PKWs will be filled by proposing FNN.

A thorough derivation of the tuning of the hyperparameters suggested in FNN is presented in this article. A crucial part of building a model is tuning; the contribution offers a systematic and precise way to adjust the parameters to the specifications. The derivation is novel and contributes to improving the model's performance.

The organization of the article is as follows: Section 2.1 talks about the experimental set-up and dataset used in the process, Section 2.2 shows the methodology used in the article and also the tuning of hyperparameters, then further in Section 3, experimental results are discussed and in Section 4, conclusion is given.

## MATERIAL AND METHODS

### Experimental set-up and model fabrication

*L*is the developed crest length,

*W*states the width of the channel of PKW,

*H*

_{t}is the total head,

*Q*is the discharge flow of PKW,

*P*is the height of PKW,

*S*

_{i}is the slope of the inlet key,

*S*

_{o}is the slope of the outlet key,

*B*

_{i}is the length of the inlet key,

*B*

_{o}is the length of the outlet key,

*E*

_{L}is relative energy dissipation, and

*E*

_{1}or

*E*

_{2}is energy dissipation at a particular section.

S. No. . | . | . | S_{i}=S_{o}
. | H_{t} (m)
. | Q (L/s)
. | B_{i}/P=B_{o}/P
. | Range of E_{L}/E_{1}
. | Range of E_{2}/E_{1}
. | No. of readings . |
---|---|---|---|---|---|---|---|---|---|

1 | 1.00 | 5 | 1.08 | 0.0300–0.0971 | 10.17–50.26 | 0.69 | 0.8093–0.1930 | 0.1907–0.8096 | 18 |

2 | 1.10 | 5 | 1.08 | 0.0304–0.0986 | 10.14–50.26 | 0.69 | 0.7860–0.1785 | 0.2140–0.8214 | 18 |

3 | 1.20 | 5 | 1.08 | 0.0307–0.0989 | 10.19–50.07 | 0.69 | 0.7700–0.1731 | 0.2300–0.8268 | 18 |

4 | 1.25 | 5 | 1.08 | 0.0317–0.1011 | 10.28–50.18 | 0.69 | 0.7533–0.1734 | 0.2467–0.8265 | 18 |

5 | 1.30 | 5 | 1.08 | 0.0322–0.1004 | 10.09–50.00 | 0.69 | 0.7356–0.1655 | 0.2644–0.8344 | 18 |

6 | 1.35 | 5 | 1.08 | 0.0310–0.0891 | 10.16–50.07 | 0.69 | 0.7297–0.1501 | 0.2703–0.8498 | 18 |

7 | 1.40 | 5 | 1.08 | 0.0303–0.0985 | 10.19–50.13 | 0.69 | 0.7031–0.1435 | 0.2969–0.8564 | 18 |

8 | 1.50 | 5 | 1.08 | 0.0310–0.0992 | 10.15–50.45 | 0.69 | 0.6822–0.1411 | 0.3118–0.8588 | 18 |

9 | 2.00 | 5 | 1.08 | 0.0313–0.0995 | 10.29–49.82 | 0.69 | 0.6518–0.1342 | 0.3482–0.8657 | 18 |

S. No. . | . | . | S_{i}=S_{o}
. | H_{t} (m)
. | Q (L/s)
. | B_{i}/P=B_{o}/P
. | Range of E_{L}/E_{1}
. | Range of E_{2}/E_{1}
. | No. of readings . |
---|---|---|---|---|---|---|---|---|---|

1 | 1.00 | 5 | 1.08 | 0.0300–0.0971 | 10.17–50.26 | 0.69 | 0.8093–0.1930 | 0.1907–0.8096 | 18 |

2 | 1.10 | 5 | 1.08 | 0.0304–0.0986 | 10.14–50.26 | 0.69 | 0.7860–0.1785 | 0.2140–0.8214 | 18 |

3 | 1.20 | 5 | 1.08 | 0.0307–0.0989 | 10.19–50.07 | 0.69 | 0.7700–0.1731 | 0.2300–0.8268 | 18 |

4 | 1.25 | 5 | 1.08 | 0.0317–0.1011 | 10.28–50.18 | 0.69 | 0.7533–0.1734 | 0.2467–0.8265 | 18 |

5 | 1.30 | 5 | 1.08 | 0.0322–0.1004 | 10.09–50.00 | 0.69 | 0.7356–0.1655 | 0.2644–0.8344 | 18 |

6 | 1.35 | 5 | 1.08 | 0.0310–0.0891 | 10.16–50.07 | 0.69 | 0.7297–0.1501 | 0.2703–0.8498 | 18 |

7 | 1.40 | 5 | 1.08 | 0.0303–0.0985 | 10.19–50.13 | 0.69 | 0.7031–0.1435 | 0.2969–0.8564 | 18 |

8 | 1.50 | 5 | 1.08 | 0.0310–0.0992 | 10.15–50.45 | 0.69 | 0.6822–0.1411 | 0.3118–0.8588 | 18 |

9 | 2.00 | 5 | 1.08 | 0.0313–0.0995 | 10.29–49.82 | 0.69 | 0.6518–0.1342 | 0.3482–0.8657 | 18 |

### Methodology

This article proposes a novel FNN. The biological neurons inspire neurons in ML. Pattern recognition and prediction are required in many situations where automation is challenging. Neural networks (NNs) were developed to address these issues, as they can automate the process and provide accurate data predictions. NN processes the input along with the hyperparameters. A fuzzy system is a logic that deals with binary values, divides the data based on membership function, and gives values as a degree of truth. Equations are given a more human touch through the use of fuzzy logic.

*n*is the total number of samples and

*t*shows the iteration number. The fuzzification layer is the first layer of the model after the input layer. The membership function used in the fuzzification layer is the trapezoidal membership function, and a graphical and mathematical representation of this function is shown in Figure 4. Where are the inputs of randomly generated parameters, and

*x*is provided to the fuzzification layer.

*x*

_{1}, combining the fuzzy components from the membership function's output. , where

*n*is the number of inputs in one iteration, subscript shows the number of the layers, and superscript shows the number of nodes in the present layer; as the membership function has three components, the production layer will have only three nodes combining the inputs. Similarly, we can calculate and . Subsequently, we will employ a membership function, namely the sigmoid function, on the output of the second layer and all subsequent layers. The sigmoid function is a membership function that helps produce output from 0 to 1, making it easy to handle outputs and then further process them. The sigmoid membership function is shown in Equation (1):where denotes the output of the first layer, which is fed to the sigmoid function and is the layer's final output will be sent as input to the following layer. Further, this output of the second layer is passed to the third layer, a neural layer in FNN. is the weight for this neural layer, and it will first be produced at random and will give output as , in generic form, it will be given as follows:

Comparably, the function for the fourth layer is displayed in Equation (4). It accepts input as and handles weights as to produce an output of .

#### Tuning of hyperparameters

*z*’ which equals in Equation (7). The output expected after the prediction is ‘

*t*’. The mean square error (MSE) for FNN is shown in Equation (8):where ‘

*n*’ is the total number of samples of input. The backtracking process is depicted in generalized form; for example, the value of

*n*is taken as 1 for simplifying the derivations. The error function in Equation (8) will give the total error of the model, and it will be minimized using the process of gradient descent. Gradient descent is an algorithm where, with each iteration, we try to update the parameters, which are weights in this case, to minimize the error.

#### Layer six

*E*) w.r.t. , which is the output of the last layer shown in Equation (10):where is the partial differentiation of the output of a layer after the sigmoid membership function w.r.t. output of the layer without the membership function, shown in Equation (11) and also given a generalized notation, i.e. . Every layer will repeat this step, making it easy to calculate and donate it with a generalized term.where is the partial differentiation of which is the output without membership function w.r.t. . As shown in Equation (12), the weights between the present and previous layers must be updated to achieve a lower error value.

#### Layer five

*w*

_{3}, the partial differentiation of

*E*w.r.t.

*w*

_{3}is needed, deduced in Equation (17):

*E*w.r.t. is shown in Equation (24):

#### Layer four

*w*

_{2}, partial differentiation of

*E*w.r.t.

*w*

_{2}is needed and deduced in Equation (26):

_{3}can be computed in similar pattern and is shown in Equation (30):

#### Layer three

#### Layer two

This layer is the production layer, which combines all the components of the fuzzification layer. This particular layer has no variable weights; hence, updating the parameters is impossible.

#### Layer one

*A*

_{1}

*, A*

_{2}, and

*A*

_{3}will be taken on the bases of the respective variables , , , ,, and which is shown in equations from Equations (38) to (43):where and are the hyperparameters for the first component of fuzzy logic, i.e.

*A*

_{1.}And Equation (38) shows the partial differentiation of component

*A*

_{1}w.r.t. variable .where the hyperparameters for the first fuzzy logic component or

*A*

_{1}are and . Additionally, Equation (39) illustrates component

*A*

_{1}'s partial differentiation with respect to the variable .where and are the hyperparameters for the second fuzzy logic component or . Furthermore, the partial differentiation of component with respect to the variable is shown in Equation (40).where the hyperparameters for the second fuzzy logic component or are and . Moreover, Equation (41) illustrates the partial differentiation of component with respect to the variable .where and are the hyperparameters for the third fuzzy logic component or . Additionally, Equation (42) shows how a component is partially differentiated with respect to the variable :where the hyperparameters for the third fuzzy logic component or are and . Furthermore, Equation (43) illustrates the partial differentiation of component with respect to the variable .

In Equation (45), the parameter is from Equation (35). is the parameter related to layers 2 and 3 of the FNN as seen in Figure 3, is the partial differentiation of the sigmoid function utilized in layer 3, and are the parameters related to fuzzy logic, and *x* is the input provided to the FNN model.

*i*th’ term and shown in equations from Equations (53) to (57).where is the partial differentiation of

*E*w.r.t. weights associated with the respective layer and is the final output of the previous is associated with the weights for the

*i*th layer.where is the differentiation of the sigmoid function for the

*i*th layer.

## RESULTS AND DISCUSSION

The dataset is collected experimentally, preprocessed, and passed to the FNN model. The method used to validate data is splitting the data into two categories, i.e. training and testing data. Both datasets are chosen randomly and divided in a ratio of 4:1. The training data is used to train the model by tuning the hyperparameters. Then, the model is validated using the testing data. This method allows the judgement of the model's performance to be balanced.

Dataset . | H_{t} vs Q
. | H_{t}/P vs C_{DL}
. | H_{t}/P vs E_{L}
. | H_{t}/P vs E_{2}/E_{1}
. | Average . |
---|---|---|---|---|---|

RMSE | 0.0582 | 0.0206 | 0.0216 | 0.0216 | 0.0305 |

MAE | 0.0383 | 0.0150 | 0.0183 | 0.0174 | 0.0222 |

Dataset . | H_{t} vs Q
. | H_{t}/P vs C_{DL}
. | H_{t}/P vs E_{L}
. | H_{t}/P vs E_{2}/E_{1}
. | Average . |
---|---|---|---|---|---|

RMSE | 0.0582 | 0.0206 | 0.0216 | 0.0216 | 0.0305 |

MAE | 0.0383 | 0.0150 | 0.0183 | 0.0174 | 0.0222 |

*H*

_{t}/

*P*< 0.79 range. The stage–discharge relationship serves as a fundamental characteristic of each flow measurement structure. It is illustrated as a curve, plotting discharge against the head for all

*W*

_{i}

*/W*

_{o}values ranging from 1.0 to 2.0, as depicted in Figure 7. The FNN model's performance metrics indicate an RMSE value of 0.0582 and an MAE value of 0.0383, as visualized in Figure 5. These metrics are vital indicators of the model's accuracy in predicting the given data. An RMSE of 0.0582 signifies the average magnitude of prediction errors, while an MAE of 0.0383 denotes the mean absolute difference between expected and actual values (see Table 2). Such metrics are pivotal in assessing the model's reliability and precision in research, contributing to a comprehensive understanding of its predictive capabilities.

*W*

_{i}/

*W*

_{o}proportion range, considering the highest

*C*

_{DL}values representing peak discharge efficiency, we present the results in Figure 8, depicting

*C*

_{DL}as a function of

*H*

_{t}/

*P*. Figure 8 clearly illustrates that

*W*

_{i}/

*W*

_{o}ratios of 1.25 and 1.3 yield the most substantial improvements in discharge efficiency. They are closely followed by

*W*

_{i}/

*W*

_{o}values of 1, 1.1, 1.2, 1.25, 1.3, 1.35, 1.4, 1.5, and 2. This observation underscores that the most advantageous discharge performance is concentrated between the

*W*

_{i}/

*W*

_{o}range of 1.25 and 1.3. The predictions made by the model in all the cases of the ratio of widths and the parameters are almost coinciding, as is visible in the graphs. Thus, the model proves to help predict the hydraulic behaviours from the change of width of the inlet key and the outlet key.

Furthermore, the data in Figure 8 reveals that *W*_{i}/*W*_{o} = 1.25 achieves notably higher discharge efficiency than *W*_{i}/*W*_{o} = 1.3 for *H*_{t}/*P* < 0.35. However, for the range 0.35 < *H*_{t}/*P* < 0.44, *W*_{i}/*W*_{o} = 1.3 surpasses *W*_{i}/*W*_{o} = 1.25 regarding discharge efficiency. Notably, *W*_{i}/*W*_{o} = 1.4 stands out as the configuration with the highest discharge capacity within the 0.44 < *H*_{t}/*P* < 0.81 range. In particular, PKW setups with *W*_{i}/*W*_{o} values of 1.25 and 1.3 demonstrate a remarkable 7–17% increase in efficiency compared with *W*_{i}/*W*_{o} = 1.0 and an approximately 8–13% gain over *W*_{i}/*W*_{o} = 2.0. It's worth noting that the FNN model excels in precision, as evidenced by its RMSE of 0.0206 and MAE of 0.0150, as shown in Figure 6.

*H*

_{t}/

*P*is less than 0.42, a trend across all PKW models. This observation deviates from previous research, which reported lower energy dissipation at these values. Conversely, for

*H*

_{t}/

*P*values greater than 0.55 and within the range of 0.42 <

*H*

_{t}/

*P*< 0.55, the relative energy dissipation rate [

*E*

_{L}

*=*(

*E*

_{1}

*−*

*E*

_{2})/

*E*

_{1}] displayed a more complex, intermingled behaviour. Figures 9 and 10 illustrate the variation of relative energy dissipation [

*E*

_{L}

*=*(

*E*

_{1}

*−*

*E*

_{2})/

*E*

_{1}] at the base of PKWs as a function of the upstream head ratio (

*H*

_{t}/

*P*).

## CONCLUSION

To precisely compute the optimal inlet-to-outlet key width ratio of PKW and the influence of the different width ratios on energy dissipation, the experimental data from a previous study by Singh & Kumar (2023a, 2023b) were used to create the FNN algorithm-based model in this research. According to the proposed model for predicting the key's width ratio, the approaches resulted in a highly nonlinear relationship between the width ratio and input parameters, with promising prediction results. The hydraulic behaviours measured in the process are discharge flow over the PKW, coefficient of discharge along developed crest length (*C*_{DL}) and relative energy dissipation (*E _{L}*). The peak efficiency occurs at a width ratio (

*W*

_{i}/

*W*

_{o}) of approximately 1.2755–1.28, with a 7–17% efficiency advantage over

*W*

_{i}/

*W*

_{o}

*=*1 and 8–13% over

*W*/

_{i}*W*

_{o}= 2.0. The energy losses over the weir decreases as the

*W*

_{i}/

*W*

_{o}ratio increases, with the highest relative energy dissipation corresponding to the lowest width ratio (i.e.

*E*

_{L}= 0.8093 or 80.93%, the corresponding

*W*

_{i}/

*W*

_{o}= 1) and the lowest energy loss for the highest width ratio (i.e.

*E*

_{L}= 0.5818 or 58.18% the related

*W*

_{i}/

*W*

_{o}= 2.0). This means the energy dissipation across the weir for

*W*

_{i}/

*W*

_{o}= 2.0 indicates 12–23% less energy dissipation than

*W*

_{i}/

*W*

_{o}= 1. The performance of the algorithm is measured based on the RMSE value and MAE value. More studies are needed on prediction and various soft computing techniques. Furthermore, doing an experimental investigation or CFD simulation while accounting for scaling effects is possible.

## ACKNOWLEDGEMENTS

The faculty, staff, and technical team of the Hydraulic Laboratory of the Civil Engineering Department are much appreciated by the authors for their support, and they are also beseeched with sympathy.

## FUNDING INFORMATION

This study has not received any funding.

## DATA AVAILABILITY STATEMENT

All relevant data are included in the paper or its Supplementary Information.

## CONFLICT OF INTEREST

The authors declare there is no conflict.

## REFERENCES

*,*

15(5), 2518–2531. jwc2024143