Skip to content

SESAM-Polimi/MicroGridsPy-Suite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

MicroGridsPy Suite

MicroGridsPy Suite is a collection of interoperable, open-source Python tools developed to support rural electrification studies within a broader Comprehensive Energy System Planning (CESP) workflow. Rather than treating network design, demand estimation, resource assessment, and system sizing as isolated tasks, the suite is structured so that each module can inform the next one in a transparent and reproducible planning chain.

The current suite brings together tools for:

  • LV distribution topology design
  • High-resolution load demand simulation
  • Solar and wind resource assessment
  • Techno-economic optimization of mini-grid systems
  • Future dispatch-oriented operational analysis as an ecosystem extension

This repository is intended to work as the documentation and navigation hub for the suite, while the actual tools live in their own dedicated repositories.

Why The Suite Exists

Rural electrification planning is rarely a single-model problem. Robust studies usually require answers to several connected questions:

  • Which users should be connected through an LV network, and which are better served by stand-alone systems?
  • What will those users actually consume over time, with realistic daily and seasonal variability?
  • What renewable resources are available at the candidate site?
  • What is the least-cost generation and storage mix for the resulting load and resource conditions?
  • After a system is sized, how will it behave under more operationally detailed dispatch logic?

MicroGridsPy Suite addresses these questions through separate but compatible tools, each responsible for one layer of the planning process. This modular structure makes the platform easier to extend, validate, and use in different study contexts.

Suite Logic

The broad rationale of the suite is to move from spatial electrification design to demand and resource characterization, then into system planning, and finally toward operational refinement.

End-to-end workflow

  1. Design the distribution topology Starting from building locations and optional road data, the LV distribution tool creates a heuristic pole-and-line layout, identifies served and unserved users, and checks basic electrical feasibility.
  2. Estimate electricity demand Once the connected user set is defined, the demand tool generates planning-ready profiles using either full bottom-up RAMP inputs or simplified SSA archetypes for data-scarce contexts.
  3. Assess renewable resources In parallel with demand modelling, the PVGIS-based resource tool retrieves typical-year solar and wind data and converts them into technology-specific hourly production series.
  4. Optimize the energy system The planning model combines load, resource, technology, cost, and policy inputs to identify the least-cost mini-grid configuration under typical-year or multi-year formulations.
  5. Refine with operational simulation A dispatch-focused layer can then be used to test operational strategies, component behaviour, and control assumptions beyond the planning abstraction.

What Is Included In This Suite Hub

The local workspace currently contains the following repositories:

Tool Role in workflow Local folder Placeholder repository link
LV Distribution Topology Network design and coverage screening SESAM-LV-Distribution-Topology-Streamlit https://github.com/SESAM-Polimi/LV-Distribution-Topology-Streamlit
RAMP Demand Simulation Bottom-up load modelling SESAM_RAMP-Streamlit https://github.com/SESAM-Polimi/RAMP-Streamlit
PVGIS Resource Assessment Solar and wind input generation PVGIS-Streamlit-App https://github.com/SESAM-Polimi/PVGIS-Streamlit
MicroGridsPy Planning Optimization and result interpretation microgridspy-planning https://github.com/MicroGridsPy/MicroGridsPy
Dispatch Simulation Module Operational refinement layer not present in this folder release link coming soon

The last item is part of the ecosystem logic already referenced by the planning application, but it is not included in this local suite folder yet.

Toolchain Overview

1. LV Distribution Topology

The LV distribution repository is a Streamlit screening tool for early-stage mini-grid network design. It starts from customer points and optional road geometries, generates candidate poles, associates users, builds a radial LV layout with an MST-based heuristic, and optionally identifies isolated clusters that may be better treated as stand-alone systems.

It also includes:

  • single-snapshot power flow validation
  • line-parameter handling using default assumptions or catalog-based data
  • fixed-topology reinforcement optimization on existing edges
  • exportable GeoJSON and CSV outputs for GIS and downstream analysis

This tool is the natural upstream module for defining who is connected, where load nodes are located, and what the physical distribution layout looks like.

Repository link: https://github.com/SESAM-Polimi/LV-Distribution-Topology-Streamlit

2. RAMP Demand Simulation

The RAMP repository wraps the RAMP bottom-up demand framework inside a Streamlit interface. Its purpose is to generate realistic electricity demand profiles from appliance-level assumptions, user categories, and stochastic behavioural rules.

The app is structured into three pages:

  • Inputs Editor to build full RAMP Excel files directly in the UI
  • RAMP Simulation to define seasonal and weekly archetypes, run the stochastic engine, and export demand series
  • SSA Archetypes to build one-year demand profiles from predefined rural user archetypes when detailed inputs are unavailable

This module is especially valuable because it preserves:

  • stochasticity
  • seasonal structure
  • user-class granularity
  • export-ready hourly demand series for planning models

Repository link: https://github.com/SESAM-Polimi/RAMP-Streamlit

3. PVGIS Resource Assessment

