Polymer in DMF
A chain of polyacrylamide solvated by N,N-dimethylformamide (DMF), in a periodic box: a system of the ComplexMixtures.jl examples, where the solvation of the polymer by DMF is studied.
The polymer, and DMF as lines, with the edges of the periodic box (drag to rotate, scroll to zoom).
Files: polyacrylamide.pdb, dmf.pdb, and the input file polymer_dmf.inp.
The chain has five monomers (55 atoms). In Packmol, molecules are rigid: the chain keeps the conformation of its file, and only its position and orientation change. For long polymers, the conformation must come from elsewhere (an equilibrated simulation, or a tool that builds chains), or the chain can be packed in parts, as different molecules held together by constraints.
The number of molecules
The box is a cube with sides of 40 Å. DMF (73.09 g/mol) has a density of 0.944 g/mL, that is, 0.944 × 0.6022/73.09 = 0.00778 molecules per ų. The chain occupies about 400 ų, so the box holds (40³ − 400) × 0.00778 ≈ 495 molecules of DMF.
The polymer at the center of the box
#
# A polyacrylamide chain in N,N-dimethylformamide (DMF, 0.944 g/mL), in a
# periodic cubic box with sides of 40 Å.
#
tolerance 2.0
output polymer_dmf.pdb
pbc -20. -20. -20. 20. 20. 20.
# Uncomment to write only the initial placement of the molecules to the output file,
# without packing them (to check the constraints):
# check_initial_placement
# The polymer, fixed with its center at the origin, the center of the box
structure polyacrylamide.pdb
number 1
fixed 0. 0. 0. 0. 0. 0.
center
end structure
structure dmf.pdb
number 495
end structure
The polymer is fixed with its geometric center (center) at the origin, the center of the box (fixed 0. 0. 0. 0. 0. 0.: no translation and no rotation of the centered coordinates): it stays in the middle of the box, whole, and the solvent is packed around it. A free polymer would be packed as any other molecule, anywhere in the box, and, near a face, would stick out of the box in the output (see Fixed molecules). The periodic box confines the DMF molecules: no constraint is needed. Run it with:
packmol polymer_dmf.inpThe packing takes a fraction of a second.
Julia script
using Packmol, PDBToolspolymer = structure_type("polyacrylamide.pdb"; number = 1, fixed = ([0., 0., 0.], [0., 0., 0.]), center = :geometric,)dmf = structure_type("dmf.pdb"; number = 495)system = PackmolSystem([polymer, dmf]; output = "polymer_dmf.pdb", tolerance = 2.0, unitcell = [40. 0. 0.; 0. 40. 0.; 0. 0. 40.], # centered at the origin # check_initial_placement = true, # uncomment to only place the molecules)packmol(system)system.status:packing_readyThe packed system, with the visualize function of PDBTools.jl: the polymer, and DMF as lines, with the edges of the periodic box (drag to rotate, scroll to zoom):
visualize(get_atoms(system), "not resname DMF" => (style = :ballandstick,), "resname DMF" => (style = :lines,); unitcell = UnitCell(system.unitcell), unitcell_origin = -sum(eachcol(system.unitcell)) / 2, rotate = [(:z, 30), (:x, -70)],)