This repository is for the development of the Solar+ Optimization software.
controller contains the code that ties together the data acquisition, optimization and sending control signals back.
models contains the Modelica models and associated information for MPC and emulation.
process contains scripts to run data processing, analysis and parameter estimation.
doc contains documentation items, such as specifications, reports, and user guide (to be updated).
simulation contains scripts to run simulations for a fixed period using CSV files in data/.
tests contains testing for the software development.
$ make build
There are two sources of data:
- static CSV files
- real time data being stored in an influxDB
Please contact Anand Prakash or Kun Zhang for access to the data.
A simulation using the modelica models and optimization using MPCPy can be run by:
-
$ make runto start the Docker container and enter its terminal. Note that the Docker image must be built already (seeBuild the Docker Imageabove). -
$ python simulation/simulate.pyto run the simulation script -
Change these times here to run the simulation for different times.
Running the controller in shadow mode involves starting the MPC controller to retrieve real time data from the InfluxDB database, run the optimization and save the generated setpoints into a CSV file. The controller runs every fifth minute.
-
$ make runto start the Docker container and enter its terminal -
Rename the
mpc_shadow_config_template.pytompc_config.pyin thecontroller/folder and make necessary changes such as changing the tz_computer to your local time zone -
$ python controller/control.pyto run the controller in shadow mode
This involves starting the MPC controller to retrieve real time data from the InfluxDB database, run the optimization and send the generated setpoints to the actual devices. It uses XBOS's wavemq message bus to publish the new setpoints.
-
$ make runto start the Docker container and enter its terminal. Note that the Docker image must be built already (seeBuild the Docker Imageabove). -
Rename the
mpc_control_config_template.pytompc_config.pyin thecontroller/folder and make necessary changes to configure the XBOS setup (there are placeholders in the template) -
Copy the generated
pyxbos/folder from xboswave repository to the main directory -
$ python controller/control.pyto run the controller
Large edits, enhancements, new features, and bug fixes should be made on separate branches from the master, and merged to the master only after completion. Do this by the following process:
- Create a new issue.
- Create a new branch locally with name issueNo_briefDescription.
- Make edits, enhancements, new features on the new branch locally.
- Merge latest master to the new branch locally and ensure proper operation.
- Merge branch to master through a pull request.
- Krishnan Prakash, A.; Zhang, K.; Gupta, P.; Blum, D.; Marshall, M.; Fierro, G.; Alstone, P.; Zoellick, J.; Brown, R.; Pritoni, M. Solar+ Optimizer: A Model Predictive Control Optimization Platform for Grid Responsive Building Microgrids. Energies 2020, 13, 3093. https://doi.org/10.3390/en13123093
- Alstone, Peter, Brown, Richard, Zoellick, Jim, Pritoni, Marco, Blum, David, Radecsky, Kristen, Zhang, Kun, Prakash, Anand, and Perez, Pol. Resilient buildings for fire-adapted landscapes: EE and flexible loads integrated with solar and storage microgrids. United States: N. p., 2020. https://www.osti.gov/biblio/1713313
- Kun Zhang, Anand Prakash, Lazlo Paul, David Blum, Peter Alstone, James Zoellick, Richard Brown, Marco Pritoni, Model predictive control for demand flexibility: Real-world operation of a commercial building with photovoltaic and battery systems, Advances in Applied Energy, Volume 7, 2022, 100099, ISSN 2666-7924, https://doi.org/10.1016/j.adapen.2022.100099.
- Paul, L., Prakash, A., Zhang, K., Pritoni, M., & Brown, R. (2022). SolarPlus Optimizer: Integrated Control of Solar, Batteries, and Flexible Loads for Small Commercial Buildings. Lawrence Berkeley National Laboratory. Retrieved from https://escholarship.org/uc/item/5zm0d09s
SolarPlus-Optimizer Copyright (c) 2022, The Regents of the University
of California, through Lawrence Berkeley National Laboratory (subject
to receipt of any required approvals from the U.S. Dept. of Energy).
All rights reserved.
If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Intellectual Property Office at IPO@lbl.gov.
NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit others to do so.
SolarPlus-Optimizer is available under the following license.