Constants

Mathematical and other constants

Package Constants (14)

e

Value: Modelica.Constants.e

Type: Real

Description: Euler's number also known as Napier's constant

eps

Value: ModelicaServices.Machine.eps

Type: Real

Description: Biggest number such that 1.0 + eps = 1.0

inf

Value: Modelica.Constants.inf

Type: Real

Description: Infinity

INF

Value: inf

Type: Real

Description: Infinity

pi

Value: Modelica.Constants.pi

Type: Real

Description: Ratio of a circle's circumference to its diameter (π)

small

Value: ModelicaServices.Machine.small

Type: Real

Description: Smallest number such that small and -small are representable on the machine

timeBaseUnits

Value: {"s", "min", "h", "d", "wk", "mo", "qtr", "yrCal"}

Type: String[TimeBases]

Description: Unit strings for model time bases

timeBaseRateUnits

Value: {"1/s", "1/min", "1/h", "1/d", "1/wk", "1/mo", "1/qtr", "1/yrCal"}

Type: String[TimeBases]

Description: Unit strings for rates matching time bases

rateStrings

Value: {"per second", "per minute", "per hour", "per day", "per week", "per month", "per quarter", "per year"}

Type: String[TimeBases]

Description: Rate strings for different time bases

timeBaseConversionFactors

Value: [1, 1 / 60, 1 / 3600, 1 / 86400, 1 / 604800, 1 / 2629746, 1 / 7889238, 1 / 31556952; 60, 1, 1 / 60, 1 / 1440, 1 / 10080, 10 / 438291, 10 / 1314873, 5 / 2629746; 3600, 60, 1, 1 / 24, 1 / 168, 200 / 146097, 200 / 438291, 50 / 438291; 86400, 1440, 24, 1, 1 / 7, 1600 / 48699, 1600 / 146097, 400 / 146097; 604800, 10080, 168, 7, 1, 1600 / 6957, 1600 / 20871, 400 / 20871; 2629746, 438291 / 10, 146097 / 200, 48699 / 1600, 6957 / 1600, 1, 1 / 3, 1 / 12; 7889238, 1314873 / 10, 438291 / 200, 146097 / 1600, 20871 / 1600, 3, 1, 1 / 4; 31556952, 2629746 / 5, 438291 / 50, 146097 / 400, 20871 / 400, 12, 4, 1]

Type: Real[TimeBases,TimeBases]

Description: Conversion factors for time base conversions

unspecified

Value: inf

Type: Real

Description: Unspecified as an alias for 'inf' to indicate potential inputs in some cases

unspec

Value: zero

Type: Real

Description: Unspecified as an alias for 'zero' to indicate potential inputs in some cases

zero

Value: -1e-10

Type: Real

Description: Constant that is negative but close enough to zero to be considered effectively zero

'1each'

Value: 1

Type: Amount (#)

Description: Define the amount of one `each` for counting

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

This package contains some common constants that are considered useful for system dynamics modeling and simulation.

Notes

It is generally advisable to set up models in SIunits of time so that they will be compatibale with models from other domains. To enter and display times and rates in a convenient fashion the displayUnit attribute should be used. This should be conveniently handled by Modelica tools which most often will allow to make such a choice by drop-down menu.

In that sense, the constants timeBaseUnits and timeBaseConversionFactors are usually not needed.

See also

Tutorial.UnitsInBusinessSimulations, TimeConversion



Copyright © 2020 Guido Wolf Reichert
Licensed under the EUPL-1.2 or later

Revisions

  • timeBaseRateUnits[TimeBases] added in v2.0.0

  • unspecified and unspec added in v2.1.0

  • timeBaseConversionFactors (mo, qtr, yr) adapted to average Gregorian year definition in v2.2.