EcoRenovator  

Go Back   EcoRenovator > Improvements > Geothermal & Heat Pumps
Advanced Search
 


Blog 60+ Home Energy Saving Tips Recent Posts Search Today's Posts Mark Forums Read


 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 02-19-15, 01:26 AM   #31
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

Quote:
Originally Posted by buffalobillpatrick View Post
A/C did I get this right?
It looks like you are handling the equation correctly, although I do believe that there is an exponentiation operator that is available to you.

Other than that, I must assume that you are using the floating point precision appropriate to this application.

Quote:
Originally Posted by buffalobillpatrick View Post
How did you come up with such an accurate formula??
Multiple Polynomial Regression Analysis.

Quote:
Originally Posted by buffalobillpatrick View Post
Either the formula or the table are off by a little bit.

OR Arduino floating point math is a bit in-accurate.
I would bet on this option, as Arduino does floating point by actually doing integer add operations.

This one line of code: y = ( a + (b * x) + (c * x*x) + (d * x*x*x) + (e * x*x*x*x));
Produces 348 bytes of Arduino object code.

At 30PSI: formula = 5.83*F, table = 7.93*F, difference = -2.1*F
At 300PSI: formula = 143.75*F, table = 142.2*F, difference = +1.55*F
I used the values of the table to generate the curve. And the equation I gave you was the best fit.

If the process you are trying to address, primarily functions in only part of that range, I can recalculate, for maximum fit over that specified range, which will give you much greater accuracy within that specified range but would be a less accurate fit in the rest of the range (that you will not use).

BTW, I replicated the equation I gave to you, on a high-quality spreadsheet, without Arduino limitations, and got the very same results, when rounded.

You did good.

Best,

-AC

P.S.:

if your input pressure variable was called "psi", and your calculated output temperature variable was called "degF", then your one-line formula would be:

Code:
degF=-40.3085122205+(1.81496452942*psi)+(-0.0101201804003*psi^2)+(3.05234258195e-005*psi^3)+(-3.37963005786e-008*psi^4)
This code will run on my spreadsheet, and I'm pretty sure that it should compile on the Arduino IDE.

Good luck!

%%%%%%%%%

__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
The Following User Says Thank You to AC_Hacker For This Useful Post:
buffalobillpatrick (02-19-15)
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design