Giter Club home page Giter Club logo

miguel's Introduction

Micro Grid User Energy Planning Tool Library (MiGUEL)

drawing

Disclaimer

MiGUEL is continously optimized in terms of handling and outputs.

Introduction

MiGUEL is a python-based, open-source simulation tool to design, simulate and evaluate the performance of photovoltaic-diesel-hybrid systems. MiGUEL is based on a matlab tool developed at the Technische Hochschule Köln (TH Köln). In the course of the research project Energy-Self-Sufficiency for Health Facilities in Ghana (EnerSHelF) the matlab tool was transferred to python, revised and additional components were added.
MiGUEL aims to provide an easy-to-use simulation tool with low entry barriers and comprehensible results. Only a basic knowledge of the programming language is needed to use the tool. For the system design, simulation and evaluation, only a small number of parameters is needed. The simulation can run without data sets provided by the user. The results are provided in the form of csv files for each simulation step and in the form of an automatically generated pdf report. The csv files are understood as raw data for further processing. The pdf report serves as a project brochure. Here, the results are presented clearly and graphically, and an economic and ecological evaluation of the system is carried out.

Table of contents

Authors and contributors

The main author is Paul Bohn (@pdb-94). Co-author of the project is Silvan Rummeny (@srummeny) who created the first approach within his PhD. Other contributors are Moritz End (@moend95). Further assistance was provided by Sascha Birk (@pyosch). The development of the tool was supervised by Prof. Dr. Schneiders (TH Köln CIRE).

Content and structure

The basic structure of MiGUEL is displayed below.

drawing

The class Environment represents the energy system. It takes basic parameters such as time frame, location, economic and ecologic parameters. System components can be added to the Environment. The Operator runs the simulation and evaluation of the designed energy system. The class Report creates the pdf-report. The program is run by the main file.

Main

The main file is used to run the program. The main file is the only time the user has to interact with the source code. The Environment, Operator and Report are created by the user.

Environment

The class Environment represents the energy system.

Input parameters

To create an instance of the class, the following parameters have to be provided. The list displays all input parameters, a brief description and the data type.

Parameter Description dtype Default Unit Comment
name Project name str MiGUEL Project -
time Project time data dict - -
start Start time datetime.datetime - -
end End time datetime.datetime - -
step Time resolution datetime.timedelta 15 min Possible resolutions: 15min, 60min
timezone Time zone str - -
location Project location dict - -
longitude Longitude float - °
latitude Latitude float - °
altitude Altitude float - m
terrain Terrain type str - - see Appendix
economy Economical parameters dict - -
d_rate Discount rate float - -
lifetime Project lifetime int 20 a
currency Currency str US$ - If other currencies are used conversion rate needs to be applied
electricity_price Electricity price float - US$/kWh
diesel_price Diesel price float - US$/l
co2_price Average CO2-price over system lifetime float - US$/t
pv_feed_in_tariff PV feed-in tariff float - US$/kWh
wt_feed_in_tariff Wind turbine feed-in tariff float - US$/kWh
ecology Ecological parameters dict - -
co2_grid Specific CO2-emissions power grid float - kg/kWh
co2_diesel Specific CO2-emissions diesel float 0.2665 kg/kWh
blackout Stable or unstable power grid bool False - True: Unstable power grid; False: Stable power grid
blackout_data csv-file path with blackout data str - - csv-file with bool-values for every timestep
feed_in Feed-in possible bool False - True: Feed-in possible, False: Feed-in not possible
weather_data csv-file path with weather data set str - - Enables off-line usage

System components

MiGUEL features the following system components. Each component can be added to the Environment by using a different function. The list displays the system components and the functions to add the components to the Environment.

System component Function
Load .add_load
Photovoltaic .add_PV
Wind turbine .add_wind_turbine
Grid .add_grid
Diesel generator .add_diesel_generator
Energy storage .add_storage
Load

