Reflective wall to prevent water from penetrating the lipid bilayer
Posted: Mon Nov 11, 2024 1:31 pm
I am seeking to implement a applied to water particles to prevent them from penetrating the membrane in the early stage of the simulation.
This is simple with a flat-bottom harmonic potential, however the issue that I find is with PBC. This excerpt from the documentation has caused me a lot of nightmares,
the force will be constant and will be independent of the coordinates of whichever particle OpenMM decides to use, although this is not true with the harmonic energy expression. Therefore, I think the usual implementation with the global coordinate is dangerous. For example, the flat-bottom harmonic restraint can be implemented with the expression,
where and are the locations of the reflective walls. The difficulty here is with PBC. I have considered the use of and , however this does not lead to a simple solution. There is also an increase of complexity here because seems to give the absolute distance, which for the case of an arbitrary plane at will give the minimum distance of particles in both the above and below the plane with the loss of information on which side of the plane the particle was on.
Does anyone have suggestions to implement this restraint? It is also a possible that I have misunderstood the documentation. In any case, any help will be appreciated.
Code: Select all
CustomExternalForce
This is simple with a flat-bottom harmonic potential, however the issue that I find is with PBC. This excerpt from the
Code: Select all
CustomExternalForce
and equally horrific from the FAQ,Special care is needed in systems that use periodic boundary conditions. In that case, each particle really represents an infinite set of particles repeating through space. The variables x, y, and z contain the coordinates of one of those periodic copies, but there is no guarantee about which.
For the case of the harmonic potential the particles position affects the force. For example, for a linear force solely on z with a general expression ofPeriodic boundary conditions are applied while computing forces that depend on the displacements between particles.
Code: Select all
" f * z "
Code: Select all
" select(a, a, b) * (k/2) * ( z - select(a, zUpper, zLower) )^2; a=step(z - zUpper); b=step(zLower - z) "
Code: Select all
zUpper
Code: Select all
zLower
Code: Select all
periodicdistance(0, 0, z, 0, 0, zUpper)
Code: Select all
periodicdistance(0, 0, z, 0, 0, zLower)
Code: Select all
periodicdistance(x1, y1, z1, x2, y2, z2)
Code: Select all
z = zUpper
Does anyone have suggestions to implement this restraint? It is also a possible that I have misunderstood the
Code: Select all
CustomExternalForce