Question about the Kinetic Energy Calculation via Script

Dear all,

I am writing a script to get the mass and velocity of each atoms to calculate the kinetic energy of part of the system.

I have followed the example of material studio online help about mass and velocity as below:

mass.png

velocity.png

What's the meaning of %sn, %fn and %dn in the line of printf?

Here are my script:

script.png

how to write line 16 to make it output the ture velocity?

Thanks.

Best regards,

Yours

CHENG Xu