This package uses linear programming to generate a future state of operation of the energy generation and storage units within an isolated microgrid. Multiple generation units of different technologies (Solar, Wind, Diesel, etc.) are considered. The amount of energy generated by each unit in a defined time horizon is calculated.
Demand forecasts and environmental variables are used to optimize the health of the microgrid components at the lowest possible cost.
Version 2.0 considers deterministic and stochastic optimization models that allows to generate charge profiles in order to decide about the microgrid.
The package is compatible with Python version 3 or higher only. The user is expected to have installed pyomo before running the package. Go to http://www.pyomo.org for more information.
- Switch to a proper directory and then type:
git clone https://github.com/SENECA-UDEA/microgrids_management.git
- Go into the microgrids_management folder
cd microgrids_management
- Install the package with the setup.py file:
python setup.py develop
- You need to install a linear solver such as "Gurobi": www.gurobi.com/ (e.g Gurobi, Cplex, SCJP, etc.)
Deterministic model uses forecasted data about Solar and Wind generation and Electricity demand in order to optimize the charge load for the renewable and non-renewable generators by once.
For more information read this paper.
Usage: MManagement d [OPTIONS]
Run the deterministic module of microgrid_management package.
Options:
-wf, --weather_forecast TEXT Path of weather forecast data .csv file
-df, --demand_forecast TEXT Path of demand forecast data .csv file
-gu, --generation_units TEXT Path of generation units parameters .json file
-dl, --down_limit FLOAT Energy level at battery to enter into deep
descharge status; default = 0.2
-ul, --up_limit FLOAT Energy level at battery to enter into
overcharge status; default = 0.9
-l_min, --l_min INTEGER Maximum number of periods in which deep
discharge is allowed; default = 2
-l_max, --l_max INTEGER Maximum number of periods in which overcharge
is allowed; default = 2
-sn, --solver_name TEXT Solver name to be use to solve the model;
default = gurobi
-mn, --model_name TEXT Model name for Pyomo object; default =
Deterministic
-plt, --plot_results BOOLEAN Plot generation results
-bfn, --base_file_name TEXT Base name for .csv output file
--help Show this message and exit.
In order to run an small example with the deterministic model, following command can be used:
python MManagement d -wf data/expr/det/FORECAST.csv -df data/expr/det/DEMAND.csv -gu data/expr/parameters.json
Affine Arithmetic Economic Dispatch model uses a self-validated numerical analysis in order to include uncertainty on the optimization model.
This model creates and optimizes a linear programming model based on forecasted data and dispatches based on the most recent Solar and Wind generation and Electricity demand available data.
Usage: MManagement s [OPTIONS]
Run the stochastic module of microgrid_management package.
Options:
-sf, --solar_forecast TEXT Path of solar generation forecast data .csv
file
-wf, --wind_forecast TEXT Path of wind generation forecast data .csv
file
-df, --demand_forecast TEXT Path of demand forecast data .csv file
-af, --actuals_filepath TEXT Path of most recent forecast (Demand, Solar,
Wind) data .csv file
-gu, --generation_units TEXT Path of generation units parameters .json file
-mw, --main_weight FLOAT Main objective function weigth; default = 0.8
-sn, --solver_name TEXT Solver name to be use to solve the model;
default = gurobi
-mn, --model_name TEXT Model name for Pyomo object; default =
Deterministic
-plt, --plot_results BOOLEAN Plot generation results
-bfn, --base_file_name TEXT Base name for .csv output file
--help Show this message and exit.
Forecasted input data enters to the package throught --solar_forecast, --wind_forecast and --demand_forecast with the following format in .csv files:
mean | 1 | ... | H |
---|---|---|---|
19089.5 | 286.7524061 | ... | 283.0492167 |
... | ... | ... | ... |
... |
Where
In order to generate dispatch values from the model, most recent data is needed. This information enters to the package throught --actuals_filepath in a single .csv file with format:
D | S | W |
---|---|---|
19612.2 | 0 | 4518.912 |
... | ... | ... |
Where
In order to run an small example with the Affine Arithmetic Economic Dispatch model, following command can be used:
python MManagement s -sf data/expr/stch/forecast/-6_solar.csv -wf data/expr/stch/forecast/-6_wind.csv -df data/expr/stch/forecast/-6_demand.csv -af data/expr/stch/actuals/0.csv -gu data/expr/parameters.json