Calculation of the Ti-C, W-C and Ti-W-C phase diagrams