  A method is presented for first-principles calculations of inelastic mean
free paths and stopping powers in condensed matter over a broad energy range.
The method is based on {\it ab initio} calculations of the dielectric function
in the long wavelength limit using a real-space Green's function formalism,
together with extensions to finite momentum transfer. From these results we
obtain the loss function and related quantities such as optical-oscillator
strengths and mean excitation energies. From a many-pole representation of the
dielectric function we then obtain the electron self-energy and inelastic mean
free paths (IMFP). Finally using our calculated dielectric function and the
optical-data model of Fern\'andez-Varea {\it et al}., we obtain collision
stopping powers (CSP) and penetration ranges. The results are consistent with
semi-empirical approaches and with experiment.
