Traversing the Network ModelElecNetKit Documentation

This article discusses techniques for accessing properties of electrical network elements, and for navigating between elements of the electrical network model.

Accessing Network Element Properties

Each NetworkElement has a number of properties that define network characteristics. For information on which properties are defined by which network elements, see:

As a general pattern, phased properties (any property that contains information on a per-phase basis) has the word Phased as a suffix, e.g. VoltagePhased and ConnectedToPhased. These Phased properties often have a corresponding aggregate property useful for analysing single-phase or balanced three-phase networks. As an example, Bus has the property Voltage, which specifies the average voltage across all bus phases, as well as the aforementioned VoltagePhased. Likewise, NetworkElement contains the property ConnectedTo, which returns all elements connected on any phase, in addition to the phased equivalent ConnectedToPhased.

Traversing the Network Topology

Upon obtaining a NetworkModel, networks can be explored in a consistent manner. The NetworkModel object maintains separate lists of Buses, Lines, Generators and Loads, and the relationships between them. Each network element has the property ConnectedTo, which maintains a list of all NetworkElements that a specific element is connected to. When used in conjunction with OnlineLINQ, means that executing complex queries for circuit details can be done in very few lines of code. It is strongly recommended that users familiarise themselves with LINQ if planning to traverse network topologies in ElecNetKit. The Related Content section contains a number of resources useful for understanding LINQ.

As an example of ElecNetKit model traversal, the code below finds all lines connected to a bus where the voltage is higher at the other end. This could be used iteratively, for example, to analytically detect the presence of DG when coordinated between a subset of network buses.

Bus myBus = Circuit.Buses["myBus"];
//Find all connected lines where:
myBus.ConnectedTo.OfType<Line>().Where(
  //the other bus the line connects to
  line => line.ConnectedTo.OfType<Bus>().Where(x => x != myBus)
  .First() //Convert from list to single element 
  //check to see if the connected bus has a higher voltage than myBus.
  .Voltage.Magnitude > myBus.Voltage.Magnitude 
);

As of version 1.1, NetworkModels can also be traversed using the phased property ConnectedToPhased. The object model for phased connections is slightly different, with each element of ConnectedToPhased specifying a target element and a target phase (see NetworkElementConnection).

See Also

Other Resources