Text this: Optimal control of a Bose-Einstein condensate in an opticallattice: the non-linear and two-dimensional cases