Magnetic behavior of heterogeneous magnetic materials