# Software for Monitoring the In-Service Efficiency of Hydraulic Pumps
## 3 Implementation of an Algorithm to Assess Pump Efficiency  
Free software packages that provide portability on any operating system have been selected to implement the software solution. The GNU GSL scientific software library provides robust interpolation, extrapolation and curve-fitting instruments and assessment of the approximation errors [31]. The free package Qt [32] was used to develop the graphic interface. The algorithm's implementation is structured on independent components, materialized by individual processes and tools in the command line, separated from the user interface. Figure 1 shows the data flow diagram of the software solution. A series of data are read from the additions \(H(Q)\), \(\eta_{P}(Q)\) and \(P_{m}(Q)\), made available from the manufacturer's catalog or experimental data. Based on these, the fitting coefficients \(h_{2}\), \(h_{1}\), and \(h_{0}\) are determined for the approximation of the \(H(Q)\) curve, which takes its shape from Equation (4). The fitting coefficients \(e_{2}\), \(e_{1}\), and \(e_{0}\) are determined for the approximation of the \(\eta(Q)\) curve, which takes its shape from Equation (11), and the fitting coefficients \(p_{3}\), \(p_{2}\), \(p_{1}\) and \(p_{0}\) are determined for the approximation of the \(P_{m}(Q)\) curve, which takes its shape from Equation (10). Using these coefficients, the current efficiency value \(\eta_{P}\) and the maximum efficiency value of the BEP (\(\eta_{P_{BEP}}\)) are determined, located on the vertex of the efficiency parabola. The desktop application generates and prints the QR code with the parameters of the hydraulic pathway, \(l_{s}\), \(d_{s}\), \(\lambda_{s}\), \(\zeta_{s}\)\(l_{d}\), \(d_{d}\), \(\lambda_{d}\), \(\zeta_{d}\). The static pressures measured during suction \(p_{s}\) and discharge \(p_{d}\) lines are input by the user in both smartphone and desktop applications, optionally accompanied by the volumetric flow rate running through the pump \(Q_{ms}\). The mobile phone application scans the coefficients of the hydraulic pathway from the printed QR code and, based on the measured values of the static suction pressure \(p_{s}\) and those of the discharge \(p_{d}\) computes the efficiency values \(\eta_{P}\) and \(\eta_{P_{BEP}}\) based on which  
Figure 1: Diagram of the data flow in the software system. they can diagnose the operating regime of the pump and return the red, yellow or green code using \(FLAG_COLOR\). Figure 2 shows the diagram of the efficiency assessment algorithm for constant speed hydraulic pumps--Algorithm 1. ```
1:\(HQ[]\gets read(HQ)\)\(\triangleright\)\(H(Q)\) data points
2:\(EQ[]\gets read(EQ)\)\(\triangleright\)\(\eta(Q)\) data points
3:\(PQ[]\gets read(PQ)\)\(\triangleright\)\(P_{m}(Q)\) data points
4:\(h[]\gets fit(HQ)\)\(\triangleright\) get 2 nd order polynomial coefficients
5:\(el[]\gets fit(EQ)\)\(\triangleright\) get 2 nd order polynomial coefficients
6:\(P[]\leftarrow fit(PQ)\)\(\triangleright\) get 3 rd order polynomial coefficients
7:procedure DIAGNOSTIC(\(p_{s}\), \(p_{d}\), \(Q_{ms}\))
8:\(\eta_{P},\eta_{P_{\mathit{BP}}}\leftarrow\eta(h,e,P)\)
9:if (\(\eta_{P}<1.05\eta_{P_{\mathit{BP}}}\)) then
10:if (\(\eta_{P}>0.9\eta_{P_{\mathit{BP}}}\)) then
11:\(FLAG_COLOR\gets GREEN\)
12:elseif (\(\eta_{P}>0.8\eta_{P_{\mathit{BP}}}\)) then
13:\(FLAG_COLOR\gets YELLOW\)
14:else
15:\(FLAG_COLOR\gets RED\)
16:endif
17:elseif (\(\eta_{P}<1.1\eta_{P_{\mathit{BP}}}\)) then
18:\(FLAG_COLOR\gets YELLOW\)
19:else
20:\(FLAG_COLOR\gets RED\)
21:endif
22:endprocedure
```  
**Algorithm 1** The assessment algorithm for hydraulic pump efficiency while operating at constant speed  
Figure 2: Diagram of the assessment algorithm for hydraulic pump efficiency while operating at constant speed.