  We discuss a class of diffusion-type partial differential equations on a
bounded interval and discuss the possibility of replacing the boundary
conditions by certain linear conditions on the moments of order 0 (the total
mass) and of another arbitrarily chosen order n. Each choice of n induces the
addition of a certain potential in the equation, the case of zero potential
arising exactly in the special case of n=1 corresponding to a condition on the
barycenter. In the linear case we exploit smoothing properties and perturbation
theory of analytic semigroups to obtain well-posedness for the classical heat
equation (with said conditions on the moments). Long time behavior is studied
for both the linear heat equation with potential and certain nonlinear
equations of porous medium or fast diffusion type. In particular, we prove
polynomial decay in the porous medium range and exponential decay in the fast
diffusion range, respectively.
