# Time-dependent external potential/force

First; thanks a lot for your fast reply!!

I am writing my Master-Thesis at the moment. For this I would like to do some (very simple) simulations. I think > MD should be the right thing. Essentially what I need is a free gas of particles confined in a box with reflecting

walls (no interaction between gas particles). As I understand that should be not a big deal.

In addition to that I would also like to sweep e.g. with a step-potential through the volume. Or in other words; I

need an external potential that is time-dependent and thus moves through the volume finally filling it completely
(the position changes not the height/strength).

Could you clarify here a bit more? How are your particles expected to
interact with that potential? For example, an electrostatic potential
that is time dependent but has no spatial dependency will not create
any forces on charged particles as there will be no potential gradient
whatsoever at all times (zero electric field). Same with a
gravitational field. The fields are generally defined as gradients of
the potential thus you need to have some spatial dependency
added. But maybe what you call potential is the field already and you
just don't know the difference between them.

Of course... The particles are expected to interact with this potential. The
particles are meant to be neutrons interacting with a B field through their
magnetic dipole moment \\mu. The potential is V = \-\\vec\{\\mu\} \\cdot \\vec\{B\}
and the force is it's gradient (not curl). You can take e.g. a potential step which
than results in an un-handy (for MD) delta distribution force. Thus I took a
Fermi-Dirac distribution like potential: V = \\frac\{1\}\{e^\{$$x\-v\*t$$/D\}\+1\} for the
1D case, where v is the potentials speed in x-direction and D is a free
parameter (you can set D=1 if you like).

Thanks for your help - Greetings
Ursin Solèr

You can use fix addforce to specify a variable that describes
an external force that is time and spatially dependent. If
the variable syntax is not powerful enough to describe the function
you want, then you can write your own fix that applies whatever
external field you can code.

Steve

You can use fix addforce to specify a variable that describes
an external force that is time and spatially dependent. If
the variable syntax is not powerful enough to describe the function
you want, then you can write your own fix that applies whatever
external field you can code.

That might work indeed. What I do not understand is how to define the
position of the potential since the force is spatially dependent (not simply
a constant on whole R^3). Second problem is how to define this potential
as "moving" then (change the position with time)?

Thanks and greetings
Ursin