I am trying to compare the efficiency of water heating methods but don't how to control for air temperature I'm trying to do a basic science experiment, but I don't know what sums to do to find the final answer.
I'm trying to prove the relative efficiency of two hot tub heating strategies to find the one that consumes the least electricity.
These are the strategies:

*

*Leave the tub on, at usage temperature, all the time.

*Turn it on only ahead of an evening when you'll use it, and let it go back to ambient temperature in between times.

To try and prove it I've built a data logger. Every minute it measures air temperature, water temperature, and the average current drawn by the tub heater for that period of time.
I've now gathered some datasets from my tub, one for each scenario. Graphed out, here they are:


It's easy to quickly measure which one used the most power, I can take that straight from the datalogger: strategy A consumed 25.4kWh in 48 hours and strategy B consumed 25.9kWh in 48 hours.
However, the different nature of the air temperature during each logging period will change the heating requirement for the tub dramatically. So how do I calculate the power used, while controlling for the independent variable of air temperature?
I feel like it's some watts per degree of air temperature difference, or maybe integrating both temperature curves and taking the difference, but at this point with only GCSE maths from 20 years ago to rely on, I don't even know what to Google.
I realise that there are also lots of other assumptions in this data: I'm not measuring how stable the voltage is at or around 240V (I'm in the UK), I'm not challenging the definition of "ambient" and how quickly the water temperature decays toward it, and I'm abstracting it all to a 48 hour period assuming two tub use sessions 1/3 and 2/3 through the time period, roughly. I think it would be fun to repeat the experiment in the middle of winter when the temperature difference is more dramatic between air and water.
 A: This is actually an engineering question and perhaps this is not the best forum to ask this question. Having said that:
A simple model for heat loss and gain is that the tub looses heat by Fourier's law, that is, the cooling rate should be proportional to the temperature difference $$\dot T = -\alpha (T - T_{ambient})$$
If the ambient temperature is time dependent (e.g. day and night as in your cases), this can be included by having $T_{ambient}$ being time dependent $T_{ambient}(t)$.
when the heater is switched on, there is an additional constant heat input $\beta$, so that the temperature change should be
$$\dot T = -\alpha (T - T_{ambient}) +\beta$$, where $\beta$ is switched on when $T$ drops below some target temperature. This kind of behavior can be modeled quite easily, even on a spread sheet, just have one column for time, one for $T_{ambient}$ and one for $\beta$ (on\off) and update $T$ in each row by a simple finite time scheme, eg $$T(t+dt) = T(t) +dt (-\alpha(T(t)-T_{ambient}(t))+\beta(t))$$
The numerical values of $\beta$ can be extracted by calculating how fast the actual heating element manages to increase the reservoir by 1 degree, but I propose instead that you extract both $\alpha,\beta$ from your experimental data by trying to run the solution with your original inputs where there is no heating, thus determining $\alpha$ by trial and error, then running the solution where the heating is fixed (the beginning of each of your experiments seems adequate), to extract $\beta$.
Once you have these parameters, you can run a full simulation, where you switch $\beta$ on/off according to the target temperature, you can even introduce some hysteresis. The power utilization is proportional to the amount of time that $\beta$ is switched on, so you can examine different scenarios.
My only worry is that the simple model I have described above is not sophisticated enough to capture all the details. As I mentioned in the comments,  the water is more or less at fixed temperature for a long time near noon 10/08 even though there is no heating at the ambient air temperature is 7 degrees cooler, which suggests that there are other effects, beyond Fourier's law.
