Calculates the PowerFlow from a graph that contains the following attributes, named edges, edgeweights, a balanced power generation and demand column. Writes a new edge attribute of power flow (existing attribute of the same name will be overwritten). The function outputs a a graph with the correct power flow values

PowerFlow(
  g,
  AZero,
  LineProperties,
  EdgeName = "Link",
  VertexName = "name",
  Net_generation = "BalencedPower",
  power_flow = "PowerFlow"
)

Arguments

g

An igraph object representing the power grid

AZero

A numeric matrix The transmission matrix of the original network

LineProperties

A numeric matrix. a diagonal matrix of the Y characteristic of the network

EdgeName

The variable that holds the edge names, a character string.

VertexName

The variable that holds the names of the nodes, to identify the slack ref. a character string

Net_generation

The name that the net generation data for each node is held in

power_flow

A character string. The name of the edge attribute that will hold the power flow information

Examples

PowerFlow(g, Slackref)
#> Error in "igraph" %in% class(graph): object 'g' not found