88
99import os
1010import pandas as pd
11- import numpy as np
1211
1312try :
1413 from matplotlib import pyplot as plt
1514except ImportError :
1615 plt = None
1716
18- from windpowerlib import modelchain
19- from windpowerlib import wind_turbine as wt
17+ from windpowerlib . modelchain import ModelChain
18+ from windpowerlib . wind_turbine import WindTurbine
2019
2120# You can use the logging package to get logging messages from the windpowerlib
2221# Change the logging level if you want more or less messages
@@ -108,7 +107,7 @@ def initialise_wind_turbines():
108107 'wind_speed' : [0.0 , 3.0 , 5.0 , 10.0 , 15.0 , 25.0 ]}) # in m/s
109108 }
110109 # initialise WindTurbine object
111- my_turbine = wt . WindTurbine (** myTurbine )
110+ my_turbine = WindTurbine (** myTurbine )
112111
113112 # specification of wind turbine where power curve is provided
114113 # if you want to use the power coefficient curve add
@@ -119,7 +118,7 @@ def initialise_wind_turbines():
119118 'rotor_diameter' : 127 # in m
120119 }
121120 # initialise WindTurbine object
122- e126 = wt . WindTurbine (** enerconE126 )
121+ e126 = WindTurbine (** enerconE126 )
123122
124123 return my_turbine , e126
125124
@@ -149,28 +148,28 @@ def calculate_power_output(weather, my_turbine, e126):
149148 # power output calculation for my_turbine
150149 # initialise ModelChain with default parameters and use run_model method
151150 # to calculate power output
152- mc_my_turbine = modelchain . ModelChain (my_turbine ).run_model (weather )
151+ mc_my_turbine = ModelChain (my_turbine ).run_model (weather )
153152 # write power output timeseries to WindTurbine object
154153 my_turbine .power_output = mc_my_turbine .power_output
155154
156155 # power output calculation for e126
157156 # own specifications for ModelChain setup
158157 modelchain_data = {
159- 'obstacle_height' : 0 , # default: 0
160158 'wind_speed_model' : 'logarithmic' , # 'logarithmic' (default),
161159 # 'hellman' or
162160 # 'interpolation_extrapolation'
163161 'density_model' : 'ideal_gas' , # 'barometric' (default), 'ideal_gas' or
164162 # 'interpolation_extrapolation'
165- 'temperature_model' : 'linear_gradient' , # 'linear_gradient' (def.) or
166- # 'interpolation_extrapolation'
163+ 'temperature_model' : 'linear_gradient' , # 'linear_gradient' (def.) or
164+ # 'interpolation_extrapolation'
167165 'power_output_model' : 'power_curve' , # 'power_curve' (default) or
168166 # 'power_coefficient_curve'
169167 'density_correction' : True , # False (default) or True
168+ 'obstacle_height' : 0 , # default: 0
170169 'hellman_exp' : None } # None (default) or None
171170 # initialise ModelChain with own specifications and use run_model method
172171 # to calculate power output
173- mc_e126 = modelchain . ModelChain (e126 , ** modelchain_data ).run_model (weather )
172+ mc_e126 = ModelChain (e126 , ** modelchain_data ).run_model (weather )
174173 # write power output timeseries to WindTurbine object
175174 e126 .power_output = mc_e126 .power_output
176175
0 commit comments