Help with power function in a Maths Expression
Posted: Tue Oct 22, 2013 9:05 pm
I'm trying to create a Math channel in I2 PRO that will display a boost value taking the altitude into consideration.
The formula for this is:
boost = manifold pressure - atmospheric pressure
To estimate atmospheric pressure at a given altitude you can use this formula:
(kPa at sea level * e ^ -(altitude/7000)*100)
which at Wakefield would be:
(1.01 * 2.7182818285 ^ -(661/7000)*100) = 91.925 kPa
So I attemted to create a Maths channel in I2 PRO like this:
power(1.01*2.7182818285,-1*('GPS Altitude' [m])/7000)*100
and it tells me that the expression is invalid. So I attempted this:
power(1.01*2.7182818285,-661/7000)*100
which I2 will happily resolve to the wrong value. Assuming there was a problem with negative exponents with the power function I tried to create a simple unitless expression to 4 decimal places like this:
power(10,-2)
The result I get is 0 not 0.01. So getting desperate I tried:
1/power(10,2)
and I still got 0 as the result. Getting even more desperate I tried:
1/10/10
and I still got 0 as a result.
Does anyone know what is going on here? There must be some sort of rounding issue I'm not seeing as I2 thinks 3/2 = 1.0000
The formula for this is:
boost = manifold pressure - atmospheric pressure
To estimate atmospheric pressure at a given altitude you can use this formula:
(kPa at sea level * e ^ -(altitude/7000)*100)
which at Wakefield would be:
(1.01 * 2.7182818285 ^ -(661/7000)*100) = 91.925 kPa
So I attemted to create a Maths channel in I2 PRO like this:
power(1.01*2.7182818285,-1*('GPS Altitude' [m])/7000)*100
and it tells me that the expression is invalid. So I attempted this:
power(1.01*2.7182818285,-661/7000)*100
which I2 will happily resolve to the wrong value. Assuming there was a problem with negative exponents with the power function I tried to create a simple unitless expression to 4 decimal places like this:
power(10,-2)
The result I get is 0 not 0.01. So getting desperate I tried:
1/power(10,2)
and I still got 0 as the result. Getting even more desperate I tried:
1/10/10
and I still got 0 as a result.
Does anyone know what is going on here? There must be some sort of rounding issue I'm not seeing as I2 thinks 3/2 = 1.0000