A new computational approach for solving optimal control of linear PDEs problem