I have a graph of values
0.399 203.9
0.6736 192.2
0.716 188.06
0.7422 185.54
0.7705 183.38
0.7948 180.86
0.8036 180.14
0.8189 178.7
0.8365 177.26
0.8609 175.64
0.8628 175.46
0.8753 174.74
0.9015 173.732
0.9206 172.832
0.9648 172.67
the 2nd column is temp in F. the value in the 1st column is the one that I want displayed. There is no known (to me) formula to calculate the 1st column from the 2nd.
what would be an appropriate way to store (variable) and display this information? what if my temp sensor shows 176?
I can devise a way to get the aetable[x][y] where y is given, but if the temp sensor gets a value that isnt in this list... that's where I am stuck at the moment.
so if the temp sensor reads 177.9, i "think i can" get the value of the 2 closest ones, and somehow get an inbetween value based on how close to the upper or lower value the temp value is? i think my brain just broke.
Do you mean 3 significant figures? That's one part out of 1000 or 0.1%. Kind of ambitious in my opinion. Your gonna have to do some kind of interpolation or curve fitting.
I assume the numbers come from some sort of (secret to you) physical process. Why not start by plotting your data on a piece of paper? Then look for some of the typical relationships you might expect: linear, quadratic, logarithmic, exponential, etc. You can curve fit to those.
Baring any other plan, go with linear interpolation between samples. Extrapolation outside the range is kind of dicey.
gfvalvo:
Do you mean 3 significant figures? That's one part out of 1000 or 0.1%. Kind of ambitious in my opinion. Your gonna have to do some kind of interpolation or curve fitting.
I assume the numbers come from some sort of (secret to you) physical process. Why not start by plotting your data on a piece of paper? Then look for some of the typical relationships you might expect: linear, quadratic, logarithmic, exponential, etc. You can curve fit to those.
Baring any other plan, go with linear interpolation between samples. Extrapolation outside the range is kind of dicey.
before coming to this forum, i went to https://mycurvefit.com/ to attempt to figure out the maths. I cant really say that I understand it very well:
y = 168.6714 + (204.0255 - 168.6714)/(1 + (x/0.7339429)^8.497811)
i threw that in excel to test, and they all came back "7". i went back and came up with this quartic Regression method:
y = 1741.346 - 36.26593x + 0.2829009x^2 - 0.0009788492x^3 + 0.000001266937x^4
#2 was the way that i was going to go, but jremington's curve is tight enough to make me happy. and I dont have to keep a 2d array. just an if statement to keep it within bounds.