Optimal Control Problems In Pde And Ode Systems