We are building an MRTOF-MS (multi-reflection time-of-flight mass spectrometer) for isobaric separation for the Lanzhou Penning Trap. The potentials applied on the electrodes of our MRTOF mass analyzer operating in in-trap-lift mode have to be optimized to achieve a very high mass resolving power. Our method to design and optimize an MRTOF mass analyzer has been updated to introduce constraints on the potentials, and this method now can be used to optimize the parameters of MRTOF-MS both operating in mirror-switching mode and in in-trap-lift mode. By using this method, the optimal potential parameters of the electrodes have been obtained for our MRTOF mass analyzer operating in the in-trap-lift mode. With a beam size of 2.8 mm diameter and an initial average ion kinetic energy of 1500 eV, the maximal mass resolving power has been achieved to be $$3.2\times 10^4$$ with a total TOF of 7.0 ms for an ion species of $$^{40}$$ Ar $$^{1+}$$ . It can reach up to $$5.6\times 10^4$$ for a beam size of 0.3 mm diameter. The simulation shows that the inaccuracy of the potentials applied on the outermost mirror electrodes M1–M2 must be less than 50 ppm or preferably 20 ppm.