  Nonlinear dynamics has an important role when designing modern synchrotron
lattices. In this letter, we introduce a new method of using a square matrix to
analyze periodic nonlinear dynamical systems [1, 2]. Applying the method to the
National Synchrotron Light Source II storage ring lattice has helped to
mitigate the chaotic motion within its dynamic aperture. For a given dynamical
system, the vector space of a square matrix can be separated into different low
dimension invariant subspaces according to their eigenvalues. When Jordan
decomposition is applied to one of the eigenspaces, it yields a set of accurate
action-angle variables. The distortion of the new action-angle variables
provides a measure of the nonlinearity. Our studies show that the common
convention of confining the tune-shift with amplitude to avoid the crossing of
resonance lines may not be absolutely necessary. We demonstrate that the third
order resonance can be almost perfectly compensated with this technique. The
method itself is general, and could be applied to other nonlinear systems.