The system component load represents the load profile of the subject under review. The load profile can be generated in two different ways.

  1. Reference load profiles: In the course of EnerSHelF standard load profiles for Ghanaian hospitals were created. This daily standard load profile is implemented in the program. Since May 2023 the reference load profiles from the Bundesverband der Energie- und Wasserwirtschaft (BDEW) have been included. The reference load profiles are used in the german dispatch to simulate certain inistitutions. [17] To create a load profile from the reference load profiles, the annual electricity consumption needs to be returned to the function (annual_consumption). The reference load profiles have a 15min-time resolution.
  2. Input via csv-file: If actual measurement data from the subject is available, the data can be returned to the program as a csv-file (load_profile). The csv file must contain two columns with the titles 'time' & 'P [W]'. ',' or ';' are used as separators; for decimal separation '.' or ',' are used depending on the setting.
Parameter Description dtype Default Unit Comment
annual_consumption Annual electricity consumption float - kWh Only for method 1
profile Reference load profile str - - Only for method 1
load_profile File path to load profile data str - - csv-file with load profile, Only for method 2

The accuracy of the simulation results increases with the quality of the input data. Using the adjusted standard load profile will provide less accurate results compared to measured data. The library Load Profile Creator can be used to create load profiles based on the electric inventory of the subject.

If the resolution of the load profile does not match the environment time resolution, the resolution of the load profile will be adjusted by summarizing or filling in the values. If no annual load profile is provided, the load profile will be repeated to create an annual load profile.

Photovoltaic

The class Photovoltaic is based on the library pvlib [1]. There are three methods implemented to create PV systems:

  1. Adding basic system parameters: Simplest way to create PV system with only basic parameters such as nominal power, surface tilt and azimuth, module and inverter power range. The class Photovoltaic will randomly choose a PV module, number of modules and an inverter that matches the parameters.
  2. Selecting your modules and inverter: All system parameters such as module, number of modules, inverter, strings per inverter, modules per string, surface tilt and azimuth, ... need to be returned to the function. The modules and inverters featured in pvlib are stored in the MiGUEL database.
  3. Provide measured PV data: Input of measured PV as a csv-file
Parameter Description dtype Default Unit Comment
p_n Nominal power float - W
pv_profile File path to pv porduction data str - - Measured pv data in csv file, Only for method 3
pv_data PV system parameters dict - -
pv_module PV module str - - PV module from pvlib database, Only for method 2
inverter Inverter str - - Inverter from pvlib database, Only for method 2
modules_per_string Modules per string int - - Only for method 2
strings_per_inverter Strings per inverster int - - Only for method 2
surface_tilt PV system tilt angle float - -
surface_azimuth PV system orientation float - - North=0°, East=90°, South=180°, West=270°
min_module_power Minimum module power float - W Only for method 1
max_module_power Maximum module power float - W Only for method 1
inverter_power_range Inverter power range float - W Only for method 1

pvlib will run the PV simulation based on the selected system parameters. The weather data for the project location is retrieved by the Environment. The data source is PVGIS hosted by the European Commission.

Wind turbine

The class WindTurbine is based on the library windpowerlib [2]. To add wind turbines to the Environment the turbine type and the turbine height [m] need to be returned. The wind turbines featured in windpowerlib are stored in the MiGUELdatabase.

Parameter Description dtype Default Unit Comment
turbine_data Turbine data dict - -
turbin_type Turbine type str - - Turbine name and manufacturer from windpowerlib register (Methd 2)
tubine_height Hub height float - m Method 2
selection_parameters list - - Select random turbine iwthin power range
p_min Minimal power float - kW Method 1
p_max Maximal power float - kW Method 1

The weather data for the project location is retrieved by the Environment. The data source is PVGIS hosted by the European Commission. Inside the class WindTurbine the weather data is processed, so it can be used for the simulation.

Grid

The class grid represents the power grid. The power grid provides electricity to the energy system. Depending on the input of blackout data, a stable or unstable power grid is simulated. The possibility of feed-in is determined in the Environment. The grid is automatically added to the Environment if the parameter grid_connection is set to True.

Diesel Generator

The class DieselGenerator is based on a simplified, self created generator model. The model assumes that in the future generators with low-load capability are used in PV-diesel hybrid systems. In comparison to conventional diesel generators, low-load diesel generators are more fuel efficient and therefore reduce CO2-emissions [3]. The input parameters for diesel generators are displayed in the table below.

