# if command and variable command and loop

I want to calculate translocation time of a polymer through a nanopore. I
need to stop performance of my input when the last bead of polymer exit form
pore.
For example when coordinate of the last bead that is tangent with axis of
pore is became larger than coordinate of the end of pore,performance of my
input is stopped.
I used if command as follows:

label loopa
variable a loop 20000
variable s equal y[100]
if “\$s < -2.5” then exit

run 20000
I decide that performance of input is stopped ,when y-coordinate of the last bead (100) is become under -2.5
I want this conditional command is checked every step. So i set if command in loop in order to check accuracy of condition during 20000 run. But i think i made mistakes. because didnt happen what i want to happen
How to define a conditional command in loop in lammps?
Thanks

I want to calculate translocation time of a polymer through a nanopore. I
need to stop performance of my input when the last bead of polymer exit
form
pore.
For example when coordinate of the last bead that is tangent with axis of
pore is became larger than coordinate of the end of pore,performance of my
input is stopped.
I used if command as follows:
label loopa
variable a loop 20000
variable s equal y[100]
if "\$s < -2.5" then exit

run 20000
I decide that performance of input is stopped ,when y-coordinate of the last
bead (100) is become under -2.5
I want this conditional command is checked every step. So i set if command
in loop in order to check accuracy of condition during 20000 run. But i
think i made mistakes. because didnt happen what i want to happen

i *already* explained to you that any lammps command
is always evaluated *immediately*. so using the if statement
in the way you are using it, makes no sense at all.

and steve *already* told you in the e-mail that you quoted
that you can use the "every" option to the "run" command.