Optimal design of a series hybrid powertrain for an agricultural tractor