Membership Functions
- pyit2fls.zero_mf(x, params=[])
All zero membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list, optional
Additional parameters for the membership function, which are not needed for the zero membership function.
Returns
output : ndarray
Returns an array of membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = zero_mf(x)
- pyit2fls.singleton_mf(x, params)
Singleton membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. params[0] indicates the singleton center, and params[1] indicates the singleton height.
Returns
output : ndarray
Returns membership values corresponding to the input.
Notes
The singleton center, params[0], must be within the discretized universe of discourse.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = singleton_mf(x, [0.5, 1])
- pyit2fls.const_mf(x, params)
Constant membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. params[0] indicates the constant membership function’s height.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = const_mf(x, [0.5])
- pyit2fls.tri_mf(x, params)
Triangular membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The left end, center, right end, and height of the triangular membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = tri_mf(x, [0.1, 0.3, 0.5, 1])
Notes
If the left end and the center coincide (params[0] == params[1]), the membership function starts at its full height, params[3], right at that shared point, and descends to zero at the right end. Symmetrically, if the center and the right end coincide (params[1] == params[2]), it rises to its full height at the shared point and immediately drops to zero after it. If all three of the left end, center, and right end coincide, the membership function is a singleton at that point.
- pyit2fls.rtri_mf(x, params)
Right triangular membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The right end, center, and height of the triangular membership function are indicated by params[0], params[1], and params[2], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = rtri_mf(x, [0.5, 0.2, 1])
- pyit2fls.ltri_mf(x, params)
Left triangular membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The left end, center, and height of the triangular membership function are indicated by params[0], params[1], and params[2], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = ltri_mf(x, [0.3, 0.5, 1])
- pyit2fls.trapezoid_mf(x, params)
Trapezoidal membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The left end, left center, right center, right end, and height of the trapezoidal membership function are indicated by params[0], params[1], params[2], params[3], and params[4], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = trapezoid_mf(x, [0.1, 0.3, 0.5, 0.7, 1])
Notes
If the left end and the left center coincide (params[0] == params[1]), the membership function starts at its full height, params[4], right at that shared point, rather than rising to it. Symmetrically, if the right center and the right end coincide (params[2] == params[3]), it stays at full height up to and including that shared point, rather than dropping from it. If all four points coincide, the membership function is a singleton at that point.
- pyit2fls.gaussian_mf(x, params)
Gaussian membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], and params[2], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = gaussian_mf(x, [0.5, 0.05, 1])
- pyit2fls.gauss_uncert_mean_umf(x, params)
Gaussian with uncertain mean UMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The lower limit of mean, upper limit of mean, standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = gauss_uncert_mean_umf(x, [0.3, 0.7, 0.05, 1])
- pyit2fls.gauss_uncert_mean_lmf(x, params)
Gaussian with uncertain mean LMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The lower limit of mean, upper limit of mean, standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = gauss_uncert_mean_lmf(x, [0.3, 0.7, 0.2, 1])
- pyit2fls.gauss_uncert_std_umf(x, params)
Gaussian with uncertain standard deviation UMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, lower limit of standard deviation, upper limit of standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = gauss_uncert_std_umf(x, [0.5, 0.2, 0.5, 1])
- pyit2fls.gauss_uncert_std_lmf(x, params)
Gaussian with uncertain standard deviation LMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, lower limit of standard deviation, upper limit of standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = gauss_uncert_std_lmf(x, [0.5, 0.2, 0.5, 1])
- pyit2fls.rgauss_uncert_std_umf(x, params)
Right Gaussian with uncertain standard deviation UMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, lower limit of standard deviation, upper limit of standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = rgauss_uncert_std_umf(x, [0.5, 0.2, 0.5, 1])
- pyit2fls.rgauss_uncert_std_lmf(x, params)
Right Gaussian with uncertain standard deviation LMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, lower limit of standard deviation, upper limit of standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = rgauss_uncert_std_lmf(x, [0.5, 0.2, 0.5, 1])
- pyit2fls.lgauss_uncert_std_umf(x, params)
Left Gaussian with uncertain standard deviation UMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, lower limit of standard deviation, upper limit of standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = lgauss_uncert_std_umf(x, [0.5, 0.2, 0.5, 1])
- pyit2fls.lgauss_uncert_std_lmf(x, params)
Left Gaussian with uncertain standard deviation LMF.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. The center, lower limit of standard deviation, upper limit of standard deviation, and height of the Gaussian membership function are indicated by params[0], params[1], params[2], and params[3], respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = lgauss_uncert_std_lmf(x, [0.5, 0.2, 0.5, 1])
- pyit2fls.elliptic_mf(x, params)
Elliptic membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Parameters of the elliptic membership function. The center, width, exponent, and height of the elliptic membership function are indicated by params[0], params[1], params[2], and params[3].
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = elliptic_mf(x, [0.5, 0.25, 1.3, 1.])
- pyit2fls.semi_elliptic_mf(x, params)
Semi-elliptic membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Parameters of the semi-elliptic membership function. The center, width, and height of the semi-elliptic membership function are indicated by params[0], params[1], and params[2].
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0, 1, 201) >>> membership_value = semi_elliptic_mf(x, [0.5, 0.25, 1.3, 1.])
- pyit2fls.gbell_mf(x, params)
Generalized bell shaped membership function.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Parameters of the generalized bell shaped membership function. The a, b, and c values and height of the generalized bell shaped membership function formula are indicated by params[0], params[1], params[2], and params[3].
Returns
output : ndarray
Returns membership values corresponding to the input.
Examples
>>> x = linspace(0., 1., 201) >>> membership_value = gbell_mf(x, [0.1, 1., 0.5, 1.])
- pyit2fls.points_mf(x, params)
Piecewise linear membership function defined by a list of points.
Parameters
x : numpy (n,) shaped array
The array-like input x indicates the points from the universe of discourse at which the membership function will be evaluated.
params : list
Additional parameters for the membership function. params is a flat list of the form [x1, y1, x2, y2, …, xn, yn], representing n points of the piecewise linear membership function, sorted by ascending x1 < x2 < … < xn. Points outside the [x1, xn] interval are clamped to y1 and yn, respectively.
Returns
output : ndarray
Returns membership values corresponding to the input.
Notes
This membership function is the natural representation of the point-list terms used by the IEC 61131-7 Fuzzy Control Language (FCL). See the pyit2fls.FCL module.
Examples
>>> x = linspace(0., 10., 201) >>> membership_value = points_mf(x, [0, 0, 5, 1, 10, 0])