Parameter Description dtype Default Unit Comment
p_n Nominal power float - W
fuel_consumption Fuel consumption at nominal power float - l
fuel_price Fuel price float - US$/l

The fuel consumption for the generator is calculated every time step using the following equation. The equation was derived using characteristic values of a 150 kW diesel generator at loads of 0%, 25%, 50%, 75% and 100% [4].

fc(l) = - 1.66360855 x l 4 +3.96330272 x l 3 -3.19877674 x l 2+1.8990825 x l +0

fc = relative fuel consumption [%]l = relative load [%]

Energy storage

The class Storage represents energy storage systems. The energy storage is represented by a basic model. The input parameters for storage systems are displayed in the table below:

Parameter Description dtype Default Unit Comment
p_n Nominal power float - W
c capacity float - Wh
soc Initial state of charge float 0.5 -
soc_max Maximum state of charge float 0.95 -
soc_min Minimum state of charge float 0.05 -
n_discharge Discharge efficiency float 0.8 -
n_charge Charge efficiency float 0.8 -

The energy storage can be either charged or discharged at any time step. The following boundary conditions apply to loading and unloading. The memory can only be discharged to the minimum state of charge and charged to the maximum state of charge. The maximum charging or discharging power corresponds to the nominal power multiplied by the respective efficiency.

Operator

The simulation process is divided in three steps.

drawing

The system design is the only time the user needs to interact with the program code. Here the Environment (create Environment) and the system components are created (system components). The annual simulation and the system evaluation are carried out by the Operator.

Annual simulation

The energy system type depends on the input parameters and the system components in the energy system. A distinction is made between off-grid systems and on-grid systems. On-grid systems are further divided into stable systems (without blackouts) and unstable systems (with blackouts). Depending on the type of energy system, different dispatch strategies are applied for the annual simulation.

drawing

RE = Renewable energies   ES = Energy storage   DG = Diesel generator

The figure displays the dispatch strategies for all system components. If a system component is not added to the system, this component will be skipped in the dispatch.

Evaluation

The two key parameters for the system evaluation are the Levelized Cost of Energy (LCOE) in US$/kWh and the CO2-emissions [t] over the system lifetime. The class Evaluation takes the Envrionemnet and the Operator as input parameters.

Note: The specific values for investment, operating and maintenance costs have been partially converted from euros to US$ (27.03.2023). The costs may differ depending on the exchange rate.

Levelized Cost of Energy

The LCOE are calculated according to Michael Papapetrou et. al. for every energy supply component [5]. The system LCOE is composed of the individual LCOEs of the system components, which are scaled according to the energetic share. The LCOE are calculated over the whole system lifetime. The LCOE includes the initial investment costs and the operation and maintenance costs. Costs for recycling are neglected in this evaluation. The investment and operation and maintenance cost are based on specific costs from literature values. The specific costs are scaled by the power (energy supply components) or capacity (energy storage).

System component Specific investment cost Specific annual operation/maintenance cost Unit Source
PV 496 7.55 US$/kW [6] [7]
Wind turbine 1160 43 US$/kW [8] [9]
Diesel generator 468 Investment cost *0.03; 0.021 US$/kWh US$/kW [10] [11]
Energy storage 1200 30 US$/kWh [12]

CO2-emissions

The CO2-emissions are evaluated over the system lifetime. Included are the CO2-emissions during the production of the system component and the CO2-emissions emitted during the usage.

System component Specific CO2 emissions production/installation Unit Source
PV 460 kg/kW [13]
Wind turbine 200 kg/kW [14]
Diesel generator 265 kg/kW [15]
Energy storage 103 kg/kWh [16]

Output

MiGUEL provides two types of outputs. The first output is a csv-file with every simulation time step. The csv-files can be used for further research or in depth analysis of the system behaviour. The csv-files do not include the system evaluation. The second output is the pdf-report. The report includes the most important results. The results are displayed graphically and will be explained briefly.

csv-files

