total energy conservation

Hi LAMMPS Users,

I am running a system with fix_modify energy yes & Total energy is drifting continuously both in NPT & NVT ensemble.

Now, if I remove fix_modify energy yes, Total energy is conserved within short interval of time.

I am unable to understand why total energy is drifting with energy yes.

Any help is greatly appreciated.

Thanks

spandana

Hi LAMMPS Users,

I am running a system with fix_modify energy yes & Total energy is
drifting continuously both in NPT & NVT ensemble.

Now, if I remove fix_modify energy yes, Total energy is conserved within
short interval of time.

I am unable to understand why total energy is drifting with energy yes.

neither am i. there is far too little information here. unless you can
provide convincing proof that there is something wrong inside of
LAMMPS (e.g. in the form of a minimal input deck that demonstrates
it), we have to assume that there is a problem with your choice of
parameters or system.

Any help is greatly appreciated.

before even worrying about NPT and NVT ensembles, does your system
conserve energy when run in NVE ensemble? this is the prerequisite for
everything else working well.

axel.

> Hi LAMMPS Users,
>
> I am running a system with fix_modify energy yes & Total energy is
> drifting continuously both in NPT & NVT ensemble.
>
> Now, if I remove fix_modify energy yes, Total energy is conserved within
> short interval of time.
>
>
> I am unable to understand why total energy is drifting with energy yes.

Because you are adding the potential energy change due to the ensambles in
your thermodynamic output of energy. Removing fix_modify does not includes
this contribution. At this point, not much i can say.

Sagar

To elaborate, all that fix_modify energy yes does is
some internal bookkeeping to add the fixes energy
to the thermo output. It does not affect the dynamics
of the system. Thus a run with and without that
command should be no different, except for
the thermo energy that is printed. E.g. forces and
pressure output should be identical, as should dump
files of coords.

Steve

Thanks Steve sir,

Now, for a system to be well equilibrated, conservation of total energy with fix_modify energy yes is better??

Then, why in none of the examples, people wont use fix_modify energy yes.

Thanks
spandana

As Steve said, fix_modify energy yes does not change dynamics so that it does not auto-magically conserve energy for a run that is not supposed to.

Bottom line is, verifying that the run conserves energy using only fix nve is more important.

Ray

Thanks Steve sir,

Now, for a system to be well equilibrated, conservation of total energy with
fix_modify energy yes is better??

tests for energy conservation are usually done with fix nve. why make
things needlessly complicated with a thermostat or barostat? if you
don't conserve energy with fix nve, it won't work with any other
ensemble.

Then, why in none of the examples, people wont use fix_modify energy yes.

most examples shipped with LAMMPS are examples to demonstrate how
features in LAMMPS can be used in the simplest possible way. the are
by no means meant to demonstrate best practices. this is something you
have to learn differently and based on text book knowledge.

axel.