functionregStep
Extends from Modelica.Icons.Function (Icon for functions).
Information
Regularization for step function around zero
Hypothesis and equations
This function is used to approximate the equation
y = if x > 0 then y1 else y2;
by a smooth characteristic, so that the expression is continuous and differentiable:
y = smooth(1, if x > x_small then y1 else
if x < -x_small then y2 else f(y1, y2));
In the region -x_small < x < x_small a 2nd order polynomial is used
for a smooth transition from y1 to y2.
Bibliography
Based on the regStep fucntion from Modelica Standard Library and recommandation in IEA ANNEX 60 to inline the function.
Instructions for use
none
Known limits / Use precautions
none
Validations
Validated function - Gilles PLESSIS 07/2016
--------------------------------------------------------------
Licensed by EDF under a 3-clause BSD-license
Copyright © EDF 2009 - 2023
BuildSysPro version 3.6.0
Initial model : regStep, Martin Otter, Copyright © 2002-2016, ABB, DLR, Dassault Systèmes AB, Modelon, TU Braunschweig, TU Hamburg-Harburg, Politecnico di Milano.
--------------------------------------------------------------
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x | Abscissa value | |
| Real | y1 | Ordinate value for x > 0 | |
| Real | y2 | Ordinate value for x < 0 | |
| Real | x_small | 1e-5 | Approximation of step for -x_small <= x <= x_small; x_small >= 0 required |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | y | Ordinate value to approximate y = if x > 0 then y1 else y2 |
Revisions
- July18, 2016
by Marcus Fuchs:
Add function withInline = truein annotations to package for better performance, as suggested in #300 . - April 29, 2008
by Martin Otter:
Designed and implemented. - August 12, 2008
by Michael Sielemann:
Minor modification to cover the limit casex_small -> 0without division by zero.