.BusinessSimulation.Functions.pimf

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

Interface

function pimf
  extends BusinessSimulation.Icons.Function;
  input Real x "Input value for which the degree of membership is to be computed";
  input Real a "Foot of the s-shaped part(lower bound of the support)";
  input Real b "Shoulder of the s-haped part (lower bound of the core)";
  input Real c "Shoulder of the z-shaped part (upper bound of the core)";
  input Real d "Foot of the z-shaped part (upper bound of the support)";
  output Real y "Degree of membership";
end pimf;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos