.BusinessSimulation.Functions.rampmf

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 bounded ramp function given the real input x and the parameters lower bound a and upper bound b.

The ramp will usually ramp up from 0 to 1, but if lower bound and upper bound are switched (i.e., a > b), then the ramp will be ramp downwards from 1 to 0.

Implementation


y := max(min((x - a) / (b - a), 1), 0);

Syntax

Functions.rampmf(x, a, b);

Examples


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

See also

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

Interface

function rampmf
  extends BusinessSimulation.Icons.Function;
  input Real x "Input value for which the degree of membership is to be computed";
  input Real a "Lower bound";
  input Real b "Upper bound";
  output Real y "Degree of membership";
end rampmf;

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