Errors with variable and velocity commands

Hello,

I’m trying to increase the initial velocity of the atoms in my simulation, but I keep getting errors.
If I use the following code:

variable v_vx equal 2.0*vx

velocity all create 300.0 87287 loop geom
velocity all set v_vx NULL NULL

I receive an error saying “variable name for velocity set does not exist.”

If I use this code:

variable v_vx equal 2.0*vx
variable v_vx0 equal $v_vx
velocity all create 300.0 87287 loop geom
velocity all set v_vx NULL NULL

I receive the error “ERROR in proc 0: substitution for illegal variable.”
I have been to the velocity and variable command pages, as well as the section for errors, and I cannot find the reason for this error and how to fix it.

Any suggestions or advice would be greatly appreciated.

Thank you,
Casey

Casey Hansen
[email protected]…24…

The variable should be named “vx”

and referenced in the velocity command
as “v_vx”. The doc page for the velocity
command explains this.

Steve

Hello,

I’m trying to increase the initial velocity of the atoms in my simulation, but I keep getting errors.
If I use the following code:

variable v_vx equal 2.0*vx

You don’t need to add the “v_” before your variable.

velocity all create 300.0 87287 loop geom
velocity all set v_vx NULL NULL

I receive an error saying "variable name for velocity set does not exist.”

From your input, the velocity set command is expecting a variable named “v_v_vx”.

If I use this code:

variable v_vx equal 2.0*vx
variable v_vx0 equal $v_vx

This “$v_vx” is wrong - it should be “v_v_vx"

velocity all create 300.0 87287 loop geom
velocity all set v_vx NULL NULL

This should be “v_v_vx0"

I receive the error “ERROR in proc 0: substitution for illegal variable.”
I have been to the velocity and variable command pages, as well as the section for errors, and I cannot find the reason for this error and how to fix it.

I suggest you re-read the variable doc page more carefully.

Ray