The development and implementation of novel MRI pulse sequences remains challenging and laborious. Gradient waveforms are typically designed using a combination of analytical and ad hoc methods to construct each gradient waveform axis independently. This strategy makes coding the pulse sequence complicated, in addition to being time inefficient. As a consequence, nearly all commercial MRI pulse sequences fail to maximize use of the available gradient hardware or efficiently mitigate physiological effects. This results in expensive MRI systems that underperform relative to their inherent hardware capabilities. To address this problem, a software solution is proposed that incorporates numerical optimization methods into MRI pulse sequence programming. Examples are shown for rotational variant vs. invariant waveform designs, acceleration nulled velocity encoding gradients, and mitigation of peripheral nerve stimulation for diffusion encoding. The application of optimization methods to MRI pulse sequence design incorporates gradient hardware limits and the prescribed MRI protocol parameters (e.g. field-of-view, resolution, gradient moments, and/or b-value) to simultaneously construct time-optimal gradient waveforms. In many cases, the resulting constrained gradient waveform design problem is convex and can be solved on-the-fly on the MRI scanner. The result is a set of multi-axis time-optimal gradient waveforms that satisfy the design constraints, thereby increasing SNR-efficiency. These optimization methods can also be used to mitigate imaging artifacts (e.g. eddy currents) or account for peripheral nerve stimulation. The result of the optimization method is to enable easier pulse sequence gradient waveform design and permit on-the-fly implementation for a range of MRI pulse sequences. KEYWORDS acquisition methods, applications, diffusion methods, diffusion MR sequences, flow imaging methods, flow quantitation, methods and engineering, methods and engineering, methods and engineering, other applications 1 INTRODUCTION Magnetic resonance imaging (MRI) is driven by pulse sequences-a synchronized series of radiofrequency (RF) and gradient events that confer image contrast, echo formation, and spatio-temporal sampling. This enables the acquisition of anatomical and physiological measurements that contain the preferred image information. The design of pulse sequences remains at the core of advances in fast and quantitative MRI.