power grid calculations