.BusinessSimulation.Functions.smf

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 S-shaped function given the real input x and the parameters foot a and shoulder b of the function.

Implementation


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

Syntax

Functions.smf(x, a, b);

Examples


Functions.smf( 5, a=2, b=8); // 0.5 Functions.smf( 1, a=2, b=8); // 0.0 Functions.smf( 9, a=2, b=8); // 1.0

See also

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

Interface

function smf
  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 function (i.e., f(a) = 0)";
  input Real b "Shoulder of the function (i.e., f(b) = 1)";
  output Real y "Degree of membership";
end smf;

Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos