Mean motion resonances are a common feature of both our own Solar System and of extrasolar planetary systems . Bodies can be trapped in resonance when their orbital semi-major axes change , for instance when they migrate through a protoplanetary disc . We use a Hamiltonian model to thoroughly investigate the capture behaviour for first and second order resonances . Using this method , all resonances of the same order can be described by one equation , with applications to specific resonances by appropriate scaling . We focus on the limit where one body is a massless test particle and the other a massive planet . We quantify how the the probability of capture into a resonance depends on the relative migration rate of the planet and particle , and the particle ’ s eccentricity . Resonant capture fails for high migration rates , and has decreasing probability for higher eccentricities , although for certain migration rates , capture probability peaks at a finite eccentricity . More massive planets can capture particles at higher eccentricities and migration rates . We also calculate libration amplitudes and the offset of the libration centres for captured particles , and the change in eccentricity if capture does not occur . Libration amplitudes are higher for larger initial eccentricity . The model allows for a complete description of a particle ’ s behaviour as it successively encounters several resonances . Data files containing the integration grid output will be available on-line . We discuss implications for several scenarios : ( i ) Planet migration through gas discs trapping other planets or planetesimals in resonances : We find that , with classical prescriptions for Type I migration , capture into second order resonances is not possible , and lower mass planets or those further from the star should trap objects in first-order resonances closer to the planet than higher mass planets or those closer to the star . For fast enough migration , a planet can trap no objects into its resonances . We suggest that the present libration amplitude of planets may be a signature of their eccentricities at the epoch of capture , with high libration amplitudes suggesting high eccentricity ( e.g. , HD 128311 ) . ( ii ) Planet migration through a debris disc : We find the resulting dynamical structure depends strongly both on migration rate and on planetesimal eccentricity . Translating this to spatial structure , we expect clumpiness to decrease from a significant level at e \lesssim 0.01 to non-existent at e \gtrsim 0.1 . ( iii ) Dust migration through PR drag : We predict that Mars should have its own resonant ring of particles captured from the zodiacal cloud , and that the capture probability is \lesssim 25 \% that of the Earth , consistent with published upper limits for its resonant ring . To summarise , the Hamiltonian model will allow quick interpretation of the resonant properties of extrasolar planets and Kuiper Belt Objects , and will allow synthetic images of debris disc structures to be quickly generated , which will be useful for predicting and interpreting disc images made with ALMA , Darwin/TPF or similar missions .