optimal energy production