# compute property/atom average velocity

I am trying to find the average velocity of 2 atoms. I used the compute atom/property of the group of nitrogen which has two atoms. I tried performing this computation using compute property/atom command and then averaging using the variable command as below:

molecule nitrogen nitrogen.dat

fix 4 n2 deposit 1 1 1 122354 mol nitrogen region addatoms near 3 attempt 500 vz -0.0115 -0.0115 units box

compute property n2 property/atom vz z

variable Vz equal (c_property + c_property)/2
variable Zcoord equal ((c_property + c_property)/2) - 10.26
variable energy equal v_Vz*v_Vz

fix print all print 300 " (time) {Vz} {Zcoord}" file values.dat screen no**_ _**fix print2 all print 300 " (time) {Zcoord} {energy}" file values.dat screen no

I get an error: illegal variable command. I read the compute documentation and as far as I understand a 2D array with 2 elements each will be created. I did read that equal style doesn’t support vector compute inputs, but I am confused how do I output what I want to?

I need these values for plotting a graph.

Thanks

I am trying to find the average velocity of 2 atoms. I used the compute
atom/property of the group of nitrogen which has two atoms. I tried
performing this computation using compute property/atom command and then
averaging using the variable command as below:

molecule nitrogen nitrogen.dat

fix 4 n2 deposit 1 1 1 122354 mol nitrogen region addatoms near 3 attempt
500 vz -0.0115 -0.0115 units box

compute property n2 property/atom vz z

variable Vz equal (c_property + c_property)/2
variable Zcoord equal ((c_property + c_property)/2) - 10.26
variable energy equal v_Vz*v_Vz

fix print all print 300 " \(time\) {Vz} \{Zcoord\}&quot; file values\.dat screen no fix print2 all print 300 &quot; (time) \{Zcoord\} {energy}" file values.dat
screen no

I get an error: illegal variable command. I read the compute documentation
and as far as I understand a 2D array with 2 elements each will be created.
I did read that equal style doesn't support vector compute inputs, but I am
confused how do I output what I want to?

the "illegal variable command" refers to a much simpler matter: you
have a variable expressions that contains whitespace without using
quotation marks. that is not allowed. hence the error message. remove
the whitespace or add quotes and that specific error message should go
away.

axel.