-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use correct Maxwell-Boltzmann velocity distribution in reaction ensemble #2377
Conversation
Codecov Report
@@ Coverage Diff @@
## python #2377 +/- ##
=======================================
+ Coverage 72% 72% +<1%
=======================================
Files 397 397
Lines 18773 18778 +5
=======================================
+ Hits 13580 13585 +5
Misses 5193 5193
Continue to review full report at Codecov.
|
Thank you for your contribution. This looks more correct than before to me, but finally @jonaslandsgesell has to decide. |
Draw a random velocity according to the Maxwell-Boltzmann distribution. Fixes espressomd#1770
This PR fixes #1770 and #2377 for particles of mass 1. For particles with different masses the Maxwell-Boltzmann distribution needs to take into account the particle mass which has to be provided to the reaction ensemble algorithm as input then. This is not yet fixed with this PR and remains an issue. I opened issue #2388 to document this. |
I don't get it, |
Yes but this should be changed if one wants to be as correct as possible.
One example would be if one wants to sample the (mass dependent) velocity
distribution in a reacting system. Then the masses of all types need to be
correct.
One can also construct exotic cases where masses become a problem. This is
obvious when you think about only the particle moving Monte Carlo moves
(which are also implemented in Espresso in the reaction ensemble module).
Consider a case where a user created particles with mass 0.5 but has not
assigned velocities. If there is no other thermostat running the velocities
will stay 0 if we only use MC moves to sample the configuration space. The
configuration space is sampled correctly. However the kinetic part of the
virial pressure will be 0 which is not how a termalized system would
behave. In order to solve this problem the correct velocity distribution
(which is mass dependent) needs to be assigned to the particles... All in
all this is not a problem if the system becomes correctly thermalized using
e.g. a Langevin thermostat before taking a sample.
Am Mo., 26. Nov. 2018 um 18:53 Uhr schrieb Florian Weik <
[email protected]>:
… I don't get it, ReactionAlgorithm::create_particle only creates particles
off mass 1, no?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2377 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE8wPf9NnjMYYkjEQi1CWjp0AZseVNKTks5uzCqTgaJpZM4YgCuP>
.
|
I mean you could just draw the velocity from the correct MBD for the particle, and this would be correct for ever right? Why can't you just put in the mass? |
Yes exactly. This will be the way to go. Pascal suggested to postpone this
though since it requires the Reaction Ensemble to be aware of masses (User
input).
Am Mo., 26. Nov. 2018, 19:43 hat Florian Weik <[email protected]>
geschrieben:
… I mean you could just draw the velocity from the correct MBD for the
particle, and this would be correct for ever right? Why can't you just put
in the mass?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2377 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE8wPR8M1WD6Rr1HaiEpKeXIcZFrHhnAks5uzDZsgaJpZM4YgCuP>
.
|
Or perhaps to rephrase myself: I currently do not have the capacity to do it. If @jonaslandsgesell wants to do it, we can incorporate it in this pull request. Maintainers are allowed to edit, so I believe Jonas can push to my branch... |
use correct Maxwell-Boltzmann velocity distribution in reaction ensemble
Fixes #1770 and #2377
The velocities of the particles inserted by the reaction ensemble did not follow the Maxwell-Boltzmann velocity distribution [1]. Even worse, with increasing temperature the mean squared velocity was decreasing. The effect of this PR on the velocity distribution function are shown in the following figure:
As you can see, now the measured velocity distribution from the simulation (marked as Sim in the plots).becomes wider with increasing temperature and follows the Maxwell-Boltzmann distribution (marked as Theo in the plots).
[1]: Atkins, P. W., and J. de Paula. Atkins’ Physical Chemistry. Oxford, UK: Oxford University Press, 2006.