Analysis of local head losses in microirrigation lateral connectors based on machine learning approaches

The presence of emitters along the lateral, as well as of connectors along the manifold, causes additional local head losses other than friction losses. An accurate estimation of local losses is of crucial importance for a correct design of microirrigation systems. This paper presents a procedure to assess local head losses caused by 6 lateral start connectors of 32- and 40-mm nominal diameter each under actual hydraulic working conditions based on artificial neural networks (ANN) and gene expression programming (GEP) modelling approaches. Different input–output combinations and data partitions were assessed to analyse the hydraulic performance of the system and the optimum training strategy of the models, respectively. The range of the head losses in the manifold (hsM) is considerable lower than in the lateral (hsL). hsM increases with the protrusion ratio (s/S). hsL does not decrease for a decreasing s/S. There is a correlation between hsL and the Reynolds number in the lateral (ReL). However, this correlation might also be dependent on the flow conditions in the manifold before the derivation. The value of the head loss component due to the protrusion might be influenced by the flow derivation. DN32 connectors and hsM present more accurate estimates. Crucial input parameters are flow velocity and protrusion ratio. The inclusion of friction head loss as input also improves the estimating accuracy of the models. The range of the indicators is considerably worse for DN40 than for DN32. The models trained with all patterns lead to more accurate estimations in connectors 7 to 12 than the models trained exclusively with DN40 patterns. On the other hand, including DN40 patterns in the training process did not involve any improvement for estimating the head losses of DN32 connectors. ANN were more accurate than GEP in DN32. In DN40 ANN were less accurate than GEP for hsM, but they were more accurate than GEP for hsL, while both presented a similar performance for hscombined. Different equations were obtained using GEP to easily estimate the two components of the local loss. The equation that should be used in practice depends on the availability of inputs.


List of symbols D
Internal diameter of the pipe (m) f DN20 Friction factor for DN20 f DN40 Friction factor for DN40 f DN32 Friction factor for DN32 g Acceleration of gravity (ms −2 ) hs M Local head loss component along the manifold (m) hs L Local head loss component in the lateral inlet (m) hs 1-2 Local head loss between points 1 and 2 (m) hr 1-2 Friction loss between the points 1 and 2 (m) HR L Friction losses in the lateral pipe (m) HR 1 Friction losses in the manifold stretch before the flow derivation (m) HR 2 Friction losses in the manifold stretch after the flow derivation (m) V 1 Flow velocity in point 1 before the protrusion (ms −1 ) V 2 Flow velocity in point 2 after the protrusion (ms −1 ) V i Flow velocity in point i (ms −1 ) V Mean flow velocity in the considered section (ms −1 ) Q i Flow rate of the corresponding stretch (m 3 s −1 ) Q 1 Flow rate in section 1 before the protrusion (m 3 s −1 ) Q 2 Flow rate in section 2 after the protrusion (m 3 s −1 ) Re Reynolds number Re 1 Reynolds number before the flow derivation Re 2 Reynolds number after the flow derivation Re L Reynolds number in the lateral

