In electrical engineering and mechanical engineering, the power rating of equipment is the highest power input allowed to flow through particular equipment. According to the particular discipline, the term power may refer to electrical or mechanical power. A power rating can also involve average and maximum power, which may vary depending on the kind of equipment and its application. Power rating limits are usually set as a guideline by the manufacturers, protecting the equipment and simplifying the design of larger systems, by providing a level of operation under which the equipment will not be damaged while allowing for a certain safety margin. In equipment which primarily dissipate electric power or convert it into mechanical power, such as resistors, and speakers, the power rating given is usually the maximum power that can be safely dissipated by the equipment. The usual reason for this limit is heat, although in certain electromechanical devices, particularly speakers, it is to prevent mechanical damage. When heat is the limiting factor, the power rating is easily calculated. First, the amount of heat that can be safely dissipated by the device, , must be calculated. This is related to the maximum safe operating temperature, the ambient temperature or temperature range in which the device will be operated, and the method of cooling. If is the maximum safe operating temperature of the device, is the ambient temperature, and is the total thermal resistance between the device and ambient, then the maximum heat dissipation is given by If all power in a device is dissipated as heat, then this is also the power rating. Equipment is generally rated by the power it will deliver, for example, at the shaft of an electric or hydraulic motor. The power input to the equipment will be greater owing to the less than 100% efficiency of the device. Efficiency of a device is often defined as the ratio of output power to the sum of output power and losses. In some types of equipment it is possible to measure or calculate losses directly.