Buildings.Occupants.BaseClasses
Package with base classes for Buildings.Occupants
Information
This package contains base functions which will be used in the Modelica Building Occupancy simulation module. The functions included in this package would map the inputs, for instance the indoor/output temperature, to two kinds of outputs: on/off state or the duration of a specific state.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name | Description |
---|---|
binaryVariableGeneration | Binary variables random generator |
exponentialVariableGeneration | Random variable generator from the exponential distribution |
linear1D | Mapping a continuous input to a binary output through a linear relation |
logit1D | Mapping a continuous input to a binary output through a logistic relation |
logit1DQuadratic | Mapping a continuous input to a binary output through a quadratic logistic relation |
logit2D | Mapping two continuous inputs to a binary output through a 2-dimension logistic relation |
weibull1DOFF | Mapping a continuous input to a binary output through a Weibull Distribution Relation |
weibull1DON | Mapping a continuous input to a binary output through a Weibull Distribution Relation |
weibullVariableGeneration | Random variable generator from the Weibull distribution |
Validation | Package with examples to validate functions in BaseClasses package |
Buildings.Occupants.BaseClasses.binaryVariableGeneration
Binary variables random generator
Information
Function that generates a random binary variable with the input of probability p
.
The input p
denotes the probability of being true
.
Higher p
indicates a higher chance of generating true
.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | p | Probaility of 1 | |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Random number |
Modelica definition
Buildings.Occupants.BaseClasses.exponentialVariableGeneration
Random variable generator from the exponential distribution
Information
This function generates a random variable, from a exponentuial distribution with the input of mean
mu
. The random variable might be the duration of a specific event, for instance the time to keep
the HVAC on.
The input mu
denotes the mean value of the exponential distribution. Higher mu
indicates a higher
chance to generate a larger output y
.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | mu | Mean exponential distribution | |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Real | y | duration of event |
Modelica definition
Buildings.Occupants.BaseClasses.linear1D
Mapping a continuous input to a binary output through a linear relation
Information
This function generates a random binary variable with the input of a continuous variable x
from a
linear relation.
The probability of being 1 is calculated from the input x
with the
slope A
and the intercept B
.
Then a random generator generates the output, which should be a binary variable.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | x | Continuous variable | |
Real | A | 1 | Slope of the linear function |
Real | B | 0 | Intercept of the linear function |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Binary variable |
Modelica definition
Buildings.Occupants.BaseClasses.logit1D
Mapping a continuous input to a binary output through a logistic relation
Information
This function generates a random binary variable with the input of a continuous variable x
from a
logistic relation.
The probability of being 1 is calculated from the input x
from a logistic relation with the
slope A
and the intercept B
. Then a random generator
generates the output, which should be a binary variable.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | x | Continuous variable | |
Real | A | 1.0 | Logistic relation: Slope |
Real | B | 1.0 | Logistic relation: Intercept |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Binary variable |
Modelica definition
Buildings.Occupants.BaseClasses.logit1DQuadratic
Mapping a continuous input to a binary output through a quadratic logistic relation
Information
This function generates a random binary variable with the input of a continuous
variable x
from a quadratic logistic relation.
The probability of being 1 is calculated from the input x
from a
quadratic logistic relation with four predefined parameters A
,
B
, C
and D
. Then a random generator
generates the output, which should be a binary variable.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | x | Continous variable | |
Real | A | 1.0 | Parameter defining the quadratic logistic relation |
Real | B | 1.0 | Parameter defining the quadratic logistic relation |
Real | C | 1.0 | Parameter defining the quadratic logistic relation |
Real | D | 1.0 | Parameter defining the quadratic logistic relation |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Binary variable |
Modelica definition
Buildings.Occupants.BaseClasses.logit2D
Mapping two continuous inputs to a binary output through a 2-dimension logistic relation
Information
This function generates a random binary variable with two inputs x1
and x2
from a 2-dimension logistic relation.
The probability of being 1 is calculated from the inputs x1
and
x2
from a 2D logistic relation with three predefined parameters
A
(mutiplier for x1
), B
(mutiplier for
x2
) and C
(intercept). Then a random generator
generates the output, which should be a binary variable.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | x1 | The first input variable | |
Real | x2 | The second input variable | |
Real | A | 1.0 | Parameter defining the 2D logistic relation: mutiplier for the first input |
Real | B | 1.0 | Parameter defining the 2D logistic relation: mutiplier for the second input |
Real | C | 1.0 | Parameter defining the 2D logistic relation: intercept |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Binary variable |
Modelica definition
Buildings.Occupants.BaseClasses.weibull1DOFF
Mapping a continuous input to a binary output through a Weibull Distribution Relation
Information
This function generates a random binary variable with a continuous inputs
x
from a Weibull Distribution relation.
The probability of being 1 is calculated from the input x
from a
Weibull Distribution relation with three predefined parameters u
(threshold, the output would be 0 if x
is bigger than u
),
L
(normalization faction) and k
(shape factor).
Then a random generator generates the output, which should be a binary variable.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | x | Continous variable | |
Real | u | 1.0 | Parameter defining the Weibull distribution threshold |
Real | L | 1.0 | Parameter defining the Weibull distribution normalization factor |
Real | k | 1.0 | Parameter defining the Weibull distribution shape factor |
Real | dt | 60 | Time step length |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Binary variable 0/1 |
Modelica definition
Buildings.Occupants.BaseClasses.weibull1DON
Mapping a continuous input to a binary output through a Weibull Distribution Relation
Information
This function generates a random binary variable with a continuous inputs
x
from a Weibull Distribution relation.
The probability of being 1 is calculated from the input x
from a
Weibull Distribution relation with three predefined parameters u
(threshold, the output would be 0 if x
is less than u
),
L
(normalization faction) and k
(shape factor). Then
a random generator generates the output, which should be a binary variable.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | x | Continous variable | |
Real | u | 1.0 | Parameter defining the Weibull distribution threshold |
Real | L | 1.0 | Parameter defining the Weibull distribution normalization factor |
Real | k | 1.0 | Parameter defining the Weibull distribution shape factor |
Real | dt | 60 | Time step length |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Boolean | y | Binary variable 0/1 |
Modelica definition
Buildings.Occupants.BaseClasses.weibullVariableGeneration
Random variable generator from the Weibull distribution
Information
This function generates a random variable, from a Weibull distribution with the
inputs of lambda
and k
. The random variable might be
the duration of a specific event, for instance the time to keep the HVAC on.
The inputs lambda
and k
defines the probability density
function. lambda
is similar to the mean value of exponential
distribution, and k
defines the shape. A value of k
= 1
means the Weibull distribution reduces to an exponential distribution. Genrally
speaking, higher lambda
and higher k
indicate a higher
chance to generate a higher output.
Inputs
Type | Name | Default | Description |
---|---|---|---|
Real | lambda | Parameter defining the Weibull distribution scale factor | |
Real | k | Parameter defining the Weibull distribution shape factor | |
Integer | globalSeed | Seed for the random number generator |
Outputs
Type | Name | Description |
---|---|---|
Real | y | Random variable generated from Weibull Distribution |