Introduction
Microirrigation is the frequent application of small quantities of water on or below the soil surface as drops, tiny streams or miniature spray through emitters or applicators placed along a water delivery line.It encompasses a number of methods or concepts; such as bubbler, drip, trickle, mist or spray and subsurface irrigation (ASAE EP 2019).Microirrigation might enhance plant growth, yield and crop quality, due to an improved water distribution along the row.Moreover, higher salinity waters can be used in comparison with other irrigation methods without greatly reducing crop yields (Ayars et al. 2007).
In general, the main goal of the design, maintenance and management of microirrigation systems is to achieve a target uniformity by controlling emitter flow rate variation.Poor designs of pipe systems may decrease the water application uniformity (Baiamonte 2018), leading to reductions in crop yield and quality (e.g.Guan et al. 2013a).A decrease of flow rate uniformity may also intensify soil salinization (e.g.Guan et al. 2013b), deep water penetration and leaching loss of nutrients, resulting in nonpoint source pollution (Wang et al. 2014), because fertilisers and water are often supplied together.Therefore, a suitable design, maintenance and management of microirrigation installations is crucial not only for improving water use efficiency, which leads to energy savings and cost reduction, but also for ensuring the sustainability of agricultural production (Wang et al. 2020).
Irrigation subunits cover predefined limited portions of the total surface of the installation for ensuring the uniformity of flow rates with suitable pipe diameters.The hydraulic design of the irrigation subunits consists, among others, in the determination of parameters such as the pipe diameters, and the required pressure at the beginning of the subunit.Thus, in the design of drip irrigation laterals with noncompensating emitters, a well-accepted practice consists in limiting the variation of the pressure head to about ± δ of its nominal value along the lateral line, where δ can be assumed to be around 10%, depending on the accepted flow rate variability of the emitters along the laterals (Baiamonte 2018).
The exponent of the emitter pressure-flow rate curve, or the compensation range in compensating emitters, allows the definition of the maximum allowable pressure variation in the subunit for a given maximum predefined desirable flow rate variation between emitters.Therefore, accurate head loss estimation in manifold and lateral lines is of crucial importance for a correct design.Energy losses are split, in general, into friction and local losses, respectively.Friction losses are due to viscosity.Local losses are caused by the modification of the flow streamlines.
The relevance of local losses in microirrigation systems design has been reported by several authors (Al-Amoud 1995;Juana et al. 2002a, b;Provenzano and Pumo 2004;Provenzano et al. 2005Provenzano et al. , 2007Provenzano et al. , 2014Provenzano et al. , 2016;;Demir et al. 2007;Yildirim 2007Yildirim , 2010;;Rettore Neto et al. 2009;Gomes et al. 2010;Perboni et al. 2015;Vilaça et al. 2017;Bombardelli et al. 2019;Sobenko et al. 2020).The presence of emitters along the lateral, as well as of connectors along the manifold, changes the inner flow streamlines, inducing a local turbulence causing additional local head losses other than friction losses (Juana et al. 2002a, b).For on-line emitters, a minor singularity is caused by the protrusion of the barbs into the flow.In integrated in-line emitters, the insertion diameter is smaller than the inner diameter of pipe, and this causes the contraction and subsequent enlargement of the flow paths (Wang and Chen 2020).Numerous studies have evaluated the local losses caused by emitters under different scenarios and considering different modelling approaches (e.g.Bagarello et al. 1997;Provenzano et al. 2005Provenzano et al. , 2007Provenzano et al. , 2014Provenzano et al. , 2016;;Martí et al. 2010;Palau-Salvador et al. 2006;Provenzano and Pumo 2004;Wang et al. 2018Wang et al. , 2020;;Nunes Flores et al. 2021;Rettore Neto et al. 2009;Perboni et al. 2014Perboni et al. , 2015)).However, the local losses caused by start connectors in microirrigation manifolds have received less attention.
Start connectors are employed to couple each lateral into its manifold.The local losses caused by them can be split, in general, in two components.On the one hand, the protrusion area of the connector into the manifold leads to the contraction and subsequent expansion of the flow streamlines along the manifold.This loss is highly influenced by the connector geometry (Vilaça et al. 2017).On the other hand, the second component of the local loss occurs in the corresponding lateral inlet, when water flows through the connector into the lateral.In this case, one or more changes in the flow section take place, inducing additional local head losses in the lateral (Sobenko et al. 2020).Rodríguez-Sinobas et al. (2004) presented an experimental and theoretical study neglecting the derivation of flow rate through the lateral pipe.Royuela et al. (2010) measured the head losses caused in the lateral inlet by connectors coupled with intake collar.Gyasi-Agyei (2007) studied the uncertainties in the lateral parameters at field-scale and quantified the head loss in the lateral inlet by means of a resistant coefficient.A difficulty associated to the analysis and determination of the head loss in the connection lateral-manifold is that connectors are not standardized and, therefore, the obstructed area in the manifold and the connector form can be very variable.
Several models were proposed in the past years for estimating such head losses, mainly relying on dimensional analysis.Zitterell et al. (2014) proposed a model to estimate the local loss occurring when water flows through small connectors used to attach microtubes into laterals.Vilaça et al. (2017) assessed five types of connectors, and proposed an equation for estimating the local head loss caused in the lateral inlet (noted hereinafter as hf L , hf c in the original notation).Further, these authors also assessed separately the component of the local head loss along the manifold (noted hereinafter as hf M , hf L in the original notation) and proposed a predicting equation.Connectors caused increases in the total head loss along the manifold between 2 and 14%.Further, they caused additional losses around 7% of the total head loss along the lateral.Bombardelli et al. (2019) developed other models for predicting local losses in lateral-manifold junctions, union connectors, union valves and start valves.Sobenko et al. (2020) combined the datasets of the previous studies (55,331 records) to provide a generalized model.These authors proposed two models, namely a full model and a simplified model.Despite presenting a slightly lower accuracy, the authors recommended to use the simplified model, because it would require fewer parameters.According to these authors, the equations proposed by Zitterell et al. (2014) and Vilaça et al. (2017) underestimated most hf L values.The local losses through the connectors ranged approximately between 6 and 21% of the total head loss.The maximum lateral length decreased between approximately 4% and 12%, due to the effect of hf L .Bombardelli et al. (2021) developed a general model based on dimensional analysis to predict local losses caused by fittings commonly used in microirrigation subunits.Further, specific models to each type of fitting were also obtained.The error ranges fluctuated between connector types, especially due to the differences in their geometry.According to these authors, connectors should be designed to avoid sudden flow expansions because these caused the largest minor losses.
Artificial neural networks (ANN) and gene expression programming (GEP) have been widely applied in many scientific branches.ANN can be efficient in the modelling of nonlinear and complex systems, even relying on noisy data.According to Koza (1992), Genetic Programming (GP) is a generalization of Genetic Algorithms (GA).In GP, individuals are nonlinear entities of different sizes and shapes.GEP is comparable to GP, but the creation of genetic diversity is simplified since genetic operators work at the chromosome level (Ferreira 2001a, b).
Concerning the application of machine learning approaches for assessing local head losses caused by microirrigation start connectors, Sobenko et al. (2020) trained feed-forward back-propagation ANNs relying on the same data base and input combinations as the mentioned models based on dimensional analysis.Bombardelli et al. (2021) compared dimensional analysis with machine learning models, specifically with artificial neural networks (multilayer perceptron, MLP), support vector machines (support vector regression, SVR) and an ensemble of decision trees (extreme gradient boosting, XGB).Semiempirical models based on dimensional analysis were less accurate than machine learning-based models.The MLP model presented the best performance, although it required a considerable amount of data and an extensive calibration of the hyperparameters.The SVR model proved computationally expensive, and the estimator was more compromised by noise.The XGB model achieved the lowest computational cost and provided good accuracy with the test set, but was less related to the theoretical power-law function expected in these hydraulic phenomena.
So far, both components of the local loss are mainly measured separately.Accordingly, connectors are plugged for assessing the head loss along the manifold.In a second stage, the complete flow rate is derived through the connector for assessing the component of head loss in the lateral inlet.The current study presents an alternative testing facility aiming at measuring the local head losses caused by the connectors along the manifold and in the lateral inlet under more realistic operating conditions, i.e. measuring both components of the head loss simultaneously.Thus, first, based on such experimental approach, ANNs models are used to identify and assess patterns in both components of the local head loss, while using a robust validation of the models.Second, ANNs are compared with GEP, which are also used to provide simple mathematical expressions relating the input and output variables of the model.

