We investigated the longitudinal ends' influence on the flux distribution in a permanent-magnet linear synchronous machine with an analytic model and with numeric finite-element methods. We derived a general analytic expression, on closed form, from a linear reluctance model. The model reveals that the flux in a linear machine differs from that in a rotating machine in several aspects. The longitudinal ends introduce a pairwise coupled flux pattern, which will behave differently in circuits with odd or even numbers of magnets. In linear machines with an even number of magnets the pairwise coupled flux will spread throughout the whole machine, whereas in linear machines with an odd number of magnets it will be transformed into an equally distributed flux in the middle. The latter case will give rise to a nonsymmetric air gap flux distribution, where every second pole has larger flux. We confirmed the pairwise coupled flux and the nonsymmetric air gap distribution predicted by the analytic model by finite-element simulations. We noted additional effects when nonlinear behavior of the steel is taken into account. We conclude that saturation counteracts the pairwise coupled flux pattern at the longitudinal ends. Again, a nonsymmetric air gap flux distribution occurs as the pairwise coupled flux is transformed into an equally coupled flux. The pairwise coupling of the flux and the nonsymmetric air gap flux distribution give rise to a number of secondary effects, which we discuss.