Generally the head losses (potential differences) at each node are neglected, and a solution is sought for the steady-state flows on the network, taking into account the pipe specifications (lengths and diameters), pipe friction properties and known flow rates or head losses.
An adaptation of this method is needed to account for water reservoirs attached to the network, which are joined in pairs by the use of 'pseudo-loops' in the Hardy Cross scheme.
The modern method is simply to create a set of conditions from the above Kirchhoff laws (junctions and head-loss criteria).
Create a separate equation for each loop where the head losses are added up, but instead of squaring Q, use |Q|·Q instead (with |Q| the absolute value of Q) for the formulation so that any sign changes reflect appropriately in the resulting head-loss calculation.
In many situations, especially for real water distribution networks in cities (which can extend between thousands to millions of nodes), the number of known variables (flow rates and/or head losses) required to obtain a deterministic solution will be very large.
The above deterministic methods are unable to account for these uncertainties, whether due to lack of knowledge or flow variability.
This entropy is then maximized subject to the constraints on the system, including Kirchhoff's laws, pipe friction properties and any specified mean flow rates or head losses, to give a probabilistic statement (probability density function) which describes the system.
This can be used to calculate mean values (expectations) of the flow rates, head losses or any other variables of interest in the pipe network.