Magnetic anisotropy in CoNi nanowire arrays: Analytical calculations and experiments