smoothLimit¶
Once continuously differentiable limitation of x to [l, u]: exactly l below l - deltaX and u above u + deltaX, x between l + deltaX and u - deltaX, quadratic blends in between that never leave [l, u]
FastSmoothBuildings.Utilities.smoothLimit, function (source)
Purpose
Limitation of x to [l, u], once continuously differentiable and without events: exactly at the bounds beyond the blends, never outside them (see Smoothing).
Equations
With δ = deltaX, x is first limited from below to z, then z from
above to y:
| Range | Value |
|---|---|
| x < l − δ | z = l |
| |x − l| ≤ δ | z = l + (x − l + δ)2/(4 δ) |
| x > l + δ | z = x |
| z < u − δ | y = z |
| |z − u| ≤ δ | y = u − (u + δ − z)2/(4 δ) |
| z > u + δ | y = u |
Each parabola meets the constant bound with a zero slope and the identity with a unit slope (C1). The result is l below l − δ, u above u + δ, x between l + δ and u − δ, and non-decreasing in x.
Use
deltaX is the half width of the blends; below (u − l)/2, the result stays within
[l, u]. The controllers limit their outputs with it, and the valves their opening.
Revisions¶
- October 2026: moved from trano's
FastModel.Utilities.