# Demon algorithm for microcanonical ensemble

Tags:
1. Dec 22, 2015

### gre_abandon

I simulated a microcanonical ensemble of 10 ideal gas particles in one dimension and yielded the expected normal distribution of velocities. However, I still did not get how the algorithm works. The demon has non-negative energy content and the demon together with the system constitutes a closed system with fixed energy. In my view, the demon algorithm amounts to conducting a random walk in phase space where H is less than E_total. Whenever a step of walk carries the particle outside the permitted region this step is rejected. But how is that a sampling of a microcanonical ensemble?

2. Dec 22, 2015

### Staff: Mentor

It is an approximation of the microcanonical ensemble. There are fluctuations in the total energy of the system, but if the energy of the demon is constrained enough, then the system will stay close to the actual microcanonical energy. The main advantage is to reduce the probability of rejection: if your were to try to simulate the actual microcanonical case, most of the computer time would be used generating configurations that would be rejected.

3. Dec 22, 2015

### gre_abandon

On wikipedia and my textbook the only constraint on the demon is that the demon should hold non-negative energy while in my opinion there also should be an upper bound as well for demon energy. And the energy fluctuation of the system is between E_demon_min and E_demon_max. If the energy fluctuation is small enough compared with the energy scale of the system we can regard the energy of the system fixed. Am I correct that there should be an upper bound for demon energy?

I've also done simulation for only two one dimensional particles. Without an upper bound on demon energy, it seems that we are effectively sampling the phase volume enclosed by the energy surface uniformly and this is by no means what we want.

4. Dec 22, 2015

### Staff: Mentor

It can be useful to limit the energy of the demon. To quote from the original paper:
The way the algorithm is described in Landau & Binder, A Guide to Monte Carlo Simulations in Statistical Physics, there is also an upper limit to the demon energy.