Photointeractions of ultra-high energy cosmic rays (UHECRs) in astrophysical scenarios are in
general of stochastic nature and are often modeled with Monte Carlo methods to obtain the
form of the distributions resulting from a sequence of interactions. These distributions are non
trivial because the products resulting from each interaction as well as the number and distances
covered by the secondary nuclear species are all random. In this work, a stochastic approach
based on the theory of matrix exponential distributions is employed to describe the cascade
distributions analytically and illustrate their potential for tracing the individual history of UHECRs,
including inside the source. This analytic description has the advantage of better precision and
considerably reduced computational cost in contrast to Monte Carlo codes, while requiring the
same inputs: the interaction rates, the multiplicity, and the energy distributions of secondaries from
a single interaction. The description of the composition evolution from in-source to extragalactic
propagation (currently performed in separate simulations in the literature) is achieved here as a
continuous distribution, using a gamma-ray burst scenario inspired by the event GRB170817A.
Finally, the potential for locating a source based on the reconstructed UHECR origin employing
this description is discussed under simplified general assumptions.
