  We present a numerical algorithm for predicting the optimal conditions for
the effective alignment of magnetic particles in dense powders during the
compactization process using an externally applied field. This task is
especially important for the permanent magnets development due to the fact that
alignment of anisotropy axes of nanocomposite grains increases both remanence
and coercivity of magnetic materials. In contrast to previously known methods
where magnetic moment of each particle was assumed to be 'fixed' with respect
to the particle itself, our approach takes into account the (field-dependent)
deviation of this moment from the particle anisotropy axis that occurs even for
magnetically 'hard' particles possessing a strong mechanical contact. We show,
that this deviation leads to the existence of the optimal value of the applied
field for which the particle orientation (or alignment) time is minimal. The
influence of the external pressure and internal mechanical friction on the
details of the compactization/orientation process is also studied.
