Rational solutions for automatic control of a solar heating system