A method of retrofitting for electrical power generation an internal combustion engine (including a plurality of pistons connected to a common crankshaft) includes applying to at least one and optionally to each piston a power converter operable to convert mechanical energy of the piston to and from electrical energy.