  We present a method for sampling microscopic configurations of a physical
system distributed according to a canonical (Boltzmann-Gibbs) measure, with a
constraint holding in average. Assuming that the constraint can be controlled
by the volume and/or the temperature of the system, and considering the control
parameter as a dynamical variable, a sampling strategy based on a nonlinear
stochastic process is proposed. Convergence results for this dynamics are
proved using entropy estimates.As an application, we consider the computation
of points along the Hugoniot curve, which are equilibrium states obtained after
equilibration of a material heated and compressed by a shock wave.
