Optimal control of parabolic equations by spectral decomposition. (3rd August 2017)