ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
397 stars 228 forks source link

UndeterminableKineticsError for highly unusual species #1495

Closed cgrambow closed 5 years ago

cgrambow commented 6 years ago

Bug Description

In a version of the minimal model, RMG adds this species (which will henceforth be referred to as weirdo) to the edge:

1  C u0 p0 c0 {4,S} {5,S} {6,S} {7,S}
2  C u0 p0 c0 {3,S} {4,D} {8,S}
3  C u0 p1 c-1 {2,S} {9,S} {10,S}
4  C u0 p0 c+1 {1,S} {2,D}
5  H u0 p0 c0 {1,S}
6  H u0 p0 c0 {1,S}
7  H u0 p0 c0 {1,S}
8  H u0 p0 c0 {2,S}
9  H u0 p0 c0 {3,S}
10 H u0 p0 c0 {3,S}

which gets created from butadiene (C=CC=C) using the Singlet_Carbene_Intra_Disproportionation family. So somehow, RMG decided butadiene reacting to weirdo should be a reaction instead of a resonance structure. It then decides that the reaction is significant enough and adds weirdo to the core. RMG then tries to generate kinetics for a reaction involving weirdo in the 1,2_Insertion_carbene family, which promptly results in an UndeterminableKineticsError. The error message is:

UndeterminableKineticsError: (
TemplateReaction(
reactants=[Molecule(SMILES="[CH2]"), Molecule(SMILES="[C-]C=[CH+]")],
products=[Molecule(SMILES="[C-]C=[C+]C")],
pairs=[[Molecule(SMILES="[CH2]"), Molecule(SMILES="[C-]C=[C+]C")], [Molecule(SMILES="[C-]C=[CH+]"), Molecule(SMILES="[C-]C=[C+]C")]],
family='1,2_Insertion_carbene'
),
'Kinetics could not be determined.
Unable to find matching template for reaction <Molecule "[CH2]"> + <Molecule "[C-]C=[CH+]"> <=> <Molecule "[C-]C=[C+]C">
in reaction family <KineticsGroups "1,2_Insertion_carbene/groups">.
Trying to match [<Entry index=0 label="carbene">, <Entry index=1 label="RR\'">] but matched [<Entry index=0 label="carbene">]'
)

So somehow the reaction got created even though it then doesn't match the template of the family. Note that the SMILES in the error message are wrong, because apparently RDKit doesn't correctly parse weirdo.

How To Reproduce

Try generating kinetics for weirdo on the RMG website. See here.

Possible Solutions

Maybe we could forbid such transformations in Singlet_Carbene_Intra_Disproportionation? Or we could try to fix the template issue in 1,2_Insertion_carbene. Another issue is that RMG evidently thinks that the reaction butadiene -> weirdo is fast enough to add it to the core, which makes no sense to me since its estimated heat of reaction for the reverse, i.e., weirdo -> butadiene is 65.93 kcal/mol and the kinetics for the reverse are

Arrhenius(A=(4.35682e+24,'s^-1'), n=-1.51019, Ea=(-158.738,'kJ/mol'),
T0=(1,'K'), Tmin=(303.03,'K'), Tmax=(2000,'K'),
comment="""Estimated using template [CsJ2-C;CsJ2(C=C);CH] for rate rule [CsJ2-C;CsJ2(C=C);CH3]
alongd commented 6 years ago

I think that the butadiene <-> weirdo transition should be a reaction rather than resonance, since it involves relocating a hydrogen atom. I agree that with the implementation of the new resonance structures we're starting to see weird carbenes, which we aren't well equipped to handle. A specific solution might be allowing charged atoms in the RR' node of 1,2_Insertion_carbene. Something like might work:

1 *2 [Cs,Sis,N]                u0 cx {2,S} {3,S} {4,S} {5,S}
2 *3 [Cs,Cd,Cb,Ct,Sis,Sid,N,S] u0 cx {1,S}
3    H                         u0 {1,S}
4    H                         u0 {1,S}
5    H                         u0 {1,S}

However, we should probably also rethink the atoms we allow to gain a lone pair in resonance transitions.

mliu49 commented 5 years ago

We should resolve this before the next release (mid-December). I think we only have two options:

I'm currently leaning more towards the first option.

alongd commented 5 years ago

I think we (or at least I) don't have good chemical intuition for carbene reactions and resonance, I'm OK with the first option. I'll make this change soon.