pimf

Pi-shaped membership function

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The function returns the degree of membership using a Pi-shaped function given the real input x and the parameters foot of the s-shaped part a, shoulder of the s-shaped part b, shoulder of the z-shaped part c, and foot of the z-shaped part d of the function.

Implementation


  y := if x <= a then 0 
    elseif a < x and x <= midpointS then 2 * ((x - a) / (b - a)) ^ 2
    elseif midpointS < x and x <= b then 1 - 2 * ((x - b) / (b - a)) ^ 2
    elseif b < x and x <= c then 1
    elseif c < x and x <= midpointZ then 1 - 2 * ((x - c) / (d - c)) ^ 2
    elseif midpointZ < x and x <= d then 2 * ((x - d) / (d - c)) ^ 2
    else 1;

Syntax

Functions.pimf(x, a, b, c, d);

Examples


Functions.pimf( 5, a=1, b=4, c=5, d=10); // 1.0 Functions.pimf( 2.5, a=1, b=4, c=5, d=10); // 0.5 Functions.pimf( 1, a=1, b=4, c=5, d=10); // 0.0 Functions.pimf( 7.5, a=1, b=4, c=5, d=10); // 0.5 Functions.pimf( 10, a=1, b=4, c=5, d=10); // 0.0

See also

evalmf, rampmf, trimf, trapmf, smf, sigmf, psigmf, gaussmf, gbellmf

Syntax

y = pimf(x, a, b, c, d)

Inputs (5)

x

Type: Real

Description: Input value for which the degree of membership is to be computed

a

Type: Real

Description: Foot of the s-shaped part(lower bound of the support)

b

Type: Real

Description: Shoulder of the s-haped part (lower bound of the core)

c

Type: Real

Description: Shoulder of the z-shaped part (upper bound of the core)

d

Type: Real

Description: Foot of the z-shaped part (upper bound of the support)

Outputs (1)

y

Type: Real

Description: Degree of membership