Cartesian coordinate data of trajectory

Hello All

Please,Can anyone explain me how I can get cartesian coordinate data of trajectory .

I constructed polymer amorphous cell and equlibrated it ,then I inserted some gas molecules in it and run NVT molecular dynamics ,now I can get MSD vs t graph but I dont know, how I can get cartesian coordinate data of gas molecules trajectory.

Thanks

nima

Answers 10
HP
HP 2012-01-09

Do you need to print out a list of all Cartesian coordinates? For that you'll need to write a script.

Or do you simply want to look at the coordinates of a few atoms? Do to that, open the trajectory, right-click and select "Label." Then select some atoms and choose "XYZ" as the label. Those atoms will show the coordinates, and the coordinates will update as you play the trajectory.

Let me know if you need an entire list of all coordinates for all frames, and I can help you with the script

-george

JD
JD 2012-01-09

For what it's worth, the coordinates can be obtained this way:

my $atoms = $doc->Sets("Gas");

foreach my $atom (@$atoms)

{

     printf "%8.3f %8.3f %8.3f\n", $atom->X, $atom->Y, $atom->Z;

}

Note now in Materials Studio 6.0, you can save a partial trajectory of only a subset of the system. Your application is an example of where this new feature would be useful. You could write out coordinates more frequently for only the diffusive molecules and thus calculate MSD more accurately.

Best,

/Jason

BN
BN 2012-01-10

Dear George & dear Jason

Thanks for your helps

Now wih script that was given by Jason I can get  cartesian coordinates data of all atomes in all frames ,but actually I need cartesian coordinate data of specific molecule like CO2 only , in all frames ,I tried so much but I cant get it ,and I dont know how I can define specific molecule in script  in order to get cartesian coordinates data of it only .

Again thank you very much.

nima

JD
JD 2012-01-10

See how I used the set named "Gas" in the above example? The idea is that you create such a set using Edit | Edit Sets which includes all of your CO2 molecules. If you need help selecting all of the CO2 molecules, you can resort to Edit | Atom Selection and Edit | Find Patterns.

Of course it is easier to just use the Forcite MSD analysis tool. You can even use Find Patterns to create a centroid on every CO2 molecule and then track the MSD of those centroids.

BN
BN 2012-01-10

Dear Jason

Thanks alot

I dont know how I can appreciate your helps ,but I hope ,one day I can make up your helps.

Best

nima

DM
DM 2015-09-07
Hello,
Could someone help me with the script to get the cartesian co-ordinate of all the atoms in all the frames of a trajectory

Thanks and regards,
Deepa
DM
DM 2015-09-07
Hi Jason,
I used the script to obtain the cartesian coordinate of a set of atoms,I get the following error:
There is no function or property named "X" on type "Object" 
Looking forward to your help

Thanks,
Deepa
JD
JD 2015-09-08
Deepa, you may have some other stuff in your set besides atoms, so it is best to filter it for atoms like:

my $atoms = $doc->Sets("Gas")->Atoms;
 
DM
DM 2015-09-08
Hi Jason ,
Thanks for your input.It is working now.Could you please help me to modify this script to run over many frames of a trajectory ?

Thanks and regards,
Deepa.
BZ
BZ 2016-03-13
Hi Jason

I need to choose specific atoms (Oxyogen atoms for example) which are part of a set. In other word I need to add another filter to choose "Oxygen" atoms after
my $atoms = $doc->UnitCell->Sets ("Gas");

what is the correct syntax of:
my $atoms = $doc->UnitCell->Sets ("Gas")->("O");

I didn't find it in help of the software.

Thanks a lot
Behnam