Monitoring and distributed control for power systems