The csv-files display the raw data of the annual simulation. The file lists every time step of the simulation, the load and all system components, as well as their generation power.

drawing

Report

The pdf-Report is automatically created by MiGUEL. It gives an overview of the simulation results and features the system evaluation based on the LCOE and CO2-emissions. The report is structured in the following chapters:

  1. Introduction: Brief description of MiGUEL and EnerSHelF
  2. Summary: Summary of the most important simulation results and system evaluation
  3. Base data: Displays input parameters
  4. Climate data: Solar and wind data from PVGIS at the selected location
  5. Energy consumption: Load profile
  6. System configuration: Overview of selected system components
  7. Dispatch: Annual simulation results
  8. Evaluation: System evaluation based on LCOE and CO2-emissions over system lifetime

The report focuses not only on the energetic results of the system evaluation but also on economic and ecologic parameters. This makes the results more comprehensible compared to the csv-files. The pdf-report can be used as a project brochure.

Graphical user interface

End of June 2023 a graphical user interface (GUI) has been implemented into MiGUEL to increase the usability of the tool. With the implemtation the entry hurdle is lowered even more. The GUI follows the logical process as described above. The following list gives an overview of the different tabs and a short description of their function:

  1. Get started: Welcome Screen including a brief overview of MiGUEL and EnerSHelF. Select csv file format
  2. Energy system: Input mask to create Environment class.
  3. Weather data: Displays weather data from PVGIS at selected location.
  4. Load profile: Input mask to add load profile to Environment.
  5. PV system: Input mask to add PV systems to Environment.
  6. Wind turbine: Input mask to add wind turbines to Environment.
  7. Diesel Generator: Input mask to addd diesel generator to Environment.
  8. Energy storage: Input mask to add energy storage to Environment.
  9. Dispatch: Overview of system components. Runs dispatch and system evaluation.
  10. Evaluation: Overview of system evaluation parameters. Creates outputs.

Database

MiGUEL features a SQLite database in the directory /data/miguel.db. The following tables are included in the database:

Name Data sets Source
pvlib_cec_module pvlib cec module parameters
pvlib_cec_inverter pvlib cec inverter parameters
windpowerlib_turbine windpowerlib wind turbine parameters
standard_load_profile standard load profile for Ghanaian hospitals
bdew_standard_load_profile standard load profile of BDEW [17]

Project partners

drawing

drawing drawing

Dependencies

For a full list of all dependencies see requirements.txt. This file will ask the user to install the dependencies automtically.

pandas

numpy

matplotlib

folium

geopy

fpdf

pvlib

windpowerlib

selenium

plotly

lcoe

global-land-mask

PyQT5

geonames

geopandas

lcoe

plotly

References

[1] William F. Holmgren, Clifford W. Hansen, and Mark A. Mikofski. “pvlib python: a python package for modeling solar energy systems.” Journal of Open Source Software, 3(29), 884, (2018). https://doi.org/10.21105/joss.00884

[2] Sabine Haas, Uwe Krien, Birgit Schachler, Stickler Bot, kyri-petrou, Velibor Zeli, Kumar Shivam, & Stephen Bosch. (2021). wind-python/windpowerlib: Silent Improvements (v0.2.1). Zenodo. https://doi.org/10.5281/zenodo.4591809

[3] PV Magazine; "Low-load generators make photovoltaic diesel applications cleaner and more efficient"; 06. October 2015; online available: Niedrig-Last-Generatoren machen Photovoltaik-Diesel-Anwendungen sauberer und effizienter

[4] Generator Source, LLC 1999-2023; Approximate Diesel Fuel Consumption Chart; online available: https://www.generatorsource.com/Diesel_Fuel_Consumption.aspx

[5] Michael Papapetrou, George Kosmadakis, Chapter 9 - Resource, environmental, and economic aspects of SGHE, Editor(s): Alessandro Tamburini, Andrea Cipollina, Giorgio Micale, In Woodhead Publishing Series in Energy, Salinity Gradient Heat Engines, Woodhead Publishing, 2022, Pages 319-353, ISBN 9780081028476, https://doi.org/10.1016/B978-0-08-102847-6.00006-1

