Simulation of an entropic spring