Multi-agent model predictive control with applications to power networks