Neural approximation for the optimal control of heating systems