Skip to content

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:

RangeValue
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.