Thanks haruspex! That works.. I've just tested it experimentally
Do you know what I should look up to get a better understanding to this as where it was derived?
I've just set a solar thermal array for research for my thesis. I would like to simulate different usage patterns to see how the system performs. I'm doing this using a Arduino with temperature sensors at the top hot the tank and on the cold supply which will then control a motorised valve which...