packageConstants

Mathematical and other constants

Extends from Icons.Package (Basic package icon).

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

Parameters

TypeNameDefaultDescription
RealeModelica.Constants.eEuler's number also known as Napier's constant
RealepsModelicaServices.Machine.epsBiggest number such that 1.0 + eps = 1.0
RealinfModelica.Constants.infInfinity
RealINFinfInfinity
RealpiModelica.Constants.piRatio of a circle's circumference to its diameter (π)
RealsmallModelicaServices.Machine.smallSmallest number such that small and -small are representable on the machine
String[TimeBases]timeBaseUnits{"s", "min", "h", "d", "wk", "mo", "qtr", "yrCal"}Unit strings for model time bases
String[TimeBases]timeBaseRateUnits{"1/s", "1/min", "1/h", "1/d", "1/wk", "1/mo", "1/qtr", "1/yrCal"}Unit strings for rates matching time bases
String[TimeBases]rateStrings{"per second", "per minute", "per hour", "per day", "per week", "per month", "per quarter", "per year"}Rate strings for different time bases
Real[TimeBases,TimeBases]timeBaseConversionFactors[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]Conversion factors for time base conversions
RealunspecifiedinfUnspecified as an alias for 'inf' to indicate potential inputs in some cases
RealunspeczeroUnspecified as an alias for 'zero' to indicate potential inputs in some cases
Realzero-1e-10Constant that is negative but close enough to zero to be considered effectively zero
Amount'1each'1Define the amount of one `each` for counting

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.