The slack bus is needed to account for transmission line losses. In a power system, the total power generated will be equal to sum of power consumed by loads and losses. In a power system, only the generated power and load power are specified for the buses. The slack bus is assumed to generate the power required for losses. Since the losses are unknown, the real and reactive power are not specified for slack bus. They are estimated through the solution of line flow equations.