Skip to content
Snippets Groups Projects
superposition_models.py 1.08 KiB
Newer Older
import numpy as np
from abc import ABC, abstractmethod


class SuperpositionModel(ABC):
    @abstractmethod
    def calc_effective_WS(self, WS_xxx, deficit_jxxx):
        """Calculate effective wind speed

        This method must be overridden by subclass

        Parameters
        ----------
        WS_xxx : array_like
            Local wind speed. xxx optionally includes destination turbine/site, wind directions, wind speeds
        deficit_jxxx : array_like
            deficit caused by source turbines(j) on xxx (see above)
        WS_eff_xxx : array_like
            Effective wind speed for xxx (see WS_xxx)
    def calc_effective_WS(self, WS_xxx, deficit_jxxx):
        return WS_xxx - np.sqrt(np.sum(deficit_jxxx**2, 0))
    def calc_effective_WS(self, WS_xxx, deficit_jxxx):
        return WS_xxx - np.sum(deficit_jxxx, 0)
    def calc_effective_WS(self, WS_xxx, deficit_jxxx):
        return WS_xxx - np.max(deficit_jxxx, 0)