Jump to content

Weibull Fit Check


Recommended Posts

Posted

Hi all,

I have a question regarding the Weibull distributions that are being fit in PyWAsP and how they compare to the relative wind datasets.

I'm trying to find a way to reproduce this table from WAsP (see here), where the mean wind speed and wind power density are compared between the measured wind climate and the fitted (emergent) Weibull distribution, including the relative discrepancy.

This information should be obtainable from the original Observed Wind Climate (OWC) files generated by WAsP. However, I am currently working with the BWC and WWC formats in PyWAsP, where it does not seem to be directly available.

So far, I haven't found an easy way to replicate this in PyWAsP. Do you have any suggestions?

Best regards

 

 

Posted

Hi Alexandru,

Everything you need should be in windkit. Here is an example script:

import windkit as wk

# 1. Read the observed/binned wind climate (.tab or .omwc file)
bwc = wk.read_bwc("SerraSantaLuzia.omwc")

# 2. Fit sectorwise Weibull distributions using WAsP's fitting algorithm
wwc = wk.weibull_fit(bwc)

# 3. Mean wind speed and power density from the histogram ("measured")
#    and from the fitted Weibull distributions ("emergent")
ws_measured = wk.mean_wind_speed(bwc)
ws_emergent = wk.mean_wind_speed(wwc)

pd_measured = wk.mean_power_density(bwc)
pd_emergent = wk.mean_power_density(wwc)

# 4. Relative discrepancy, as in WAsP's "Weibull fit check" table
ws_disc = 100 * (ws_emergent - ws_measured) / ws_measured
pd_disc = 100 * (pd_emergent - pd_measured) / pd_measured

print(f"Mean wind speed  [m/s]: measured={ws_measured.squeeze().item():.3f}, "
      f"emergent={ws_emergent.squeeze().item():.3f}, discrepancy={ws_disc.squeeze().item():+.2f}%")
print(f"Power density  [W/m^2]: measured={pd_measured.squeeze().item():.1f}, "
      f"emergent={pd_emergent.squeeze().item():.1f}, discrepancy={pd_disc.squeeze().item():+.2f}%")

# Sectorwise version of the same table
ws_measured_sec = wk.mean_wind_speed(bwc, bysector=True)
ws_emergent_sec = wk.mean_wind_speed(wwc, bysector=True)
sec_disc = 100 * (ws_emergent_sec - ws_measured_sec) / ws_measured_sec
print(sec_disc.squeeze().to_series())

Best regards,

Bjarke

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...