Experimental procedure
The experimental values of the local losses were obtained from an automated testing facility shown in Fig. 1.This bench basically consists in a closed circuit, were water is recirculated using a pump from a tank through a manifold with an inserted lateral pipe, coupled with a start connector.Pressure taps are installed at strategic locations and measurements are monitored.Flow rates are also monitored and controlled through different valves.Different pipe diameters of manifold and connector geometries are tested.
The aim of this experimental procedure was to reproduce actual hydraulic working conditions of the set manifold-lateral, instead of isolating the measurement of the two components of local loss caused by the start connector, as in the approach of Vilaça et al. (2017).These authors focussed first on the measurement of the local losses along the manifold plugging the start connectors of the laterals.Second, they estimated the local losses that occur when water flows from the manifold into the lateral through the connector.Therefore, they installed pressure taps at the end of the lateral line and in the manifold at the position where the start connector was attached to the manifold.The complete flow rate of the manifold was derived through the studied connector-lateral.In this study, the proposed facility pursues the simultaneous measurement of both components of the local loss, which might differ from the previous approach mainly in two issues.First, the derivation of flow through the lateral might alter the local loss caused by the protrusion area of the connector and the subsequent contraction and expansion of the flow streamlines.Second, if the flow rate is split in the protrusion area, instead of being completely derived through the lateral, the contraction of the streamlines at the inlet of the connector might also follow a different pattern.However, it seems difficult to completely split the measurement of both types of local losses in both approaches.
Two polyethylene (PE) manifolds with nominal diameters 32 (DN32) and 40 (DN40) mm were assessed, respectively.In each case six connector geometries were evaluated when used to couple a single PE lateral pipe with nominal diameter of 20 mm into the manifold.The manifold was set up in horizontal position and aligned.These six geometries correspond strictly to only three connector types coupled with and without gasket, respectively, but lead to different obstructed cross-sections in the manifold.The inner diameters of the pipes were measured using a digital calliper, with resolution 0.01 mm, repeating the measurement in ten stretches of the original unaltered sample.The average inner diameters were 35.38 (DN40), 27.01 (DN32) and 17.55 (DN20) mm, respectively.For each model of connector, three units per sample were tested.
The geometrical characteristics of irrigation devices can be complex, which complicates the identification of the relevant physical information that must be part of the models (Zitterell et al. 2014;Bombardelli et al. 2021).However, in this study the geometrical description of the lateral connectors was simplified as follows: The insertion of the connectors caused an obstruction in the manifold.Accordingly, this obstruction, defined as s/S, where s is the projection of the area occupied by the connector in the crosssection of the pipe S, was basically used to describe the geometry of each connector.The values of s/S of the tested connectors range between 0.1330 and 0.4050.The measurement of the obstructed cross-section fraction was carried out by means of image analysis, as shown in Fig. 2.These measurements were obtained by sampling 10 units.
Two electromagnetic Promag 10 Endress + Hauser flowmeters were used to measure and monitor the flow rates in the manifold and lateral, respectively.The expanded uncertainty of the flow meters was less than 0.5%.The pipe flow rates were limited by the flow-meters measuring capacity.In the lateral (flow-meter size DN8) these rates ranged between 0.02 10 -3 m 3 /s and 0.5 10 -3 m 3 /s, whereas in the manifold (flow-meter size DN15) they ranged between 0.083 10 -3 m 3 /s and 1.67 10 -3 m 3 /s.In both cases, the instruments were installed downstream the connectors, i.e. at the end of the manifold and of the lateral, respectively, before the control valves.
The piezometric head difference between the points (1) and ( 2) of the installation was measured by means of a Del-tabarS Endress + Hauser differential transducer of 100 mbar.The pressure drop between the points (1) and (2 ') was measured with a differential transducer of 200 mbar.In both cases the transducer presented an uncertainty of 0.075% of the full scale.Tap (1) was placed 2 m before the lateral connection, while tap (2) was placed 3 m downstream of the connection in the manifold (i.e.distance between sensor inlets of 5 m).Tap (2') was placed at the end of the lateral, 2 m downstream of the connection (i.e.distance between sensor inlets of 4 m).The location of the pressure taps was fixed avoiding very short distances, which may cause unstable measurements, as well as very long distances, which may lead to too high friction losses.
Finally, water temperature was monitored by a temperature transmitter, with resolution of 0.1 °C, measuring range from 0 to 40 °C, with uncertainty lower than 0.5% of the full scale.Temperature was used to calculate water density and kinematic viscosity.The pressure and flow rate signals of the sensors, together with a temperature signal of and additional sensor, were digitalized using a National Instrument data acquisition system.

