Analytical determination of anchoring energy coefficient in liquid crystal cells