Dynamics of a trapped Bose Einstein condensate in the presence of a one-dimensional optical lattice