Local head loss calculation
The local head loss due to the connector was calculated indirectly applying Bernoulli's theorem between the pressure sensor taps as follows: where hs 1-2 is the local head loss between points 1 and 2; the square bracket of Eq. ( 1) is the direct record measured by the pressure differential transducer, i.e. the piezometric difference, connected in the manifold between tap 1 before the insertion (subscript 1 in variables) and tap 2 after the insertion; hr 1-2 is the friction loss between the points 1 and 2; V 1 and V 2 are the flow velocity values in points 1 and 2, respectively, and g is the acceleration of gravity.Likewise, the same equation was used between the points 1 and 2'.The speed term was calculated as follows : where V i is the velocity in point i; Q i is the flow rate of the corresponding stretch, and D is the internal diameter of the pipe.Further, it was necessary to calculate the friction losses along the involved stretches of the pipes.Thus, the friction losses were calculated applying the general Darcy-Weisbach equation.For this it was previously necessary to calibrate the friction factor for each pipe.Therefore, different measurements were made with the differential transducer between taps (1) and ( 2), before the connector/lateral were inserted into the manifold so that only friction losses took place between those points.The friction losses were calculated again based on the Bernoulli's equation, as the difference ( 1) Outliers were deleted from the database.Table 1 shows the pruned measured ranges of the most relevant variables per connector.The number of finally available patterns per connector is shown in Table 2.The number of patterns is different depending on the output considered.

Inputs of the models
Different input-output combinations were defined to assess the relevance of the inputs for each target output using ANNs.Table 3 presents the different combinations assessed.On the one hand, three outputs were evaluated, namely the component of the head loss along the manifold (hs M ), the component of the head loss in the lateral inlet (hs L ) and the addition of both (hs combined ).Apart from assessing both components of the local loss separately, the addition of both  was also considered, because (i) as mentioned, it might be difficult to split completely the measurement of both, and (ii) the total head losses in lateral and manifold is required for the design of irrigation subunits.For each output exactly the same input combinations were assessed.
Regarding the inputs, nine combinations were defined to find out general trends in the hydraulic performance of the parameters.The potential inputs considered were flow velocity, flow rate and Reynolds number before the protrusion (V 1 , Q 1 and Re 1 , respectively), flow velocity, flow rate and Reynolds number after the protrusion (V 2 , Q 2 and Re 2 , respectively), flow velocity, flow rate and Reynolds number in the lateral (V L , Q L and Re L , respectively), obstructed cross section rate (s/S), friction losses in the manifold stretch before the protrusion (HR 1 ), friction losses in the manifold stretch after the protrusion (HR 2 ) and friction losses in the lateral pipe (HR L ).Input combination 9 (ANN9) includes all the inputs to assess the effect of excluding any input in the rest of input combinations.Input combinations 1 to 3 (ANN1, ANN2 and ANN3) aimed at comparing the effect of flow velocity, flow rate and Reynolds number in the mapping ability of the models.The three parameters are mutually related and might provide similar information to the model.Therefore, combinations 4 to 8 just consider flow velocity and omit flow rate and Reynolds number.The definition of model 4 (ANN4), in comparison to model 1, aimed at assessing the influence of V L .Combination 8 (ANN8) omits s/S to assess the relevance of this geometrical parameter.Combinations 5 to 8 (ANN5, ANN6, ANN7 and ANN8) assess the effect of including friction losses in the previous (HR 1 ) and sequent (HR 2 ) stretch of the manifold, as well as in the lateral pipe (HR L ).The definition of the previous input combinations aims at assessing the effect of each input type, rather than to find out the optimum input combination relying on these data series.Based on the results of ANNs, the most relevant combinations were assessed subsequently using GEP, too.

Artificial neural networks
This study considers feed forward neural networks with back-propagation.Neurons are based on the model by Haykin (1999), while the Levenberg-Marquardt algorithm (Hagan et al. 1996) was used to supervise the training of the networks.The used activation function is the hyperbolic tangent sigmoid function (tansig), and linear output neurons are considered.Over-fitting is avoided through the earlystopping procedure (Bishop 1995).
Different ANN architectures are trained and tested for each data set partition, assessing architectures with one hidden layer and 1 up to 20 hidden neurons each.Multilayer feedforward networks with as few as one hidden layer using arbitrary squashing functions are capable of approximating any measurable function from one finite dimensional space to another to any desired degree of accuracy, provided sufficiently many hidden units are available (Hornik et al. 1989).Each architecture is trained 20 times intending to offset the initial random assignment of the weights when the training algorithm is initialized.Finally, all source data are scaled.A detailed description of the ANN implementation can be found in previous papers (e.g.Martí et al. 2013b).ANNs were implemented using the software Matlab version 2021b (The MathWorks, Inc., Natick, MA, USA).

Gene expression programming
The application of the GEP procedure requires the determination of the fitness function, the set of terminals T and the set of functions F, the length of head (h) and genes per chromosome, the linking function and the genetic operators.The root mean square error (RMSE) is used as fitness function.
Once the subtrees are built with chromosomes and genes, the addition linking function is applied to link the subtrees and provide the genetic expression.More details about the GEP application can be found e.g. in Shiri et al. (2012).GEP was implemented using the software GeneXproTools 5.0 (Gepsoft Ltd., Capelo, Portugal).

