moncenterlib.station_power_simulator.wind_turbine_power module

Wind turbine power generation simulator.

The module estimates hourly electrical power output of a wind turbine using historical weather data and turbine performance parameters.

class moncenterlib.station_power_simulator.wind_turbine_power.WindTurbinePower(config: dict)

Bases: object

Wind turbine power generation simulator.

The class estimates hourly electrical power output of a wind turbine using historical weather data and turbine performance parameters.

__init__(config: dict) None

Initialize the wind turbine power calculator.

The class simulates hourly electrical power generation of a wind turbine using historical meteorological data from Open-Meteo.

Parameters:

config (dict) – Configuration dictionary containing turbine parameters, geographic location and simulation period.

Note

Default configuration can be obtained using:

>>> WindTurbinePower.get_default_config()

Example

>>> config = WindTurbinePower.get_default_config()
>>> config["latitude"] = 54
>>> wind = WindTurbinePower(config)
calculate()

Calculate hourly wind turbine power generation.

This method retrieves historical weather data from Open-Meteo, estimates air density using temperature, pressure and humidity, and computes turbine power using the wind power equation.

The calculated power output is stored in self.df.

The resulting DataFrame contains a timezone-aware datetime index.

Raises:

Exception – If meteorological data cannot be retrieved.

Example

>>> wind = WindTurbinePower(config)
>>> wind.calculate()
>>> df = wind.get_hourly_power()
get_all_period_metrics(path_protocol: str = '') DataFrame

Calculate wind turbine statistics for the entire simulation period.

The method computes wind regime statistics and turbine generation metrics for the full dataset.

Parameters:

path_protocol (str, optional) – Path to a file where the textual report will be saved. If empty, the report is not written.

Returns:

Table containing calculated metrics for the full simulation period.

Return type:

pd.DataFrame

Example

>>> wind.calculate()
>>> metrics = wind.get_all_period_metrics()
get_default_config() dict

Return the default configuration for the wind turbine calculator.

Returns:

Dictionary containing default parameters for turbine configuration, location and simulation period.

Return type:

dict

Example

>>> config = WindTurbinePower.get_default_config()
>>> wind = WindTurbinePower(config)
get_hourly_power() DataFrame

Return the calculated hourly wind turbine power time series.

Returns:

Hourly time series with wind speed and turbine power.

Return type:

pd.DataFrame

Raises:

Exception – If calculate() has not been executed and the internal DataFrame is empty.

Example

>>> wind.calculate()
>>> df = wind.get_hourly_power()
get_monthly_metrics(step: int = 1, path_protocol: str = '') DataFrame

Calculate wind turbine statistics aggregated by monthly periods.

The simulation range is divided into intervals of step months, and metrics are calculated for each period.

Parameters:
  • step (int, optional) – Number of months per aggregation period. For example, 1 means monthly statistics and 3 means quarterly statistics.

  • path_protocol (str, optional) – Path to a file where the textual report will be saved.

Returns:

Table containing metrics for each calculated period.

Return type:

pd.DataFrame

Example

>>> wind.calculate()
>>> monthly_metrics = wind.get_monthly_metrics()
get_seasonal_metrics(path_protocol: str = '') DataFrame

Calculate wind turbine statistics grouped by seasons.

Seasons follow the meteorological definition:

  • Winter: December – February

  • Spring: March – May

  • Summer: June – August

  • Autumn: September – November

Parameters:

path_protocol (str, optional) – Path to a file where the textual report will be saved.

Returns:

Table containing calculated metrics for each season.

Return type:

pd.DataFrame

Example

>>> wind.calculate()
>>> seasonal_metrics = wind.get_seasonal_metrics()