Skip to main content

The library aims to provide a simple way to create individual consumer loads, generation.

Project description

Welcome to consmodel library 👋

Python Version

!!! Warning: the library is active and the functionalities are being added on weekly basis, some functionalities will also change !!!

The library aims to provide a simple way to create individual consumer loads and generation.

The library is a centralised modelling tool that implements the following consumption/generation consumptions:

  • pure consumption model,
  • solar plant model,
  • heat pump model,
  • electric vehicle modelling,
  • possibly other models...

The main idea of the library is to be able to easily create consumption or generation power consumption profiles.

The schema of the library is as follows:

🏠 Homepage

Install

pip3 install consmodel

Usage

PV model

   from consmodel import PV
   import pandas as pd
   import numpy as np
   import matplotlib.pyplot as plt

   # create a simple PV model
   pv = PV(lat=46.155768,
           lon=14.304951,
           alt=400,
           index=1,
           name="test",
           freq="15min",)
   timeseries = pv.simulate(pv_size=14.,
                            year=2022,
                            model="ineichen",
                            consider_cloud_cover=True)
   # plot the results
   timeseries.plot()
   plt.show()

BS model

   from consmodel import BS
   import pandas as pd
   import numpy as np
   import matplotlib.pyplot as plt

   # create a simple PV model
   test_consumption = [0.,-3.,-2.,8.,7.,6.,7.,8.,5.,4.,-2.]
   test_consumption_df = pd.DataFrame({"p": test_consumption},
                  index=pd.date_range("2020-01-01 06:00:00",
                                       periods=11,
                                       freq="15min"))
   bs = BS(lat=46.155768,
           lon=14.304951,
           alt=400,
           index=1,
           st_type="10kWh_5kW",
           freq="15min",)
   timeseries = batt.simulate(control_type="installed_power",
                              p_kw=test_consumption_df)
   # plot the results
   timeseries.plot()
   plt.show()

Consumer model

   from consmodel import ConsumerModel
   import pandas as pd
   import numpy as np
   import matplotlib.pyplot as plt

   cons = ConsumerModel(lat=46.155768,
                        lon=14.304951,
                        alt=400,
                        index=1,
                        name="ConsumerModel_default",
                        tz="Europe/Ljubljana",
                        use_utc=False,
                        freq="15min",)
   timeseries = cons.simulate(has_generic_consumption=False,
                              has_pv=True,
                              has_heatpump=True,
                              has_ev=False,
                              has_battery=True,
                              start=pd.to_datetime("2020-01-01 06:15:00"),
                              end=pd.to_datetime("2020-01-01 06:00:00")+pd.Timedelta("1d"),
                              pv_size=14.,
                              wanted_temp=20.,
                              hp_st_type="Outdoor Air / Water (regulated)",
                              bs_st_type="10kWh_5kW",
                              control_type="production_saving")
   timeseries.plot()
   plt.show()

Author

👤 Blaž Dobravec

Colaborated:

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

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

consmodel-0.2.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

consmodel-0.2.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file consmodel-0.2.0.tar.gz.

File metadata

  • Download URL: consmodel-0.2.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.18

File hashes

Hashes for consmodel-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e1336c09c06b5cffe889191ed26f65b3095b211c357eec5f8d290323065a7fab
MD5 15d0991be98cb9c93f652eb3ac07cc1e
BLAKE2b-256 83ae05018017e976c3865a47b6844e729e2188abf278c33abd51774a7340cc09

See more details on using hashes here.

File details

Details for the file consmodel-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: consmodel-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.18

File hashes

Hashes for consmodel-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0930679db1f717635342ec7196ae2f33c34b8c6b66f542543a0d029f5e124794
MD5 324c2ceb5a029d9b716896a3fb81c186
BLAKE2b-256 42705ea5dc7d0eb515280b600844fe051a89120a0ee1ccf96dcfdc94fbcbd204

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