where F represents the Helmholtz free energy and µ i are the Lagrange multipliers that ensure the fixed number of particles of type i inside the cell. This relation can be interpreted as expressing the condition of constant electrochemical potential of each specie i inside the system. The Helmholtz free-energy functional F is composed of the entropic (ideal gas) contribution F id , a mean-field contribution F mf , and a (generally unknown) excess free-energy F ex . The ideal contribution is explicitly given by