Expected floating point parameter in input script or data file

Hi,

I am using the already

I wanted to apply unidirectional stress on a cantilever beam, hence I used the following code.

variable j loop 5
fix 20 boundary setforce 0 0 0
displace_atoms right move 0.0 0.0 0.9 units box
displace_atoms mobile ramp z 0.0 0.1 y 1.0 49.0+0.1*(${j}-1.0) units box

But I am getting an error saying-

Displacing atoms …
Displacing atoms …
ERROR: Expected floating point parameter in input script or data file

The value of $j is an integer. How do I convert it to float so that the expression is evaluated?

I am using the pre-built Ubuntu executable downloaded from the website.

displace_atoms mobile ramp z 0.0 0.1 y 1.0 49.0+0.1*(${j}-1.0) units box

You can’t put an equation in the middle of an input script command,
at least like that. Not sure why you think you could. There
is nothing in the displace_atoms doc page that indicates
you can.

You have 2 choices.

a) define the equation as a variable, and use the variable
in the displace_atoms commands

b) use an “immediate variable” in the displace_atoms command
which would look similar to what you have, but is a different
syntax, inside $(). See Section 3.2 of the manual for details.

Steve

Thank you, Steve, for the assistance, the first option worked.