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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: solar_and_storage-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 2ede20791e8c9f149095bd8bec700eb2aac7545c1eeb128ef781a425456bcce0
MD5 4bc133cd266bc70f4115dae2ed8c2302
BLAKE2b-256 218910707aba7ce7b39d11aca6dc35a9bf77622ff694babc66e96bf217beb178

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solar_and_storage-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e4b692eb68efaf77cb8910a1d4a1d55f4c5f4867dc069a88629773e842a794c1
MD5 e63f3e9aff8b013a45c8536989d4a018
BLAKE2b-256 98dfec303d88cec386db76307adb0381895bd1e6c9f604f0c5724ead032c8e09

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