Applications of model predictive control to vehicle dynamics for active safety and stability