Synthesis of titanium and tungsten carbides in iron matrices