A new numerical description of the interaction of an ion beam with a magnetized plasma in an ECR-based charge breeding device