# Contingency (electrical grid)

In an electrical grid, contingency is an unexpected failure of a single principal component (e.g., an electrical generator or a power transmission line) that causes the change of the system state large enough to endanger the grid security. Some protective relays are set up in a way that multiple individual components are disconnected due to a single fault, in this case, taking out of all the units in a group counts as a single contingency. A scheduled outage (like maintenance) is not a contingency.
The choice of term emphasizes the fact that a single fault can cause severe damage to the system so quickly that the operator will not have time to intervene, and therefore a reaction to the fault has to be defensively pre-built into the system configuration. Some sources use the term interchangeably with "disturbance" and "fault".

## Contingency analysis

The contingency analysis application periodically runs on the computers at the operations centers providing suggestions to the operators based on the current state of the grid and the contingency selection. The software provides answers to the "what if" scenarios in the form of "alarms": "Loss of component X will result in overload of Y by Z%". By the 1990s analysis of a large interconnected system involved testing of many thousands of contingency events (millions if double contingencies were considered). An effect of each contingency requires performing a power flow calculation. Due to the rapid change of the state of a power system the run of the application shall complete in minutes (up to 30) for the results to be useful. Typically only selected contingencies, mostly single ones with some double ones are considered to speed up the process. The selection of contingencies is using engineering judgment to choose the ones most likely to cause problems.

### Credible contingencies

The foreseen and analyzed contingencies are called credible. Examples of these are failures of:
* a transmission line or tie line / HVDC link;
* a generator;
* a transformer;
* a variable renewable energy cluster;
* a voltage compensation device.
In continental Europe these contingencies are considered "normal", with "exceptional" credible contingencies being the failures of:
* a double circuit transmission line;
* two generators;
* a bus bar.
Non-credible (also called "out-of-range") contingencies are not used in planning, as they are rare and their effects are hard to predict, for example, failures of:
* an entire electrical substation;
* a transmission tower that carries more than two lines.

## N-X contingency planning

Reliability of the energy supply usually requires that any single major unit failure leaves the system with enough resources to supply the current load. The system that satisfies this requirement is described as meeting the N-1 contingency criterion (N designates the number of pieces of equipment). The N-2 and N-3 contingency refers to planning for a simultaneous loss of, respectively, 2 or 3 major units; this is sometimes done for the critical area (e.g. downtown).
The N-1 requirement is used throughout the network, from generation to substations. At the distribution level, however, the planners frequently allow a more relaxed interpretation: a single failure should ensure uninterrupted delivery of power to almost all the customers at least at the "emergency level" (Range B of the ANSI C84.1), but a small section of the network that contains the original fault might require manual switching with a service interruption for about an hour.
The popularity of contingency planning is based on its advantages:
* each of the N elements in the system is analyzed separately, limiting the amount of work to be done and simplifying the failure options (e.g., generator failure, short circuit);
* the process inherently provides a way to deal with the contingency if and when it will happen.
The N-1 contingency planning is typically sufficient for the systems with the usual ratio of peak load to capacity (below 70%). For a system with a substantially higher ratio, the N-1 planning will not deliver satisfactory reliability, and even N-2 and N-3 criteria might not be sufficient; therefore the reliability-based planning is used that considers the probabilities of the individual contingencies.
N-1-1 contingency is defined as a single fault followed by manual recovery procedures, with another fault occurring after the successful recovery from the first failure. Normal operating conditions are sometimes referred to as N-0.