This is class project I conducted as team leader. I developed Matlab code to calculate the wellbore stability considering Mohr-Columb failure criteria in gemomechanical calculations. Example cases was studied using the code and based on results conclusions about wellbore stability during drilling was reached.