Integration method to calculate the stress field in the optical fiber