Experimental and theoretical investigations on thermal energy systems for agricultural and rural applications: energy and exergy analysis