Engineering Effective Hamiltonians for Magnetic Resonance