Optimal control of wind turbines for distributed power generation