Predictive Control for Linear and Hybrid Systems