[6] Vartiainen, E, Masson, G, Breyer, C, Moser, D, Román Medina, E. Impact of weighted average cost of capital, capital expenditure, and other parameters on future utility-scale PV levelised cost of electricity. Prog Photovolt Res Appl. 2020; 28: 439– 453. https://doi.org/10.1002/pip.3189

[7] Bjarne Steffen, Martin Beuse, Paul Tautorat, Tobias S. Schmidt, Experience Curves for Operations and Maintenance Costs of Renewable Energy Technologies, Joule, Volume 4, Issue 2, 2020, Pages 359-375, ISSN 2542-4351, https://www.sciencedirect.com/science/article/pii/S2542435119305793

[8] Lucas Sens, Ulf Neuling, Martin Kaltschmitt, Capital expenditure and levelized cost of electricity of photovoltaic plants and wind turbines – Development by 2050, Renewable Energy, Volume 185, 2022, Pages 525-537, ISSN 0960-1481, https://www.sciencedirect.com/science/article/pii/S0960148121017626

[9] Tyler Stehly, Philipp Beiter, and Patrick Duffy, National Renewable Energy Laboratory, 2019 Cost of Wind Energy Review, 2019, https://www.nrel.gov/docs/fy21osti/78471.pdf9

[10] James Hamilton, Michael Negnevitsky, Xiaolin Wang, The potential of variable speed diesel application in increasing renewable energy source penetration, Energy Procedia, Volume 160, 2019, Pages 558-565, ISSN 1876-6102, https://doi.org/10.1016/j.egypro.2019.02.206

[11] The EU Global Technical Assistance Facility for Sustainable Energy (EU GTAF), Sustainable Energy Handbook Module 6.1 Simplified Financial Models

[12] National Renewable Energy Laboratory, Utility-Scale Battery Storage, 2023, https://atb.nrel.gov/electricity/2022/utility-scale_battery_storage

[13] Fraunhofer ISE, Photovoltaics and Climate Change, 2020, https://www.ise.fraunhofer.de/content/dam/ise/de/documents/publications/studies/ISE-Sustainable-PV-Manufacturing-in-Europe.pdf

[14] Ozoemena, M., Cheung, W.M. & Hasan, R. Comparative LCA of technology improvement opportunities for a 1.5-MW wind turbine in the context of an onshore wind farm. Clean Techn Environ Policy 20, 173–190 (2018). https://doi.org/10.1007/s10098-017-1466-2

[15] Friso Klemann, University Utrecht, The environmental impact of cycling 1,600 MWh electricity - A Life Cycle Assessment of a lithium-ion battery from Greener Power Solutions (P. 35)

[16] Hao, H.; Mu, Z.; Jiang, S.; Liu, Z.; Zhao, F. GHG Emissions from the Production of Lithium-Ion Batteries for Electric Vehicles in China. Sustainability 2017, 9, 504. https://doi.org/10.3390/su9040504

[17] BBDEW Bundesverband der Energie- und Wasserwirtschaft e.V.; Standardlastprofile Strom; https://www.bdew.de/energie/standardlastprofile-strom/; 01.01.2017

Appendix

Environment - terrain types

Terrain type Roughness length [m]
Water surfaces 0.0002
Open terrain with smooth surface, e.g., concrete, airport runways, mowed grass 0.0024
Open agricultural terrain without fences or hedges, possibly with widely scattered houses, very rolling hills 0.03
Agricultural terrain with some houses and 8 meter high hedges at a distance of approx. 1250 meters 0.055
Agricultural terrain with many houses, bushes, plants or 8 meter high hedges at a distance of approx. 250 meters 0.2
Villages, small towns, agricultural buildings with many or high hedges, woods and very rough and uneven terrain 0.4
Larger cities with tall buildings 0.8
Large cities, tall buildings, skyscrapers 1.6

miguel's People

Contributors

pdb-94 avatar

Stargazers

 avatar ringsaturn avatar  avatar NP avatar

Watchers

 avatar

Forkers

luizahiginoss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.