Calculation of Phase Equilibrium and its Applicaitons