Data set partitions
In most cases a cross-validation strategy is enough for ensuring robust performance assessment (Kohavi 1995).Cross-validation consists in dividing the whole dataset into a training set and a test set and to repeat this procedure of partitioning and testing until the complete dataset is used for training and testing.The main algorithms for the definition of the two complementary subsets according to cross-validation include random sub-sampling, k-fold cross-validation and leave-one-out cross-validation (Shao 1993;Stone 1974).
In this paper k-fold validation was applied reserving in each fold the complete series of a different connector for testing.For a suitable assessment of the generalizability of the model, the training data could not include patterns from the testing connector.Further, in order to assess the effect of separating series of DN32 from DN40 or not, the k-fold validation was repeated three times as follows: (i) considering a 12-fold validation, where DN32 and DN40 series were pooled together, (ii) considering a 6-fold validation for DN32 series, where models were trained and tested exclusively with data of DN32 connectors, and (iii) a 6-fold validation for DN40 series, trained and tested exclusively with data of DN40 connectors.Thus, 259,200 ANN models were trained and tested for covering the mentioned 24 partitions, 3 outputs, 9 input combinations, up to 20 hidden neurons per input combination and 20 repetitions per architecture.

Performance evaluation
Several error parameters were calculated to assess the performance accuracy of the proposed methods.The relative root mean squared error (RRMSE), and the mean absolute error (MAE) were obtained according to Eqs. 3 and 4, respectively, being x i the actual value of the head loss and xi the prediction.n was the total number of data in the matrix.The RRMSE is unitless.The MAE is expressed in m.
Finally, the squared correlation coefficient R 2 was calculated as follows, where x i and  xi are the standard deviations of observed and predicted values, respectively:

Analysis of friction factor and local losses
In order to estimate the friction losses, the friction factor was fitted for the manifold and lateral pipes, respectively, through an equation relying on the Reynolds number.Thus, the obtained expressions for the friction factors are shown in Table 4.
These equations were used to estimate f in the Darcy-Weisbach equation.Subsequently, the corresponding calculated friction losses were used to estimate the local losses of the connectors based on Eq. (1).
Figures 3, 4, 5 and 6 present the estimated components of the local loss caused by each connector along the manifold and in the lateral inlet, respectively.Each plot presents three rows, one per connector, where the local losses along the manifold (hs M ) are represented vs. Re at the manifold before the derivation (Re 1 has been renamed as Re M ), column 3, while the local losses in the lateral inlet (hs L ) are represented, respectively, vs. Re at the lateral (Re L ), column 1, and vs. Re at the manifold before the derivation, column 2. Figures 3 and 4 correspond to DN32, while Figs. 5 and 6 correspond to DN40.In general terms, three trends can be stated.First, hs M is considerable lower than hs L (range of 0-0.25 m vs. 0-2 m, respectively).Second, hs M ranges are considerably lower for DN40 than for DN32.Similarly, hs M increases with s/S within both diameters.This could be expected, because a higher obstruction causes a higher contraction and subsequent expansion of flow streamlines.As stated by Vilaça et al. (2017), this component of the local loss is influenced by connector geometry.On the other hand, hs L does not decrease with DN40.Further, it does not decrease for a decreasing s/S.It seems to depend rather on the combination of Re L and Re M .Accordingly, the protrusion ratio seems not to affect hs L , due to the nature of these local losses.Third, in agreement with Vilaça et al. (2017), there is a correlation between hs L and Re L , as well as between hs M and Re M (those authors correlated hs generically with Re, because the complete flow rate of the manifold was derived through the lateral, i.e. the flow rate was not split).Similarly, other studies found a correlation between hs L and Q (Sobenko et al. 2020) and between hs L and v (Bombardelli et al. 2021).However, thanks to the new experimental approach, where a fraction of the flow rate in the manifold is derived through the lateral, it can be stated that these correlations might also depend on Re M , i.e. on the flow conditions in the manifold.Thus, hs L might depend on the combination of Re L and Re M .As mentioned, in these plots each marker type (M1 to M6, respectively) corresponds to a position of the manifold valve, while each point within each marker type series corresponds to a different position of the lateral valve.M1 corresponds to the position of the valve in the manifold providing the maximum flow rate in the manifold, while the following positions (M2 to M6) provide, respectively, a decreasing flow rate through the manifold.It can be stated that any hs L value can be caused by different Re L values, depending on which Re M is taking place, too.In contrast to previous studies, where the complete flow of the manifold is derived through the lateral, these results might demonstrate that the flow conditions of the manifold should also be considered for estimating hs L .Finally, it can be also stated that hs L tends not to zero if Re L tends to zero, but Re M does not.There is a remanent hs L value between 0 and 0.75 m (connectors 1, 2, 4, 6), 0 and 0.5 m (connector 3), 0 and 0.4 m (connectors 7,8,9), 0 and 0.3 m (connectors 10, 11, 12).There might be two reasons for this.First, even for very small flow rates in  the lateral (near to 0), there is a remanent value of hs L due to the nature of this loss component, the magnitude of which also depends on Re M .This remanent presents a higher value than the corresponding hs M values, e.g.hs L around 0.75 m for M1 in connector 1 vs. a maximum hs M around 0.25 m.Accordingly, the head loss component due to the protrusion alone could not cause the total remanent hs L around 0.75 m, which might be due to the other component, too.Second, these results might be due to the position of pressure tap 1, which is used simultaneously to estimate hs M and hs L .Accordingly, the measurement of both components cannot be split completely, i.e. the measurement of both components is including simultaneously a common fraction.Thus, the measurement of hs L includes a fraction of loss due to the protrusion, which might correspond strictly to hs M according to the definition of the nature of both components.However, as mentioned, this remanent presents a higher value than the corresponding hs M values.Accordingly, the value of the head loss component due to the protrusion is influenced by the flow derivation, causing eventually a higher turbulence than without flow derivation, i.e. than with plugged connectors.So, a part of the head loss caused by the protrusion might be attributed to the second component.A position of pressure tap 1 exactly in the protrusion segment would have caused unstable measurements, due to the turbulence that takes place in that segment.Hence, it might be difficult to completely split the measurement of both components, because this second component is linked to flow conditions in lateral and manifold, as well as to the protrusion.Similarly, the measurement of hs M would have provided different results if the connector would have been plugged.

