functionStepsmoother
Continuous interpolation for x
Extends from Modelica.Icons.Function (Icon for functions).
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:
- func = 0.75
- nofunc = 0.25
References
- Wischhusen, St.
- Simulation von Kältemaschinen-Prozessen mit MODELICA / DYMOLA. Diploma thesis, Hamburg University of Technology, Institute of Thermofluiddynamics, 2000.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | func | Input value for that result = 100% | |
| Real | nofunc | Input value for that result = 0% | |
| Real | x | Input variable for continuous interpolation |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | result | Output value |