Efficiency Saves Money!
Velocity is generally used for sizing main line piping. Exceeding 5 feet per second may result in damage to pipe or components.
Friction loss is traditionally used to size laterals. It is best not to exceed 5% friction loss in laterals.
Note; I generally stick to the feet per second method for laterals on residential properties, because it is much easier to calculate for every location in a given system.
the longest run is the distance from the valve to the furthest sprinkler head (following the path of the lateral piping.)
The allowable percentage loss is simply the total allowable PSI drop over distance. This is generally 5%
As always, check the outcome and calculations, do not depend on this tool to be accurate. We strive hard to build a perfect tool, but it is possible that there are flaws or bugs in the programming or calculations.