Skip to content

Commit 04a28a4

Browse files
Birgit SchachlerBirgit Schachler
authored andcommitted
Move detailed explanation of the basic example to separate file
1 parent bca2ef4 commit 04a28a4

File tree

2 files changed

+89
-97
lines changed

2 files changed

+89
-97
lines changed

README.rst

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -76,100 +76,3 @@ Matplotlib can be installed using pip3 but some Linux users reported that it is
7676

7777
http://matplotlib.org/users/installing.html
7878

79-
80-
Example
81-
========
82-
Download the .csv data and the example file and execute it:
83-
84-
https://github.com/wind-python/windpowerlib/tree/master/example
85-
86-
87-
Basic Usage
88-
===========
89-
90-
You need three steps to get a time series.
91-
92-
Warning
93-
~~~~~~~
94-
Be accurate with the units. In the example all units are given without a prefix.
95-
* pressure [Pa]
96-
* wind speed [m/s]
97-
* installed capacity [W]
98-
* nominal power [W]
99-
* area [m²]
100-
* temperature [°C]
101-
102-
You can also use kW instead of W but you have to make sure that all units are changed in the same way.
103-
104-
1. Initialise your Turbine or Module
105-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106-
107-
To initialise your specific turbine you need a dictionary that contains your basic parameters.
108-
109-
The most import parameter is the name of the turbine to get technical parameters from the provided libraries. Use the *get_wind_pp_types* function to get a list of all available converter types.
110-
111-
.. code-block:: python
112-
113-
from windpowerlib import basicmodel
114-
basicmodel.get_wind_pp_types()
115-
116-
The other parameters are related to location of the plant like diameter of the rotor or the hub height. The existing model needs the following parameters:
117-
118-
* h_hub: height of the hub in meters
119-
* d_rotor: diameter of the rotor in meters
120-
* wind_conv_type: Name of the wind converter according to the list in the csv file
121-
122-
.. code:: python
123-
124-
your_wind_turbine = basicmodel.SimpleWindTurbine(**your_parameter_set)
125-
126-
If you pass a valid model the nominal_power and the cp-values are read from a file. If you want to use your own converter you can pass your own cp-series and nominal power instead of the converter type. This can be done with a dictionary (as shown above) or directly.
127-
128-
.. code:: python
129-
130-
your_wind_turbine = basicmodel.SimpleWindTurbine(cp_values=my_cp_values,
131-
nominal_power=my_nominal_power,
132-
d_rotor=my_d_rotor,
133-
h_hub=my_h_hub)
134-
135-
2. Get your Feedin Time Series
136-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137-
138-
To get your time series you have to pass a weather DataFrame (or dictionary) to your model.The DataFrame needs to have pressure, wind speed, temperature and the roughness length. The following names are used:
139-
140-
* 'pressure'
141-
* 'temp_air'
142-
* 'v_wind'
143-
* 'z0'
144-
145-
In an additional dictionary the height of the weather data has to be defined. The example shows a dictionary for the coasdat2 weather data set:
146-
147-
.. code:: python
148-
149-
coastDat2 = {
150-
'dhi': 0,
151-
'dirhi': 0,
152-
'pressure': 0,
153-
'temp_air': 2,
154-
'v_wind': 10,
155-
'Z0': 0}
156-
157-
If your weather DataFrame has different column names you have to rename them. This can easily be done by using a conversion dictionary:
158-
159-
.. code:: python
160-
161-
name_dc = {
162-
'your pressure data set': 'pressure',
163-
'your ambient temperature': 'temp_air',
164-
'your wind speed': 'v_wind',
165-
'your roughness length': 'z0'}
166-
167-
your_weather_DataFrame.rename(columns=name_dc)
168-
169-
Now you can pass the weather data to the output method:
170-
171-
.. code:: python
172-
173-
your_wind_turbine.turbine_power_output(weather=weather_df, data_height=coastDat2)
174-
175-
You will get the output of one wind_turbine in [W] if you followed the united recommendations from above.

doc/example_documentation.rst

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
Basic Usage
2+
===========
3+
4+
You need three steps to get a time series.
5+
6+
Warning
7+
~~~~~~~
8+
Be accurate with the units. In the example all units are given without a prefix.
9+
* pressure [Pa]
10+
* wind speed [m/s]
11+
* installed capacity [W]
12+
* nominal power [W]
13+
* area [m²]
14+
* temperature [°C]
15+
16+
You can also use kW instead of W but you have to make sure that all units are changed in the same way.
17+
18+
1. Initialise your Turbine or Module
19+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20+
21+
To initialise your specific turbine you need a dictionary that contains your basic parameters.
22+
23+
The most import parameter is the name of the turbine to get technical parameters from the provided libraries. Use the *get_wind_pp_types* function to get a list of all available converter types.
24+
25+
.. code-block:: python
26+
27+
from windpowerlib import basicmodel
28+
basicmodel.get_wind_pp_types()
29+
30+
The other parameters are related to location of the plant like diameter of the rotor or the hub height. The existing model needs the following parameters:
31+
32+
* h_hub: height of the hub in meters
33+
* d_rotor: diameter of the rotor in meters
34+
* wind_conv_type: Name of the wind converter according to the list in the csv file
35+
36+
.. code:: python
37+
38+
your_wind_turbine = basicmodel.SimpleWindTurbine(**your_parameter_set)
39+
40+
If you pass a valid model the nominal_power and the cp-values are read from a file. If you want to use your own converter you can pass your own cp-series and nominal power instead of the converter type. This can be done with a dictionary (as shown above) or directly.
41+
42+
.. code:: python
43+
44+
your_wind_turbine = basicmodel.SimpleWindTurbine(cp_values=my_cp_values,
45+
nominal_power=my_nominal_power,
46+
d_rotor=my_d_rotor,
47+
h_hub=my_h_hub)
48+
49+
2. Get your Feedin Time Series
50+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51+
52+
To get your time series you have to pass a weather DataFrame (or dictionary) to your model.The DataFrame needs to have pressure, wind speed, temperature and the roughness length. The following names are used:
53+
54+
* 'pressure'
55+
* 'temp_air'
56+
* 'v_wind'
57+
* 'z0'
58+
59+
In an additional dictionary the height of the weather data has to be defined. The example shows a dictionary for the coasdat2 weather data set:
60+
61+
.. code:: python
62+
63+
coastDat2 = {
64+
'dhi': 0,
65+
'dirhi': 0,
66+
'pressure': 0,
67+
'temp_air': 2,
68+
'v_wind': 10,
69+
'Z0': 0}
70+
71+
If your weather DataFrame has different column names you have to rename them. This can easily be done by using a conversion dictionary:
72+
73+
.. code:: python
74+
75+
name_dc = {
76+
'your pressure data set': 'pressure',
77+
'your ambient temperature': 'temp_air',
78+
'your wind speed': 'v_wind',
79+
'your roughness length': 'z0'}
80+
81+
your_weather_DataFrame.rename(columns=name_dc)
82+
83+
Now you can pass the weather data to the output method:
84+
85+
.. code:: python
86+
87+
your_wind_turbine.turbine_power_output(weather=weather_df, data_height=coastDat2)
88+
89+
You will get the output of one wind_turbine in [W] if you followed the united recommendations from above.

0 commit comments

Comments
 (0)