{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Node Breaker Models" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This section contains description of transmission node-breaker modeling concepts and usage of the CIMantic Graphs `NodeBreakerModel` 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": [ "## Transmission Network Models in CIM\n", "\n", "CIM was originally designed to support full node-breaker modeling of transmission network models and substations " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# TODO: Provide sample Node Breaker Model diagram" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "----" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading a FeederModel from an XML File\n", "\n", "It is possible to use CIMantic Graphs without any database and instead directly build the graph from an XML file. " ] }, { "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'] = 'cim17v40' # import and env var must match\n", "\n", "import cimgraph.data_profile.cim17v40 as cim # import and env var must match" ] }, { "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", "\n", "file = XMLFile(filename='../../sample_models/maple10nodebreaker.xml')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If custom extensions are used, provide a namespaces dictionary mapping the prefix to the custom namespaces:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "namespaces={'cim': 'http://iec.ch/TC57/CIM100#',\n", " 'gmdm': 'http://epri.com/gmdm/2025#',\n", " 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n", " 'gad': 'http://gridappsd.org/CIM/extension#'}\n", "\n", "file = XMLFile(filename='../../sample_models/maple10nodebreaker.xml',\n", " namespaces=namespaces)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, create a new `NodeBreakerModel` network class to load the transmission model into the graph:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from cimgraph.models import NodeBreakerModel\n", "\n", "network = NodeBreakerModel(container=None, connection=file)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ], "text/plain": [ "