LBNL-ETA / SolarPlus-Optimizer

This repository is for the development of the Solar+ Optimization software.
Other
5 stars 2 forks source link

SolarPlus-Optimizer

This repository is for the development of the Solar+ Optimization software.

Structure

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.

Build the Docker Image

$ make build

Request Data

There are two sources of data:

Please contact Anand Prakash or Kun Zhang for access to the data.

Running Simulations

A simulation using the modelica models and optimization using MPCPy can be run by:

  1. $ make run to start the Docker container and enter its terminal. Note that the Docker image must be built already (see Build the Docker Image above).

  2. $ python simulation/simulate.py to run the simulation script

  3. Change these times here to run the simulation for different times.

Running the MPC Controller in Shadow Mode (Open-loop Control)

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.

  1. $ make run to start the Docker container and enter its terminal

  2. Rename the mpc_shadow_config_template.py to mpc_config.py in the controller/ folder and make necessary changes such as changing the tz_computer to your local time zone

  3. $ python controller/control.py to run the controller in shadow mode

Running the MPC Controller in Realtime (Closed-loop Control)

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.

  1. $ make run to start the Docker container and enter its terminal. Note that the Docker image must be built already (see Build the Docker Image above).

  2. Rename the mpc_control_config_template.py to mpc_config.py in the controller/ folder and make necessary changes to configure the XBOS setup (there are placeholders in the template)

  3. Copy the generated pyxbos/ folder from xboswave repository to the main directory

  4. $ python controller/control.py to run the controller

Edits, Enhancements, and New Features

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:

1) Create a new issue. 2) Create a new branch locally with name issueNo_briefDescription. 3) Make edits, enhancements, new features on the new branch locally. 4) Merge latest master to the new branch locally and ensure proper operation. 5) Merge branch to master through a pull request.

Relevant Publications

Copyright Notice

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.

License

SolarPlus-Optimizer is available under the following license.