Home Manuals Math Parser Functions
Math Parser Functions PDF Print E-mail
Written by Phil Tobin   
Saturday, 24 August 2013 10:03

The following functions are available for use in TunerStudio and MegaLog Viewer:

Function Definition Usage
Smoothing* Smooths a field by averaging over the smoothingFactor number of records. smoothBasic( field, smoothingFactor)
sine Standard Sine of a value. sin(val)
cosine Standard Cosine of a value. cos(val)
arcsine Standard arcsine of a value. asin(val)
arccosine Standard arccosine of a value. acos(val)
tangent Standard Tangent of a value. tan(val)
arc tangent Standard Arc Tangent of a value. atan(val)
square root Standard Square Root, same as pow(val, 0.5) of a value. sqrt(val)
absolute Changes any negative values to the same magnitude in the positive direction. abs(val)
log Natural log of a value. log(val)
log base 10 Base 10 log of a value of a value. log10(val)
recipricol The recipricol of a value, or 1/val recip(val)
exponent Exponent of a value. pow(val, exponent)
round Rounds the value of a value to the nearest integer value. round(val)
floor Returns the largest (closest to positive infinity) integer value that is greater than or equal to the argument. floor(val)
ceiling Returns the smallest (closest to negative infinity) integer value that is greater than or equal to the argument. ceil(val)
exponent Returns Euler's number e raised to the power of a double value. exp(val)
isNaN Checks the output of an expression to result in a invalid number isNaN(val)
smoothFiltered Smooth a field using a matrix filter for less lag smoothFiltered(val)
accelHp Calculates HP based on Acceleration rate. accelHp(
    velocity (MPH),
    deltaVelocity(MPH),
    deltaTime(s),
    weight(lb)
)
Aero Drag Calculates the Aerodynamic Drag aerodynamicDragHp(
    velocity (m/s),
    airDensity (kg/m^-3),
    dragCoefficent,
    frontalArea (m^2)
)
Rolling Drag Calculates estimated rolling resistence rollingDragHp(
    speed (MPH),
    tirePressure (psi),
    weight (lbs)
)
Last Value Returns the last record value for the specified field or expression lastValue(anyField)
Historical Value Returns the value for the specified field or expression from n records back historicalValue(anyField, n)
Min Returns the minimum value resulting from 1-n expressions or variables min(exp, exp, ...)
Max Returns the maximum value resulting from 1-n expressions or variables max(exp, exp, ...)
Max Value Returns the maximum historical value for the specified field or expression maxValue(anyField)
Min Value Returns the minimum historical value for the specified field or expression minValue(anyField)
table Perform a table lookup using an inc file table(expression, 'fileName.inc')
tableLookup

Perform a table lookup on 1D or 2D arrays based on specified OutputChannel(s) and 1D array lookup references.

It will provide the interpolated value for the relative position of the lookup.

tableLookup([array.valueArrayName], [array.lookupArrayName], [lookupChannelName])

 

tableLookup([array.zParamName], [array.xParamName], [array.yParamName], [xChannelName], [yChannelName])

Accumulate* Accumulate and sum the expression
This allows totalling distance, milage, fuel consumption, etc.
accumulate(expression)
Persistent Accumulate* Same as accumulate, except the accumulated value is persisted to the next  session. Allows for an Odometer. persistentAccumulate(expression)

 

*TunerStudio 2.9.124+ required.

Last Updated on Thursday, 04 August 2016 15:01
 
 

Polls

What would you like to see in TunerStudio 3.0