[lammps-users] how to use "fix spring"

Hi,

I have some questions about the command “fix spring.”

fix 5 bilayer1 spring couple bilayer2 100.0 NULL NULL 10.0 0.0

Does this example mean that the spring acts only in the Z direction?
And what does the Z parameter 10 mean?
On the LAMMPS page, it says displacement, but I’m not sure.

If I simply connect two groups (distance between groups is 20) with a virtual spring with a spring constant of 10 that acts only in the z direction without changing the current coordinates, is the following command correct?

fix ex2 group1 spring couple group2 10.0 NULL NULL 0.0 20.0

thanks,

Ocean.

Hi,

I have some questions about the command “fix spring.”

fix 5 bilayer1 spring couple bilayer2 100.0 NULL NULL 10.0 0.0

Does this example mean that the spring acts only in the Z direction?

yes.

And what does the Z parameter 10 mean?
On the LAMMPS page, it says displacement, but I’m not sure.

take the center of mass for each group and compute the difference for each component.

If I simply connect two groups (distance between groups is 20) with a virtual spring with a spring constant of 10 that acts only in the z direction without changing the current coordinates, is the following command correct?

fix ex2 group1 spring couple group2 10.0 NULL NULL 0.0 20.0

no, you want the first variant.

Thanks, Axel.

But I don’t know what "the first variant"means.

2021年7月28日(水) 22:27 Axel Kohlmeyer <[email protected]>:

why don’t you just set up a simple/small/fast test input and figure out which combination of options works the way you expect?
that way there is no miscommunication and misunderstanding.

the documentation says what the fix does and how it operates. whatever I will explain will be a variant of that text, so if you don’t understand the manual, chances are that you won’t learn much more from somebody repeating it.

Thank you.
I will try it one by one.

2021年7月28日(水) 22:41 Axel Kohlmeyer <[email protected]>: