Modelling for Solar and Storage
Project description
Solar and Storage
A Python Library to run solar and storage optimization. This uses mixed integer linear programming and maximises revenue made by charging and discharging the battery. The model uses variable prices and a solar generation profile.
Installation
pip install solar-and-storage
Example
Import the packages
import numpy as np
from solar_and_storage.solar_and_storage import SolarAndStorage
Make the fake price and solar data
# make prices
prices = np.zeros(24) + 30
prices[6:19] = 40
prices[9] = 50
prices[12:14] = 30
prices[16:18] = 50
prices[17] = 60
# make solar profile
solar = np.zeros(24)
solar[8:16] = 2.0
solar[10:14] = 4.0
Then run optimization
solar_and_storage = SolarAndStorage(prices=prices, solar_generation=list(solar))
solar_and_storage.run_optimization()
result_df = solar_and_storage.get_results()
Now plot the data
fig = solar_and_storage.get_figure()
fig.show(rendered="browser")
The first plot shows the solar profile, the second shows the prices that day. The third shows the battery profile. Finally the fourth shows profit. You can see that the battery charged from the solar site at the end of the solar maximum
Thanks
Thanks you to the follow repos for inspiration
- https://github.com/ADGEfficiency/energy-py-linear
- https://github.com/wzyfrank/battery/
- https://github.com/greysonchung/Battery-Optimisation/
- https://github.com/edu230991/battery-optimization/ sdk-python-ci.yml
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Peter Dudfield 💻 |
gilbertgong 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solar_and_storage-0.0.11.tar.gz.
File metadata
- Download URL: solar_and_storage-0.0.11.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff139d15860e0bee854ae154d409e8b9d07c7a6065d222ec25745970aa505af2
|
|
| MD5 |
236e3b3a9c06bdea2a026b35e0e81546
|
|
| BLAKE2b-256 |
99c8f3133ecab252dd4755efd997fbcd4b1424b61580b531fc1e4da296afe692
|
File details
Details for the file solar_and_storage-0.0.11-py3-none-any.whl.
File metadata
- Download URL: solar_and_storage-0.0.11-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c3f9278dee4915d6b5004b316570a93845843e1f2b98f83a090ef466c9c3830
|
|
| MD5 |
f24e352d05ff51891a3397b480fe0731
|
|
| BLAKE2b-256 |
9c36cc59974d98c761c013b809d5aa1909c14b353538a994025e5c38d996fae1
|