Fix rigid: Bad principal moments

Hello everyone,

I’m going to simulate a system of rigid pure CO2 molecules.

I built the initial configuration by using the Packmol software at known density and box dimensions. Accordingly I built the data file.

I’m using the rigid/nvt in my input file. However, when I run the simulation I get the error:

Fix rigid: Bad Principal moments.

I appreciate any comment regarding this.

Thank you

Hassan

That means your CO2 molecules are not perfectly linear, or rather not linear “enough” for LAMMPS to detect them as such. A common reason for this is to use a file format like PDB which stores position data in very low resolution and thus with too large of an error.

1 Like

Thanks Akohlmey for your reply.
Can I know what file formats do you think will work?
I tried xyz but I still have the same error.

Then it may not be the file format, but rather the procedure how you create the system.

Since your system is quite simple, why not build the system directly with LAMMPS?
You can use a molecule file for just a single CO2 molecule (an example is in the examples/mc folder)
and then just use create_atoms random. Mind you, you need to pay attention to overlaps and either use the “overlap” option to avoid them during creation (if your LAMMPS version is sufficiently recent) or use delete_atoms overlap with the proper options to delete whole molecules and all associated data.

1 Like

Dear Axel,

I was into something for the past days and I’m writting this because I think it might be helpful for others.

I checked the issue once again and I realized that I had a mistake in creating the xyz file for the CO2 molecule.
You were correct, the PDB file format stores the position data in a very low resolution and I found that the XYZ file is a better choice for working with rigid molecules.
Now my problem with the fix rigid/nvt is resolved.

Thank you so much for your suggestion, I appreciate it.

Kind regards

Hassan

1 Like