A treatment agent and method to introduce magnesium into ferrous material. A library of basic waveforms is produced by applying selected digital initialization codes to a chaotic system. A frequency divider may be employed to scale the frequency of the feedback signal.