Moltemplate and OPLSAA: net charge is not zero

When i run the code I have also warning like " net charge is not zero " !

well, should the system be neutral or not?

When OPLSAA, the partial charge of each atom is determined by its type.
If the charge is incorrect, then this is generally an indication that
you are using the wrong atom type(s) somewhere in one of your .LT
files.

The net charge of a Fluorene molecule should be zero.
The problem with "Fourene.lt" file SaeeD attached is that the 4th and
5th atoms (named "$atom:C4" and "$atom:C5" in the Fluorene.lt file and
shown as grey spheres in the attached image) are not aromatic carbons
and should not be assigned to the "Aromatic C" OPLSAA atom type
(currently "@atom:90").

   Generally, the difficult part of setting up a simulation using
OPLSAA using moltemplate is figuring out what atom type number to
assign to every atom type. You have to read the "oplsaa.prm" file
carefully, taking into account the charge of each atom, and select the
number whose description most closely matches what you see in your
molecule. I will attempt to do this for your molecule:

   For reference, moltemplate assigns charge to each atom according to
the "charges" section of the "oplsaa.prm" or "oplsaa_subset.prm"
files. (Scroll down to the section with all the charges. Note that
this information ends up getting copied to the write_once("In
Charges") section of the "oplsaa.lt" file created by
"oplsaa_moltemplate.py", which in turn, gets copied to the
"system.in.charges" file created by moltemplate.)

    First note that if you exclude these two atoms ($atom:c4 and
$atom:c5), the remaining charges in the molecule cancel out. Since
you know the entire molecule should have net zero charge, you can
infer that the charge in these two atoms must also both be 0. This
narrows down the possible choices in the "oplsaa.prm" or
"oplsaa_subset.prm" file to atoms with charge 0. I see 3 nearby
candidates:
atom 84 13 CT "Alkane >C<"
atom 86 47 CM "Alkene R2-C="
atom 92 48 CA "Naphthalene Fusion C"
If these three, the only choice which seems plausible is "Naphthalene
Fusion C" (http://en.wikipedia.org/wiki/Naphthalene). So I would
edit your "Fluorene.lt" file and change the atom type from @atom:90 to
@atom:92. (Somebody please let me know if I screwed this up. My
chemistry background is weak.)

I attached a new version of "Flourene.lt", "oplsaa_subset.prm", and
"system.lt" with these changes. When using OPLSAA, build your system
using:

oplsaa_moltemplate.py oplsaa_subset.prm
moltemplate.sh system.lt

  --- details about charge in OPLSAA and moltemplate ---

there
are no charges assigned at all in your data file.

True. But, again, when using OPLSAA, moltemplate generates a separate
file for storing the atom charges. It looks like SaeeD is reading
this file. (That's why LAMMPS complained that the net charge is not
zero.) The new version of Fluorene.lt I attached should fix this.

   ----- boring details (feel free to skip): -----

Normally, users manually specify the charge of each atom manually, and
this information does indeed end up in the DATA file. However, OPLSAA
determines the charge of each atom according to atom-type. Since not
all force-fields do this, I decided to save the OPLSAA charges in a
seperate file named "system.in.charges", containing a list "set"
commands. For example:
    set type 1 charge -0.12
    set type 2 charge 0.06
     :
Input scripts typically load this file after reading the data file.
read_data "system.data"
include "system.in.charges"

I have attached my LT file with this Email.

Actually, that was helpful. (I can't guarantee I'll have time to
debug people's LT files in the future, but this one was pretty easy.)

This is strange because as I said i can visulaize the molecule by topotools
and VMD !

a visualization only shows the bonds and doesn't say anything about
incorrect parameters.

True.

It worked and I have data file and input file for my molecule , with using
of VMD and topoTools I can visualize it .
But when i start MD simulation , the molecule has dissociation inside of it
and it is obvious that my data file has problem .

then you'll have to debug it.

I hope it's debugged now.
Good luck

Andrew
I was travelling, and I apologize for the slow reply.
Also forgive me for starting a new thread.

flourene.jpg

Fluorene.lt (3.73 KB)

oplsaa_subset.prm (118 KB)

oplsaa.lt (14.3 KB)

When i run the code I have also warning like " net charge is not zero " !

When OPLSAA, the partial charge of each atom is determined by its type.

Oops. That should be:
"When using OPLSAA, the partial charge of each atom is determined by its type."

My previous post was correct in spirit, but I made a small mistake
when I attempted to post a fix to SaeeD's LT file. I'm posting a new
"Fluorene.lt" file. Sorry for the double-post. Hopefully this
version works.

No need to read the rest of this post.

If the charge is incorrect, then this is generally an indication that
you are using the wrong atom type(s) somewhere in one of your .LT
files.

The net charge of a Fluorene molecule should be zero.
The problem with "Fourene.lt" file SaeeD attached is that the 4th and
5th atoms (named "$atom:C4" and "$atom:C5" in the Fluorene.lt file and
shown as grey spheres in the attached image) are not aromatic carbons
and should not be assigned to the "Aromatic C" OPLSAA atom type
(currently "@atom:90").

Correction: there were actually 4 atoms with the incorrect atom type:
$atom:C2, $atom:C3, $atom:C4, $atom:C5. As explained below, each of
these four atoms should have zero charge (assuming they have the same
type).

   Generally, the difficult part of setting up a simulation using
OPLSAA using moltemplate is figuring out what atom type number to
assign to every atom type. You have to read the "oplsaa.prm" file
carefully, taking into account the charge of each atom, and select the
number whose description most closely matches what you see in your
molecule. I will attempt to do this for your molecule:

   For reference, moltemplate assigns charge to each atom according to
the "charges" section of the "oplsaa.prm" or "oplsaa_subset.prm"
files. (Scroll down to the section with all the charges. Note that
this information ends up getting copied to the write_once("In
Charges") section of the "oplsaa.lt" file created by
"oplsaa_moltemplate.py", which in turn, gets copied to the
"system.in.charges" file created by moltemplate.)

    First note that if you exclude these two atoms ($atom:c4 and
$atom:c5),

(again, it should be $atom:C2, $atom:C3, $atom:C4, $atom:C5)

the remaining charges in the molecule cancel out.
Since
you know the entire molecule should have net zero charge, you can
infer that the charge in these two atoms must also both be 0. This
narrows down the possible choices in the "oplsaa.prm" or
"oplsaa_subset.prm" file to atoms with charge 0. I see 3 nearby
candidates:
atom 84 13 CT "Alkane >C<"
atom 86 47 CM "Alkene R2-C="
atom 92 48 CA "Naphthalene Fusion C"
If these three, the only choice which seems plausible is "Naphthalene
Fusion C" (http://en.wikipedia.org/wiki/Naphthalene). So I would
edit your "Fluorene.lt" file and change the atom type from @atom:90 to
@atom:92. (Somebody please let me know if I screwed this up. My
chemistry background is weak.)

Yep, I'm totally capable of screwing up. I hope this version works.

flourene.jpg

Fluorene.lt (3.73 KB)

oplsaa.lt (14.3 KB)

oplsaa_subset.prm (118 KB)

system.lt (239 Bytes)