- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » regStep function
regStep function
regStep function
Greetings,
I would like to have some information about the may the regStep function works.
The documentation states the following:
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.
Therefore, I understand that the f function has the following conditions to keep the fucntion continuous and differentiable:
f(x_small) = y1(x_small)
f'(x_small) = y1'(x_small)
f(-x_small) = y2(-x_small)
f'(-x_small) = y2'(-x_small)
The documentation states that f would be a second degree polynomial. However, a second degree polynomial has only three parameters (a, b and c in case of ax2 +bx + c) and therefore we would have a set of four equations woth only three unknowns that may be unsolvable (e.g. you can take y1(x) = -x+1, y2(x) = 0 and x_small = 1).
I would therefore like to understand how this function actually works and if I made a mistake in my understanding of this function.
Thanks
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » regStep function