 The design of subsurface drainage systems in terms layout, depth and spacing of the drains is often done using subsurface drainage equations with parameters like drain depth, depth of the water table, soil depth, hydraulic conductivity of the soil and drain discharge.The drain discharge is found from an agricultural water balance.The computations can be done using computer models like EnDrain, which uses the hydraulic equivalent of Joule's law in electricity.