espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: code for constant pH ensemble


From: Peter Košovan
Subject: Re: code for constant pH ensemble
Date: Fri, 8 Nov 2019 03:39:24 +0100

Hi Jiaxing,

This is because internally the forward and reverse directions of the reaction are represented separately. The backward reaction is assigned
equilibrium constant 1.0 / self._params["gamma"] and the code that you mentioned takes this into account by multiplying pKa with nubar. For the forward direction, nubar=1.0. For the reverse direction, nubar=-1.0, that is equivalent to using Ka = 1/Ka_reverse.

I believe that this has mostly historical reasons. The reaction ensemble was implemented first, and it was implemented such that forward and reverse directions had to be specified separately. The constant-pH ensemble was implemented later, using the same functions. Only then, the redundancy of specifying the forward and reverse reaction was removed. I think that what you just found is an artifact of that redundancy that makes the code more complicated but has no impact on the results or on the performance.

Perhaps Jonas Landsgesell can provide further comments.

With regards,

Peter

On Thu, Nov 7, 2019 at 3:23 PM Jiaxing Yuan <address@hidden> wrote:
Dear all, 

While I am reading the source code reaction_ensemble.cpp for constant pH ensemble, there is a function double ConstantpHEnsemble::calculate_acceptance_probability. In this function there is a line:
pKa = -current_reaction.nu_bar * log10(current_reaction.gamma);

I am confused why there is a factor current_reaction.nu_bar before (nu_bar is the change of the particle). It seems to me pKa is simply defined as pKa=-log10(current_reaction.gamma)

Best,
Jiaxing 


--
Dr. Peter Košovan

Department of Physical and Macromolecular Chemistry
Faculty of Science, Charles University in Prague, Czech Republic

Katedra fyzikální a makromolekulární chemie
Přírodovědecká fakulta Univerzity Karlovy v Praze

www.natur.cuni.cz/chemistry/fyzchem/
Tel. +420221951029
Fax +420224919752

reply via email to

[Prev in Thread] Current Thread [Next in Thread]