- We use numerical solutions of the focused transport equation obtained by an implicit stochastic differential equation scheme to study the evolution of the pitch-angle dependent distribution function of protons in the vicinity of shock waves. For a planar stationary parallel shock, the effects of anisotropic distribution functions, pitch-angle dependent spatial diffusion, and first-order Fermi acceleration at the shock are examined, including the timescales on which the energy spectrum approaches the predictions of diffusive shock acceleration theory. We then consider the case that a flare-accelerated population of ions is released close to the Sun simultaneously with a traveling interplanetary shock for which we assume a simplified geometry. We investigate the consequences of adiabatic focusing in the diverging magnetic field on the particle transport at the shock, and of the competing effects of acceleration at the shock and adiabatic energy losses in the expanding solar wind. We analyze the resulting intensities, anisotropies, and energy spectra as a function of time and find that our simulations can naturally reproduce the morphologies of so-called mixed particle events in which sometimes the prompt and sometimes the shock component is more prominent, by assuming parameter values which are typically observed for scattering mean free paths of ions in the inner heliosphere and energy spectra of the flare particles which are injected simultaneously with the release of the shock. © 2016. The American Astronomical Society. All rights reserved..