In electricity generation, an electrical generator is a device that converts mechanical energy to electrical…