Comparison of input combinations and data splitting scenarios in ANN models
Tables 5 and 6 present the average performance indicators of each input-ouput combination of the ANN models for DN32 (connectors 1 to 6) and DN40 (connectors 7 to 12), respectively.The category 'trained with all' involves that all connectors, namely 1 to 12, excluding the testing one, were used for training.In this case, the average results correspond only to the testing connectors of that DN.The category 'trained with DN32' involves that only the connectors 1 to 6, excluding the testing one, were used for training.Similarly, 'trained with DN40' involves that only the connectors 7 to 12, excluding the testing one, were used for training.
Attending to the indicators of models with target hs M in Table 5, there are only slight differences between models trained with all data and those trained with DN32 series.In both cases, the optimum input combinations are ANN5, ANN6, ANN7 and ANN9, with RRMSE around 0.04 (the optimum RRMSE 0.0350 corresponds to ANN5, in the scenario trained with all, while the optimum RRMSE 0.0363 corresponds to ANN7, in the scenario trained with DN32).
The worst indicators correspond to ANN3 in both cases with RRMSE around 0.43-0.44.ANN9, which includes all possible inputs does not present the lowest error, because unnecessary inputs might be introducing noise in the model.Thus, the inputs flow velocity, friction head losses and protrusion area seem to be the most relevant.The consideration of flow velocity seems to be more suitable than flow rate and Reynolds number.Further, the parameters referred to the lateral (V L , HR L , excluded in ANN7) seem to be less important for modelling the losses in the manifold, as could be expected.The conclusions are confirmed on the basis of the other performance indicators.
Attending to the indicators of models with target hs L in Table 5, there are more marked differences between models trained with all data series and models trained with series of DN32.However, there is no clear trend about which strategy is preferable.The optimum input combination corresponds in both cases to ANN6 (RRMSE of 0.0641 trained with all vs. 0.0597 trained with DN32).When the models are trained with all patterns, the worst input combinations correspond to ANN3 (RRMSE of 0.2597) and ANN8 (RRMSE of 0.2369).When the models are trained with DN32 patterns, the worst input combinations correspond to ANN8 (RRMSE of 0.2787) and second to ANN3 (RRMSE of 0.1746).Again, the comparison of ANN1, ANN2 and ANN3 indicates that the consideration of flow velocity as input might be preferable to flow rate and, especially to Reynolds number.ANN9 does not present the best indicators despite including all the inputs, again.Models ANN5, ANN6 and ANN7, with RRMSE in the range 0.06-0.1,seem to be the most accurate, too.Thus, the inclusion of flow velocity, friction head losses and protrusion area seem to be crucial, again.The omission of HR L among the inputs also seems to improve the estimation of hs L , around 0.02 of RRMSE.
Attending to the indicators of the models with target hs combined in Table 5, the ranges of the indicators are closer to those of the hs L models than to those of the hs M models, because the ranges of the targets are more similar, i.e. the values of hs M are considerably lower to those of hs L .Thus, the trends with hs combined are similar to those of hs L .When the models are trained with all patterns, the optimum input combination correspond to ANN6 (RRMSE of 0.0702).When the models are trained with DN32 patterns, the best indicators correspond to ANN7, ANN6 and ANN5 (RRMSE of 0.0613, 0.0646 and 0.0665, respectively).Regarding the worst indicators, they correspond to ANN2, ANN3 and ANN8 (0.2209, 0.2205 and 0.2181, respectively) when they are trained with all patterns.When being trained with DN32 patterns, the worst indicators correspond to ANN3 and ANN8 (RRMSE of 0.2232 and 0.24776, respectively).Thus, similarly to the previous outputs, flow velocity seems to be preferable to flow rate and Reynolds number (RRMSE of 0.1109 vs. 0.2209 and 0.2205, respectively), while excluding s/S reduces the model accuracy.Further, introducing friction head losses as input contributes to reduce the estimation error.The difficulty of splitting the measurement of hs L and hs M lead to assess the suitability of modelling the addition of both (hs combined ).However, those models do not present a higher estimating accuracy.Anyway, the addition of the estimation errors of both components separately might lead to a higher error than the direct estimation of hs combined .Finally, the analysis of the MAE values corresponding to the three target outputs reveals that hs M presents a lower error range (0.002-0.023 m) in comparison to hs L (0.039-0.183 m) and hs combined (0.046-0.171 m), as might be expected, because, as was seen in Fig. 3, hs M presents clearly lower ranges than hs L .Attending to Table 6, which corresponds to the average performance of the models tested with DN40 series, i.e. connectors 7 to 12, the following conclusions might be drawn in comparison to Table 5.First, similar results can be found in terms of input combination ranking, i.e. flow velocity is preferable to flow rate and Reynolds number (0.4311 vs. 0.8211 and 0.8017 of RRMSE, respectively, for hs M ; 0.3532 vs. 0.3905 and 0.4590 of RRMSE, respectively, for hs L ).Further, the optimum input combinations seem to be ANN5, ANN6 and ANN7, i.e. those including flow velocity, protrusion ratio and friction head losses as inputs.Second, the range of the indicators is considerably worse for DN40 than for DN32 (0.3690-0.8904 vs. 0.035-0.4297 of RRMSE, respectively, for hs M ; 0.2980-0.5241vs. 0.0641-0.2787 of RRMSE, respectively, for hs L ; 0.3449-0.5317vs. 0.0702-0.2476 of RRMSE, respectively, for hs combined ).In the case of hs M , this worsening might be due to the lower ranges of the measured head loses in connectors 7-12 (DN40) in comparison to 1-6 (DN32).This fact might also explain that, in contrast to Table 5, the models trained with all patterns (i.e.including also DN32 patterns) lead to more accurate estimations than the models trained exclusively with DN40 patterns.On the other hand, in Table 5, including DN40 patterns in the training process did not involve any improvement for estimating the head losses of DN32.
Figures 7 and 8 present, respectively, the scatter plots of hs M and hs L estimations based on ANN5 trained with all available patterns, excluding the testing ones.The plot was split per DN.Further, the ranges of the x and y corresponding labels were adapted for ensuring a suitable visualization, because the head losses caused in DN40 present a considerably lower range than in DN32.Each marker represents a different connector.In Fig. 7 it can be observed that the connectors 1 to 6 (DN32) present better adjustment to the 1:1 line than connectors 7 to 12 (DN40).The ANN models present a lower accuracy for estimating the low ranges of the hs M component of the local loss, although the accuracy for low hs M ranges is still high in DN32 in contrast to DN40.In DN32 the models present a similar estimation accuracy for all the ranges of the connectors, while in DN40 the models show a clear underestimation pattern for connectors 8 and 11 and a clear overestimation pattern for connector 7.
In Fig. 8, in agreement with the average indicators discussed above, the adjustment of the models to the 1:1 line is worse for estimating hs L than it was for hs M , despite that it is again considerably better for DN32 than for DN40.In this case the order of magnitude of hs L is similar for both DN.In DN32, the models show an underestimation pattern for connector 2, an overestimation pattern connector 3, while in the rest of connectors there is not a clearly marked bias.In DN40, the models present an underestimation pattern for connectors 8 and 10, while they present an overestimation pattern for connectors 9, 11 and 12. 1:1 con.7 con.8 con.9 con.10 con.11 con.12 DN40 DN32 Fig. 8 Scatter plot of ANN5 estimations of hs L present higher estimation accuracy.Within each DN, the estimation accuracy fluctuates among connectors.Comparing ANN vs. GEP, it can be stated that ANNs were more accurate than GEP in DN32 (respectively, RRMSE ranges of 0.0242-0.0748vs. 0.0340-0.1340for hs M ; RRMSE ranges of 0.0623-0.2183vs. 0.220-0.538for hs L ; RRMSE ranges of 0.0610-0.2015vs. 0.272-0.386for hs combined ).In DN40 ANNs were less accurate than GEP for hs M (respectively, RRMSE ranges of 0.1219-0.891vs. 0.039-0.086),but they were more accurate than GEP for hs L (respectively, RRMSE ranges of 0.1856-0.5119vs. 0.345-0.673),while both presented a similar performance for hs combined (respectively, RRMSE ranges of 0.2677-0.5256vs. 0.256-0.600).This table also presents the resistant coefficient of each connector, i.e. the constant that should be multiplied by the kinetic head to estimate the local head loss.Moreover, two resistant coefficients are provided, i.e. one based on the estimated local losses in the lateral inlet (K L ) and one based on the addition of the estimated local losses in the lateral inlet and along the manifold (K combined ).It can be observed that each connector presents a lower resistant coefficient in DN40 than in DN32, probably because s/S is markedly lower.However, within each DN there is no direct correspondence with the protrusion ratio, i.e. a higher s/S does not involve a higher K.This might be due to the nature of the loss component in the lateral inlet.The geometrical parameter s/S might be not enough to accurately predict this type of loss.Further, as mentioned above, this component also relies on the specific combination of flow conditions in lateral and manifold.

