Computing hydrocarbon chemical reactions based on graph theoretic operations
by Osama Sarhan
Alexandria University - Petrotrade
by Osama Sarhan
Alexandria University - Petrotrade
The goal of this project is to simulate one-pot synthesis starting from simple graphs representing chained hydrocarbon molecules. By applying graph theoretic operations, we will randomly merge and split graphs/molecules according to stochastic processes. We will investigate the physical properties of hydrocarbons and neglect all other factors of reaction (catalysis, temperature, pressure).
◼
Molecular Reconstruction of Crude Oil: https://www.researchgate.net/publication/262947358_Molecular_Reconstruction_of_Crude_Oil
One-pot synthesis for hydrocarbons using the Molecule Framework
One-pot synthesis for hydrocarbons using the Molecule Framework
Create an initial ensemble of multiple methane molecules:
Create an initial ensemble of multiple methane molecules:
In[]:=
initialEnsemble=Molecule[Table["C",500]]
Out[]=
Molecule
In[]:=
MoleculeGraph@initialEnsemble
Out[]=
◼
Get the list of carbons in the pot with AtomList:
In[]:=
carbons=AtomList[initialEnsemble,"C","AtomIndex"];
Get the list of bonds between carbons with BondList:
Get the list of bonds between carbons with BondList:
In[]:=
ClearAll[getFreeCarbons,addRandomBond,getCarbonBonds]
In[]:=
getCarbonBonds[ensemble_Molecule]:=BondList[ensemble,Bond[{"C","C"}]]
In[]:=
getCarbonHidrogenBonds[ensemble_Molecule,carbonID_Integer]:=BondList[ensemble,Bond[{carbonID,"H"}]]
Initially we have only methane molecules, so there are zero bonds between carbons:
In[]:=
getCarbonBonds[initialEnsemble]
Out[]=
{}
In[]:=
BondCount[initialEnsemble,Bond[{"C","C"}]]
Out[]=
0
Add a random bond between two carbons:
Add a random bond between two carbons:
Get carbon atoms with less than 4 carbon bonds:
In[]:=
getFreeCarbons[ensemble_Molecule]:=Complement[carbons,Cases[Tally@Flatten@Part[getCarbonBonds[ensemble],All,1],{x_,4}:>x]]
Carbon-hydrogen bonds are deleted automatically:
In[]:=
getCarbonHidrogenBonds[initialEnsemble,1]
Out[]=
{Bond[{1,501},Single],Bond[{1,502},Single],Bond[{1,503},Single],Bond[{1,504},Single]}
In[]:=
MoleculeModify[initialEnsemble,{"AddBond",{1,2}}]
Out[]=
Molecule
In[]:=
getCarbonHidrogenBonds[MoleculeModify[initialEnsemble,{"AddBond",{1,2}}],1]
Out[]=
{Bond[{1,1001},Single],Bond[{1,1002},Single],Bond[{1,1003},Single]}
Add a random carbon bond:
In[]:=
addRandomBond[ensemble_Molecule]:=MoleculeModify[ensemble,{"AddBond",Bond[RandomSample[getFreeCarbons[ensemble],2],"Single"]}]
◼
Carbons with 4 bonds
In[]:=
Cases[Tally@Flatten@Part[getCarbonBonds[Nest[addRandomBond[#]&,initialEnsemble,200]],All,1],{x_,4}:>x]
Out[]=
{7,444,52,327,261,149,454,242}
In[]:=
Histogram@Map[Length,ConnectedComponents@MoleculeGraph@Nest[addRandomBond[#]&,initialEnsemble,100]]
Out[]=
In[]:=
ensemble300=Nest[addRandomBond[#]&,initialEnsemble,300]
Use a pattern to identify bonds of rings with “RingAtomQ” (“AromaticAtomQ” when we add double bonds):
Use a pattern to identify bonds of rings with “RingAtomQ” (“AromaticAtomQ” when we add double bonds):
◼
Use FindCycle for getting aromatic rings:
Delete a random carbon bond which is not part of an aromatic ring
Delete a random carbon bond which is not part of an aromatic ring
Second round of synthesis
Second round of synthesis
Third round of synthesis
Third round of synthesis
Fourth Round
Fourth Round
Fifth Round
Fifth Round
N-Rounds
N-Rounds
Large ensemble
Large ensemble
Create an initial ensemble of methane molecules:
Create an initial ensemble of methane molecules:
◼
Get the list of carbons in the pot with AtomList:
Get the list of bonds between carbons with BondList:
Get the list of bonds between carbons with BondList:
Add a random bond between two carbons:
Add a random bond between two carbons:
Get carbon atoms with less than 4 carbon bonds:
Add a random carbon bond:
Delete a random carbon bond which is not part of an aromatic ring
Delete a random carbon bond which is not part of an aromatic ring
◼
Use FindCycle for getting aromatic rings:
Second Synthesis
Second Synthesis
N-Round Synthesis
N-Round Synthesis
Graph Approach
Graph Approach
◼
Start from an ensemble of carbon atoms
◼
Or start with one big hydrocarbon [Current approach]
◼
Adding edges and removing edges with the 4-bond restriction (Carbon valency)
Counting the number of bonds for each carbon
Counting the number of bonds for each carbon
Counting how number of bonds for each carbon:
Obtain the carbons that only have one carbon bond:
Create alternatives with carbons with only one bond:
Removes from the edge list the carbons with only one bond:
Function to break a random carbon bond:
Function to break a random carbon bond:
Function to form a random carbon bond:
Function to form a random carbon bond:
◼
Remove carbons that have already 4 bonds from the list of potential carbons for new bonds.
◼
Using RandomChoice to create a new carbon bond.
Molecule Object Approach
Molecule Object Approach
Create an initial ensemble of multiple methane molecules:
Create an initial ensemble of multiple methane molecules:
◼
Get the list of carbons in the pot with AtomList:
Get the list of bonds between carbons with BondList:
Get the list of bonds between carbons with BondList:
Initially we have only methane molecules, so there are zero bonds between carbons:
Add a random bond between two carbons:
Add a random bond between two carbons:
Get carbon atoms with less than 4 carbon bonds:
Carbon-hydrogen bonds are deleted automatically:
Add a random carbon bond:
◼
Carbons with 4 bonds
Counts vs fraction/probability mole fraction (third option of Histogram PDF )
Use a pattern to identify bonds of rings with “RingAtomQ” (“AromaticAtomQ” when we add double bonds):
Use a pattern to identify bonds of rings with “RingAtomQ” (“AromaticAtomQ” when we add double bonds):
◼
Use FindCycle for getting aromatic rings:
Delete a random carbon bond which is not part of an aromatic ring
Delete a random carbon bond which is not part of an aromatic ring
N-Rounds
N-Rounds
Future work
Future work
◼
Make distant bonds easy to break.
◼
Start from different initial ensembles.
◼
Make a rule for promoting bonds to form aromatic rings.
◼
Add double and triple bonds to the model.
◼
Extra refinements or generalizations. Add other atoms N, O, ...
◼
Add a parameter that changes. When joining molecules biased by size. If small more likely to join. How distribution changes of products are forms.
Acknowledgment
Acknowledgment
I would like to thank my mentor Jofre Espigule. Stephen Wolfram for his project idea and how to approach this model for Hydrocarbon one-pot synthesis. Finally I would like to thank Bob Nachbar, Mads Bahrami, Ahmed Elbana for fruitful discussion .