The Andersen thermostat in molecular dynamics