Vehicle dynamics control using a flexible body model