Skip to main content

Descriptions

Each attribute and constraint object has a defined value. For attributes, this includes the unit, the type of value, and any associated equations. For constraints, the value is simply a boolean statement. These values can either be simple values, like strings or numbers, or complex mathematical relations involving values from other objects.
Special handling is applied when resolving values containing strings of TBD (To Be Determined). This can be useful during the early stages of model formation to not resolve errors when the value is still being defined.

Math Syntax

Equations are powered by Math.js, providing a comprehensive set of mathematical operations and functions. The syntax follows standard mathematical conventions:

Basic Operations

OperationSyntax
AdditionA + B
SubtractionA - B
MultiplicationA * B
DivisionA / B
ModulusA % B
ExponentiationA ^ B

Comparison Operators

OperatorSyntax
Equal==
Not Equal!=
Less Than<
Greater Than>
Less or Equal<=
Greater or Equal>=

Mathematical Functions

FunctionSyntaxDescription
Absolute Valueabs(x)Returns the absolute value
Square Rootsqrt(x)Returns the square root
Cube Rootcbrt(x)Returns the cube root
Powerpow(x, y)Returns x raised to power y
Exponentialexp(x)Returns e raised to power x
Natural Loglog(x)Returns the natural logarithm
Base-10 Loglog10(x)Returns the base-10 logarithm
Minimummin(a, b, ...)Returns the minimum value
Maximummax(a, b, ...)Returns the maximum value
Roundround(x)Rounds to nearest integer
Floorfloor(x)Rounds down to integer
Ceilceil(x)Rounds up to integer
Signsign(x)Returns -1, 0, or 1

Trigonometric Functions

FunctionSyntaxDescription
Sinesin(x)Sine of x (in radians)
Cosinecos(x)Cosine of x (in radians)
Tangenttan(x)Tangent of x (in radians)
Arcsineasin(x)Inverse sine
Arccosineacos(x)Inverse cosine
Arctangentatan(x)Inverse tangent
Arctangent2atan2(y, x)Angle from x-axis to point
Hyperbolic Sinesinh(x)Hyperbolic sine
Hyperbolic Cosinecosh(x)Hyperbolic cosine
Hyperbolic Tangenttanh(x)Hyperbolic tangent

Statistical Functions

FunctionSyntaxDescription
Meanmean(a, b, ...)Returns the average value
Medianmedian(a, b, ...)Returns the median value
Modemode(a, b, ...)Returns the most frequent value
Standard Deviationstd(a, b, ...)Returns standard deviation
Variancevariance(a, b, ...)Returns variance
Sumsum(a, b, ...)Returns the sum of all values
Productprod(a, b, ...)Returns the product of all values

Logical Functions

FunctionSyntaxDescription
ANDand(a, b)Logical AND
ORor(a, b)Logical OR
NOTnot(x)Logical NOT
XORxor(a, b)Logical XOR

Constants

ConstantSyntaxValue
Pipi3.14159…
Euler’s Numbere2.71828…
Golden Ratiophi1.61803…

Value Types

Attributes can have the following kind assoicated to a value, which handles how it is displayed or computed:
TypeDescription
BooleanRepresents true or false values. Does not use a unit and clears any existing unit.
DateUsed for date values. Does not use a unit and clears any existing unit.
NumberRepresents standard numeric values. Optionally includes a unit.
StringRepresents string values. Does not use a unit and clears any existing unit.

Unit Referencing

Values can reference units inline, such as 10 kg, where the number is associated with the unit.

Object Referencing

To reference other objects within an equation, use the @ symbol followed by the object’s name. This will automatically resolve the object’s value and unit.