I am trying to do a mathematical operation in loop for all the atoms using different parameter and printing the value using thermo_style command. Please let me know a more sophisticated way of doing this operation.

variable k loop 10

variable V1rx atom c_vel[2]*cos(($k-1)*0.1*c_vel[1])) //doing some mathematical operation

compute $k all reduce sum v_V1rx // storing the value by variable

next k

jump in_test.input loop

variable k delete

thermo_style custom step temp c_1 c_2 c_3 c_4 ...... // I have to print values for all variables using hard coding, if k=1000 its not possible to do this way.

Any suggestion to compute, store and print the values using arrays or some other sophisticated form.

Thanks