ln gm, chem = ln(Cm,1/xmCom,1)-rm(Y -Yom)

New tutorial on  Phase Diagrams