Skip to main content

Modelling for Solar and Storage

Project description

Solar and Storage

All Contributors

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
import plotly.graph_objects as go
from plotly.subplots import make_subplots

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_fig()

fig.show(rendered="browser")

Example1 The first plot shows the solar profile, the second shows the prices that day. The third shows the battery profile. 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

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Peter Dudfield
Peter Dudfield

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solar_and_storage-0.0.8.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

solar_and_storage-0.0.8-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file solar_and_storage-0.0.8.tar.gz.

File metadata

  • Download URL: solar_and_storage-0.0.8.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for solar_and_storage-0.0.8.tar.gz
Algorithm Hash digest
SHA256 cb2c7ca84e45377c41d6a6773bd3f48d0fd7981ba02ccab2897bb99d04225cd9
MD5 7bea758ebaa2f48d18299b32ab61302f
BLAKE2b-256 270ebf9d4e1df5f55241345c9839dda6d9af12bd7a6d8fdb93ec8b7165a89c73

See more details on using hashes here.

File details

Details for the file solar_and_storage-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for solar_and_storage-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b267349ae69cd654af316ed78b7e49c8f859735325d7b0f2aae32c402495ed1f
MD5 c4c4ebf1e7512469b920e4f900a42884
BLAKE2b-256 536b686ed9e641ca8481b8208bb0c585ff44a986f55c22a916f9f03d51aaaa56

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page