How to use group dynamic command correctly?

Dear lammps-users:

I am looking at group command and I also use the case about the dynamic style in manual, however, the returned result is illegal group command. Here are my input script and the result.

The input script:

group AR type 2

group AG type 1

group ALL molecule >= 0

create_atoms 2 random 300 177188 NULL units box

variable nsteps equal 5000

variable rad equal 18-(step/v_nsteps)*(18-5)

region ss sphere 20 20 0 v_rad units box

group mobile dynamic all region ss

fix 1 mobile nve

run ${nsteps}

group mobile static

run ${nsteps}

The result:

variable nsteps equal 5000

variable rad equal 18-(step/v_nsteps)*(18-5)

region ss sphere 20 20 0 v_rad units box

group mobile dynamic all region ss

ERROR: Illegal group command (group.cpp:341)

And Why is this happening? How to use group dynamic command correctly? Thanks for your help.

Sincerely yours

Hi .

I think you have to use " every value = N = update group every this many timesteps "

for example :

group mobile dynamic all region ss every 1000

Saeed.