Dear all,

I want to simulate a LJ particle in a double potential well. I tried to add the force using addforce command. I want to change the force according to the x-coordinates of the Brownian particle but i am not able to due that. How do i extract the x-coordinates of a particular atom and pass it to the force variable ?

This is my input script:

I think I already explained, that you need to use an atom style variable. You are using equal style variables which are global and not per–atom.

Axel.

Ok, thanks for the clarification. I replaced ‘equal’ in "variable f equal v_Vo*(4*PI/v_L)**sin(4*PIv_xx/v_L) " with “atom”. Now its running but I want to know, Is it the correct approach?

sorry, but i have no time (or interest) to do your thinking for you

and verify what you are doing. it will do you no good, since you will

have to stand for it, anyway. what if i make a mistake, you are

responsible.

instead, you need to apply your skills as a scientist and figure this

out for yourself. for example, start with a simpler test system, where

you have a harmonic external potential and only one atom. then you can

easily confirm with a pencil & paper calculation and dumping positions

and forces for every step, whether what LAMMPS computes is correct.

then you use your more complex potential and do the same and then you

add a second atom and do the same until you can prove, that what you

are doing is correct.

axel.