# About HOW to calculate mu_ex

Hello Lammps user，
I have some question about chemical potential in “fix GCMC”，it seems only provides the method of mu_id，but in my research i also need the calculate method of mu_ex. i will appreciate it if you give some advice.
sincerely，
Yu

@yzliang I am having trouble figuring out the specific meaning of your request due to your “creative” use of grammar and me not being a native english speaker (who is?).

I would like to point out the the excess chemical potential in an input parameter for fix gcmc, so you (obviously) cannot use it to compute it. It may be possible to use fix widom instead, but you will have to carefully study the documentation and corresponding publications and text books. Perhaps @athomps can provide some additional advice, but I fear he may struggle with understanding your request as much as me.

@yzliang We have provided about a page of text and equations carefully defining chemical potential \mu, as well as the related definitions of \mu_id and \mu_ex, so I am struggling to imagine what exactly you need to know that has not already been explained. Perhaps you are asking if LAMMPS, as a convenience to the user and as a consistency check, could output the numerical value of \mu_id and \mu_ex, based on the input value of \mu and other related inputs. Is that it?

thanks I’ll try it later

oh This is mentioned in the manual “The second term mu_ex is the excess chemical potential due to energetic interactions and is formally zero for the fictitious gas reservoir but is non-zero for interacting systems.” So i mean this value is a function of energy, isn’t it? Please forgive my understanding of this commands， i will waiting for your reply sincerely

The basic idea is, the user specifies the value of \mu, as well as some other things like temperature, atomic mass and unit styles. From these quantities, LAMMPS calculates the thermodynamic activity, and that is used to calculate the acceptance criterion for GCMC exchange moves. Note that \mu_id depends on density, and so can only be estimated from a statistical sample of density captured during the simulation. Since \mu = \mu_id + \mu_ex, the same is true for excess chemical potential.