A new method for performing molecular dynamics simulations
under constant pressure is presented. In the method, which is
based on the extended system formalism introduced by Andersen,
the deterministic equations of motion for the piston degree
of freedom are replaced by a Langevin equation; a suitable choice
of collision frequency then eliminates the unphysical ``ringing''
of the volume associated with the piston mass. In this way it
is similar to the ``weak coupling algorithm'' developed by Berendsen
and co-workers to perform molecular dynamics simulation without
piston mass effects. It is shown, however, that the weak coupling
algorithm induces artifacts into the simulation which can be
quite severe for inhomogeneous systems such as aqueous biopolymers
or liquid/liquid interfaces.