[lammps-users] help with oscillatory body forces

Hi,

I am trying to apply oscillatory external body forces in my simulations. I would like to apply step functional force such as 0.2 in the first 1000 time steps and -0.2 in the next 1000 time steps and continue this pattern upto 1000000 time steps. Or applying oscillate sinusoidally body forces upto 1000000 time steps. Is there a way to do this automatically (script) ? Thanks for your help.

Shihai

Hi,
I am trying to apply oscillatory external body forces in my simulations. I
would like to apply step functional force such as 0.2 in the first 1000 time
steps and -0.2 in the next 1000 time steps and continue this pattern upto
1000000 time steps. Or applying oscillate sinusoidally body forces upto
1000000 time steps. Is there a way to do this automatically (script) ?

yes, there is. you can use fix addforce and have the added
force component being given as an "equal style" variable,
i.e. in your case a function of the simulation time.
there is a very large degree of flexibility in this construct.

cheers,
    axel.