:py:mod:`simcats.sensor.barrier_function` ========================================= .. py:module:: simcats.sensor.barrier_function .. autoapi-nested-parse:: SimCATS subpackage of the sensor package containing all functionalities related to barrier functions. Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: simcats.sensor.barrier_function.BarrierFunctionInterface simcats.sensor.barrier_function.BarrierFunctionGLF simcats.sensor.barrier_function.BarrierFunctionMultiGLF Package Implementation Details ------------------------------ .. py:class:: BarrierFunctionInterface Bases: :py:obj:`abc.ABC` .. autoapi-inheritance-diagram:: simcats.sensor.barrier_function.BarrierFunctionInterface :parts: 1 Interface that models the conductivity (similar to a pinch-off measurement) of a barrier. .. py:method:: get_value(potential) :abstractmethod: Returns the value of the barrier function for a given potential. :param potential: Potential for which the conductance of the barrier function is to be calculated. :type potential: Union[float, np.ndarray] :returns: Value of the barrier function for a given potential. :rtype: Union[float, np.ndarray] .. py:property:: pinch_off :type: float :abstractmethod: Potential value of the pinch off. .. py:property:: fully_conductive :type: float :abstractmethod: Potential value of the point from which on the barrier vanishes and becomes fully conductive. .. py:class:: BarrierFunctionGLF(pinch_off_percentage, fully_conductive_percentage, asymptote_left, asymptote_right, growth_rate, asymmetry, shape_factor, denominator_offset = 1, offset = 0) Bases: :py:obj:`simcats.sensor.barrier_function.BarrierFunctionInterface` .. autoapi-inheritance-diagram:: simcats.sensor.barrier_function.BarrierFunctionGLF :parts: 1 Implementation of the BarrierFunctionInterface that models a conductivity off of a barrier using a generalized logistic function (GLF). For further information see: https://en.wikipedia.org/wiki/Generalised_logistic_function Initializes an object of the class to represent the barrier function using the generalized logistic function. For further information see: https://en.wikipedia.org/wiki/Generalised_logistic_function :param pinch_off_percentage: Percentage of the GLF height before which the barrier response is considered non-conductive. The height is defined as the absolute difference between the two asymptotes. :type pinch_off_percentage: float :param fully_conductive_percentage: Percentage of the GLF height after which the barrier response is considered fully conductive. The height is defined as the absolute difference between the two asymptotes. :type fully_conductive_percentage: float :param asymptote_left: Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. This parameter may take any rational number. :type asymptote_left: float :param asymptote_right: Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. :type asymptote_right: float :param growth_rate: Originally called B. The growth rate of the function. The value must be a float and can be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. :type growth_rate: float :param asymmetry: Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. :type asymmetry: float :param shape_factor: Originally called Q. is related to the value Y(0) and adjusts the curve's value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. :type shape_factor: float :param denominator_offset: Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator.This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right-asymptote_left)/(denominator_offset^(1/asymmetry)). :type denominator_offset: float :param offset: Potential offset that shifts the GLF starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. Default is 0. :type offset: float .. py:property:: pinch_off_percentage :type: float Percentage of the GLF height before which the barrier response is considered non-conductive. The height is defined as the absolute difference between the two asymptotes. .. py:property:: fully_conductive_percentage :type: float Percentage of the GLF height after which the barrier response is considered fully conductive. The height is defined as the absolute difference between the two asymptotes. .. py:property:: asymptote_left Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. This parameter may take any rational number. .. py:property:: asymptote_right Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. .. py:property:: growth_rate Originally called B. The growth rate of the function. The value must be a float and can´be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. .. py:property:: asymmetry Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - If `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - If `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. .. py:property:: shape_factor Originally called Q. is related to the value Y(0) and adjusts the curve’s value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. .. py:property:: denominator_offset :type: float Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator.This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right-asymptote_left)/(denominator_offset^(1/asymmetry)). .. py:property:: offset :type: float Attribute that shifts the GLF starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. Default is 0. .. py:method:: get_value(potential) Returns the value of the barrier function for a given potential. :param potential: Potential for which the conductance of the barrier function is to be calculated. :type potential: Union[float, np.ndarray] :returns: Value of the barrier function for a given potential. :rtype: Union[float, np.ndarray] .. py:property:: pinch_off :type: float Potential value of the pinch off. .. py:property:: fully_conductive :type: float Potential value of the point from which on the barrier vanishes and becomes fully conductive. .. py:class:: BarrierFunctionMultiGLF(pinch_off, fully_conductive, *params) Bases: :py:obj:`simcats.sensor.barrier_function.BarrierFunctionInterface` .. autoapi-inheritance-diagram:: simcats.sensor.barrier_function.BarrierFunctionMultiGLF :parts: 1 Implementation of the BarrierFunctionInterface that models a conductivity off of a barrier using a combination of multiple generalized logistic functions (GLFs). For further information see: https://en.wikipedia.org/wiki/Generalised_logistic_function Initializes an object of the class to represent the barrier function using several generalized logistic functions. For further information see: https://en.wikipedia.org/wiki/Generalised_logistic_function The number of GLFs is specified by the number of parameters. To do this, the parameter count must be divisible by seven and a GLF is added for every seven other parameters. Each GLF has the following parameters: - asymptote_left (float): Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. - asymptote_right (float): Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. - growth_rate (float): Originally called B. The growth rate of the function. The value must be a float and can be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. - asymmetry (float): Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - If `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - If `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. - shape_factor (float): Originally called Q. is related to the value Y(0) and adjusts the curve’s value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. - denominator_offset (float): Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator.This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right - asymptote_left) / (denominator_offset^(1 / asymmetry)). - offset (float): Potential offset, that shifts the function starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. :param pinch_off: Potential at which the pinch-off of the barrier is located. :type pinch_off: float :param fully_conductive: Potential of the point from which on the barrier function is fully conductive. :type fully_conductive: float :param \*params: Additional positional arguments representing the GLF parameters. The number of additional parameters must be divisible by seven and determines the number of GLFs that are used for the Multi-GLF. All parameters consist of sequential groups of seven floats that each represent a single GLF. All individual parameters are described above and are in the same order as they are described. .. py:property:: pinch_off :type: float Potential value of the pinch off. .. py:property:: fully_conductive :type: float Potential value of the point from which on the barrier vanishes and becomes fully conductive. .. py:property:: params :type: Tuple[float] Parameters of the multiple GLFs. The number of GLFs is specified by the number of parameters. To do this, the parameter count must be divisible by seven and a GLF is added for every seven other parameters. Each GLF has the following parameters: - asymptote_left (float): Originally called A. This parameter is the left horizontal asymptote of the function. Any rational number can be used as the left asymptote. - asymptote_right (float): Originally called K. Specifies the right horizontal asymptote of the function when denominator_offset=1. If asymptote_left=0 and denominator_offset=1 then this parameter is also called the carrying capacity. This parameter may take any rational number. - growth_rate (float): Originally called B. The growth rate of the function. The value must be a float and can be any rational number. Be careful with negative values, because the function is mirrored on a vertical straight line for these. This line passes through the point where the potential equals `offset`. - asymmetry (float): Originally called nu. This parameter introduces skew and affects symmetry. It also affects near which asymptote maximum growth occurs. The value of asymmetry must be a rational number greater than zero. - If `asymmetry > 1`: the curve rises more gradually before the midpoint and more sharply after. - If `asymmetry < 1`: the curve rises quickly early on and levels off more slowly. - shape_factor (float): Originally called Q. is related to the value Y(0) and adjusts the curve’s value at the y-intercept. Thereby it changes the shape of the function without changing the asymptotes. The shape factor can be any rational number. - denominator_offset (float): Originally called C. A constant added to the denominator inside the power. Controls the initial level of the denominator. This parameter must be a rational number. It typically takes a value of 1. Otherwise, the upper asymptote is asymptote_left + (asymptote_right - asymptote_left) / (denominator_offset^(1 / asymmetry)). - offset (float): Potential offset, that shifts the function starting from the zero point. If the offset is positive, the function is shifted to the right and if it is negative, it is shifted to the left. :returns: The parameters of the multiple GLFs as described above. .. py:method:: get_value(potential) Returns the value of the barrier function for a given potential. :param potential: Potential for which the conductance of the barrier function is to be calculated. :type potential: Union[float, np.ndarray] :returns: Value of the barrier function for a given potential. :rtype: Union[float, np.ndarray]