Magnetic properties of heavy fermion superconductors UPt3 and URu2Si2