View Source Flex.MembershipFun (FLex v0.2.0)

An interface to create Membership Functions reference.

Link to this section Summary

Functions

Gaussian membership derivatived function.

Generalized Bell membership derivatived function.

An interface to execute derivatives of membership functions, where,

Gaussian membership function.

Generalized Bell membership function.

For Takagi-Sugeno-Kang fuzzy inference, uses this output membership functions that are either constant or a linear function that will be combined with the input values.

Pi-shaped membership function.

S-shaped membership function.

Saturation membership function.

Shoulder membership function.

Sigmoidal membership function.

Trapezoidal membership function.

Triangle membership function.

Z-shaped membership function.

Link to this section Functions

Link to this function

d_gaussian(list, x, mu, arg4)

View Source

Gaussian membership derivatived function.

  • m - (number) Mean,
  • s - (number) Standard deviation, it must not be equal to 0.
  • f - (number) Fuzzification Factor.
  • mu - (number) Last membership function value.
Link to this function

d_gbell(list, x, mu, arg4)

View Source

Generalized Bell membership derivatived function.

  • c - (number) Center.
  • s - (number) Slope.
  • b - (number) The width of the curve, it must not be equal to 0.

Definition of Generalized Bell function is:

  y(x) = 1 / (1 + |((x - c) / b)|^(2 * s))
Link to this function

derivative(fuzzy_set, input, membership_grade, darg_index)

View Source

An interface to execute derivatives of membership functions, where,

  • z_i - is the i'th rule output.
  • x, y - are the values of input 1 and input 2, respectively.
  • a_i, b_i, and c_i - are constant coefficients of the i'th rule output. For a zero-order Takagi-Sugeno system, z_i is a constant (a = b = 0).
@spec gaussian([...]) :: {(... -> any()), any()}

Gaussian membership function.

  • m - (number) Mean,
  • s - (number) Standard deviation, it must not be equal to 0.
  • f - (number) Fuzzification Factor,
@spec gbell([...]) :: {(... -> any()), any()}

Generalized Bell membership function.

  • c - (number) Center.
  • s - (number) Slope.
  • b - (number) The width of the curve, it must not be equal to 0.

Definition of Generalized Bell function is:

  y(x) = 1 / (1 + |((x - c) / b)|^(2 * s))
Link to this function

linear_combination(coefficients)

View Source
@spec linear_combination([...]) :: {(... -> any()), nil}

For Takagi-Sugeno-Kang fuzzy inference, uses this output membership functions that are either constant or a linear function that will be combined with the input values.

Example (2 inputs 1 output): z_i = a_ix + b_iy + c_i

where,

  • z_i - is the i'th rule output.
  • x, y - are the values of input 1 and input 2, respectively.
  • a_i, b_i, and c_i - are constant coefficients of the i'th rule output. For a zero-order Takagi-Sugeno system, z_i is a constant (a = b = 0).

## Example (in Elixir)

iex> {z_i_mf, nil} = MembershipFun.linear_combination([a_i, b_i, c_i])
iex> z_i = z_i_mf.([x,y])
@spec pi_shaped([...]) :: {(... -> any()), any()}

Pi-shaped membership function.

@spec s_shaped([...]) :: {(... -> any()), any()}

S-shaped membership function.

@spec saturation([...]) :: {(... -> any()), any()}

Saturation membership function.

@spec shoulder([...]) :: {(... -> any()), any()}

Shoulder membership function.

@spec sigmoid([...]) :: {(... -> any()), any()}

Sigmoidal membership function.

  • c - (number) Crossover point.
  • s - (number) Slope.

Definition of Generalized Bell function is:

  y(x) = 1 / (1 + e^(-s(x-c)))
@spec trapezoidal([...]) :: {(... -> any()), any()}

Trapezoidal membership function.

@spec triangle([...]) :: {(... -> any()), any()}

Triangle membership function.

@spec z_shaped([...]) :: {(... -> any()), any()}

Z-shaped membership function.