Ab-initio Based Analytical Evaluation of Entropy in Magnetocaloric Materials with First Order Phase Transitions