## 2 Mathematical Model
### Application of the Analytical Approach to the Regulation of the Hydraulic System  
When the hydraulic system is sufficiently described by an analytical model and the coefficients of pipes in the individual branches are identified, those correlations may be used to regulate the system. The requirement determined for the regulation of the network in the industrial enterprise was to maximise the use of water from the wastewater treatment plant, supplied from Source 2 (the environmental aspect of the operation), while stabilising the water discharge pressure in the enterprise (\(p_{\mathrm{V2}}\) and \(p_{\mathrm{V4}}\)). The required pressures are regulated at the inlets into pipes (\(p_{1}\) and \(p_{3}\)) from Source 1 and Source 2 by continuous regulation of rotational speeds of the pumps. For the purpose of regulating the V2 Branch, it was proposed to modify Equations (1) and (2) and supplement the term that adjusts the preset pressure to the difference between the real (\(p_{\mathrm{V2}}\)) and the required value (\(p_{\mathrm{V2-required}}\)) of pressure at the inlet into the facility:  
\[p_{1}=p_{\mathrm{V2-required}}+k_{1}\cdot Q_{1}^{2}+k_{2}+k_{3}\cdot\left[Q_{ 1}+Q_{\mathrm{3-required}}\right]^{2}+k_{4}-\varepsilon\cdot(p_{\mathrm{V2}}- p_{\mathrm{V2-required}}) \tag{34}\]  
\[p_{3}=p_{\mathrm{V2-required}}+k_{5}\cdot Q_{\mathrm{3-required}}^{2}+k_{6}+k_{ 3}\cdot\left[Q_{1}+Q_{\mathrm{3-required}}\right]^{2}+k_{4}-\varepsilon\cdot(p _{\mathrm{V2}}-p_{\mathrm{V2-required}}) \tag{35}\]  
The regulation is functional in the continuous measurement of the flow rate \(Q_{1}\) and the discharge pressure \(p_{\mathrm{V2}}\). The flow rate \(Q_{\mathrm{3-required}}\) is substituted with the value of the required flow rate of water from Source 2. An increase in the water withdrawal in the industrial enterprise will result in a short-term decrease in the measured pressure \(p_{\mathrm{V2}}\) and an increase in the flow rate \(Q_{1}\). Subsequently, the model is used to calculate new required pressures \(p_{1}\) and \(p_{3}\) at which the system is in equilibrium. Based on the identified pressures,the rotational speeds of the pumps are adjusted to achieve higher values; this facilitates that pressure \(p_{\rm V2}\) acquires the required operational value \(p_{\rm V2-required}\). Flow rate \(Q_{\rm I}\) is also adjusted. A variable parameter in the proposed regulation system is coefficient \(\varepsilon\), which facilitates multiplying the deviation between the required and the measured pressure values, thereby significantly stabilising the dynamic changes in the discharge pressure \(p_{\rm V2}\). However, if the \(\varepsilon\) value is increased too much, the solution may become unstable; therefore, the solution settings depend on the type of the hydraulic system and the response of the controlling elements. Based on the testing of the regulated system, the value of parameter \(\varepsilon\) that is critical for the system stability was determined; when that value exceeded the critical limit, the regulated system parameters exhibited a divergence. The critical value \(\varepsilon\) was identified using the ratio of the average time constant for the pipe \(\tau_{\rm pipe}\), which was defined as the time required for the regulated parameter, diverted by 63.2% from its amplitude, to stabilise to the reaction time of the pumps \(\tau_{\rm pump}\):  
\[\varepsilon<\varepsilon_{\rm crit}=\frac{\tau_{\rm pipe}}{\tau_{\rm pump}} \tag{36}\]  
The reaction time of the pumps is the average time required for the preset output pressure to reach the required value.  
A similar regulation procedure was applied to the V4 Branch, in which the flow rate \(Q_{\rm 2}\) and the discharge pressure \(p_{\rm V4}\) were measured:  
\[p_{\rm 2}=p_{\rm V4-required}+k_{\rm 7}\cdot Q_{\rm 2}^{2}+k_{\rm 8}-\varepsilon \cdot\left(p_{\rm V4}-p_{\rm V4-required}\right) \tag{37}\]  
The regulating person analyses the measured data and makes adequate adjustments to the inlet pressure \(p_{\rm 2}\) at the entry into the V4 Branch.