GEP expressions
GEP can generate a simple mathematical expression relating the input and output variables of the model.These expressions might be useful for designers, because, in contrast to other approaches, such as ANN, they might be applied more easily.Table 8 presents the resulting GEP expressions corresponding to models 1-3 (ANN1), 13-15 (ANN5), 25-27 (ANN9).Thus, based on these input-output combinations and the training matrices used to feed the models, the GEP algorithms selected the most representative inputs and provided a final expression.
Regarding models 1-3, the final GEP expressions rely on the initial inputs, i.e. flow velocity and protrusion ratio.However, in models 13-15 and 25-27 some inputs are discarded by GEP.In model 13 HR 2 , V 2 and V L are discarded for estimating hs M ; in model 14 HR 2 and V 1 are discarded for estimating hs L, while in model 14 HR 2 and V 2 are discarded for estimating hs combined .Finally, attending to models 25-27, which include all possible inputs, GEP selects the following inputs based on the current data series.For estimating hs M the selected inputs would be V 2 , V L , Q 1 , Q 2 , s/S, HR 1 , HR 2 and HR L .For estimating hs L the selected inputs would be V 1 , V 2 , V L , s/S, HR 1 , HR 2 and HR L .For estimating hs combined the selected inputs would be V 1 , V L , Q 1 , Q 2 , s/S, HR 1 , HR 2 and HR L .It is important to highlight that this input selection and the resulting equation are based on the specific data series used in this study, which involves a very specific definition of both components of the head loss.The equation that should be selected in practice will depend on the availability of inputs.Models 1 to 3 require less inputs, and can be applied more easily, but might be slightly less accurate.If possible, models 13 to 15, and 25 to 27 should be used.However, the development of predicting tools with wide generalization ability is beyond the scope of the paper.

