.Modelica.Fluid.Dissipation.Utilities.Functions.General.Stepsmoother

Information

The function is used for continuous fading of variable inputs within a defined range. It allows a differentiable and smooth transition between function outputs, e.g., laminar and turbulent pressure drop or correlations for certain ranges.

Function

The tanh-function is used, since it provides an existing derivative and the derivative is zero at the borders [nofunc, func] of the interpolation domain (smooth derivative for transitions).

In order to work correctly, the internal interpolation range in terms of the external arbitrary input x needs to be scaled such that:

f(func)   = 0.5 π
f(nofunc) = -0.5 π

Example

In the picture below the input x is increased from 0 to 1. The range of interpolation is defined by:

Stepsmoother

References

Wischhusen, St.
Simulation von Kältemaschinen-Prozessen mit MODELICA / DYMOLA. Diploma thesis, Hamburg University of Technology, Institute of Thermofluiddynamics, 2000.

Interface

function Stepsmoother
  extends Modelica.Icons.Function;
  input Real func "Input value for that result = 100%";
  input Real nofunc "Input value for that result = 0%";
  input Real x "Input variable for continuous interpolation";
  output Real result "Output value";
end Stepsmoother;

Generated at 2024-12-24T19:25:53Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos