×
Menu
Index

VistaPro Expressions

 
Custom variables in VistaPro can be defined by combining several variables together using a formula or in other words an expression.  Below describes all the operators, functions and constants available for use in your own expressions.  The expression syntax is Excel like in nature so should be easy to pick up and understand.
 
Operators
Arithmetic
The usual arithmetic operators are supported for addition +, subtraction -, division /, multiplication *, modulo %, exponentiation ^, and negation -.
Parentheses ( , ) can be used to change the precedence of the operators.
For example: (A + B + C) / 3 computes the average of the sum of A , B and C .
All operators work in the usual way and can be used with variables, constants, or numbers.
For example: X^(-0.5) computes the inverse of the square root of X.
Modulo is defined as the remainder of a division that rounds the quotient towards minus infinity.
That is: A % B == A - FLOOR(A/B)*B.
Relational
Relational operators are also supported; the result of such an operation is either true or false (i.e., a boolean value).
Available operators are: equal to == , not equal to != , less than < , greater than > , less than or equal to <= , and greater than or equal to >= .
These can be used with the logical functions described here.
All operators can be used with variables, constants, or numbers.
 
 
Functions
As well as operators, expressions support a standard set of functions that can be used to transform values.  A complete list of all the functions available for you to use is below.
The syntax describes how to use the function in your expressions. Note: square brackets ‘[ ] ’ denote the argument is optional; while ellipsis ‘ ... ’ denote additional arguments can be specified.
Numerical / Mathematical
Name
Syntax
Description
ABS
ABS( value )
Returns the absolute value of a number.
ACOS
ACOS( value )
Returns the arccosine (in radians) of a number.
ACOSH
ACOSH( value )
Returns the inverse hyperbolic cosine of a number.
ASIN
ASIN( value )
Returns the arcsine (in radians) of a number.
ASINH
ASINH( value )
Returns the inverse hyperbolic sine of a number.
ATAN
ATAN( value )
Returns the arctangent (in radians) of a number.
ATAN2
ATAN2( x-value, y-value )
Returns the arctangent (in radians) of (x,y) coordinates.
ATANH
ATANH( value )
Returns the inverse hyperbolic tangent of a number.
AVG
AVG( value )
Returns the average (arithmetic mean) of the variable.
CBRT
CBRT( value )
Returns the cubic root of a number.
CEIL
CEIL( value )
Returns a number rounded up.
CLAMP
CLAMP( value, min, max )
Returns a number within the specified range.
COS
COS( value )
Returns the cosine of an angle.
COSH
COSH( value )
Returns the hyperbolic cosine of a number.
COUNT
COUNT( value, ... )
Returns the number of values which are valid, i.e. not .
DEGREES
DEGREES( value )
Converts radians into degrees.
EXP
EXP( value )
Returns mathematical constant  raised to the nth power.
EXP2
EXP2( value )
Returns 2 raised to the nth power.
FLOOR
FLOOR( value )
Returns a number rounded down.
FRACT
FRACT( value )
Returns the fractional part of a number.
HYPOT
HYPOT( x-value, y-value )
Returns the hypotenuse (square root of the sum of the squares) of the coordinates.
INRANGE
INRANGE( value, min, max )
Returns true if the number is within the specified range or false if it is outside the range.
LOG
LOG( value, base )
Returns the logarithm of a number to the specified base.
LOG2
LOG2( value )
Returns the base-2 logarithm of a number.
LOG10
LOG10( value )
Returns the base-10 logarithm of a number.
LN
LN( value )
Returns the natural logarithm of a number.
MAX
MAX( value1, [value2] )
Returns the largest value(s) for the specified variable(s).
MEDIAN
MEDIAN( array )
Returns the median value in the array.
MIN
MIN( value1, [value2] )
Returns the smallest value(s) for the specified variable(s).
MOD
MOD( value, divisor )
Returns the remainder after a value is divided by a divisor.
NEG
NEG( value )
Returns true if the value is less than zero, otherwise false.
NUM
NUM( value )
Converts a true or false value to one or zero respectively.
POS
POS( value )
Returns true if the value is greater than zero, otherwise false.
POW
POW( value, power )
Returns the result of a number raised to a given power.
RADIANS
RADIANS( value )
Converts degrees to radians.
RANGE
RANGE( array )
Returns the range of values in the array.
ROTATE
ROTATE( array, offset )
Rotates elements in the array so that offset is now the start.
ROUND
ROUND( value )
Returns a number rounded to the nearest integer.
SHIFT
SHIFT( array, offset, [value] )
Shifts elements in the array so that offset is now the start while filling the gap with the specified value or .
SIGN
SIGN( value )
Returns 1 if the value is greater than zero, -1 if the value is less than zero, or 0 otherwise.
SIN
SIN( value )
Returns the sine of an angle.
SINH
SINH( value )
Returns the hyperbolic sine of a number.
SQRT
SQRT( value )
Returns the square root of a number.
SUM
SUM( value )
Returns the total (summation) of a variable.
TAN
TAN( value )
Returns the tangent of an angle.
TANH
TANH( value )
Returns the hyperbolic tangent of a number.
TRUNCATE
TRUNCATE( value, min, max )
Returns the number if it is within the specified range or  if it is outside the range.
Logical
Name
Syntax
Description
IF
IF( condition, true-value, false-value )
Returns one value if a specified condition evaluates to true, or another value if it evaluates to false.
AND
AND( condition1, condition2, ... )
Returns true if all conditions are true, otherwise false.
OR
OR( condition1, condition2, ... )
Returns true if any conditions are true, otherwise false.
NOT
NOT( condition )
Returns the reversed logical value.
XOR
XOR( condition1, condition2, ... )
Returns true when the number of true conditions is odd and false when the number of true conditions is even.
ALL
ALL( value, ... )
Returns true if all values are true, otherwise returns false.
ANY
ANY( value, ... )
Returns true if any value is true, otherwise returns false.
NONE
NONE( value, ... )
Returns true if no values are true, otherwise returns false.
COUNTIF
COUNTIF( value, ... )
Returns the number of values which are true.
Constants
A list of common and model related constants is also available to use as well.  A constant is just a numerical value represented with a name.  These are defined below.
Model Related
Name
Description
Units
WHP
Weather – Heating Percentile.
%
WCP
Weather – Cooling Percentile.
%
WMDT
Weather – Maximum Dry-bulb Temperature.
°C , °F
WMWT
Weather – Maximum Wet-bulb Temperature.
°C , °F
WWDT
Weather – Winter Design Temperature.
°C , °F
WCO2
Weather – External CO2 concentration.
ppm
WRAD
Weather – Reference Air Density.
kg/m³ , lb/ft³
NR
Number of Rooms in Model.
-
NS
Number of Apache Systems in Model.
-
RA
Total Room Floor Area.
m² , ft²
RV
Room Volume.
m³ , ft³
ROA
Room Opaque Area.
m² , ft²
RGA
Room Glazed Area.
m² , ft²
RIWA
Room Internal Wall Area.
m² , ft²
REWA
Room External Wall Area.
m² , ft²
RIGA
Room Internal Glazed Area.
m² , ft²
REGA
Room External Glazed Area.
m² , ft²
RRLA
Room Roof Light Area.
m² , ft²
RDA
Room Door Area.
m² , ft²
RFA
Room Floor Area.
m² , ft²
RGFA
Room Ground Floor Area.
m² , ft²
RCA
Room Ceiling Area.
m² , ft²
RRA
Room Roof Area.
m² , ft²
RRHL
Lowest Relative Humidity in Room.
%
RRHH
Highest Relative Humidity in Room.
%
RNS
Number of Surfaces in Room.
-
RNO
Number of Openings in Room.
-
SA
Net Surface Area.
m² , ft²
OA
Gross Opening Area.
m² , ft²
SFA
Apache System Floor Area.
m² , ft²
SFAMV
Apache System Auxiliary Mechanical Ventilation Floor Area.
m² , ft²
SATD
Apache System Supply Air Temperature Difference.
°C , °F
SRAD
Apache System Reference Air Density.
kg/m³ , lb/ft³
Note: Model constants are only available for use with their respective data level or lower.
The values are taken directly from the apache results file so are representative of your model at the point of simulation.
Where applicable, values are in Metric or US IP units based on the current VE setting.
General
Name
Description
DEG
The value representing 1 degree in radians, with an approximate value of 0.01745329251.
INF
The representation of positive infinity.
LN10
The natural logarithm of 10, with an approximate value of 2.302585092994046.
LN2
The natural logarithm of 2 , with an approximate value of 0.6931471805599453.
LOG10E
The base-10 logarithm of the mathematical constant , with an approximate value of 0.4342944819032518.
LOG2E
The base-2 logarithm of the mathematical constant , with an approximate value of 1.442695040888963387.
NAN
Not a Number, which represents an undefined or unrepresentable value.
PI
The ratio of a circle's circumference to its diameter, with an approximate value of 3.141592653589793.
RAD
The value representing 1 radian in degrees, with an approximate value of 57.2957795131.
SQRT2
The square root of 2, with an approximate value of 1.41421356237.
SQRT3
The square root of 3, with an approximate value of 1.73205080757.
TRUE
Logical value representing true for use in conditional expressions.
FALSE
Logical value representing false for use in conditional expressions.