Notice
The feedinlib as of version 0.0.12 will receive an API breaking overhaul. After that we'll move to 0.1.x and initially focus on developing the following features:
- a standardized/unified weather object containing standardized names for measured variables and the ability to convert itself to pvlib and windpowerlib compatible dataframes
- easy access to at least one freely available weather dataset and
- if possible a unified interface to access functionality of technically more specialized libraries like pvlib and windpowerlib.
If you want to stay informed follow issue #29.
The feedinlib is designed to calculate feedin timeseries of photovoltaic and wind power plants. It is part of the oemof group but works as a standalone application.
The feedinlib is ready to use but may have some teething troubles. It definitely has a lot of space for further development, new and improved models and nice features.
Table of contents
Having weather data sets you can use the feedinlib to calculate the electrical output of common pv or wind power plants. Basic parameters for many manufacturers are provided with the library so that you can start directly using one of these parameter sets. Of course you are free to add your own parameter set.
The parameter sets for pv modules are provided by Sandia Laboratories and can be found here:
The cp-values for the wind turbines are provided by the Reiner Lemoine Institut and can be found here:
If just want to use the feedinlib to calculate pv systems, you should think of using the pvlib directly. At the moment the pv part of the feedinlib is just a high level (easy to use) interface for same pvlib functionalities.
Download/Install: https://pypi.python.org/pypi/feedinlib/
Documentation: http://pythonhosted.org/feedinlib/
Clone/Fork: https://github.com/oemof/feedinlib
Documentation: http://feedinlib.readthedocs.org/en/latest/
As the feedinlib is part of the oemof developer group we use the same developer rules: http://oemof.readthedocs.io/en/stable/developer_notes.html
So far, the feedinlib is mainly tested on python 3.4 but seems to work down to 2.7.
Install the feedinlib using pip3 (or pip2).
sudo pip3 install feedinlib
If you have push rights clone this repository to your local system.
git clone git@github.com:oemof/feedinlib.git
If you do not have push rights, fork the project at github, clone your personal fork to your system and send a pull request.
If the project is cloned you can install it using pip3 (or pip2) with the -e flag. Using this installation, every change is applied directly.
sudo pip3 install -e <path/to/the/feedinlib/root/dir>
To see the plots of the example file one should install the matplotlib package.
Matplotlib can be installed using pip but some Linux users reported that it is easier and more stable to use the pre-built packages of your Linux distribution.
http://matplotlib.org/users/installing.html
Download the example file and execute it:
http://vernetzen.uni-flensburg.de/~git/feedinlib_example.py
You need three steps to get a time series.
- Be accurate with the units. In the example all units are given without a prefix.
- pressure [Pa]
- wind speed [m/s]
- irradiation [W/m²]
- peak power [W]
- installed capacity [W]
- nominal power [W]
- area [m²]
You can also use kW instead of W but you have to make sure that all units change in the same way.
To initialise your specific module or turbine you need a dictionary that contains your basic parameters.
The most import parameter is the name of the module or turbine to get technical parameters from the provided libraries.
The other parameters are related to location of the plant like orientation of the pv module or the hub height of the wind turbine. The existing models need the following parameters:
- h_hub: height of the hub in meters
- d_rotor: diameter of the rotor in meters
- wind_conv_type: Name of the wind converter according to the list in the csv file
- azimuth: Azimuth angle of the pv module in degree
- tilt: Tilt angle of the pv module in degree
- module_name: According to the sandia module library (see the link above)
- albedo: Albedo value
your_wind_turbine = plants.WindPowerPlant(model=SimpleWindModel, **your_parameter_set)
your_pv_module = plants.Photovoltaic(model=PvlibBased, **your_parameter_set)
If you do not pass a model the default model is used. So far we only have one model, so the follwing lines will have the same effect than the lines above.
your_wind_turbine = plants.WindPowerPlant(**your_parameter_set) your_pv_module = plants.Photovoltaic(**your_parameter_set)
A weather object contains one weather data set and all its necessary meta data. You can define it passing all the information from your weather data source to the FeedinWeatehr class.
my_weather_a = weather.FeedinWeather(
data=my_weather_pandas_DataFrame,
timezone='Continent/City', # e.g. Europe/Berlin or America/Caracas
latitude=x, # float
longitude=y, # float
data_heigth=coastDat2 # Dictionary, for the data heights (see below).
)
Depending on the model you do not need all of the optional parameters. For example the standard wind model does not need the longitude. If the DataFrame has a full time index with a time zone you don't have to set the time zone.
For wind and pv calculations the DataFrame needs to have radiation, temperature and wind speed for the pv model and pressure, wind speed, temperature and the roughness length for the wind model.
The data_height dictionary should be of the following form.
coastDat2 = {
'dhi': 0,
'dirhi': 0,
'pressure': 0,
'temp_air': 2,
'v_wind': 10,
'Z0': 0}
If your DataFrame has different column names you have to rename them. This can easily be done by using a conversion dictionary:
name_dc = {
'your diffuse horizontal radiation': 'dhi',
'your direct horizontal radiation': 'dirhi',
'your pressure data set': 'pressure',
'your ambient temperature': 'temp_air',
'your wind speed': 'v_wind',
'your roughness length': 'z0'}
your_weather_DataFrame.rename(columns=name_dc)
To get your time series you have to pass the weather object to your model. If you pass only the weather object, you get the electrical output of the turbine or module specified by your parameters. You can use optional parameters to calculated more than one module or turbine.
The possible parameters are number and installed capacity for wind turbines and number, peak_power and area for pv modules.
feedin_series_pv1 = your_pv_module.feedin(weather=my_weather_df) # One Module
feedin_series_wp1 = your_wind_turbine.feedin(data=my_weather_df, number=5)
You always should know the nominal power, area or peak_power of your plant. An area of two square meters (area=2) of a specific module that has an area of 1.5 sqm per module might not be realistic.
If you use your own model it is safer to pass a list of the required parameters but you don't have to:
own_wind_model = models.YourWindModelClass(required=[parameter1, parameter2])
own_pv_model = models.YourPVModelClass()
your_wind_turbine = plants.WindPowerPlant(model=own_wind_model, **your_parameter_set)
your_pv_module = plants.Photovoltaic(model=own_pv_model, **your_parameter_set)
feedin_series_wp1 = your_wind_turbine.feedin(data=my_weather_df, number=5)
feedin_series_pv1 = your_pv_module.feedin(data=my_weather_df) # One Module