Equation help
Could someone help figure out how to effectiviley write the following equation so that the Basic Stamp II could do. It deals with Wind Chill Factor.
Wind chill temperature = 35.74 + 0.6215T - 35.75V (**0.16) + 0.4275TV(**0.16)
In the formula, V is in the wind speed in statute miles per hour, and T is the temperature in degrees Fahrenheit.
Note: In the formula, ** means the following term is an exponent (i.e. 10**(0.5 ) means 10 to the 0.5 power, or the square root of V), - means to subtract, + means to add. A letter next to a number means to multiply that quantity represented by the letter by the number. The standard rules of algebra apply.
Sassy
Wind chill temperature = 35.74 + 0.6215T - 35.75V (**0.16) + 0.4275TV(**0.16)
In the formula, V is in the wind speed in statute miles per hour, and T is the temperature in degrees Fahrenheit.
Note: In the formula, ** means the following term is an exponent (i.e. 10**(0.5 ) means 10 to the 0.5 power, or the square root of V), - means to subtract, + means to add. A letter next to a number means to multiply that quantity represented by the letter by the number. The standard rules of algebra apply.
Sassy
Comments
Post Edited (Mike Green) : 5/6/2007 7:28:47 PM GMT
I did infact look at Tracy's Web page, But I am not smart enough to figure out how to do it. I was hoping someone with Good Math Knowledge could help me.
Sassy
different terms, my first thought is to use a co-processor such
as the PAK-II from Al Williams.
See http://www.awce.com/pak1.htm
It has the ability to handle the exponentiation required by this
equation.
phil
Rick
Wind chill temperature = 35.74 + 0.6215T - 35.75(V **0.16) + 0.4275T(V**0.16)
The only factor raised to a power **0.16 is the wind speed. That makes things a lot easier. That is a very slow currve, easy to approximate.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 5/7/2007 5:19:31 PM GMT
Thank you for your help. Like I said I am not a Math wize. I was wondering if you have this on your site or know where I may obtain a sample program. Someone has had to attempt this.
Thanks
Sassy
I'd programme·a table (matrix), using DATA; have the programme prompt for user input (Temperature, Wind Speed -- integers only or truncate them); then retrieve (READ) the pre-calculated "answers" to the more complicated parts which could be computed more easily.
All this raising to powers of <1 and multiplying by <1... Sheesh.
Update:
·Then you could "do" 35.74 + A - B + C (after you work around the "integer only" maths.)
Post Edited (PJ Allen) : 5/8/2007 12:45:09 AM GMT
DATA 36,31,25,19,13,7,1,-5,-11,-16,-22,-28,-34,-40,-46,-52,-57,-63
DATA 34,27,21,15,9,3,-4,-10,-16,-22,-28,-35,-41,-47,-53,-59,-66,-72
DATA 32,25,19,13,6,0,-7,-13,-19,-26,-32,-39,-45,-51,-58,-64,-71,-77
DATA 30,24,17,11,4,-2,-9,-15,-22,-29,-35,-42,-48,-55,-61,-68,-74,-81
DATA 29,23,16,9,3,-4,-11,-17,-24,-31,-37,-44,-51,-58,-64,-71,-78,-84
DATA 28,22,15,8,1,-5,-12,-19,-26,-33,-39,-46,-53,-60,-67,-73,-80,-87
DATA 28,21,14,7,0,-7,-14,-21,-27,-34,-41,-48,-55,-62,-69,-76,-82,-89
DATA 27,20,13,6,-1,-8,-15,-22,-29,-36,-43,-50,-57,-64,-71,-78,-84,-91
DATA 26,19,12,5,-2,-9,-16,-23,-30,-37,-44,-51,-58,-65,-72,-79,-86,-93
DATA 26,19,12,4,-3,-10,-17,-24,-31,-38,-45,-52,-60,-67,-74,-81,-88,-95
DATA 25,18,11,4,-3,-11,-18,-25,-32,-39,-46,-54,-61,-68,-75,-82,-89,-97
DATA 25,17,10,3,-4,-11,-19,-26,-33,-40,-48,-55,-62,-69,-76,-84,-91,-98
no, I didn't type it in. I used Excel and VBA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
"Typo Reposted"
' {$STAMP BS2}
' {$PBASIC 2.5}
DATA 36,31,25,19,13,7,1,-5,-11,-16,-22,-28,-34,-40,-46,-52,-57,-63
DATA 34,27,21,15,9,3,-4,-10,-16,-22,-28,-35,-41,-47,-53,-59,-66,-72
DATA 32,25,19,13,6,0,-7,-13,-19,-26,-32,-39,-45,-51,-58,-64,-71,-77
DATA 30,24,17,11,4,-2,-9,-15,-22,-29,-35,-42,-48,-55,-61,-68,-74,-81
DATA 29,23,16,9,3,-4,-11,-17,-24,-31,-37,-44,-51,-58,-64,-71,-78,-84
DATA 28,22,15,8,1,-5,-12,-19,-26,-33,-39,-46,-53,-60,-67,-73,-80,-87
DATA 28,21,14,7,0,-7,-14,-21,-27,-34,-41,-48,-55,-62,-69,-76,-82,-89
DATA 27,20,13,6,-1,-8,-15,-22,-29,-36,-43,-50,-57,-64,-71,-78,-84,-91
DATA 26,19,12,5,-2,-9,-16,-23,-30,-37,-44,-51,-58,-65,-72,-79,-86,-93
DATA 26,19,12,4,-3,-10,-17,-24,-31,-38,-45,-52,-60,-67,-74,-81,-88,-95
DATA 25,18,11,4,-3,-11,-18,-25,-32,-39,-46,-54,-61,-68,-75,-82,-89,-97
DATA 25,17,10,3,-4,-11,-19,-26,-33,-40,-48,-55,-62,-69,-76,-84,-91,-98
Temp VAR Byte
Wind VAR Byte
Index VAR Word
result VAR Word
DO
· DEBUG "Temperature?",CR
· DEBUGIN SDEC3 Temp
· DEBUG ?Temp
· DEBUG "Wind Speed?",CR
· DEBUGIN DEC2 Wind
· Index=40-Temp & $FF / 5
· DEBUG ?index
· Index=Wind - 5 / 5 * 18 +Index
· DEBUG ?index
· READ Index,result
· result.HIGHBYTE=result.BIT7 * $FF 'sign extend
· DEBUG "Wind Chill:",SDEC result,"°",CR,CR
LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 5/8/2007 4:01:07 AM GMT
The calculation uses the */ operator for the fractional multiplies, and offsets the temperature to positive values and then restore the offset after the divisions. The attached graph shows mph ^ 0.16, except at values below 5mph I extrapolated through the value at 3mph to build the interpolation table. Windchill not defined for windspeeds below 3 mph.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thank You all for your Help! I will try Using the Program Tracy has provided with the Look-Up Table TechoRobbo has provided. Tracy your Web page is a source of much needed information. I think you should add this to it.
Thanks Again
Sassy