1. A method of magnetic gradient waveform design for rapid magnetic resonance imaging using constrained optimization comprising the steps of: a) selecting a number N of discrete-time waveforms with a sampling period, τ, and time T=Nτ, b) expressing constraints as equations, c) identifying if a solution exists for T, and if not, increasing T until a solution exists, d) decreasing T to find a shortest solution, and e) solving the equations to identify the solution.