regStepApproximation of a general step, such that the characteristic is continuous and differentiable |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
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.
x |
Type: Real Description: Abscissa value |
---|---|
y1 |
Type: Real Description: Ordinate value for x > 0 |
y2 |
Type: Real Description: Ordinate value for x < 0 |
x_small |
Default Value: 1e-5 Type: Real Description: Approximation of step for -x_small <= x <= x_small; x_small >= 0 required |
y |
Type: Real Description: Ordinate value to approximate y = if x > 0 then y1 else y2 |
---|