Explain the theory and operation of synchronous machines in electrical engineering, including the construction, working principle, and characteristics of synchronous generators and motors. Discuss the applications and advantages of synchronous machines in power systems.