Theoretical basis for power system optimization