[lammps-users] Issue using if-conditional process

Hi all,

It’s my first time using conditional processes on LAMMPS. Can someone tell me what is wrong with the syntax below? The point of it is to assign 1000000 to end_timesteps_equilibration_nvt if epsilon_attractive < .1 and epsilon_attractive*20000000 to end_timesteps_equilibration_nvt otherwise.

if “{epsilon_attractive} < .1" then "variable end_timesteps_equilibration_nvt equal 1000000" & else "variable end_timesteps_equilibration_nvt equal {epsilon_attractive}*20000000”

Thanks in advance for any insight you can provide,

the syntax is correct and works as documented.

My mistake must be elsewhere. I’ll keep searching. Thanks!

It is difficult to assess this since you didn’t provide any context.
In most cases where people are trying to use the “if” command and report that it does not do what they expect, they simply expect it to work in a way that it does not.
All LAMMPS commands are executed when they are encountered. Please see, e.g., https://docs.lammps.org/Commands_input.html and https://docs.lammps.org/Commands_parse.html