MicroGridsPy
Provide an open-source alternative to the problem of sizing and dispatch of energy in micro-grids in isolated places.
https://github.com/microgridspy/microgridspy
Category: Energy Systems
Sub Category: Grid Analysis and Planning
Last synced: about 6 hours ago
JSON representation
Repository metadata
- Host: GitHub
- URL: https://github.com/microgridspy/microgridspy
- Owner: MicroGridsPy
- License: eupl-1.2
- Created: 2018-01-23T02:21:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-22T13:15:44.000Z (6 days ago)
- Last Synced: 2025-04-27T03:01:52.659Z (1 day ago)
- Language: Python
- Size: 528 MB
- Stars: 35
- Watchers: 4
- Forks: 31
- Open Issues: 0
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
README.md
MicroGridsPy 2.1
Description
The MicroGridsPy model main objective is to provide an open-source alternative to the problem of sizing and dispatch of energy in micro-grids in isolated places. It’s written in python(pyomo) and use excel and text files as input and output data handling and visualisation.
Here the link to the online documentation: MicroGridsPy Documentation.
⚠️ Warning: For a MACOS compatible version, please refer to version 2.0. The project is under active development.
Main Features
- Optimal sizing of PV panels, wind turbines, other renewable technologies, back-up genset and electrochemical storage system for least cost electricity
supply in rural remote areas - Optimal dispatch from the identified supply systems
- Possibility to optimize on NPC or operation costs
- LCOE evaluation for the identified system
- Two-stage stochastic optimization
- User Interface
Advanced Features
MicroGridsPy 2.1 incorporates several advanced features, enhancing its versatility and effectiveness in various scenarios:
- Variable Fuel Costs: Adjust fuel costs dynamically based on market prices.
- MILP Formulation for Unit Commitment: Ensures optimal operation of generation sources.
- Partial Load Operation of Diesel Genset: Optimizes diesel genset operations, even under partial load, using MILP.
- High-Resolution Optimization: Conducts optimization at a 1-minute time-step, suitable for coupling with RAMP load profiles.
- Evolving Load Demand & Multi-Step Capacity Expansion: Adapts to changing load demands over multiple years.
- Optimization of Grid-Connected Microgrids: Enhances the efficiency of grid-connected systems.
- Two-Objective Optimization: Focuses on minimizing either Net Present Cost or CO2 emissions.
- Brownfield Optimization: Tailors solutions for existing infrastructure upgrades.
- Built-In Load Archetypes: Specifically designed for rural users in Sub-Sahara Africa.
- NASA POWER Integration: Utilizes NASA POWER for calculating renewable energy production.
Environments and Solvers
In the current repository under the Environments branch, environments for both macOS and Windows are available. Currently, MicroGridsPy has been confirmed to work with Gurobi and GLPK.
⚠️ Warning: While GLPK is a capable solver for many optimization problems, it tends to operate slower compared to commercial solvers like Gurobi, especially for large or complex problems. The performance difference can be significant, potentially ranging from several times to orders of magnitude faster, depending on the specifics of the problem. These observations are general, and actual performance will vary with each unique problem. It is advisable to consider this factor when choosing a solver for time-sensitive or large-scale applications.
Getting Started with MicroGridsPy
To install MicroGridsPy, the conda package manager is recommended. Follow this step-by-step guide:
-
Install Anaconda:
- Download and install the Anaconda distribution for Python 3 from the Anaconda Archive. Anaconda simplifies package management and deployment, especially for data science and machine learning applications.
-
Download the MicroGridsPy Environment File:
- The environment file for MicroGridsPy is available on the MicroGridsPy/Environments SESAM GitHub repository. Download the file to prepare your modeling environment.
-
Create and Activate the MicroGridsPy Environment:
- Save the downloaded
mgpy_win.yml
file in an accessible directory (e.g.,C:\\Users\\youruser
). - Open the Anaconda Prompt, navigate to the directory, and execute the following commands:
conda env create -f mgpy_win.yml conda activate mgpy
- Save the downloaded
-
Development Environment Setup:
- Make sure your development environment includes necessary Python packages such as Pyomo (minimum version 6.4.3), Pandas, NumPy, and Matplotlib.
-
Launch Spyder IDE for Development:
- Use the Spyder IDE for development and debugging, available in the Anaconda distribution. Start Spyder with the following commands:
conda activate mgpy spyder
- Use the Spyder IDE for development and debugging, available in the Anaconda distribution. Start Spyder with the following commands:
-
Run the GUI Application:
- MicroGridsPy includes a GUI for easier data input. Launch the GUI by running
app_main.py
from the Code/User Interface folder using Spyder or your preferred IDE.
- MicroGridsPy includes a GUI for easier data input. Launch the GUI by running
These steps will guide you through a successful installation of MicroGridsPy.
Maintenance and Development
MicroGridsPy is currently mantained and developed by the SESAM group in the Department of Energy Engineering at Politecnico di Milano. The research activity of SESAM focuses on using mathematical models for the study of systems, components, and processes in the energy field and industrial ecology.
Contributors of the current version:
- Nicolò Stevanato, Politecnico di Milano [email protected]
- Alessandro Onori, Politecnico di Milano [email protected]
- Riccardo Mereu, Politecnico di Milano [email protected]
- Emanuela Colombo, Politecnico di Milano [email protected]
Past contributors:
- Gianluca Pellecchia, Politecnico di Milano
- Ivan Sangiorgio, Politecnico di Milano
- Francesco Lombardi, TU Delft
- Giulia Guidicini, Politecnico di Milano
- Lorenzo Rinaldi, Politecnico di Milano
Based on the original model by:
- Sergio Balderrama, Universidad Mayor de San Simón [email protected]
- Sylvain Quoilin, Université de Liège [email protected]
License
This is a free software licensed under the “European Union Public Licence" EUPL v1.1. It
can be redistributed and/or modified under the terms of this license.
Owner metadata
- Name: MicroGridsPy
- Login: MicroGridsPy
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/35714111?v=4
- Repositories: 2
- Last ynced at: 2024-06-05T16:56:36.209Z
- Profile URL: https://github.com/MicroGridsPy
GitHub Events
Total
- Issues event: 3
- Watch event: 5
- Push event: 31
- Pull request event: 9
- Fork event: 2
Last Year
- Issues event: 3
- Watch event: 5
- Push event: 31
- Pull request event: 9
- Fork event: 2
Committers metadata
Last synced: 7 days ago
Total Commits: 428
Total Committers: 14
Avg Commits per committer: 30.571
Development Distribution Score (DDS): 0.467
Commits in past year: 70
Committers in past year: 2
Avg Commits per committer in past year: 35.0
Development Distribution Score (DDS) in past year: 0.143
Name | Commits | |
---|---|---|
AleOnori98 | o****8@g****m | 228 |
Slbalderrama | s****7@h****m | 83 |
Nicolò Stevanato | n****o@p****t | 50 |
Ivan Sangiorgio | 7****o | 23 |
Giulia Guidicini | 4****i | 13 |
costanzasummaria | 8****m | 7 |
Sylvain Quoilin | s****n@e****u | 6 |
FLomb | f****i@p****t | 4 |
gianlucapellecchia | g****a@m****t | 3 |
Nicolò Stevanato | n****o@m****t | 3 |
LorenzoRinaldi | l****1@g****m | 3 |
FLomb | f****i@o****m | 2 |
GiacomoCrevani | g****i@m****t | 2 |
LorenzoRinaldi | 4****i | 1 |
Committer domains:
- mail.polimi.it: 3
- polimi.it: 2
- ec.europa.eu: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 3
Total pull requests: 10
Average time to close issues: about 5 years
Average time to close pull requests: 8 months
Total issue authors: 2
Total pull request authors: 6
Average comments per issue: 0.0
Average comments per pull request: 0.2
Merged pull request: 5
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 6
Past year average time to close issues: N/A
Past year average time to close pull requests: 16 days
Past year issue authors: 0
Past year pull request authors: 2
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 5
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- squoilin (2)
- ghost (1)
Top Pull Request Authors
- abirbouts (4)
- Stevogallo (2)
- ivansangiorgio (1)
- TomFer97 (1)
- FLomb (1)
- JVISchneider (1)
Top Issue Labels
Top Pull Request Labels
Dependencies
- sphinx ==7.1.2
- sphinx-gallery *
- sphinx-panels *
- sphinx-rtd-theme ==1.3.0rc1
- sphinx-sitemap *
- sphinx-togglebutton *
- sphinxcontrib-images *
Score: 6.194405391104672