In this paper the trapping of high energy particles in solar coronal loops is addressed. Using simulations, the time evolution of electrons and protons trapped in a magnetic bottle is calculated under various scattering conditions and the results compared with loss-cone analysis. Thereafter the case of time-dependent injection into a magnetic loop is addressed, and the results compared with previous analytic work on X and γ-ray delay times