Setting mass from a normal distribution.

Hi all,

I am trying to simulate a system of N(say N=100) particles having different masses. To set mass values from a normal distribution, I have used the following commands in my input script.

variable m1 equal normal(10,1,seed1)

variable m2 equal normal(10,1,seed2)

mass 1 ${m1}

mass 2 ${m2}

I want a fixed but random value for each of the masses but the values of these variables seems to changing throughout the run. I am using atomify software with lammps version 11 Aug 2017. Any suggestions?

with regards

Diljith T.

You are misunderstanding how equal style variables work. they are reevaluated every time you use them.
so if you wrote

variable m equal normal(10,1,62356234)

mass 1 {m} mass 2 {m}

it would be equally valid.

to look up the mass for particles, you should use compute property/atom.

BTW: if the only difference between the particles is the mass, you would not need to reserve a new atom type for each, but could also use fix property/atom to enable per-atom masses instead of the default of per-type masses. in that case you need to set the mass via the “set” command.

Axel.

Thank you for the clarification.