Step 3 – building the model

In this case, we want to implement a physics-based approach by building a mathematical relationship between the wind speed (m/s) and the amount of power generated (kW). The following Python code implements our model:

def wind_turbine_model(x):
if x<=4.5 or x>21.5:
return 0
return 376.936 - 195.8161*x + 33.75734*x**2 - 2.212492*x**3 + 0.06309095*x**4 - 0.0006533647*x**5

The following is a plot of the model with varying wind speed on the x axis:

Model of a wind turbine (wind speed versus generated power)

Note that this digital twin is only valid for a specific wind turbine model and we cannot generalize it to another. Generally speaking, however, every wind turbine will follow a similar sigmoidal model. Let's build our algorithm:

  1. Import the dataset and calculate the expected power versus the measured power. After that, visualize the dataset:
# load data
df = pd.read_csv('./data/wind_turbine.csv')
expected_power = [wind_turbine_model(x) for x in df.wind_speed_ms]
reference_power = [wind_turbine_model(x) for x in range(0,30)]

# show data and reference
plt.plot(df.wind_speed_ms, df.power_generated_kw,'.r')
plt.plot(reference_power,'k')
plt.show()

The following diagram shows the output of the algorithm:

The dataset compared with the reference model
  1. We can now evaluate the loss of power using the following equation: (measured_power – expected_power) / expected_ power :
# evaluate ratio
de=[]
ts=[]
for i in range(0,len(expected_power)):
mp = df.power_generated_kw[i]
ep = expected_power[i]
if ep>0 and mp>0:
t = df.cycle_10_mins[i]
de.append( (mp-ep) / ep )
ts.append(t)
  1. Finally, to predict the degradation of the equation over the next 9 years, we can estimate the first-order equation of the degradation using the following code:
# predict degradation
samples=365*24*6
year=9
z = np.polyfit(ts, de, 1)
print("degradation in %s years will be %.2f %%" % (year, 100*(z[0]*(samples*year) + z[1])) )

The output is degradation in 9 years will be -15.72 %. This is not exactly the same as the expected 16%, but it is quite close.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset