occupancy¶
1 between the pairs of instants of a day schedule {on, off, on, off, ...} [s] (Buildings OccupancySchedule with firstEntryOccupied), each change a smooth step over dt
FastSmoothBuildings.Utilities.occupancy, function (source)
Purpose
Occupancy from a day schedule of instants {on, off, on, off, …} in seconds since midnight: 1 between the instants of each pair, 0 outside, each change a smooth step without events.
Equations
With the schedule s and Δt = dt,
y = ∑k [regStep(tday − s2k−1, 1, 0, Δt/2) − regStep(tday − s2k, 1, 0, Δt/2)],
over the complete pairs (a last unpaired instant is ignored). Each change is a regStep over Δt centred on its instant: C1, with the value 1/2 at the instant itself. The result stays in [0, 1] when the instants increase and are at least Δt apart, and is continuous across midnight when they lie between Δt/2 and 86400 s − Δt/2.
Relation to Buildings
The schedule of Buildings.Controls.SetPoints.OccupancySchedule with
firstEntryOccupied = true; the result is a Real between 0 and 1 instead of a Boolean.
Use
Call it with tod =
timeOfDay(time);
dt = 60 s by default. See
Validation.Schedules.
Revisions¶
- October 2026: moved from trano's
FastModel.Utilities.