At it's simplest, electricity generation is achieved by induced voltage due to a changing magnetic field. In a vacuum in the absence of friction, would the initial spin imparted to the rotor of a generator ever come to a halt?
i.e. Would a traditional generator in space generate electricity perpetually (notwithstanding component failure etc)?
