You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as requested in the buildings-library issue #3262, I opened the issue here as well (a bit belatedly, please excuse!).
As mentioned, for some implementations it is necessary to cap values (say a variable x) smoothly (over an interval dx) and additionally to not have them move out of bounds, especially not above (for smoothMin) or below the cap s (for smoothMax).
The smoothness requirement for regStep introduces an overshooting (for smoothMin) or undershooting behaviour (for smoothMax), making it necessary for the cap and the higher/lower bound for a value to differ. While there is a remark within the docu for Examples.SmoothMin, that this can happen, it is not quantified there.
However, it is possible to quantify exactly at what value x the over-/undershooting happens and to what extent.
For smoothMin, the maximum overshoot happens at $x = s - \frac{1}{2} dx \cdot (1 - \sqrt{3})$ at a function value $f(x) = s + \frac{3}{16} (2 \sqrt{3}-3) \cdot dx \approx s + 0.09 \cdot dx$.
For smoothMax, the maximum overshoot happens at $x = s + \frac{1}{2} dx \cdot (1 - \sqrt{3})$ at a function value $f(x) = s - \frac{3}{16} (2 \sqrt{3}-3) \cdot dx \approx s - 0.09 \cdot dx$.
So I would suggest adding the following text snippets to the docu in order to not overcomplicate things and maintaining a safe distance to machine precision eps:
For smoothMin: If variable x1 is to be capped by its max-value s smoothly and without overshooting, write smoothMin(x1, s-0.1 * deltaX, deltaX).
For smoothMax: If variable x1 is to be capped by its min-value s smoothly and without undershooting, write smoothMin(x1, s+0.1 * deltaX, deltaX).
What do you think?
Thank you all for the amazing work on this library and have a nice day!
Cheers
Rouven
The text was updated successfully, but these errors were encountered:
Hello all, hello @EttoreZ,
as requested in the buildings-library issue #3262, I opened the issue here as well (a bit belatedly, please excuse!).
As mentioned, for some implementations it is necessary to cap values (say a variable
x
) smoothly (over an intervaldx
) and additionally to not have them move out of bounds, especially not above (for smoothMin) or below the caps
(for smoothMax).The smoothness requirement for
regStep
introduces an overshooting (forsmoothMin
) or undershooting behaviour (forsmoothMax
), making it necessary for the cap and the higher/lower bound for a value to differ. While there is a remark within the docu for Examples.SmoothMin, that this can happen, it is not quantified there.However, it is possible to quantify exactly at what value
x
the over-/undershooting happens and to what extent.For$x = s - \frac{1}{2} dx \cdot (1 - \sqrt{3})$ at a function value $f(x) = s + \frac{3}{16} (2 \sqrt{3}-3) \cdot dx \approx s + 0.09 \cdot dx$ .$x = s + \frac{1}{2} dx \cdot (1 - \sqrt{3})$ at a function value $f(x) = s - \frac{3}{16} (2 \sqrt{3}-3) \cdot dx \approx s - 0.09 \cdot dx$ .
smoothMin
, the maximum overshoot happens atFor
smoothMax
, the maximum overshoot happens atSo I would suggest adding the following text snippets to the docu in order to not overcomplicate things and maintaining a safe distance to machine precision
eps
:For
smoothMin
:If variable x1 is to be capped by its max-value s smoothly and without overshooting, write smoothMin(x1, s-0.1 * deltaX, deltaX).
For
smoothMax
:If variable x1 is to be capped by its min-value s smoothly and without undershooting, write smoothMin(x1, s+0.1 * deltaX, deltaX).
What do you think?
Thank you all for the amazing work on this library and have a nice day!
Cheers
Rouven
The text was updated successfully, but these errors were encountered: