Optimization of Energy Flow