Control of a mechanical hybrid powertrain by