Modeling powder encapsulation in dosator-based machines: I. Theory.