Livewire:

for power delivery modeling

@rhysallister

Agenda

  • Overview of power generation and delivery
  • What is livewire?
  • How does it help?

Generation

Transmission

distribution

Power Delivery 101

distribution

Substation Transformer

Feeder Line

Secondary Transformer

Secondary Line

Service Wire

Electric Meter

Power Delivery 101

distribution

Part 1

Using isolators for redundancy

Using isolators for redundancy

What is livewire?

  • Postgresql Extension
  • Written in PL/PGSQL
  • Makes editing of electric network painless
  • Makes answering common questions simple
CREATE EXTENSION livewire
SELECT lw_initialise('electric', 3448)
select lw_addedgeparticipant('electric',
  '{
    "tablename": "ohprimaryline",
    "primarykey":"objectid",
    "geomcolumn": "wkb_geometry",
    "labelcolumn": "dataid",
    "phasecolumn": "phasingcode",
    "phasemap":{
      "ABC":"7", "AB":"6",
      "AC":"5", "BC":"3",
      "A":"4","B":"2",
      "C":"1"}
    }')	;
select lw_addnodeparticipant('electric', 
  $${ 
      "tablename": "overcurrentdevicebank",
      "primarykey":"facilityid",
      "geomcolumn": "wkb_geometry",
      "labelcolumn": "dataid",
      "sourcequery": "devicetype = 'FDR'",
      "blockquery": "enabled = False",
      "phasecolumn": "phasingcode",
      "phasemap":{
        "ABC":"7","AB":"6",
        "AC":"5","BC":"3",
        "A":"4","B":"2",
        "C":"1"}
    }$$);
select lw_generate('electric');
select lw_traceall('electric');
SELECT lw_tracednstream(
    'electric',
    'overcurrentdevicebank',
    12567)
SELECT lw_tracednstream(
    'electric',
    'Point(76541 688795)'::geometry)
SELECT lw_tracednstream(
    'electric',
    'overcurrentdevicebank',
    12567,
    data := True)
SELECT lw_traceupstream(
    'electric',
    'transformerbank',
    28081)
SELECT lw_traceupstream(
    'electric',
    'transformerbank',
    28081
    data := True)
SELECT lw_traceupstream(
    'electric',
    'Point(876652 657211)'::geometry)
UPDATE data.switchdevicebank 
SET enabled = 1 
WHERE facilityid = 369195;
SELECT lw_commonparent(
    'electric',
    'transformerbank',
    [12567, 67738, 76599, 34908, 55110])
SELECT lw_commonparent(
    'electric',
    ['Point(786120 687910)'::geometry, 
     'Point(787134 687395)'::geometry,
     'Point(785134 682383)'::geometry])
UPDATE data.switchdevicebank 
SET enabled = 1 
WHERE facilityid = 369195;
UPDATE data.switchdevicebank 
SET enabled = 0 
WHERE facilityid = 407425;

https://github.com/rhysallister/livewire

Livewire

By rhysallister

Livewire

  • 100