Density profile control in a fusion reactor using pellet injection