Skip to content

Case 2: Small Molecule Mixture (Water + Ethanol)

Case 2: Small Molecule Mixture (Water + Ethanol)

Section titled “Case 2: Small Molecule Mixture (Water + Ethanol)”

In this case, we construct a system mixed with two types of small molecules (water and ethanol) at a specific numerical ratio.

  • Composition:
    • Water: 300 molecules
    • Ethanol: 150 molecules
  • Total Atoms: 2,250
  • Initial Target Density: 0.80 g/cm³
Water Ethanol
import fbtk
# 1. Create each molecule object from SMILES
water = fbtk.Molecule.from_smiles("O", name="water")
ethanol = fbtk.Molecule.from_smiles("CCO", name="ethanol")
# 2. Initialize the Builder
builder = fbtk.Builder(density=0.80)
# 3. Add specified counts of each molecule
builder.add_molecule(water, count=300)
builder.add_molecule(ethanol, count=150)
# 4. Build the system and perform relaxation
system = builder.build()
print("Starting relaxation for Water + EtOH...")
system.relax()
# 5. Output results
water.to_file("water.mol")
ethanol.to_file("ethanol.mol")
system.to_file("water_etoh_cell.mol2")
print("Done.")
Mixed Unit Cell
Atoms: 2250 | Bonds: 1800
--------------------------------------------------------------------------------
| Fmax | FRMS | Total E |
Iter | (kcal/mol/Å) | (kcal/mol/Å) | (kcal/mol) | Status
--------------------------------------------------------------------------------
0 | 36477.1705 | 3459.2950 | 204596098964.3458 |
10 | 1620.0353 | 134.2404 | 51220.1694 |
20 | 813.1749 | 50.6762 | 24796.0682 |
...
280 | 2.9743 | 0.2826 | 2533.5805 |
290 | 1.5966 | 0.2099 | 2532.7015 | FRMS-Conv
--------------------------------------------------------------------------------
=== Optimization Finished ===
Reason: FRMS-Conv
Total Time: 5.678s (Avg: 19.512ms / step)
Final Energy: 2532.7015 kcal/mol
Final Fmax: 1.5966 kcal/mol/Å
Final FRMS: 0.2088 kcal/mol/Å
Min Distance: 0.9979 Å (Atoms 1353 and 1359)
--------------------------------------------------------------------------------

The Min Distance after relaxation is 0.9979 Å. It can be confirmed that a stable initial arrangement that does not “explode” before the formation of a hydrogen-bonded network has been obtained.