Optimization-based Cell Selection Method for Grid-connected Modular Multilevel Converters