Aerodynamic optimization of a morphing airfoil using energy as an objective