Learning and control with inaccurate models