{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Distribution Feeder Modeling" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This section contains description of distribution feeder modeling concepts and usage of the CIMantic Graphs `FeederModel` class for accessing CIM feeder models in a centralized and distributed manner.\n", "\n", "All diagrams within this page have been auto-generated using mermaid.js and the `cimgraph.utils` module of CIMantic Graphs, which can be imported using" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from cimgraph import utils\n", "from mermaid import Mermaid" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Distribution Feeders in CIM\n", "\n", "Full modeling of North American distribution circuits was introduced in CIM 17 to include include unbalanced medium-voltage networks, low-voltage customer-side equipment, DERs, and advanced metering infrastructure (AMI) usage points. An example of a very simple distribution feeder is shown and explained in detail below:\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* `ConnectivityNode` used for 3-phase buses. Separate modeling of single-phase nodes not used\n", "\n", "* `Terminal` used to connect conducting equipment to a bus\n", "\n", "* `ACLineSegment` used for overhead lines, underground cables, and secondary triplex lines. Phasing represented using `ACLineSegmentPhase`\n", "\n", "* Representation of downstream switching devices using `Recloser`, `Sectionaliser`, etc.\n", "Poletop `LinearShuntCompensator` and `RatioTapChanger` devices\n", "\n", "* `EnergySource` slack bus at substation\n", "\n", "* Loads can be represented at medium voltage level or broken down into individual `EnergyConsumer` customers with split-phase `TransformerTank`\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "----" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## FeederModel Class\n", "\n", "The `FeederModel` class in CIMantic Graphs provides the interface for users to access a single feeder at a time (in a manner similar to study tools such as EPRI OpenDSS or Eaton CYME). The class provides access to the typed property graph and API methods to read and write to a data source.\n", "\n", "It can be imported using" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from cimgraph.models import FeederModel" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The structure of the distribution network graphs and API methods are explained in the sections below" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "----" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading a FeederModel from an XML File\n", "\n", "When working with small test cases (e.g. IEEE 13 and 123 bus models), it is possible to use CIMantic Graphs without any database and instead directly build the graph from an XML file. *Note: large models (e.g. IEEE 8500) will see poor performance when reading directly from the XML (approx 2 minutes to load all triples and build the full network graph).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The first step is to import the correct CIM profile to use and set the associated environment variable used by CIM-Graph. For an explanation of CIM profiles, see [Profiles Overview](../02_cim_profiles/2_1_profiles_overview.ipynb)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import os\n", "os.environ['CIMG_CIM_PROFILE'] = 'cimhub_2023'\n", "import cimgraph.data_profile.cimhub_2023 as cim" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, use the `XMLFile` interface to open the XML file:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from cimgraph.databases import XMLFile\n", "file = XMLFile(filename='../../sample_models/ieee13.xml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, create a new `FeederModel` network class to load the feeder into the graph:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "network = FeederModel(container=cim.Feeder(), connection=file)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The complete network model, including both forward and reverse associations between all objects in the model has now been loaded into the FeederModel graph. \n", "\n", "To demonstrate the structure of resulting FeederModel network, we can display a sample breaker object:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ], "text/plain": [ "