blockOccupancySchedule
Occupancy schedule with look-ahead
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Information
This model outputs whether the building is currently occupied, and how long it will take until the next time when the building will be occupied or non-occupied. The latter may be used, for example, to start a ventilation system half an hour before occupancy starts in order to ventilate the room.
The occupancy is defined by a time schedule of the form
occupancy = 3600*{7, 12, 14, 19}
This indicates that the occupancy is from 7:00 until 12:00
and from 14:00 to 19:00. This will be repeated periodically.
The parameter periodicity defines the periodicity.
The period always starts at t=0 seconds.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:] | occupancy | 3600*{7, 19} | Occupancy table, each entry switching occupancy on or off |
| Boolean | firstEntryOccupied | true | Set to true if first entry in occupancy denotes a changed from unoccupied to occupied |
| Modelica.Units.SI.Time | period | 86400 | End time of periodicity |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealOutput | tNexNonOcc | Time until next non-occupancy | |
| Modelica.Blocks.Interfaces.RealOutput | tNexOcc | Time until next occupancy | |
| Modelica.Blocks.Interfaces.BooleanOutput | occupied | Outputs true if occupied at current time |
Contents
| Name | Description |
|---|---|
| Get the next occupancy or non-occupancy outputs | |
| switchIntegerprotected | Switch two Integer arguments |
| switchRealprotected | Switch two Real arguments |
Revisions
-
February 7, 2025, by Jelger Jansen:
Removedimportstatement. This is for IBPSA, #1961. -
March 25, 2021, by Michael Wetter:
Integrated changes from Buildings for IBPSA, #1454. -
February 26, 2021, by Michael Wetter:
Refactored implementation to use a function to compute the next time events.
This is a work-around for Buildings, issue 2369. -
October 30, 2017, by Michael Wetter:
Rewrote usingequationrather thanalgorithmand removed assertion.
This is for issue 844. -
September 11, 2012, by Michael Wetter:
Addedpreoperator inwhenclause and relaxed tolerance inassertstatement. -
July 26, 2012, by Michael Wetter:
Fixed a bug that caused an error in the schedule if the simulation start time was negative or equal to the first entry in the schedule. -
February 16, 2012, by Michael Wetter:
Removed parameterstartTime. It was removed becausestartTime=0would imply that the schedule should not start for one day if the simulation were to be started at t=-8760 seconds. Fixed bug that prevented schedule to start when the simulation was started at a time that is higher thanendTime. Renamed parameterendTimetoperiod. -
April 2, 2009, by Michael Wetter:
First implementation.