Sizing of an electrical machine in an operating cycle