Double-Bus Single-Breaker Substation¶
The double-bus single-breaker configuration has two main buses joined by a bus-tie breaker. Each branch has one breaker and can be switched onto either bus through its two bus-selector disconnectors. Branches can be moved between buses for maintenance or to split the substation, but a branch breaker failure still takes out its branch.

CIM representation¶
The two buses are nodes with BusbarSections, joined by a tie breaker bay. Each branch has a selector
Disconnector from each bus to its junction node j1; the selector to the unused bus is normally open. A
Breaker and a line Disconnector follow, out to the branch node.
| Object | mRIDs |
|---|---|
| Bus 1, bus 2 | nodes vl_115_bus_1 and vl_115_bus_2, BusbarSections vl_115_bus_1_bbs and vl_115_bus_2_bbs |
| Bus tie | breaker bay vl_115_tie, from vl_115_bus_1 to vl_115_bus_2 |
| Branch n bus selectors | Disconnectors vl_115_n_sel_1 from vl_115_bus_1 and vl_115_n_sel_2 from vl_115_bus_2, both to vl_115_n_j1 |
| Branch n | Breaker vl_115_n_brk from vl_115_n_j1 to vl_115_n_j2, then Disconnector vl_115_n_d to the branch node |
A breaker bay p is the chain p_d1 - p_j1 - p_brk - p_j2 - p_d2: a Breaker between two
Disconnectors, with a junction node on either side of the breaker. See
Substation builder for the naming rules and the call order shared by every
layout.
The diagram comes from an earlier release of CIM-Builder, and its labels are not the mRIDs written now.
The table gives the current mRIDs, all prefixed with the VoltageLevel mRID vl_115.
import logging
import os
os.environ["CIMG_CIM_PROFILE"] = "cim18v17"
os.environ["CIMG_USE_UNITS"] = "TRUE"
os.environ["CIMG_SYSTEM_MVA_BASE"] = "100"
# The IEEE 13 files carry CIMHub extensions that cim18v17 does not have: hide the parser warnings
logging.getLogger("cimgraph").setLevel(logging.ERROR)
import cimgraph.utils as utils
import cimprofiles.cim18.cim18v17 as cim
from cimgraph.databases import XMLFile
from cimgraph.models import FeederModel
from cimtables.units import Qty
from cimbuilder.object_builder import BaseVoltageBuilder, FeederBuilder
from cimbuilder.substation_builder import DoubleBusSingleBreakerSubstationBuilder
Load the IEEE 13 and IEEE 13 Assets feeders¶
Both feeder files load into one graph. The substation is built into the same graph, so that its switches connect to the feeders' existing head nodes.
IEEE13 = "49AD8E07-3BF9-A4E2-CB8F-C3722F837B62"
IEEE13_ASSETS = "5B816B93-7A5F-B64C-8460-47C17D6E4B0F"
FEEDER_FILES = ["../../tests/test_models/IEEE13.xml", "../../tests/test_models/IEEE13_Assets.xml"]
network = FeederModel(
container=cim.Feeder(mRID=IEEE13), connection=XMLFile(filename=FEEDER_FILES), distributed=False
)
container = network.container
Two small helpers: sourcebus finds a feeder's head node, the ConnectivityNode named sourcebus inside
that feeder, and show prints each switch with the nodes on its two terminals.
def sourcebus(network, feeder_mRID):
"""mRID of the feeder head node, the ConnectivityNode named sourcebus in the feeder"""
for node in network.graph[cim.ConnectivityNode].values():
node_container = node.ConnectivityNodeContainer
if node.name == "sourcebus" and node_container is not None and node_container.mRID == feeder_mRID:
return node.mRID
raise ValueError(f"no sourcebus in feeder {feeder_mRID}")
def show(switches):
"""one line per switch: class, mRID, the nodes on its two terminals and normalOpen"""
for switch in switches:
node1, node2 = [terminal.ConnectivityNode for terminal in switch.Terminals]
print(
f"{type(switch).__name__:13} {switch.mRID:24} "
f"{node1.name or node1.mRID} - {node2.name or node2.mRID} normalOpen={switch.normalOpen}"
)
print("IEEE 13 sourcebus: ", sourcebus(network, IEEE13))
print("IEEE 13 Assets sourcebus:", sourcebus(network, IEEE13_ASSETS))
IEEE 13 sourcebus: A8A25B50-3AE3-4A31-A18B-B3FA13397ED3 IEEE 13 Assets sourcebus: E14BD0DF-466D-487B-8786-0D46515D1F9B
Create the Substation and its 115 kV VoltageLevel¶
References between objects are mRID strings, as in every other builder. The BaseVoltage is created first
so the VoltageLevel can refer to it.
BaseVoltageBuilder(network, container).create(
mRID="bv_115kV", name="115 kV", nominalVoltage=Qty(115, "kV")
)
builder = DoubleBusSingleBreakerSubstationBuilder(network, container)
substation = builder.create(mRID="sub_double_bus", name="sub_double_bus")
substation, voltage_level = builder.add_voltage_level(
substation, mRID="vl_115", name="115 kV", BaseVoltage="bv_115kV"
)
Add the buses¶
add_buses adds both buses and the bus tie between them.
voltage_level, busbars, ties = builder.add_buses(voltage_level)
print([busbar.mRID for busbar in busbars])
show(ties)
['vl_115_bus_1_bbs', 'vl_115_bus_2_bbs'] Disconnector vl_115_tie_d1 vl_115_bus_1 - vl_115_tie_j1 normalOpen=False Breaker vl_115_tie_brk vl_115_tie_j1 - vl_115_tie_j2 normalOpen=False Disconnector vl_115_tie_d2 vl_115_tie_j2 - vl_115_bus_2 normalOpen=False
Add the branches¶
number names the branch's switches. bus (1 or 2, default 1) picks the bus the branch normally runs on:
its selector is closed and the other selector is normally open.
voltage_level, switches = builder.add_branch(voltage_level, number=1, node="line_1", bus=1)
show(switches)
voltage_level, switches = builder.add_branch(
voltage_level, number=2, node=sourcebus(network, IEEE13), bus=1
)
show(switches)
voltage_level, switches = builder.add_branch(
voltage_level, number=3, node=sourcebus(network, IEEE13_ASSETS), bus=2
)
show(switches)
Disconnector vl_115_1_sel_1 vl_115_bus_1 - vl_115_1_j1 normalOpen=False Disconnector vl_115_1_sel_2 vl_115_bus_2 - vl_115_1_j1 normalOpen=True Breaker vl_115_1_brk vl_115_1_j1 - vl_115_1_j2 normalOpen=False Disconnector vl_115_1_d vl_115_1_j2 - line_1 normalOpen=False Disconnector vl_115_2_sel_1 vl_115_bus_1 - vl_115_2_j1 normalOpen=False Disconnector vl_115_2_sel_2 vl_115_bus_2 - vl_115_2_j1 normalOpen=True Breaker vl_115_2_brk vl_115_2_j1 - vl_115_2_j2 normalOpen=False Disconnector vl_115_2_d vl_115_2_j2 - sourcebus normalOpen=False Disconnector vl_115_3_sel_1 vl_115_bus_1 - vl_115_3_j1 normalOpen=True Disconnector vl_115_3_sel_2 vl_115_bus_2 - vl_115_3_j1 normalOpen=False Breaker vl_115_3_brk vl_115_3_j1 - vl_115_3_j2 normalOpen=False Disconnector vl_115_3_d vl_115_3_j2 - sourcebus normalOpen=False
Link the feeders to the substation¶
The switches connect the feeders electrically. The feeder containers link to the substation through
Feeder.NormalEnergizingSubstation:
feeder_builder = FeederBuilder(network, container)
for feeder_mRID in (IEEE13, IEEE13_ASSETS):
feeder = network.find_by_mRID(feeder_mRID)
feeder_builder.add_connectivity(feeder, NormalEnergizingSubstation=substation.mRID)
print([feeder.name for feeder in substation.NormalEnergizedFeeder])
['ieee13nodeckt', 'ieee13nodecktassets']
Save the substation and feeders to CIM XML¶
os.makedirs("output", exist_ok=True)
utils.write_xml(network, "output/double_bus_single_breaker.xml")
Read the XML file back¶
Reload the file into a new model and check that the substation, its feeders and its switching equipment all came back, along with the feeders' load.
roundtrip = FeederModel(
container=cim.Feeder(mRID=IEEE13),
connection=XMLFile(filename="output/double_bus_single_breaker.xml"),
distributed=False,
)
substation = roundtrip.find_by_mRID("sub_double_bus")
voltage_level = roundtrip.find_by_mRID("vl_115")
print("feeders:", [feeder.name for feeder in substation.NormalEnergizedFeeder])
for cim_class in (cim.BusbarSection, cim.Breaker, cim.Disconnector):
count = sum(isinstance(equipment, cim_class) for equipment in voltage_level.Equipments)
print(f"{cim_class.__name__}: {count}")
feeders: ['ieee13nodeckt', 'ieee13nodecktassets'] BusbarSection: 2 Breaker: 4 Disconnector: 11
# CIM XML values are in SI base units (W); CIMUnit converts them for display
total_load = sum(float(load.p) for load in roundtrip.graph[cim.EnergyConsumer].values())
print(f"total load served by the substation: {cim.ActivePower(total_load).to('kW'):.1f} kW")
total load served by the substation: 6937.0 kW
<style>
['pre { line-height: 125%; }\ntd.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\nspan.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\ntd.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\nspan.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\n.highlight-ipynb .hll { background-color: var(--jp-cell-editor-active-background) }\n.highlight-ipynb { background: var(--jp-cell-editor-background); color: var(--jp-mirror-editor-variable-color) }\n.highlight-ipynb .c { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment */\n.highlight-ipynb .err { color: var(--jp-mirror-editor-error-color) } /* Error */\n.highlight-ipynb .k { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword */\n.highlight-ipynb .o { color: var(--jp-mirror-editor-operator-color); font-weight: bold } /* Operator */\n.highlight-ipynb .p { color: var(--jp-mirror-editor-punctuation-color) } /* Punctuation */\n.highlight-ipynb .ch { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Hashbang */\n.highlight-ipynb .cm { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Multiline */\n.highlight-ipynb .cp { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Preproc */\n.highlight-ipynb .cpf { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.PreprocFile */\n.highlight-ipynb .c1 { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Single */\n.highlight-ipynb .cs { color: var(--jp-mirror-editor-comment-color); font-style: italic } /* Comment.Special */\n.highlight-ipynb .kc { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Constant */\n.highlight-ipynb .kd { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Declaration */\n.highlight-ipynb .kn { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Namespace */\n.highlight-ipynb .kp { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Pseudo */\n.highlight-ipynb .kr { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Reserved */\n.highlight-ipynb .kt { color: var(--jp-mirror-editor-keyword-color); font-weight: bold } /* Keyword.Type */\n.highlight-ipynb .m { color: var(--jp-mirror-editor-number-color) } /* Literal.Number */\n.highlight-ipynb .s { color: var(--jp-mirror-editor-string-color) } /* Literal.String */\n.highlight-ipynb .ow { color: var(--jp-mirror-editor-operator-color); font-weight: bold } /* Operator.Word */\n.highlight-ipynb .pm { color: var(--jp-mirror-editor-punctuation-color) } /* Punctuation.Marker */\n.highlight-ipynb .w { color: var(--jp-mirror-editor-variable-color) } /* Text.Whitespace */\n.highlight-ipynb .mb { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Bin */\n.highlight-ipynb .mf { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Float */\n.highlight-ipynb .mh { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Hex */\n.highlight-ipynb .mi { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Integer */\n.highlight-ipynb .mo { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Oct */\n.highlight-ipynb .sa { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Affix */\n.highlight-ipynb .sb { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Backtick */\n.highlight-ipynb .sc { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Char */\n.highlight-ipynb .dl { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Delimiter */\n.highlight-ipynb .sd { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Doc */\n.highlight-ipynb .s2 { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Double */\n.highlight-ipynb .se { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Escape */\n.highlight-ipynb .sh { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Heredoc */\n.highlight-ipynb .si { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Interpol */\n.highlight-ipynb .sx { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Other */\n.highlight-ipynb .sr { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Regex */\n.highlight-ipynb .s1 { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Single */\n.highlight-ipynb .ss { color: var(--jp-mirror-editor-string-color) } /* Literal.String.Symbol */\n.highlight-ipynb .il { color: var(--jp-mirror-editor-number-color) } /* Literal.Number.Integer.Long */']
</style>