A proof of concept of an exergy based optimal controller is presented. The problem is to find an optimal sequence of valve openings that load a three-tank process given a hypothetical intermittent temperature profile of a concentrating solar colector. Three cases are compared: (1) energy optimization, (2) temperature maximization, and (3) the proposed exergy optimization. Twenty hours of operation are optimized using multiple shooting technique. The results show that case 1 seeks to maximize accumulated mass to the detriment of high temperature, while case 2 does the opposite. The proposed case 3 integrates the advantages and minimizes the disadvantages of the earlier cases, finding an equilibrium between final temperatures and masses. The exergy storage increase by 30% and 71% relative to cases 1 and 2, respectively.