In a method and a magnetic resonance apparatus for determining k-space positions for modeling RF pulses for exciting nuclear spins in a magnetic resonance sequence, a target magnetization is selected and a deviation thereof from a current achievable magnetization is determined. At least one maximum is localized in a spectrum of the deviation in k-space, and the k-space position of the localized maximum is stored, from which current pulse coefficients are determined that cause an optimal current magnetization to be achieved. This procedure is repeated until a termination criterion is satisfied, with the current pulse coefficients determined in this terminating repetition being used to generate an RF pulse to excite nuclear spins in a subject in the magnetic resonance sequence.