Hi I am trying to calculate the slope of some data. Voltage reading taken every 10 min on a solar site. I am trying to calculate the nocturnal rate of discharge or slope of the data. It is classic linear regression.
I've tried using the forecast function with linear fit and projecting forward by an hour. Subtracting that forecast from the last data reading should give me the rate of discharge per hour. Calculation is done at 5am and using the last 10hours data, so 19h00 to 04h50 (60 points).
1000 * (last(/Puffer solar site test/Voltage) - forecast(/Puffer solar site test/Voltage,1h,10h,"linear"))
"Forecast" extrapolates a 6am voltage of 24.5218v based on the data above. last() is 24.93v so the slope would be -0.4082 V/Hr or -408.2mV/Hr This is empirically very high and not realistic.
Using Excel linear regression gives y = -0.0066x + 24.91. Slope would be 0.0066 per 10 min reading or 6 x 0.0066 = -0.0396v/Hr or -39.6mV/Hr. and the 6am forecast would be 24.87v.
Sanity check : voltage at 19h00 is 25.33V and at 04h50 is 24.93V (25.33-24.93 = 0.4) / 10 hours = 0.04 or roughly equal to 0.0396.
Can anyone suggest where I am going wrong with the application of the standard forecast function, or suggest a better way of getting the accurate slope? There is some noise on the data so linear regression is the right solution.
I've tried using the forecast function with linear fit and projecting forward by an hour. Subtracting that forecast from the last data reading should give me the rate of discharge per hour. Calculation is done at 5am and using the last 10hours data, so 19h00 to 04h50 (60 points).
1000 * (last(/Puffer solar site test/Voltage) - forecast(/Puffer solar site test/Voltage,1h,10h,"linear"))
"Forecast" extrapolates a 6am voltage of 24.5218v based on the data above. last() is 24.93v so the slope would be -0.4082 V/Hr or -408.2mV/Hr This is empirically very high and not realistic.
Using Excel linear regression gives y = -0.0066x + 24.91. Slope would be 0.0066 per 10 min reading or 6 x 0.0066 = -0.0396v/Hr or -39.6mV/Hr. and the 6am forecast would be 24.87v.
Sanity check : voltage at 19h00 is 25.33V and at 04h50 is 24.93V (25.33-24.93 = 0.4) / 10 hours = 0.04 or roughly equal to 0.0396.
Can anyone suggest where I am going wrong with the application of the standard forecast function, or suggest a better way of getting the accurate slope? There is some noise on the data so linear regression is the right solution.
Comment