Equilibrium charge distributions of ion beams in carbon