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]
Integerseed10Seed for the random number generator

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.SIunits.Time one_mu(displayUnit="min") = 4368 "Mean occupancy duration"; parameter Modelica.SIunits.Time zero_mu(displayUnit="min") = 2556 "Mean vacancy duration"; parameter Integer seed = 10 "Seed for the random number generator"; Modelica.Blocks.Interfaces.BooleanOutput occ(start=true, fixed=true) "The State of occupancy, true for occupied"; protected discrete Real mu; discrete Real tNext(start=0, fixed=true); discrete Real hold_time; Real r(min=0, max=1) "Generated random number"; Integer state[Modelica.Math.Random.Generators.Xorshift1024star.nState]( each start=0, each fixed=true); algorithm when initial() then (r, state) := Modelica.Math.Random.Generators.Xorshift1024star.random( Modelica.Math.Random.Generators.Xorshift1024star.initialState(seed, seed)); occ :=false; mu :=if occ then one_mu else zero_mu; hold_time :=-mu*Modelica.Math.log(1 - r); tNext :=time + hold_time; elsewhen 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 :=time + hold_time; end when; end Wang2005Occupancy;