Frequency of the system will vary as load and generation change. Increasing the mechanical input power to any individual synchronous generator will not greatly affect the overall system frequency, but will produce more electric power from that unit. During a severe overload caused by tripping or failure of generators or transmission lines the power system frequency will decline, due to an imbalance of load versus generation. Loss of an interconnection while exporting power (relative to system total generation) will cause system frequency to increase upstream of the loss, but may cause a collapse downstream of the loss, as generation is now not keeping pace with consumption. Automatic generation control (AGC) is used to maintain scheduled frequency and interchange power flows. Control systems in power stations detect changes in the network-wide frequency and adjust mechanical power input to generators back to their target frequency. This counteracting usually takes a few tens of seconds due to the large rotating masses involved (although the large masses serve to limit the magnitude of short-term disturbances in the first place). Temporary frequency changes are an unavoidable consequence of changing demand. Exceptional or rapidly changing mains frequency is often a sign that an electricity distribution network is operating near its capacity limits, dramatic examples of which can sometimes be observed shortly before major outages. Large generating stations including solar farms can reduce their average output and use the headroom between operating load and maximum capacity to assist in providing grid regulation; response of solar inverters is faster than generators, because they have no rotating mass. As variable resources such as solar and wind replace traditional generation and the inertia they provided, algorithms have had to become more sophisticated. Energy storage systems, such as batteries, are fulfilling the regulation role to an expanding degree as well.