# What is a Contingency Analysis in Power Systems?

In power systems, a contingency analysis is a type of analysis performed to determine the impact on the system of losing one or more elements. These elements generally include lines or transformers but can technically include any element.

## What is a Contingency Analysis Used for?

The results of a contingency analysis are normally the lines that would be overloaded and the buses whose voltages would be out of the required tolerance if a specific element is lost.

These results are used to determine if any area of the power system needs to be reinforced or upgraded. They can also tell if changes are needed in how the system is operated in order to maintain the proper operation of the power system.

## How is a Contingency Analysis Performed?

A contingency analysis is performed by removing a number of elements (usually one(1)) at a time from the power system being analyzed and performing a power flow calculation.

This power flow calculation will give the active and reactive power from generators in a system and the flows through the lines and transformers necessary to serve the loads. It also provides the voltage magnitude and angle at the power system buses.

The results of the power flow are then compared to the specifications of the elements, such as the maximum power capacity of the lines and transformers. They are also compared with operational requirements such as required voltage levels and power levels below maximum capacity as needed.

## How Hard is it to Perform a Contingency Analysis

The difficulty with a contingency analysis is really in how long it takes. The first step is usually to do a power flow calculation to establish a base state of the system, a so called N state. This itself is an iterative process because of the non-linear nature of a power system.

After the base state power flow calculation is done, an element is taken out of service and another power flow calculation is done as stated above.

Just removing one element is know as the N-1 state of the power system. But as stated above, a contingency analysis can be done by removing more than one element at a time. This is a N-X contingency analysis where X is any whole number. Practically X is limited to 2 or 3.

For practical power systems it is impractical to perform these calculations by hand and therefore software is used. All commercially available power system analysis software have contingency analysis built in as a 'one click' function.

You can see an example of performing a contingency analysis in this other post Power System Contingency Analysis with Python PandaPower.