Merging Optimization and Control in Power Systems