Problems: 1. Solar panel conversion efficiency decreases with increasing temperature 2. The amount of energy required to desalinate water increases as temperature of the feed water decreases Technology: This invention uses photovoltaic panels (PV) to power reverse-osmosis water filtration. A thermal controller maximizes the clean water produced by a PV/RO system by managing the temperatures of the PV panel and the RO feed water in response to changes in the incoming solar radiation ambient air temperature and source water temperature. In this system a circulating pump drives the source water through both a heat exchanger mounted on the back of the PV panel and a controllable bypass valve. The circulation pump and the bypass valve settings are determined by the solar panel and RO feed water temperatures. A prototype has been built and tested.