Skip to main content

PV Forecast simulation

Project description

pv60hz

CircleCI codecov Documentation Status Python: 3.6 Code style: black License: BSD 3-Clause

The pv60hz library is an solar forecast simulation powered by the 60hz company. This library provides easy download to the Global Forecast System, a numerical forecasting model provided by the National Oceanic and Atmospheric Administration, and preprocessing steps required for solar power generation estimation. This library uses the open source pvlib-python to simulate the predicted solar power generation.

Intro

As interest in climate change and environmental issues is growing around the world, renewable energy power plants are continuously increasing.

However, as renewable energy increases, it becomes increasingly difficult to operate the power grid. Renewable energy power plants are an intermittent resource whose power generation varies depending on the weather, making it difficult to balance the supply and demand for electricity. In addition, relatively small power plants are characterized by decentralization, making them difficult to manage with traditional methods.

Therefore, if you can accurately predict the amount of renewable energy generation across the country, you can balance supply and demand by adjusting the utilization rate of flexible resources such as fossil fuels. In addition, this generation forecasting technology can be used for grid operation, monitoring and maintenance of solar and wind power plants.

Getting started

This library recommends a virtual environment using conda.

$ conda create -y -n venv python==3.6.10
$ conda activate venv

And install the cfgrib library.

conda install -c conda-forge cfgrib

Installation

$ pip install pv60hz

QuickStart

>>> from pv60hz.preprocessor.preprocess import GFSPreprocessor
>>> from pv60hz.loader.gfs import GFSLoader
>>> from pv60hz.simulator.simulate import PVWattsV5
>>> import pytz
>>> import datetime
>>>
>>> kst = pytz.timezone("Asia/Seoul")
>>> start_dt = kst.localize(datetime.datetime(2021, 9, 2, 0, 0)) # Change datetime to recent datetime
>>> end_dt = kst.localize(datetime.datetime(2021, 9, 3, 0, 0)) # Change datetime to recent datetime
>>> lat, lon, alt = 37.123, 126.598, 0
>>> capacity = 300  # kw
>>> azimuth = 180
>>> tilt = 25
>>>
>>>
>>> loader = GFSLoader()
>>> loader.collect_data(start_dt, end_dt)
Latest GFS Simulation Datetime: 2021-09-01 06:00:00+00:00
Download Global Forecast System Data
====================================
100%|█████████████████████████████████████████████████████████████████████████| 10/10 [00:18<00:00
>>>
>>>
>>> data = loader(lat, lon, start_dt, end_dt)
Read Global Forecast System Grib file
====================================
100%|█████████████████████████████████████████████████████████████████████████| 10/10 [00:18<00:00
>>>
>>> preproc_model = GFSPreprocessor(decomp_model="disc", clearsky_interpolate=True)
>>> weather_preproc = preproc_model(lat, lon, altitude=alt, weather=data, keep_solar_geometry=False)
>>>

>>> simulator = PVWattsV5(lat, lon, alt, capacity=capacity, surface_azimuth=azimuth, surface_tilt=tilt)
>>> simulator(weather_preproc, start_dt, end_dt, kst)
                           predict_yield
dt                                      
2021-09-02 00:00:00+09:00       0.000000
2021-09-02 01:00:00+09:00       0.000000
2021-09-02 02:00:00+09:00       0.000000
2021-09-02 03:00:00+09:00       0.000000
2021-09-02 04:00:00+09:00       0.000000
2021-09-02 05:00:00+09:00       0.000000
2021-09-02 06:00:00+09:00       0.000000
2021-09-02 07:00:00+09:00       0.000000
2021-09-02 08:00:00+09:00       0.837611
2021-09-02 09:00:00+09:00       4.288974
2021-09-02 10:00:00+09:00      17.897454
2021-09-02 11:00:00+09:00      43.032267
2021-09-02 12:00:00+09:00      72.636298
2021-09-02 13:00:00+09:00      97.711072
2021-09-02 14:00:00+09:00     112.442749
2021-09-02 15:00:00+09:00     117.264219
2021-09-02 16:00:00+09:00     114.608081
2021-09-02 17:00:00+09:00      94.638939
2021-09-02 18:00:00+09:00      49.883874
2021-09-02 19:00:00+09:00      11.370596
2021-09-02 20:00:00+09:00       0.000000
2021-09-02 21:00:00+09:00       0.000000
2021-09-02 22:00:00+09:00       0.000000
2021-09-02 23:00:00+09:00       0.000000
2021-09-03 00:00:00+09:00       0.000000

Documentation

Full documentation can be found at here

Related to

License

BSD-3-Clause

Citing

William F. Holmgren, Clifford W. Hansen, and Mark A. Mikofski. "pvlib python: a python package for modeling solar energy systems." Journal of Open Source Software, 3(29), 884, (2018). https://doi.org/10.21105/joss.00884

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

pv60hz-0.0.4.tar.gz (17.5 kB view hashes)

Uploaded Source

Built Distribution

pv60hz-0.0.4-py3-none-any.whl (20.0 kB view hashes)

Uploaded Python 3

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