  We compute numerical simulations of spherical collapse triggered by a slow
increase in external pressure. We compare isothermal models to models including
cooling with a simple but self-consistent treatment of the coupling between
gas, grains and radiation field temperatures. The hydrostatic equilibrium
appears to hold past the marginally stable state, until the collapse proceeds.
The last hydrostatic state before collapse has a lower central gas temperature
in the centre due to the enhanced coupling between gas, grains and radiation
field. This results in slightly lower pressure gradients in the bulk of the
envelope which is hence slightly more extended than in the isothermal case. Due
to the sensitivity of the collapse on these initial conditions, protostellar
infall velocities in the envelope turn out to be much slower in the case with
cooling.Our models also compute the radiative transfer and a rather large
chemical network coupled to gas dynamics. However, we note that the
steady-state chemisorption of CO is sufficient to provide an accurate cooling
function of the gas. This justifies the use of post-processing techniques to
account for the abundance of observed molecules. Existing observations of
infall signatures put very stringent constraints on the kinematics and
temperature profile of the class 0 protostar IRAM 04191+1522. We show that
isothermal models fail to account for the innermost slow infall motions
observed, even with the most hydrostatic initial conditions. In contrast,
models with cooling reproduce the general shape of the temperature profile
inferred from observations and are in much better agreement with the infall
signatures in the inner 3000 AU.
