Math operations
Warning
For Engine versions older than v1.7.0, only a subset of the below operations are supported.
Multiple fields in the gridmo webapp support mathematical operations, which are resolved by the gridmo engine. These operations allow you to perform calculations directly within supported fields, enhancing flexibility in commands, tables, and analysis records.
Supported Operations
You can use the following mathematical operators and functions:
- Basic arithmetic:
+
,-
,/
,*
- Brackets:
()
for grouping expressions
Additional functions are available:
Function | Example |
---|---|
Absolute value | abs({{i_p_poc}}) |
Square root | sqrt({{i_p_poc}}) |
Trigonometric functions | sin({{i_angle}}) , cos({{i_angle}}) , tan({{i_angle}}) |
Inverse trigonometric functions | asin({{i_value}}) , acos({{i_value}}) , atan({{i_value}}) |
Logarithmic functions | log({{i_p_poc}}) , log10({{i_p_poc}}) |
Degrees to radians | deg2rad({{i_angle}}) |
Radians to degrees | rad2deg({{i_angle}}) |
Exponentiation | {{i_p_poc}}**2 |
Sign (-1 if negative, 1 if positive, 0 if 0) | sign({{i_p_poc}}) |
Mathematical constants | pi |
tip
In gridmo's online documentation, Arguments marked with the number emoji (🔢) support the above math operations and functions.
Examples
In Commands
Draw a line at 5 seconds after an initiating condition
DRAW_LINE, X1=5+{{i_intiating_condition_time}}, Y1=-999, X2=5+{{i_intiating_condition_time}}, Y2=999
In Table Node Cells
Calculate the amplification factor ratio for a voltage oscillation test
({{i_vpoc_max}}-{{i_vpoc_min}})/({{i_vthev_max}}-{{i_vthev_min}})