예제 #1
0
    def calculate_power_output(self):
        r"""
        Calculates power output of wind turbines using the
        :class:`~.modelchain.ModelChain`.
    
        The :class:`~.modelchain.ModelChain` is a class that provides all necessary
        steps to calculate the power output of a wind turbine. You can either use
        the default methods for the calculation steps, or choose different methods, 
        as done for the 'e126'. Of course, you can also use the default methods 
        while only changing one or two of them.
    
        Parameters
        ----------

    
        """
        # power output calculation for e126
        # own specifications for ModelChain setup
        modelchain_data = {
            'wind_speed_model':
            self.wind_speed_model,  # 'logarithmic' (default),
            # 'hellman' or
            # 'interpolation_extrapolation'
            'density_model':
            self.density_model,  # 'barometric' (default), 'ideal_gas' or
            # 'interpolation_extrapolation'
            'temperature_model':
            self.temperature_model,  # 'linear_gradient' (def.) or
            # 'interpolation_extrapolation'
            'power_output_model':
            self.power_output_model,  # 'power_curve' (default) or
            # 'power_coefficient_curve'
            'density_correction':
            self.density_correction,  # False (default) or True
            'obstacle_height': self.obstacle_height,  # default: 0
            'hellman_exp': self.hellman_exp
        }  # None (default) or None

        # initialize ModelChain with own specifications and use run_model method
        # to calculate power output
        if self.environment.start == None or self.environment.end == None:
            self.ModelChain = ModelChain(self.wind_turbine,
                                         **modelchain_data).run_model(
                                             self.environment.wind_data)

        else:
            self.ModelChain = ModelChain(
                self.wind_turbine, **modelchain_data).run_model(
                    self.environment.wind_data[self.environment.start:self.
                                               environment.end])

        # write power output time series to WindPower.timeseries
        self.timeseries = self.ModelChain.power_output / 1000  # convert to kW

        return
예제 #2
0
def calculate_power_output(weather, my_turbine, e126):
    r"""
    Calculates power output of wind turbines using the
    :class:`~.modelchain.ModelChain`.

    The :class:`~.modelchain.ModelChain` is a class that provides all necessary
    steps to calculate the power output of a wind turbine. You can either use
    the default methods for the calculation steps, as done for 'my_turbine',
    or choose different methods, as done for the 'e126'. Of course, you can
    also use the default methods while only changing one or two of them, as
    done for 'dummy_turbine'.

    Parameters
    ----------
    weather : :pandas:`pandas.DataFrame<frame>`
        Contains weather data time series.
    my_turbine : :class:`~.wind_turbine.WindTurbine`
        WindTurbine object with self provided power curve.
    e126 : :class:`~.wind_turbine.WindTurbine`
        WindTurbine object with power curve from the OpenEnergy Database
        turbine library.

    """
    # ************************************************************************
    # **** Data is provided in the oedb turbine library **********************
    # **** ModelChain with non-default specifications
    modelchain_data = {
        "wind_speed_model": "logarithmic",  # 'logarithmic' (default),
        # 'hellman' or
        # 'interpolation_extrapolation'
        "density_model": "ideal_gas",  # 'barometric' (default), 'ideal_gas' or
        # 'interpolation_extrapolation'
        "temperature_model": "linear_gradient",  # 'linear_gradient' (def.) or
        # 'interpolation_extrapolation'
        "power_output_model": "power_curve",  # 'power_curve' (default) or
        # 'power_coefficient_curve'
        "density_correction": True,  # False (default) or True
        "obstacle_height": 0,  # default: 0
        "hellman_exp": None,
    }  # None (default) or None
    # initialize ModelChain with own specifications and use run_model method
    # to calculate power output
    mc_e126 = ModelChain(e126, **modelchain_data).run_model(weather)
    # write power output time series to WindTurbine object
    e126.power_output = mc_e126.power_output

    # ************************************************************************
    # **** Specification of wind turbine with your own data ******************
    # **** ModelChain with default parameter
    mc_my_turbine = ModelChain(my_turbine).run_model(weather)
    # write power output time series to WindTurbine object
    my_turbine.power_output = mc_my_turbine.power_output

    return
