Buildings.Occupants.Office.Occupancy

Package with models to simulate occupancy in office buildings

Information

This package contains models to simulate occupancy in office buildings.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Occupants.Office.Occupancy.Wang2005Occupancy Wang2005Occupancy A model to predict Occupancy of a single person office
Buildings.Occupants.Office.Occupancy.Validation Validation Package with examples to validate models in Occupancy package

Buildings.Occupants.Office.Occupancy.Wang2005Occupancy Buildings.Occupants.Office.Occupancy.Wang2005Occupancy

A model to predict Occupancy of a single person office

Buildings.Occupants.Office.Occupancy.Wang2005Occupancy

Information

Model predicting the occupancy of a single person office.

References

The model is documented in the paper "Wang, D., Federspiel, C.C. and Rubinstein, F., 2005. Modeling occupancy in single person offices. Energy and buildings, 37(2), pp.121-126."

The model parameters are regressed from a field study in California with 35 single person offices at a large office building from 12/29/1998 to 12/20/1999.

Extends from Modelica.Blocks.Icons.DiscreteBlock (Graphical layout of discrete block component icon).

Parameters

TypeNameDefaultDescription
Timeone_mu4368Mean occupancy duration [s]
Timezero_mu2556Mean vacancy duration [s]
IntegerlocalSeed2005Local seed to be used to generate the initial state of the random number generator
IntegerglobalSeed30129Global seed to be combined with the local seed

Connectors

TypeNameDescription
output BooleanOutputoccThe State of occupancy, true for occupied

Modelica definition

model Wang2005Occupancy "A model to predict Occupancy of a single person office" extends Modelica.Blocks.Icons.DiscreteBlock; parameter Modelica.Units.SI.Time one_mu(displayUnit="min") = 4368 "Mean occupancy duration"; parameter Modelica.Units.SI.Time zero_mu(displayUnit="min") = 2556 "Mean vacancy duration"; parameter Integer localSeed = 2005 "Local seed to be used to generate the initial state of the random number generator"; parameter Integer globalSeed = 30129 "Global seed to be combined with the local seed"; Modelica.Blocks.Interfaces.BooleanOutput occ(start=true, fixed=true) "The State of occupancy, true for occupied"; protected discrete Real mu; discrete Modelica.Units.SI.Time tNext; discrete Modelica.Units.SI.Time hold_time; discrete Real r(min=0, max=1) "Generated random number"; Integer state[Modelica.Math.Random.Generators.Xorshift1024star.nState] "State of the random number generator"; initial equation (r, state) = Modelica.Math.Random.Generators.Xorshift1024star.random( Modelica.Math.Random.Generators.Xorshift1024star.initialState(localSeed, globalSeed)); mu = zero_mu; hold_time = -mu*Modelica.Math.log(1 - r); // Use max of 1 second to avoid cornercase of very tiny sampling tNext = time + max(1, hold_time); equation when time >= pre(tNext) then (r, state) = Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state)); occ = not pre(occ); mu = if occ then one_mu else zero_mu; hold_time = -mu*Modelica.Math.log(1 - r); tNext = pre(tNext) + max(1, hold_time); end when; end Wang2005Occupancy;