Magnetocrystalline anisotropy of R2Fe14B tetragonal compounds