Conclusions
This paper presents a procedure to assess the local head losses caused by lateral connectors in microirrigation manifolds.The proposed experimental procedure aims at reproducing actual hydraulic working conditions of the set manifold-lateral, instead of isolating the measurement of the two components of the local losses caused by the connector.Different input-output combinations were assessed using ANN in order to analyse the hydraulic performance of the system.Further, different robust strategies were adopted for partitioning the dataset based on k-fold validation to find out the optimum training strategy of the models.Finally, GEP was compared with ANN and used to provide simple expressions for estimating the two components of the studied local losses.
The following general conclusions might be drawn.First, hs M is considerably lower than hs L .Second, hs M ranges are considerably lower for DN40 than for DN32, i.e. hs M increases with s/S, because a higher obstruction causes a higher contraction and subsequent expansion of flow streamlines.On the other hand, hs L does not decrease for a decreasing s/S.Accordingly, the protrusion ratio seems not to affect hs L , due to the nature of these local losses.Third, there is a correlation between hs L and Re L and between hs M and Re M .However, it can be stated that the correlation between hs L and Re L might also depend on the flow conditions in the manifold before the derivation.Any hs L value can be caused by different Re L values, depending on which Re M is taking place, too.Accordingly, the flow conditions of the manifold should also be considered for estimating hs L .Finally, it can be also stated that hs L tends not to zero when Re L tends to zero, but Re M does not.So, even for very small flow rates in the lateral (near to 0), there might be a remanent value of hs L due to the nature of this loss component, whose magnitude also depends on Re M .On the other hand, these results might be due to the position of pressure tap 1.Thus, the measurement of hs L includes a fraction of loss due to the  15 protrusion.However, the value of the head loss component due to the protrusion might be influenced by the flow derivation, causing eventually a higher turbulence than without flow derivation.So, a part of the head loss caused by the protrusion might be attributed to the second component.Hence, it might be difficult to completely split the measurement of both components, because this second component is linked to flow conditions in lateral and manifold, as well as to the protrusion.Similarly, the measurement of hs M would have provided different results if the connector would have been plugged.DN32 connectors and hs M present more accurate estimates.The optimum input-output combinations are ANN5, ANN6 and ANN7.The worst indicators correspond to ANN3 and ANN8.The inclusion of flow velocity seems to be more suitable than flow rate or Reynolds number.Crucial input parameters are flow velocity and protrusion ratio.The inclusion of friction head loss as input also improves the estimating accuracy of the models.The range of the indicators is considerably worse for DN40 than for DN32.In the case of hs M , this worsening might be due to the lower ranges of the measured head loses in connectors 7-12 (DN40) in comparison to 1-6 (DN32).This fact might also explain that the models trained with all patterns (i.e.including also DN32 patterns) lead to more accurate estimations for connectors 7 to 12 than the models trained exclusively with DN40 patterns.On the other hand, including DN40 patterns in the training process did not involve any improvement for estimating the head losses of DN32 connectors.The difficulty of splitting the measurement of hs L and hs M leads to assess suitability of modelling the addition of both (hs combined ).However, those models do not present a higher estimating accuracy.In any case, the addition of the errors in the estimation of both components separately might lead to a higher error than the direct estimation of hs combined .
Within each DN, the estimation accuracy fluctuates among connectors.Comparing ANN vs. GEP, it can be stated that ANN were more accurate than GEP in DN32.In DN40, ANN were less accurate than GEP for hs M , but they were more accurate than GEP for hs L , while both presented a similar performance for hs combined .Finally, GEP was used to provide simple expressions for estimating the studied components of the local head loss.The equation that should be selected in practice will depend on the availability of inputs.

Fig. 1
Fig. 1 Scheme of the testing facility (circled and red 1, 2, and 2' represent pressure measuring points)

Fig. 3 Fig. 4
Fig.3Local head loss in lateral inlet and along the manifold for connectors 1 to 3 in DN32

Fig. 5
Fig. 5 Local head loss in lateral inlet and along the manifold for connectors 7 to 9 in DN40

Fig. 6
Fig. 6 Local head loss in lateral inlet and along the manifold for connectors 10 to 12 in DN40

Table 1
Variation ranges of the runs performed

Table 3
Models and input combinations assessed

Table 4
Fitted friction factors for DN40, DN32 and DN20 f DN40 is the friction factor for DN40, f DN32 is the friction factor for DN32, f DN20 is the friction factor for DN20, and Re is the Reynolds number

Table 7
Indicators per connector for ANN and GEP model 5 and average resistant coefficients

Table 8
GEP expressions corresponding to models ANN 1 , ANN 5 and ANN 9