In the permanent magnet linear synchronous motor (PMLSM), force ripple is harmful, useless and disturbing. The force ripple is basically composed of two components: detent force and mutual force ripple. This force is influenced by the geometric parameters of the permanent magnet (PM) motors; such as width, thickness and length of the magnet poles, length and thickness of the rotor and stator, and stator slot shape. For design optimization, the force ripple can be considered as the objective function and geometric parameters can be considered as design variables. In this paper, the distribution of magnetic flux density in the air gap is calculated using an analytical method, then detent force is computed by integrating the Maxwell stress tensor; that is expressed in terms of flux density distribution on the slot face and end face of the iron core of moving parts. The analytical result is compared with FEM simulation to verify the model. The geometric parameter effect on the detent force is investigated. Finally, using genetic algorithm, the optimum design of a linear synchronous motor with minimum detent force is obtained.