Forward magnetic modeling