  Predicting the emerging X-ray spectra in several astrophysical objects is of
great importance, in particular when the observational data are compared with
theoretical models. To this aim, we have developed an algorithm solving the
radiative transfer equation in the Fokker-Planck approximation when both
thermal and bulk Comptonization take place. The algorithm is essentially a
relaxation method, where stable solutions are obtained when the system has
reached its steady-state equilibrium. We obtained the solution of the radiative
transfer equation in the two-dimensional domain defined by the photon energy E
and optical depth of the system tau using finite-differences for the partial
derivatives, and imposing specific boundary conditions for the solutions. We
treated the case of cylindrical accretion onto a magnetized neutron star. We
considered a blackbody seed spectrum of photons with exponential distribution
across the accretion column and for an accretion where the velocity reaches its
maximum at the stellar surface and at the top of the accretion column,
respectively. In both cases higher values of the electron temperature and of
the optical depth tau produce flatter and harder spectra. Other parameters
contributing to the spectral formation are the steepness of the vertical
velocity profile, the albedo at the star surface, and the radius of the
accretion column. The latter parameter modifies the emerging spectra in a
specular way for the two assumed accretion profiles. The algorithm has been
implemented in the XSPEC package for X-ray spectral fitting and is specifically
dedicated to the physical framework of accretion at the polar cap of a neutron
star with a high magnetic field (> 10^{12} G), which is expected to be typical
of accreting systems such as X-ray pulsars and supergiant fast X-ray
transients.
