1. Modeling a power grid
In this video, we will learn how a power grid is constructed and how we can use recursive CTEs to query the hierarchy of the electrical grid.
2. The power grid
A power grid is a grid of connected overhead lines, of connected cables which are buried and of transformers. These transformers are needed to transform the different voltage levels as we can see in the picture. In this example voltage levels of 220 KiloVolt or 380 KiloVolt are represented by the blue and purple lines. A power grid is a networked data model. We have many lines which are connected to each other and therefore, the power grid is a very good candidate to be used for recursive querying.
3. Modeling a power grid
A power grid is described by many different attributes. The three most important attributes are the three ID values, which are needed to build the connection between power lines. The first ID is the ID of power lines, for example the EquipmentID. The second ID is the first connected power line, the EquipmentID_From and the third ID, the EquipmentID_To, is the second connected power line.
As we can see in the example, the EquipmentID 3 has two connected power lines. The line with ID 2 is the EquipmentID_From element and the line with ID 4 is the EquipmentID_To element. Accordingly, line 3 connects the lines 2 and 4.
In a total grid, one line could have more than one connection. Accordingly, a common power grid can be described as a networked data model.
4. Characteristics of power lines
In addition to the IDs, each power line has some characteristics. These characteristics are the voltage level which can be high voltage, medium voltage, or low voltage, the description, for example, cable, overhead line, or transformer. There are also attributes such as the construction year of an item, the inspection year indicating the last inspection and finally, the result of the inspection defining the condition of the item.
5. Common task for grid maintenance
Now, how can we use such a data model? A very common task for grid operators is maintaining the power grid. Their task is to find out which lines have to replaced. To perform this task, we first have to find the connected power lines. This task can be solved using the recursive querying technique. Finally, we have to select only those lines which have conditions bad, exchange, or repair. A possible result is shown on the slide. Lines 1, 2, and 3 have to be maintained according to their conditions which are exchange, repair, and bad.
6. Let's find the power lines to be maintained!
We have now seen how to model a power grid. Your task will be first of all to create such a data model on your own and then to find power lines which have to be maintained according to their conditions.