Find Potential Energy Minimum
Here we show how to find the minimum energy (acc. to a force field) position of a molecule in a crystal.
Example
For example, we wish to find the minimum energy (acc. to the UFF) position of a xenon adsorbate in SBMOF-1.
xtal = Crystal("SBMOF-1.cif")
molecule = Molecule("Xe")
ljff = LJForceField("UFF")
# grid search to find min energy position.
# gives good starting guess for optimization algorithm to fine tune.
resolution = 1.0 # resolution of grid points in Å
minimized_molecule, min_E = find_energy_minimum_gridsearch(xtal, molecule, ljff, resolution=resolution)
# minimized_molecule: xenon at its min energy position
# min_E: associated minimum energy of xenon (kJ/mol)
# fine tune the minimum energy position according to the grid search.
minimized_molecule, min_E = find_energy_minimum(xtal, minimized_molecule, ljff)
# output
Computing energy grid of Xe in SBMOF-1.cif
Regular grid (in fractional space) of 13 by 7 by 24 points superimposed over the unit cell.
(Molecule species: Xe
Center of mass (fractional coords): Frac([0.01749943805846959; 0.9372916114895011; 0.011192272400742498;;])
Atoms:
atom = Xe, xf = [0.017, 0.937, 0.011], -37.69376112588296)
detailed docs
PorousMaterials.find_energy_minimum
— Functionminimized_molecule, min_energy = find_energy_minimum(xtal, molecule, ljff) # molecule set at initial guess
find the minimum energy position, and associated minimum energy, of a molecule in a crystal. n.b. if molecule has more than one atom, it will not minimize over the orientation (rotations). the optimizer needs an initial estimate of the minimum energy position. pass molecule with good initial position. if you don't have a good initial position, use find_energy_minimum_gridsearch
.
Arguments
xtal::Crystal
: the crystalmolecule::Molecule
: the molecule, whose position we seek to tune until we reach a local minimum. must start at a good initial position close to the minimum.ljff::LJForceField
: the force field used to calculate crystal-molecule interaction energies
Returns
minimized_molecule::Molecule{Frac}
: the molecule at its minimum energy positionmin_energy::Float64
: the associated minimum molecule-crystal interaciton energy (kJ/mol)
PorousMaterials.find_energy_minimum_gridsearch
— Functionxf₀ = find_energy_minimum_gridsearch(xtal, molecule, ljff; resolution=(50, 50, 50))
perform an energy_grid
calculation and, via a grid search, find the minimum energy position of a molecule.
Arguments
xtal::Crystal
: The crystal being investigatedmolecule::Molecule{Cart}
: The molecule used to probe energy surfaceljff::LJForceField
: The force field used to calculate interaction energiesresolution::Union{Float64, Tuple{Int, Int, Int}}=1.0
: maximum distance between grid points, in Å, or a tuple specifying the number of grid points in each dimension.
Returns
minimized_molecule::Molecule{Frac}
: the molecule at its minimum energy positionmin_energy::Float64
: the associated minimum molecule-crystal interaciton energy (kJ/mol)