예제 #3
0
def calculate_power_output(weather, my_turbine, e126):
    r"""
    Calculates power output of wind turbines using the
    :class:`~.modelchain.ModelChain`.

    The :class:`~.modelchain.ModelChain` is a class that provides all necessary
    steps to calculate the power output of a wind turbine. You can either use
    the default methods for the calculation steps, as done for 'my_turbine',
    or choose different methods, as done for the 'e126'.

    Parameters
    ----------
    weather : pd.DataFrame
        Contains weather data time series.
    my_turbine : WindTurbine
        WindTurbine object with self provided power curve.
    e126 : WindTurbine
        WindTurbine object with power curve from data file provided by the
        windpowerlib.

    """

    # power output calculation for my_turbine
    # initialise ModelChain with default parameters and use run_model method
    # to calculate power output
    mc_my_turbine = ModelChain(my_turbine).run_model(weather)
    # write power output timeseries to WindTurbine object
    my_turbine.power_output = mc_my_turbine.power_output

    # power output calculation for e126
    # own specifications for ModelChain setup
    modelchain_data = {
        'wind_speed_model': 'logarithmic',  # 'logarithmic' (default),
        # 'hellman' or
        # 'interpolation_extrapolation'
        'density_model': 'ideal_gas',  # 'barometric' (default), 'ideal_gas' or
        # 'interpolation_extrapolation'
        'temperature_model': 'linear_gradient',  # 'linear_gradient' (def.) or
        # 'interpolation_extrapolation'
        'power_output_model': 'power_curve',  # 'power_curve' (default) or
        # 'power_coefficient_curve'
        'density_correction': True,  # False (default) or True
        'obstacle_height': 0,  # default: 0
        'hellman_exp': None
    }  # None (default) or None
    # initialise ModelChain with own specifications and use run_model method
    # to calculate power output
    mc_e126 = ModelChain(e126, **modelchain_data).run_model(weather)
    # write power output timeseries to WindTurbine object
    e126.power_output = mc_e126.power_output

    return
예제 #4
0
    def feedin(self, weather, power_plant_parameters, **kwargs):
        r"""
        Calculates power plant feed-in in Watt.

        This function uses the windpowerlib's :windpowerlib:`ModelChain \
        <windpowerlib.modelchain.ModelChain>` to calculate the feed-in for the
        given weather time series and wind turbine.

        Parameters
        ----------
        weather : :pandas:`pandas.DataFrame<dataframe>`
            Weather time series used to calculate feed-in. See `weather_df`
            parameter in windpowerlib's Modelchain :windpowerlib:`run_model \
            <windpowerlib.modelchain.ModelChain.run_model>` method for
            more information on required variables, units, etc.
        power_plant_parameters : dict
            Dictionary with power plant specifications. Keys of the dictionary
            are the power plant parameter names, values of the dictionary hold
            the corresponding value. The dictionary must at least contain the
            required power plant parameters (see
            :attr:`~.power_plant_requires`) and may further contain optional
            power plant parameters (see :windpowerlib:`windpowerlib.\
            WindTurbine <windpowerlib.wind_turbine.WindTurbine>`).
        **kwargs :
            Keyword arguments can be used to overwrite the windpowerlib's
            :windpowerlib:`ModelChain <windpowerlib.modelchain.ModelChain>`
            parameters.

        Returns
        -------
        :pandas:`pandas.Series<series>`
            Power plant feed-in time series in Watt.

        """
        self.power_plant = self.instantiate_turbine(**power_plant_parameters)
        mc = WindpowerlibModelChain(self.power_plant, **kwargs)
        return mc.run_model(weather).power_output
