Pseudospectral methods and iterative solvers for optimization problems from multiscale particle dynamics