{"id":15693835,"url":"https://github.com/finger563/webgme-gridlabd","last_synced_at":"2025-05-08T05:56:08.936Z","repository":{"id":67934037,"uuid":"53820780","full_name":"finger563/webgme-gridlabd","owner":"finger563","description":"Metamodel, visualization, and model generators for gridlab-d in WebGME.  Allows graphical model-driven development and simulation of power grids and power generation / transmission / distribution / storage systems.","archived":false,"fork":false,"pushed_at":"2018-07-17T02:00:38.000Z","size":3490,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-08T05:56:02.434Z","etag":null,"topics":["gridlab","power-systems","simulation","webgme","webgme-domain","webgme-gridlabd"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finger563.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-14T02:27:19.000Z","updated_at":"2023-11-15T20:29:46.000Z","dependencies_parsed_at":"2023-09-18T04:46:08.167Z","dependency_job_id":null,"html_url":"https://github.com/finger563/webgme-gridlabd","commit_stats":{"total_commits":221,"total_committers":4,"mean_commits":55.25,"dds":"0.46153846153846156","last_synced_commit":"ac1ee10707040d641f7e082c3ce2a0cb1db8669b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finger563%2Fwebgme-gridlabd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finger563%2Fwebgme-gridlabd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finger563%2Fwebgme-gridlabd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finger563%2Fwebgme-gridlabd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finger563","download_url":"https://codeload.github.com/finger563/webgme-gridlabd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253009891,"owners_count":21839714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gridlab","power-systems","simulation","webgme","webgme-domain","webgme-gridlabd"],"created_at":"2024-10-03T18:49:31.628Z","updated_at":"2025-05-08T05:56:08.916Z","avatar_url":"https://github.com/finger563.png","language":"JavaScript","funding_links":["https://paypal.me/finger563"],"categories":[],"sub_categories":[],"readme":"# webgme-gridlabd\n\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://opensource.org/licenses/MIT)\n[![Documentation](https://img.shields.io/badge/documentation-wiki-blue.svg?style=flat-square)](https://github.com/finger563/webgme-gridlabd/wiki)\n[![npm](https://img.shields.io/npm/v/webgme-gridlabd.svg)](https://www.npmjs.com/package/webgme-gridlabd)\n[![npm](https://img.shields.io/npm/dm/webgme-gridlabd.svg)](https://www.npmjs.com/package/webgme-gridlabd)\n[![npm](https://img.shields.io/npm/dt/webgme-gridlabd.svg)](https://www.npmjs.com/package/webgme-gridlabd)\n\n[![gridlabd.collaborative-design.org](https://img.shields.io/website-up-down-green-red/https/tes.collaborative-design.org/profile/login.svg?label=tes.collaborative-design.org)](https://tes.collaborative-design.org)\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/finger563)\n\nMetamodel, visualization, and model generators for gridlab-d in\nWebGME.\n\nThis document covers how to use the WebGME modeling environment for\ncreating, importing, updating, and rendering (serializing) Gridlab-D\nmodels (GLM format).\n\n**Note**: this document does not describe how Gridlab-D works, merely\nhow the WebGME interface works for importing, creating, and rendering\nGLM files. Users who have questions about what a specific attribute of\na specific Gridlab-D object type means are referred to the\n[Gridlab-D Wiki](http://gridlab-d.sourceforge.net/wiki/index.php/Main_Page).\n\n**Table of Contents:**\n- [WebGME Interface](#webgme-interface)\n- [META](#meta)\n- [Models](#models)\n- [Plugins](#plugins)\n  - [UpdateGLDMeta](#updategldmeta-plugin)\n  - [ImportGLM](#importglm-plugin)\n  - [GenerateGLM](#generateglm-plugin)\n  - [SimulateWithGridlabD](#simulatewithgridlabd-plugin)\n  - [SimulateTES](#simulatetes-plugin)\n  - [SimulateTESCluster](#simulatetescluster-plugin)\n- [Creating a Gridlab-D Model from Scratch](#creating-a-gridlab-d-model-from-scratch)\n\n## WebGME interface\n\nThe webgme interface allows the visual creation and editing of models,\nwhere the top level (ROOT) of the webgme interface can contain models,\nand each model represents a GLM (gridlabd model).\n\n**Note**: since the WebGME interface is designed to graphically model\n  and represent `GLM` files, ancillary files which a single GLM file\n  can include are not directly modeled. To capture those files as part\n  of the webgme model, please create an `Include` object (with the\n  name of the file as the name of the object) and upload the relevant\n  file sa the new `Include` object's `file` attribute (by clicking on\n  the attribute). Then when a user wants to access that file they can\n  simply click on that attribute to download it from the server.\n\n![Root view showing models and language.](./images/models.png)\n\n## META\n\nThe meta for webgme-gridlabd is broken up into many parts, with the\nbase meta (GridlabD) being the only hand-crafted part of the meta. The\nbase meta defines what a model is, what it can contain such as\nobjects, globals, variables, modules, classes, etc. The types defined\nin this aspect are the most basic class definitions from which all\nother gridlabd types derive (e.g. a node derives from a powerflow\nobject which derives from object).\n\n![Base meta defining the base types from which all gridlabd objects inheirit.](./images/baseMeta.png)\n\nThe specific metas for each of the different gridlab-d modules are\ndefined in their own separate sheets, which are automatically created\nwhen running the UpdateGLDMeta plugin (described below). An example of\nan imported meta can be found below (note that when it is imported it\nis not automatically laid out, so some manual layout of the objects\nmay be necessary to better visualize the meta).\n\n![Example imported powerflow meta.](./images/powerflowMeta.png)\n\n## Models\n\nWithin a model, you have the ability to create nodes, links between\nnodes (e.g. overhead lines, transformers), schedules, loads, etc. just\nas you would in a gridlab-d model. Any connection objects between\nnodes are visualized as lines connecting those nodes.\n\nBelow is a simple 4 node powerflow model which was automatically\nimported from a gridlab-d model (GLM) file that exists in the gridlabd\nrepository.\n\n![Simple 4 node powerflow model.](./images/simpleModel.png)\n\nBelow is a more complex example showing two communities of houses\nconnected to two generators. Each house has water heaters, HVAC\nsystems, and controllers.\n\n![More complex Two Community model.](./images/complexModel.png)\n\nFinally, here is a very large (comparatively) model which was created \nand automatically laid out using the [ImportGLM](#importglm-plugin) \nplugin, from the [Taxonomy Feeder R1-12.47 model](https://sourceforge.net/p/gridlab-d/code/HEAD/tree/trunk/models/taxonomy_feeder_R1-12.47-1.glm) in the Gridlab-D source code repository.\n\n![Very Large 5000 Node Model.](./images/VeryLargeModel.png)\n\n## Plugins\n\nThis section describes the plugins available to the user for\ninteracting with the webgme client / server.\n\n### UpdateGLDMeta Plugin\n\n**Location**: `ROOT`\n\nThe UpdateGLDMeta plugin is useful for automatically updating or\nextending the webgme gridlabd meta language with information about the\nsupported types from the current (or a selected) version of\ngridlabd. The plugin takes as input a type specification file\n([example](./gld_schema/powerflow.cpp)) which can be automatically\ngenerated from gridlab-d in the following way:\n\n``` bash\ngridlabd --modhelp ${module_name} \u003e ${module_name}.cpp\n```\n\ne.g.\n\n``` bash\ngridlabd --modhelp powerflow \u003e powerflow.cpp\n```\n\nThe information about gridlab-d's input arguments and how to run this\ncommand can be found\n[here](http://gridlab-d.sourceforge.net/wiki/index.php/Command_options)\n\nWhen the UpdateGLDMeta plugin runs, it will check to see if the\nobjects already exist, and if they don't it will create new\nmeta-objects based on the file specification in a new `MetaAspect`\nsheet with the same name as the file. Additionally, if it finds a\nloaded svg (i.e. present in the `./src/svgs` folder with the same name\nas the meta type it is trying to create, it will automatically assign\nthat svg to be the icon for that type of object. In this way it is\nvery easy to create a useful graphical modeling language for gridlab-d\nwith a minimal amount of effort.\n\n### ImportGLM Plugin\n\n**Location**: `ROOT`\n\nFrom the root level, you can run the ImportGLM plugin which takes as\ninput an uploaded GLM file. The plugin parses this file and creates\nwebgme objects in accordance with the current webgme meta. This means\nthat any relevant meta types for that model should be present in the\nmeta.\n\nThe plugin supports auto-layout of the imported models. For the\nauto-layout code, the plugin takes input parameters specifying the\nnumber of iterations of the layout code, the length of the connections\nand the size of the objects to be laid out. For the most part, these\nparameters need not be changed from their default values. If the model\nis too densely packed, then increase the size / length parameters, and\nvice versa if the model is too sparsely packed. If the model is not\nlaid out well (many crossing connections for instance), then increase\nthe number of iterations.\n\n### GenerateGLM Plugin\n\n**Location**: `Model`\n\nThe GenerateGLM plugin performs the reverse transform of the ImportGLM\nplugin, allowing the user to serialize their webgme gridlabd model out\ninto a simulatable GLM file.\n\n### SimulateWithGridlabD Plugin\n\n**Location**: `Model`\n\nThe SimulateWithGridlabD plugin provides the user the ability to\nautomatically test their gridlabd model. It executes that model in\nGridlabD (which must be installed on the server) and provides the\nstdout / stderr back to the user for inspection.\n\n### SimulateTES Plugin\n\n**Location**: `Model`\n\nThis plugin uses a a set of docker containers on the server to simuate\na Transactive Energy System (TES) using CPSWT as the backbone for\nallowing distributed, coordinated simulation of reactive market\ncontrollers, reactive demand controllers, communications network, and\npower system.\n\n**Note**: this plugin is designed to be run solely from the\n  `TwoCommunities` model.\n\n### SimulateTESCluster Plugin\n\n**Location**: `Model`\n\nThis plugin uses a cluster of VMs to simuate a Transactive Energy\nSystem (TES) using CPSWT as the backbone for allowing distributed,\ncoordinated simulation of reactive market controllers, reactive demand\ncontrollers, communications network, and power system.\n\n**Note**: this plugin is designed to be run solely from the\n  `TwoCommunities` model.\n\n## Creating a Gridlab-D Model from Scratch\n\nIf the user does not wish to import or modify an existing power system\nmodel, they are free to create one from scratch by dragging a `Model`\nobject from the part browser into the `ROOT` level of the\nproject. Having done so, they can double-click to enter their new\nmodel. Once inside the model, they are free to again drag and drop any\nobjects from the part browser into the active area of the model. Once\ncreated, these objects may be selected (upon which point their\nattributes will be displayed and editable within the attribute\npane). The editable attributes for an object are derived from the\n`META` for that object, which was loaded as described in the\n[UpdateGLDMeta section](#updategldmeta-plugin). A complete list of all\npossible attributes for all possible types of objects is outside the\nscope of this README, so users interested in which attributes have\nwhich physical meaning are referred to the\n[Gridlab-D Wiki](http://gridlab-d.sourceforge.net/wiki/index.php/Main_Page),\nwhere they can find the reference documentation for specific object\ntypes, e.g. for `powerflow` objects:\n[Powerflow User Guide](http://gridlab-d.sourceforge.net/wiki/index.php/Power_Flow_User_Guide).\n\n**Note**: Some capabilities of GLD currently only have limited\n  support. The ability to define new object types on the fly within a\n  GLM is not possible within the WebGME interface. However, the\n  importer is able to parse, create, and serialize any such custom\n  object types it finds. This feature may be supported in the future\n  depending on users' needs and more discussion with GLD developers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinger563%2Fwebgme-gridlabd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinger563%2Fwebgme-gridlabd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinger563%2Fwebgme-gridlabd/lists"}