Re: [lammps-users] Inquiry on LAMMPS fix_deform and variable formula"
Axel Kohlmeyer <akohlmey@...24...>
Thu, 27 Jul 2017 15:51:50 -0400
>> variable displace equal "v_L0 + (0.5*v_L0)*(1 +
>> (2/PI)*asin(sin((2*PI*(1/v_Tp)*step*dt) - (PI/2))))"
>> variable rate equal "(2*v_L0*(1/v_Tp))*(-1)^floor(2*(1/v_Tp)*step*dt)"
>> fix 4 all deform 1 x variable v_displace v_rate remap v
>> However, I obtained an error statement: ERROR: Power by 0 in variable
>> formula (../variable.cpp:1718)
>> Even when I looked at the LAMMPS error manual, I am not understanding this
>> error since my variable formula does not have a zero powered to a number. I
> that is not what the error message says. it says that you have a
> number raised to the power of 0.
that said, LAMMPS should not stop with an error here.
x^0 should always result in 1.0 for any value of x, even for x == NaN.
instead 0^y with y < 0.0 should be disallowed, as this is equivalent
to 1.0/0^-y and thus would cause a division by zero.
so the current behavior of LAMMPS is actually a bug.
Dr. Axel Kohlmeyer akohlmey@...24... http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.