Magnetic resonance imaging (MRI) has a wide range of applications towards imaging the human body. In this work we have solved the Bloch equations for different magnetic field gradients along the transverse direction. We have modified the magnetic field components based on the relaxation terms and solved the field gradient as well as the field components for both off-pulse and on-pulse configurations. In particular we focus on different pulse sequences and optimize them to realize the best possible output. We have analyzed the field components along transverse direction because the rotation of the object to form the image by emitting signal is along the xy plane. © Published under licence by IOP Publishing Ltd.