The PVGIS repository is a resource characterization and conversion tool. It downloads PVGIS Typical Meteorological Year (TMY) data for a selected location and turns those data into planning-ready hourly series for:

  • solar PV production
  • wind turbine production
  • raw weather and resource diagnostics

The app combines:

  • map-based or coordinate-based site selection
  • explicit local-time shifting
  • solar resource plots and PV performance calculations
  • wind distribution analysis, Weibull fitting, and wind-rose visualization
  • built-in and uploadable wind turbine power curves
  • ZIP export of raw and processed CSV outputs

This module provides the renewable supply-side inputs required by the optimization model.

Repository link: https://github.com/SESAM-Polimi/PVGIS-Streamlit

4. MicroGridsPy Planning

MicroGridsPy Planning is the core techno-economic optimization layer of the suite. It is implemented as a Streamlit application backed by a Python modelling stack and a mathematical optimization backend built around Linopy.

The app is organized as a guided workflow:

  1. Project Setup Define formulation, technologies, horizon, uncertainty structure, and policy or system constraints.
  2. Data Audit and Visualization Validate generated inputs, inspect the canonical dataset, and visualize time-series and optional curves before solving.
  3. Optimization Build and solve the planning model using supported solvers such as HiGHS or Gurobi.
  4. Results Explore optimal capacities, dispatch behaviour, least-cost energy mix, costs, emissions, reliability metrics, and exportable results bundles.

Key modelling features already present in the repository include:

  • typical-year and multi-year formulations
  • deterministic and multi-scenario analysis
  • continuous and discrete sizing
  • optional grid import and export
  • generator partial-load modelling
  • battery efficiency and degradation logic
  • renewable land constraints
  • carbon-cost internalization
  • capacity expansion over time

The repository also documents a canonical data contract through an xarray.Dataset interface, which is important for keeping loaders, templates, and formulation logic aligned.

Repository link: https://github.com/MicroGridsPy/MicroGridsPy

5. Dispatch Simulation Module

The broader suite narrative also includes a dispatch-oriented operational module for evaluating strategies such as load-following and cycle-charging, as well as more detailed component behaviour and control constraints.

Based on the local workspace, this module is conceptually part of the ecosystem but not currently present here as a repository. In this hub, it should therefore be presented as:

  • an ecosystem extension
  • a work in progress module
  • a downstream tool that refines planning outputs rather than replacing the planning model

Note: the dispatch strategy simulation tool is currently a work in progress and will be released soon.

Implementation Philosophy

Although the tools address different planning stages, they share a common implementation philosophy:

  • Python-first open-source development
  • Streamlit interfaces for guided and transparent workflows
  • exportable artifacts in common formats such as CSV, YAML, JSON, Excel, and GeoJSON
  • reproducible project structures instead of opaque database-only pipelines
  • modular repositories that can evolve independently while remaining interoperable

In practice, the suite combines heuristics, engineering checks, stochastic simulation, API-based data retrieval, and mathematical optimization rather than forcing every problem into a single monolithic model.

Recommended Workflow For Users

For a typical rural electrification study, the suite can be used in the following order:

  1. Start with the LV Distribution Topology tool to define candidate connected users and network geometry.
  2. Use RAMP Demand Simulation to create hourly or minute-scale demand profiles for the selected users.
  3. Use PVGIS Resource Assessment to generate site-specific renewable production inputs.
  4. Feed demand and resource outputs into MicroGridsPy Planning to perform techno-economic sizing and least-cost analysis.
  5. If available, pass the resulting system design to the Dispatch Simulation Module for more operationally detailed assessment.

Depending on the case study, steps 2 and 3 can be developed in parallel, while the topology step remains especially important when the electrification strategy depends on settlement geometry and line-extension costs.

Repository Navigation

This hub is intended to point users toward the correct repository depending on the task they want to perform.

Quick links

  • Suite overview: README.md
  • Detailed tool catalog: tools.md
  • Installation guidance placeholder: installation.md
  • References placeholder: references.md

Repository placeholders

  • LV Distribution Topology: https://github.com/SESAM-Polimi/LV-Distribution-Topology-Streamlit
  • RAMP Demand Simulation: https://github.com/SESAM-Polimi/RAMP-Streamlit
  • PVGIS Resource Assessment: https://github.com/SESAM-Polimi/PVGIS-Streamlit
  • MicroGridsPy Planning: https://github.com/MicroGridsPy/MicroGridsPy
  • Dispatch Simulation Module: release link coming soon

Current Scope Of This Hub

This repository does not duplicate the code of the individual projects. Instead, it serves as a GitHub landing space that:

  • explains the suite-wide rationale
  • clarifies how the tools connect to one another
  • helps new users identify the correct entry point
  • centralizes repository links and documentation pointers
  • makes the broader platform easier to understand at a glance

For detailed per-tool descriptions, inputs, outputs, and workflow notes, see tools.md.

About

Collection of open-source tools developed within the SESAM research group to support integrated energy planning workflows for rural electrification and mini-grid design.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors