Stability modelling applied to wellbore design