On the use of space invariant imbedding to solve optimal control problems for second order elliptic equations