QuantumChemistry
PlotMolecule
plot molecule in 3D
Calling Sequence
Parameters
Description
Examples
PlotMolecule(molecule, options)
molecule
-
list of lists; each list has 4 elements, the string of an atom's symbol and atom's x, y, and z coordinates
options
(optional) equation(s) of the form option = value
PlotMolecule(molecule, options) returns a 3D Maple plot of the molecules. The molecule can be fully rotated.
The options available are model, units, bonds, addbonds, removebonds, numberatoms, and viewpoint.
The value of model is either the string "ballandstick" (default) or "spacefilling".
The value of units is either the string "Angstrom" (default) or "Bohr".
The value of bonds can be a set of sets where each set contains two integers denoting the atoms to be connected by a chemical bond. The integers correspond to the positions of the atoms in molecule. If the optional keyword bonds is not set, the bonds to be shown are determined automatically.
Automatic bonds can also be modified with addbonds and/or removebonds. The keywords addbonds and removebonds can be a set of sets where each set contains two integers denoting atoms between which a chemical bond should be added or removed, respectively.
The keyword viewpoint generates a molecular fly-through animation. It can be set to one of the following strings "flythrough", "flythrough2", "flythrough3", "flythrough4", "circleleft", and "circleright". It can also be set to a custom fly-through animation as described on the help page for viewpoint.
withQuantumChemistry:
Define the molecule hydrogen fluoride
molecule ≔ H, 0, 0, −0.55, F, 0, 0, +0.55 ;
Plot the molecule hydrogen fluoride
molecule≔H,0,0,−0.55000000,F,0,0,0.55000000
PlotMoleculemolecule;
Define the molecule TNT from MolecularData which obtains the geometry from a web database
tnt≔ MolecularDataTNT,geometry3d;
tnt≔O,0.54540000,−3.51400000,0.00120000,O,0.54950000,3.51370000,0.00080000,O,2.46770000,−2.45390000,−0.00050000,O,2.47050000,2.45130000,0.00030000,O,−3.59310000,−1.09590000,0.00040000,O,−3.59220000,1.09930000,0.00060000,N,1.21420000,−2.45400000,0.00020000,N,1.21700000,2.45270000,0,N,−2.98460000,0.00150000,0.00010000,C,1.22530000,−0.00060000,−0.00090000,C,0.52710000,−1.20820000,−0.00080000,C,0.52840000,1.20780000,−0.00080000,C,−1.56460000,0.00080000,−0.00040000,C,−0.86780000,−1.20740000,−0.00060000,C,−0.86660000,1.20840000,−0.00060000,C,2.72390000,−0.00160000,0.00110000,H,−1.41590000,−2.14680000,−0.00030000,H,−1.41370000,2.14830000,−0.00030000,H,3.12260000,0.24180000,−0.98910000,H,3.08630000,0.69340000,0.76620000,H,3.31540000,−0.81110000,0.41090000
Plot the molecule
PlotMoleculetnt;
Define the molecule tylenol from MolecularData which obtains the geometry from a web database
molecule,bonding ≔ MolecularDatatylenol,geometry3d, returnbonds=true;
molecule,bonding≔O,3.85090000,0.45160000,0.00120000,O,−2.59990000,1.40410000,−0.00180000,N,−1.57050000,−0.71710000,0.00010000,C,−0.20660000,−0.42310000,−0.00020000,C,0.22050000,0.90470000,0.00040000,C,0.72980000,−1.45700000,−0.00070000,C,1.58410000,1.19860000,0.00020000,C,2.09330000,−1.16290000,−0.00070000,C,2.52040000,0.16480000,−0.00030000,C,−2.64850000,0.17820000,0.00090000,C,−3.97350000,−0.54200000,0.00100000,H,−0.44360000,1.75770000,0.00120000,H,0.41130000,−2.49630000,−0.00100000,H,−1.80100000,−1.70860000,0.00010000,H,1.90530000,2.23700000,0.00090000,H,2.81800000,−1.97260000,−0.00080000,H,−4.06550000,−1.14630000,−0.90580000,H,−4.79040000,0.18440000,0.02880000,H,−4.04450000,−1.18860000,0.88020000,H,3.96500000,1.41760000,0.00170000,1,9,1,20,2,10,3,4,3,10,3,14,4,5,4,6,5,7,5,12,6,8,6,13,7,9,7,15,8,9,8,16,10,11,11,17,11,18,11,19
PlotMoleculemolecule, 'bonds'=bonding;
Number the atoms in tylenol
PlotMoleculemolecule,numberatoms=true;
Remove the bond between atoms 3 and 4
PlotMoleculemolecule,removebonds=3,10;
Use the viewpoint keyword to make a fly-though animation for TNT
PlotMoleculetnt, viewpoint=flythrough3;
See Also
QuantumChemistry ReadXYZ MolecularData MolecularGeometry
Download Help Document