Off-line and on-line optimization of the energy management strategy in a hybrid electric helicopter for urban air-mobility