Optimal Control of PDE-based Systems by Using a Finite-Dimensional Approximation Scheme