Skip to main content

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
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

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.7.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

solar_and_storage-0.0.7-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: solar_and_storage-0.0.7.tar.gz
  • Upload date:
  • Size: 4.9 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.7.tar.gz
Algorithm Hash digest
SHA256 778892e9cafaccfad5f76b90ab299692ed7b45a5c78a4dc6c0b7e35afc3869ff
MD5 56b0e3d6d378ef893db75506464cb09b
BLAKE2b-256 301ca1c06c8c516bf533c382e48ac388462286b429d725abbc5b96d49d64bd9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solar_and_storage-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8669bef5c9060fb57b9075942c776ae8f88119344967194e7cf0405bcdf393a0
MD5 0d7f4eff52a40a612826046976d88bfd
BLAKE2b-256 82e4dfe61580141c9b245b31fdd34f9bd28cb7c4cb8a55a80d3055d97ee4a565

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