  The $\varphi_0$ Josephson junctions formed by ordinary superconductors and a
magnetic non-centrosymmetric interlayer are studied. We derive an analytical
solution for the magnetization dynamics induced by an arbitrary current pulse
and formulate the criteria for magnetization reversal. Using the obtained
results, the form and duration of the current pulse are optimized. The
agreement between analytical and numerical investigations is reached in the
case of a large product of the ratio Josephson to magnetic energy, strength of
spin-orbit interaction and a minimal value of the current pulse. The obtained
results allow one to predict magnetization reversal at the chosen system
parameters.
