# cannot use scientific notation in the LAMMPS input scripts

Hello,

I am performing an energy minimization, I find 1e-4 doesn't work as well as 0.0001.

"minimize 1e-4 1e-4 1e5 1e5" gives the results:

Stopping criterion = max force evaluations
Energy initial, next-to-last, final =
57.1773311841 57.1773311841 46.7784078493
Force two-norm initial, final = 334.897 240.262
Force max component initial, final = 159.148 133.29
Final line search alpha, max atom move = 0.000157086 0.0209381
Iterations, force evaluations = 1 3
..................................................

While, "minimize 0.0001 0.0001 100000 100000" seems to work well,

Stopping criterion = energy tolerance
Energy initial, next-to-last, final =
57.1773311841 11.9268834228 11.9267974207
Force two-norm initial, final = 334.897 1.97889
Force max component initial, final = 159.148 0.592499
Final line search alpha, max atom move = 1.02401e-05 6.06725e-06
Iterations, force evaluations = 580 4267
.............................................................

Best wishes,

Wei

Hello,

I am performing an energy minimization, I find 1e-4 doesn't work as well as 0.0001.

sorry, but it *does* work.

"minimize 1e-4 1e-4 1e5 1e5" gives the results:

Stopping criterion = max force evaluations
Energy initial, next-to-last, final =
57.1773311841 57.1773311841 46.7784078493
Force two-norm initial, final = 334.897 240.262
Force max component initial, final = 159.148 133.29
Final line search alpha, max atom move = 0.000157086 0.0209381
Iterations, force evaluations = 1 3
..................................................

While, "minimize 0.0001 0.0001 100000 100000" seems to work well,

the problem is not the 1e-4, but the 1e5.

while the first two numbers are floating point numbers,
the second two numbers are expected to be integers,
hence the minimizer will read 1e5 as 1
and only do 1 step of minimization.

cheers,
axel.

Numerical parameters in LAMMPS are parsed using the atof standard
library function [1]. This should support scientific notation, but(!)
it may be locale dependent. What system are you compiling and running
LAMMPS under?

Numerical parameters in LAMMPS are parsed using the atof standard
library function [1]. This should support scientific notation, but(!)

sorry, but that is not correct.

from minimize.cpp:

void Minimize::command(int narg, char **arg)
{
if (narg != 4) error->all(FLERR,"Illegal minimize command");

if (domain->box_exist == 0)
error->all(FLERR,"Minimize command before simulation box is defined");

update->etol = atof(arg[0]);
update->ftol = atof(arg[1]);
update->nsteps = atoi(arg[2]);
update->max_eval = atoi(arg[3]);

so the first two arguments are parsed with atof(3) alright,
but the third and the fourth with atoi(3) and hence the
exponents are ignored.

axel.