Optimal control of uncertain piecewise affine/mixed logical dynamical systems