  In spite of planetary resonances being a common dynamical mechanism acting on
planetary systems, no general model exists for describing their properties,
particularly for commensurabilities of any order and arbitrary values of the
eccentricities and inclinations. The present work presents a semi-analytical
model that describes the resonance strength, width, location and stability of
fixed points, as well as periods of small-amplitude librations. The model is
valid to any two gravitationally interacting massive bodies, and thus
applicable to planets around single or binary stars. Using a theoretical
framework in Poincar\'e and Jacobi reference system we develop a
semi-analytical method that employs a numerical evaluation of the averaged
resonant disturbing function. Validations of the model are presented comparing
its predictions with dynamical maps for real and fictitious systems. The model
is shown to describe very well many dynamical features of planetary resonances.
Notwithstanding the good agreements found in all cases, a small deviation is
noted in the location of the resonance centers for circumbinary systems. As a
consequence of its application to the HD31527 system we have found that the
updated best-fit solution leads to a high-eccentricity stable libration between
the middle and outer planets inside the 16/3 mean-motion resonance. This is the
first planetary system whose long-term dynamics appears dominated by such a
high-order commensurability. In the case of circumbinary planets, the overlap
of N/1 mean-motion resonances coincides very well with the size of the global
chaotic region close to the binary, as well as its dependence with the mutual
inclination.