e126 = WindTurbine(**enercon_e126)

##########################################################################
# 3. Calculate the output and evaluate the turbine
##########################################################################

# The modelchain.ModelChain is a class that provides all necessary steps to
# calculate the power output of a wind turbine. You can either use the default
# methods for the calculation steps, as done for my_turbine or choose different
# methods, as done for the 'e126'.

logging.info("3. Calculate the output and evaluate the turbine")

# power output calculation for my_turbine initialize ModelChain with default
# parameters and use run_model method to calculate power output
mc_my_turbine = ModelChain(my_turbine).run_model(weather)

# write power output time series to WindTurbine object
my_turbine.power_output = mc_my_turbine.power_output

# power output calculation for e126
# own specifications for ModelChain setup
modelchain_data = {
    'wind_speed_model': 'logarithmic',  # 'logarithmic' (default),
    # 'hellman' or
    # 'interpolation_extrapolation'
    'density_model': 'ideal_gas',  # 'barometric' (default), 'ideal_gas' or
    # 'interpolation_extrapolation'
    'temperature_model': 'linear_gradient',  # 'linear_gradient' (def.) or
    # 'interpolation_extrapolation'
    'power_output_model': 'power_curve',  # 'power_curve' (default) or
예제 #6
0
def calculate_power_output(weather, my_turbine, e126, dummy_turbine):
    r"""
    Calculates power output of wind turbines using the
    :class:`~.modelchain.ModelChain`.

    The :class:`~.modelchain.ModelChain` is a class that provides all necessary
    steps to calculate the power output of a wind turbine. You can either use
    the default methods for the calculation steps, as done for 'my_turbine',
    or choose different methods, as done for the 'e126'. Of course, you can
    also use the default methods while only changing one or two of them, as
    done for 'dummy_turbine'.

    Parameters
    ----------
    weather : :pandas:`pandas.DataFrame<frame>`
        Contains weather data time series.
    my_turbine : :class:`~.wind_turbine.WindTurbine`
        WindTurbine object with self provided power curve.
    e126 : :class:`~.wind_turbine.WindTurbine`
        WindTurbine object with power curve from the OpenEnergy Database
        turbine library.
    dummy_turbine : :class:`~.wind_turbine.WindTurbine`
        WindTurbine object with power coefficient curve from example file.

    """

    # power output calculation for my_turbine
    # initialize ModelChain with default parameters and use run_model method
    # to calculate power output
    mc_my_turbine = ModelChain(my_turbine).run_model(weather)
    # write power output time series to WindTurbine object
    my_turbine.power_output = mc_my_turbine.power_output

    # power output calculation for e126
    # own specifications for ModelChain setup
    modelchain_data = {
        'wind_speed_model': 'logarithmic',  # 'logarithmic' (default),
        # 'hellman' or
        # 'interpolation_extrapolation'
        'density_model': 'ideal_gas',  # 'barometric' (default), 'ideal_gas' or
        # 'interpolation_extrapolation'
        'temperature_model': 'linear_gradient',  # 'linear_gradient' (def.) or
        # 'interpolation_extrapolation'
        'power_output_model': 'power_curve',  # 'power_curve' (default) or
        # 'power_coefficient_curve'
        'density_correction': True,  # False (default) or True
        'obstacle_height': 0,  # default: 0
        'hellman_exp': None
    }  # None (default) or None
    # initialize ModelChain with own specifications and use run_model method
    # to calculate power output
    mc_e126 = ModelChain(e126, **modelchain_data).run_model(weather)
    # write power output time series to WindTurbine object
    e126.power_output = mc_e126.power_output

    # power output calculation for example_turbine
    # own specification for 'power_output_model'
    mc_example_turbine = ModelChain(
        dummy_turbine,
        power_output_model='power_coefficient_curve').run_model(weather)
    dummy_turbine.power_output = mc_example_turbine.power_output

    return