A dynamo that generates an alternating current